/* ============================================================
   Content Engine — Dark Gold Brand System
   Matches CRM Demo Part 1 design language
   ============================================================ */

/* ── CSS Custom Properties ─────────────────────────────── */
:root {
    /* Backgrounds */
    --bg-primary: #0B0B0D;
    --bg-card: #17181C;
    --bg-card-hover: #1E2025;
    --bg-tertiary: #111215;

    /* Gold Palette */
    --gold: #C7A35A;
    --gold-hover: #B88933;
    --gold-champagne: #E4D3A2;
    --gold-bronze: #87652C;
    --gold-tint: rgba(199, 163, 90, 0.10);

    /* Text */
    --text-primary: #F5F0E8;
    --text-muted: #C8C0B4;
    --text-subtle: #9E978C;

    /* Borders */
    --border: #31343C;

    /* Status */
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Stage Colors */
    --stage-scrape: #3b82f6;
    --stage-script: #a855f7;
    --stage-image: #22c55e;
    --stage-video: #f97316;
    --stage-caption: #14b8a6;
    --stage-publish: #C7A35A;

    /* Sizing */
    --sidebar-width: 220px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

/* ── Base / Reset ──────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--gold);
    color: var(--bg-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-subtle);
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--gold-champagne);
}

/* ── Layout Shell ──────────────────────────────────────── */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--gold), var(--gold-bronze));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.sidebar-link:hover {
    background: var(--gold-tint);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--gold-tint);
    color: var(--gold);
    font-weight: 600;
}

.sidebar-link.active .sidebar-icon {
    color: var(--gold);
}

.sidebar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-link.active .sidebar-icon,
.sidebar-link:hover .sidebar-icon {
    opacity: 1;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--border);
}

/* Mobile sidebar toggle */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 35;
}

.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 30;
    padding: 0 16px;
    align-items: center;
}

.hamburger-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
}
.hamburger-btn:hover {
    background: var(--gold-tint);
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.card-hover {
    transition: all 0.2s ease;
    cursor: pointer;
}
.card-hover:hover {
    background: var(--bg-card-hover);
    border-color: var(--gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(199, 163, 90, 0.08);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-hover));
    color: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(199, 163, 90, 0.25);
}
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--gold-champagne), var(--gold));
    box-shadow: 0 4px 16px rgba(199, 163, 90, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg-card-hover);
    border-color: var(--gold);
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
}
.btn-outline:hover:not(:disabled) {
    background: var(--gold-tint);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 8px 12px;
}
.btn-ghost:hover:not(:disabled) {
    background: var(--gold-tint);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
    border-radius: var(--radius);
}

.btn-full {
    width: 100%;
}

/* ── Inputs ────────────────────────────────────────────── */
.input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    outline: none;
}
.input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-tint);
}
.input::placeholder {
    color: var(--text-subtle);
}

textarea.input {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.input-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-subtle);
}

/* Password show/hide toggle */
.input-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    padding: 4px;
}
.input-toggle:hover {
    color: var(--text-primary);
}

/* ── Badges ────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
}

.badge-draft {
    background: rgba(158, 151, 140, 0.15);
    color: var(--text-subtle);
    border: 1px solid rgba(158, 151, 140, 0.25);
}

.badge-processing {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.25);
    animation: badge-pulse 2s ease-in-out infinite;
}

.badge-ready {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-published {
    background: var(--gold-tint);
    color: var(--gold);
    border: 1px solid rgba(199, 163, 90, 0.25);
}

.badge-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-scheduled {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

/* Platform badges */
.badge-instagram {
    background: rgba(236, 72, 153, 0.15);
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.25);
}
.badge-tiktok {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.25);
}
.badge-linkedin {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.25);
}
.badge-x {
    background: rgba(245, 240, 232, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(245, 240, 232, 0.2);
}
.badge-youtube {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.badge-facebook {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

/* ── Pipeline X-Ray ────────────────────────────────────── */
.pipeline-bar {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: 40px 24px 24px;
    overflow-x: auto;
}

.pipeline-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    min-width: 90px;
    flex-shrink: 0;
}

.pipeline-node {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-subtle);
    font-size: 16px;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
}

.pipeline-stage-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-subtle);
    transition: color 0.3s;
}

.pipeline-stage-duration {
    font-size: 10px;
    color: var(--gold-champagne);
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-weight: 500;
}

/* Stage States */
.pipeline-stage.waiting .pipeline-node {
    border-color: var(--border);
    border-style: dashed;
    color: var(--text-subtle);
}

.pipeline-stage.active .pipeline-node {
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 0 0 5px var(--gold-tint), 0 0 24px rgba(199, 163, 90, 0.25);
    animation: pipeline-pulse 2s ease-in-out infinite;
}
.pipeline-stage.active .pipeline-stage-label {
    color: var(--gold);
    font-weight: 700;
}

.pipeline-stage.completed .pipeline-node {
    border-color: var(--success);
    background: var(--success);
    color: white;
    animation: stage-complete-pop 0.4s ease-out;
}
.pipeline-stage.completed .pipeline-stage-label {
    color: var(--success);
}

.pipeline-stage.error .pipeline-node {
    border-color: var(--danger);
    background: var(--danger);
    color: white;
}
.pipeline-stage.error .pipeline-stage-label {
    color: var(--danger);
}

.pipeline-stage.skipped .pipeline-node {
    border-color: var(--border);
    opacity: 0.35;
}
.pipeline-stage.skipped .pipeline-stage-label {
    color: var(--text-subtle);
    text-decoration: line-through;
    opacity: 0.35;
}

/* Connecting Lines — centered vertically with nodes */
.pipeline-connector {
    width: 40px;
    height: 3px;
    background: var(--border);
    flex-shrink: 0;
    border-radius: 2px;
    /* Vertically center with the 48px node: (48/2) - (3/2) = 22.5px from top */
    margin-top: 23px;
}

.pipeline-connector.completed {
    background: var(--success);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.3);
}

.pipeline-connector.active {
    background: linear-gradient(90deg, var(--gold), var(--gold-champagne), var(--gold));
    background-size: 200% 100%;
    animation: connector-flow 1.5s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(199, 163, 90, 0.25);
}

.pipeline-connector.skipped {
    background: var(--border);
    opacity: 0.25;
    border-style: dashed;
}

/* ── Live Log Feed ─────────────────────────────────────── */
.log-feed {
    background: #0a0a0c;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.7;
    max-height: 360px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.log-feed::-webkit-scrollbar {
    width: 4px;
}
.log-feed::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 3px 0;
    animation: log-fade-in 0.3s ease-out;
    opacity: 1;
}

.log-timestamp {
    color: var(--text-subtle);
    flex-shrink: 0;
    font-size: 11px;
    min-width: 70px;
}

.log-status-icon {
    flex-shrink: 0;
    font-size: 12px;
    width: 16px;
    text-align: center;
}

.stage-tag {
    flex-shrink: 0;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 56px;
    text-align: center;
}

.log-message {
    color: var(--text-muted);
    word-break: break-word;
}

/* Stage tag colors */
.log-entry[data-stage="scrape"] .stage-tag {
    background: rgba(59, 130, 246, 0.15);
    color: var(--stage-scrape);
}
.log-entry[data-stage="script"] .stage-tag {
    background: rgba(168, 85, 247, 0.15);
    color: var(--stage-script);
}
.log-entry[data-stage="image"] .stage-tag {
    background: rgba(34, 197, 94, 0.15);
    color: var(--stage-image);
}
.log-entry[data-stage="video"] .stage-tag {
    background: rgba(249, 115, 22, 0.15);
    color: var(--stage-video);
}
.log-entry[data-stage="caption"] .stage-tag {
    background: rgba(20, 184, 166, 0.15);
    color: var(--stage-caption);
}
.log-entry[data-stage="publish"] .stage-tag {
    background: var(--gold-tint);
    color: var(--stage-publish);
}
.log-entry[data-stage="system"] .stage-tag {
    background: rgba(158, 151, 140, 0.15);
    color: var(--text-subtle);
}

/* Polling shimmer */
.log-entry.polling .log-message {
    animation: shimmer 2s ease-in-out infinite;
}

/* ── Modal ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease-out;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ── Toast Notifications ───────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: toast-slide-in 0.4s ease-out;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 280px;
    max-width: 400px;
}

.toast.success {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}
.toast.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}
.toast.warning {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

.toast-exit {
    animation: toast-slide-out 0.3s ease-in forwards;
}

/* ── KPI Stats Row ─────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--gold-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    flex-shrink: 0;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-top: 2px;
}

/* ── Content Grid ──────────────────────────────────────── */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}
.content-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.content-card-thumb {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-card-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.content-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.content-card-thumb-placeholder {
    color: var(--text-subtle);
    font-size: 32px;
    opacity: 0.3;
}

.content-card-body {
    padding: 16px;
}

.content-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.content-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.content-card-date {
    font-size: 12px;
    color: var(--text-subtle);
}

/* ── Platform Selector ─────────────────────────────────── */
.platform-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.platform-btn {
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.platform-btn:hover {
    border-color: var(--text-subtle);
    color: var(--text-primary);
}

.platform-btn.active {
    border-color: var(--gold);
    background: var(--gold-tint);
    color: var(--gold);
}

/* ── Results Panel ─────────────────────────────────────── */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
    animation: fadeIn 0.4s ease-out;
}

.result-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.result-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-image-preview {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-top: 8px;
}

.result-video-player {
    width: 100%;
    border-radius: var(--radius);
    background: #000;
    margin-top: 8px;
}

/* ── Cost Summary ──────────────────────────────────────── */
.cost-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
}

.cost-total {
    font-size: 14px;
    font-weight: 600;
    color: var(--gold);
    font-family: 'SF Mono', 'Consolas', monospace;
}

.cost-breakdown {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-subtle);
    font-family: 'SF Mono', 'Consolas', monospace;
}

/* ── Calendar ──────────────────────────────────────────── */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.calendar-header-cell {
    background: var(--bg-card);
    padding: 10px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-subtle);
}

.calendar-cell {
    background: var(--bg-primary);
    padding: 8px;
    min-height: 100px;
    transition: background 0.2s;
}
.calendar-cell:hover {
    background: var(--bg-card);
}
.calendar-cell.other-month {
    opacity: 0.3;
}
.calendar-cell.today {
    background: var(--gold-tint);
}

.calendar-day-num {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.calendar-event {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 2px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: var(--gold-tint);
    color: var(--gold);
    border: 1px solid rgba(199, 163, 90, 0.2);
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.calendar-month-title {
    font-size: 20px;
    font-weight: 700;
    min-width: 180px;
    text-align: center;
}

/* ── Filter Tabs ───────────────────────────────────────── */
.filter-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: fit-content;
}

.filter-tab {
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    background: none;
    border: none;
    font-family: inherit;
}
.filter-tab:hover {
    color: var(--text-primary);
}
.filter-tab.active {
    background: var(--bg-card);
    color: var(--gold);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 64px 24px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-subtle);
    margin-bottom: 24px;
}

/* ── Two-Column Layout ─────────────────────────────────── */
.detail-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

/* ── Breadcrumb ────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-subtle);
    margin-bottom: 20px;
}
.breadcrumb a {
    color: var(--text-subtle);
}
.breadcrumb a:hover {
    color: var(--gold);
}
.breadcrumb-sep {
    color: var(--border);
}

/* ── Tab Component ─────────────────────────────────────── */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    gap: 0;
    margin-bottom: 16px;
}

.tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-subtle);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}
.tab:hover {
    color: var(--text-primary);
}
.tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

/* ── Toggle Switch ─────────────────────────────────────── */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle {
    width: 40px;
    height: 22px;
    background: var(--border);
    border-radius: 11px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}
.toggle.active {
    background: var(--gold);
}
.toggle::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}
.toggle.active::after {
    transform: translateX(18px);
}

.toggle-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Toggle Switch (button-based) ─────────────────────── */
.toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}
.toggle-switch.active {
    background: var(--gold);
    border-color: var(--gold);
}
.toggle-knob {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}
.toggle-switch.active .toggle-knob {
    transform: translateX(20px);
}

/* ── Settings Service Card ─────────────────────────────── */
.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}

.service-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.service-name {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.service-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
}
.service-status.connected {
    color: var(--success);
}
.service-status.disconnected {
    color: var(--text-subtle);
}

.service-desc {
    font-size: 13px;
    color: var(--text-subtle);
    margin-bottom: 16px;
}

/* ── Input Type Detection Badge ────────────────────────── */
.input-detect-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 8px;
}

.input-detect-badge.url {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}
.input-detect-badge.idea {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

/* ── Animations ────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pipeline-pulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--gold-tint), 0 0 20px rgba(199, 163, 90, 0.15); }
    50% { box-shadow: 0 0 0 8px var(--gold-tint), 0 0 30px rgba(199, 163, 90, 0.25); }
}

@keyframes stage-complete-pop {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes connector-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes log-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes toast-slide-in {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-slide-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* ── Login Page ────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    padding: 16px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.5s ease-out;
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--gold), var(--gold-bronze));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    font-size: 24px;
    margin: 0 auto 12px;
}

.login-brand-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.login-brand-sub {
    font-size: 13px;
    color: var(--text-subtle);
    margin-top: 4px;
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--danger);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Stage Timeline (Detail Page) ─────────────────────── */
.stage-timeline { display: flex; align-items: flex-start; padding: 16px 8px; overflow-x: auto; gap: 0; }
.stage-node { display: flex; flex-direction: column; align-items: center; min-width: 64px; }
.stage-circle { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--border); background: var(--bg-tertiary); transition: all 0.2s; }
.stage-node.completed .stage-circle { border-color: #22c55e; background: rgba(34,197,94,0.15); color: #22c55e; }
.stage-node.error .stage-circle { border-color: #ef4444; background: rgba(239,68,68,0.15); color: #ef4444; }
.stage-node.skipped .stage-circle { opacity: 0.4; }
.stage-label { font-size: 10px; color: var(--text-subtle); margin-top: 4px; font-weight: 500; }
.stage-duration { font-size: 10px; color: var(--text-muted); font-family: 'SF Mono', monospace; }
.stage-cost { font-size: 10px; color: var(--gold); font-family: 'SF Mono', monospace; }
.stage-connector { width: 24px; height: 2px; background: var(--border); margin-top: 18px; flex-shrink: 0; }
.stage-connector.completed { background: #22c55e; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1024px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.show {
        display: block;
    }
    .mobile-header {
        display: flex;
    }
    .main-content {
        margin-left: 0;
        padding: 72px 16px 24px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .content-grid {
        grid-template-columns: 1fr;
    }
    .pipeline-bar {
        flex-direction: column;
        gap: 0;
    }
    .pipeline-connector {
        width: 2px;
        height: 24px;
        margin-top: 0;
        align-self: center;
    }
    .calendar-grid {
        font-size: 11px;
    }
    .calendar-cell {
        min-height: 60px;
        padding: 4px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .platform-selector {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Light Mode ────────────────────────────────────────── */
:root.light-mode {
    --bg-primary:    #F0F2F5;
    --bg-card:       #FFFFFF;
    --bg-card-hover: #F8F9FA;
    --bg-tertiary:   #EAECF0;

    --gold:          #9A7A2E;
    --gold-hover:    #7A6020;
    --gold-champagne:#7A6020;
    --gold-bronze:   #6B5418;
    --gold-tint:     rgba(154, 122, 46, 0.10);

    --text-primary:  #111318;
    --text-muted:    #374151;
    --text-subtle:   #6B7280;

    --border:        #D1D5DB;

    --success:       #16a34a;
    --warning:       #d97706;
    --danger:        #dc2626;
}

/* Light mode overrides for components that use hard-coded dark colors */
:root.light-mode body { background: var(--bg-primary); color: var(--text-primary); }
:root.light-mode .sidebar { background: #FFFFFF; border-right-color: #D1D5DB; }
:root.light-mode .sidebar-brand { border-bottom-color: #D1D5DB; }
:root.light-mode .sidebar-link { color: #4B5563; }
:root.light-mode .sidebar-link:hover { background: rgba(154,122,46,0.08); color: var(--text-primary); }
:root.light-mode .sidebar-link.active { background: rgba(154,122,46,0.12); color: var(--gold); }
:root.light-mode .sidebar-footer { border-top-color: #D1D5DB; }
:root.light-mode .mobile-header { background: #FFFFFF; border-bottom-color: #D1D5DB; }
:root.light-mode .topbar { background: transparent; border: none; }
:root.light-mode .log-feed { background: #F8F9FA; }
:root.light-mode .table-wrapper { background: #FFFFFF; border-color: #D1D5DB; }
:root.light-mode .table thead th { background: #F3F4F6; border-bottom-color: #D1D5DB; color: #6B7280; }
:root.light-mode .table tbody td { border-bottom-color: #E5E7EB; color: #111318; }
:root.light-mode .table tbody tr:hover { background: #F9FAFB; }
:root.light-mode .modal { background: #FFFFFF; border-color: #D1D5DB; }
:root.light-mode .modal-overlay { background: rgba(0,0,0,0.4); }
:root.light-mode .form-group input,
:root.light-mode .form-group select,
:root.light-mode .form-group textarea { background: #F9FAFB; border-color: #D1D5DB; color: #111318; }
:root.light-mode .form-group input:focus,
:root.light-mode .form-group select:focus { border-color: var(--gold); }
:root.light-mode .search-bar input { background: #FFFFFF; border-color: #D1D5DB; color: #111318; }
:root.light-mode .filter-input { background: #FFFFFF; border-color: #D1D5DB; color: #111318; }
:root.light-mode .scout-panel { background: #FFFFFF; border-left-color: #D1D5DB; }
:root.light-mode .sf input,
:root.light-mode .sf select,
:root.light-mode .scout-select,
:root.light-mode .scout-input { background: #F9FAFB; border-color: #D1D5DB; color: #111318; }
:root.light-mode .rpill { background: #F3F4F6; border-color: #D1D5DB; color: #6B7280; }
:root.light-mode .result-row { border-bottom-color: #E5E7EB; }
:root.light-mode .result-row:hover { background: #F9FAFB; }
:root.light-mode .results-header,
:root.light-mode .filter-wrap,
:root.light-mode .scout-results-header,
:root.light-mode .scout-filter-wrap { border-bottom-color: #D1D5DB; }
:root.light-mode .upcoming-card,
:root.light-mode .slot-item { background: #F3F4F6; border-color: #D1D5DB; }
:root.light-mode .sidebar-panel { background: #FFFFFF; border-color: #D1D5DB; }
:root.light-mode .theme-toggle { background: #FFFFFF; color: #374151; border-color: #D1D5DB; }
:root.light-mode .theme-toggle:hover { background: #F3F4F6; border-color: var(--gold); }
:root.light-mode ::-webkit-scrollbar-track { background: #F0F2F5; }
:root.light-mode ::-webkit-scrollbar-thumb { background: #D1D5DB; }

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0 16px;
    gap: 12px;
    background: transparent;
    border: none;
}

/* Theme toggle button */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.theme-toggle:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* ── CRM Components ────────────────────────────────────── */

[x-cloak] { display: none !important; }

/* Page header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.page-subtitle {
    font-size: 13px;
    color: var(--text-subtle);
    margin: 0;
}

/* Sidebar section label */
.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-subtle);
    padding: 8px 12px 4px;
    opacity: 0.6;
}

/* Card sub-components */
.card-body { padding-top: 4px; }
.card-footer {
    display: flex;
    align-items: center;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border);
}

/* Avatar */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold-tint);
    color: var(--gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    border: 1px solid rgba(199, 163, 90, 0.2);
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 44px; height: 44px; font-size: 18px; }

/* CRM status badges */
.badge-lead     { background: rgba(234,179,8,0.12); color: #eab308; border: 1px solid rgba(234,179,8,0.25); }
.badge-customer { background: rgba(34,197,94,0.12); color: #22c55e; border: 1px solid rgba(34,197,94,0.25); }
.badge-vip      { background: rgba(168,85,247,0.12); color: #a855f7; border: 1px solid rgba(168,85,247,0.25); }
.badge-inactive { background: rgba(158,151,140,0.12); color: var(--text-subtle); border: 1px solid rgba(158,151,140,0.2); }

/* Search bar */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
}
.search-bar input {
    width: 100%;
    padding: 8px 36px 8px 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--gold); }
.search-bar input::placeholder { color: var(--text-subtle); }
.search-icon {
    position: absolute;
    left: 10px;
    color: var(--text-subtle);
    display: flex;
    pointer-events: none;
}
.search-clear {
    position: absolute;
    right: 10px;
    color: var(--text-subtle);
    display: flex;
    cursor: pointer;
}
.search-clear:hover { color: var(--text-primary); }

/* Data table */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-subtle);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}
.table tbody td {
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-card-hover); }

/* Modal header/body/footer/close */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal-body { /* inherits from .modal padding */ }
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border);
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    transition: color 0.2s;
}
.modal-close:hover { color: var(--text-primary); }

/* Form components */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }
.form-group input::placeholder { color: var(--text-subtle); }
.form-group select { appearance: none; cursor: pointer; }
.form-group select option { background: var(--bg-card); color: var(--text-primary); }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 12px; padding: 10px 0; position: relative; }
.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 28px;
    bottom: -10px;
    width: 2px;
    background: var(--border);
}
.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--border);
    flex-shrink: 0;
    margin-top: 2px;
    border: 2px solid var(--bg-card);
}
.timeline-dot.success { background: var(--success); }
.timeline-dot.warning { background: var(--warning); }
.timeline-dot.danger  { background: var(--danger); }
.timeline-content { flex: 1; min-width: 0; }
.timeline-time { font-size: 11px; color: var(--text-subtle); }

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
.spinner-sm { width: 12px; height: 12px; border-width: 2px; }

/* ── Upload Zone ──────────────────────────────────────── */
.upload-dropzone {
    border: 2px dashed #C7A35A;
    border-radius: 12px;
    padding: 40px 28px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 10px;
    background: rgba(199, 163, 90, 0.04);
}
.upload-dropzone:hover {
    background: rgba(199, 163, 90, 0.10);
    border-color: #C7A35A;
    border-style: solid;
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(199, 163, 90, 0.20);
}
.upload-dropzone:hover svg,
.upload-dropzone:hover i {
    transform: translateY(-5px) scale(1.15);
    color: var(--gold) !important;
}
.upload-dropzone:active {
    transform: scale(0.97);
    box-shadow: 0 0 0 4px rgba(199, 163, 90, 0.20);
    border-style: solid;
}
.upload-dropzone svg,
.upload-dropzone i {
    transition: transform 0.25s ease, color 0.2s;
}
:root.light-mode .upload-dropzone {
    border-color: #C7A35A;
    background: rgba(199,163,90,0.05);
}

/* ── CAM Interface ────────────────────────────────────── */
.cam-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
@media (max-width: 1024px) { .cam-layout { grid-template-columns: 1fr; } }
.cam-hero { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.cam-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.cam-tab { padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-subtle); background: transparent; border: none; transition: all 0.2s; font-family: inherit; }
.cam-tab.active { background: rgba(199,163,90,0.15); color: var(--gold); }
.cam-tab .count { font-size: 11px; margin-left: 4px; opacity: 0.7; }
.cam-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; cursor: pointer; transition: border-color 0.2s; }
.cam-card:hover { border-color: var(--gold-dim, rgba(199,163,90,0.4)); }
.cam-card-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; display: block; text-decoration: none; }
.cam-card-title:hover { color: var(--gold); }
.cam-progress { height: 4px; background: var(--bg-tertiary); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.cam-progress-fill { height: 100%; background: var(--gold); border-radius: 2px; transition: width 0.5s ease; }
.cam-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-subtle); }
.cam-sse-log { max-height: 200px; overflow-y: auto; font-family: 'SF Mono', 'Consolas', monospace; font-size: 11px; padding: 12px; background: var(--bg-primary); border: 1px solid var(--border); border-radius: 8px; }
.cam-sse-entry { padding: 2px 0; color: var(--text-muted); }
.cam-mini-cal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.cam-cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cam-cal-header h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.cam-cal-nav { background: none; border: 1px solid var(--border); border-radius: 6px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-subtle); }
.cam-cal-nav:hover { border-color: var(--gold); color: var(--gold); }
.cam-cal-labels { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 10px; color: var(--text-subtle); margin-bottom: 4px; font-weight: 600; }
.cam-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cam-cal-day { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; color: var(--text-muted); border-radius: 6px; position: relative; }
.cam-cal-day.has-content { color: var(--gold); font-weight: 600; }
.cam-cal-day.has-content::after { content: ''; width: 4px; height: 4px; background: var(--gold); border-radius: 50%; position: absolute; bottom: 2px; }
.cam-cal-day.today { background: rgba(199,163,90,0.1); border: 1px solid rgba(199,163,90,0.3); }
.cam-cal-day.other-month { opacity: 0.3; }
