/* ===== CSS Variables / Design Tokens ===== */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(30, 30, 50, 0.7);
    --bg-column: rgba(22, 22, 40, 0.6);
    --bg-modal-overlay: rgba(0, 0, 0, 0.6);

    --text-primary: #e8e8f0;
    --text-secondary: #a0a0b8;
    --text-muted: #6a6a80;

    --accent-blue: #4f8cff;
    --accent-purple: #a855f7;
    --accent-green: #34d399;
    --accent-orange: #fb923c;
    --accent-red: #ef4444;
    --accent-cyan: #22d3ee;
    --accent-pink: #f472b6;

    --gradient-1: linear-gradient(135deg, #4f8cff, #a855f7);
    --gradient-2: linear-gradient(135deg, #a855f7, #f472b6);
    --gradient-3: linear-gradient(135deg, #34d399, #22d3ee);
    --gradient-4: linear-gradient(135deg, #fb923c, #ef4444);
    --gradient-head: linear-gradient(135deg, #38bdf8, #818cf8);
    --gradient-member: linear-gradient(135deg, #fb923c, #f472b6);

    --border-glass: 1px solid rgba(255, 255, 255, 0.06);

    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-drag: 0 12px 40px rgba(79, 140, 255, 0.25);
    --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 30px rgba(79, 140, 255, 0.15);
    --shadow-glow-purple: 0 0 30px rgba(168, 85, 247, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Light Theme ===== */
:root[data-theme="light"] {
    /* Slightly deeper and cooler background to avoid being "too pale" */
    --bg-primary: #eff3f8;
    --bg-secondary: #ffffff;
    /* Cards are solid white to pop off the container background */
    --bg-card: #ffffff;
    /* Columns have a bit more weight */
    --bg-column: rgba(230, 236, 244, 0.9);
    --bg-modal-overlay: rgba(15, 23, 42, 0.5);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    /* Stronger borders for definition */
    --border-glass: 1px solid rgba(15, 23, 42, 0.12);

    /* Slightly more pronounced shadows for depth */
    --shadow-card: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-drag: 0 16px 40px rgba(79, 140, 255, 0.2);
    --shadow-modal: 0 24px 48px rgba(15, 23, 42, 0.15);
}

:root[data-theme="light"] body {
    /* Slightly stronger gradients to add character */
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(79, 140, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(52, 211, 153, 0.04) 0%, transparent 50%);
}

:root[data-theme="light"] .login-page {
    background-image:
        radial-gradient(ellipse at 30% 40%, rgba(79, 140, 255, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(168, 85, 247, 0.05) 0%, transparent 60%);
}

:root[data-theme="light"] .login-container {
    background: rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] .login-field select,
:root[data-theme="light"] .login-field input {
    background: rgba(15, 23, 42, 0.02);
}

:root[data-theme="light"] .header,
:root[data-theme="light"] .search-toolbar,
:root[data-theme="light"] .stats-bar {
    background: rgba(255, 255, 255, 0.85);
}

:root[data-theme="light"] .search-box input,
:root[data-theme="light"] .btn-icon-only,
:root[data-theme="light"] .btn-ghost,
:root[data-theme="light"] .user-badge,
:root[data-theme="light"] .login-role-preview,
:root[data-theme="light"] .sort-select {
    background: rgba(15, 23, 42, 0.04);
}

:root[data-theme="light"] .search-box input:focus {
    background: rgba(15, 23, 42, 0.06);
}

:root[data-theme="light"] .btn-icon-only:hover,
:root[data-theme="light"] .btn-ghost:hover,
:root[data-theme="light"] .dept-tab:hover {
    background: rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .column-primary {
    background: rgba(248, 250, 252, 0.85);
    box-shadow: 0 0 24px rgba(168, 85, 247, 0.03), inset 0 1px 0 rgba(168, 85, 247, 0.05);
}

:root[data-theme="light"] .stat-dot {
    background: rgba(15, 23, 42, 0.1);
}

:root[data-theme="light"] .modal {
    background: rgba(255, 255, 255, 0.95);
}

:root[data-theme="light"] .form-input,
:root[data-theme="light"] .form-select,
:root[data-theme="light"] .form-textarea,
:root[data-theme="light"] #detail-comment-input {
    background: rgba(15, 23, 42, 0.02);
}

:root[data-theme="light"] .form-input:focus,
:root[data-theme="light"] .form-select:focus,
:root[data-theme="light"] .form-textarea:focus {
    background: rgba(15, 23, 42, 0.04);
}

:root[data-theme="light"] .card-progress-value,
:root[data-theme="light"] .progress-ring {
    color: var(--text-primary);
}

:root[data-theme="light"] .progress-bar-track {
    background: rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .shortcuts-panel {
    background: rgba(255, 255, 255, 0.95);
}

:root[data-theme="light"] .shortcut-item {
    border-bottom-color: var(--border-glass);
}

:root[data-theme="light"] kbd {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.1);
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(79, 140, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(52, 211, 153, 0.03) 0%, transparent 50%);
}

/* ===== Login Page ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 30% 40%, rgba(79, 140, 255, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 60%, rgba(168, 85, 247, 0.06) 0%, transparent 60%);
}

.login-page.hidden {
    display: none;
}

.login-container {
    width: 380px;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(24px);
    border: var(--border-glass);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
    padding: 40px 36px;
    animation: fadeUp 0.5s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.login-logo-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 4px 20px rgba(79, 140, 255, 0.3);
}

.login-logo-text {
    font-size: 26px;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.login-field {
    margin-bottom: 18px;
}

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.login-field select,
.login-field input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-family);
    outline: none;
    transition: border-color var(--transition-fast);
}

.login-field select:focus,
.login-field input:focus {
    border-color: rgba(79, 140, 255, 0.4);
}

.login-field select option,
.login-field select optgroup {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.login-role-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    animation: fadeUp 0.2s ease;
}

.role-preview-badge {
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.role-preview-badge.admin {
    background: var(--gradient-4);
}

.role-preview-badge.dept_head {
    background: var(--gradient-head);
}

.role-preview-badge.member {
    background: var(--gradient-member);
}

.role-preview-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.login-btn {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--gradient-1);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 20px rgba(79, 140, 255, 0.25);
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px rgba(79, 140, 255, 0.35);
}

/* ===== App container ===== */
#app {
    display: none;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

#app.active {
    display: flex;
}

.app-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

/* ===== Header ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: var(--border-glass);
    flex-shrink: 0;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo {
    width: 32px;
    height: 32px;
    background: var(--gradient-1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    box-shadow: 0 2px 12px rgba(79, 140, 255, 0.3);
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Dept filter tabs */
.dept-tab {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-family: var(--font-family);
}

.dept-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.dept-tab.active {
    color: var(--accent-blue);
    background: rgba(79, 140, 255, 0.1);
    border-color: rgba(79, 140, 255, 0.15);
}

/* User badge */
.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-full);
    border: var(--border-glass);
}

.user-badge-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.user-badge-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-badge-role {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    color: #fff;
}

.user-badge-role.admin {
    background: var(--gradient-4);
}

.user-badge-role.dept_head {
    background: var(--gradient-head);
}

.user-badge-role.member {
    background: var(--gradient-member);
}

/* Notification badge */
.notification-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-full);
    cursor: default;
    animation: notifPulse 2s ease-in-out infinite;
}

.notification-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-red);
    animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

@keyframes notifPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }

    50% {
        box-shadow: 0 0 12px 2px rgba(239, 68, 68, 0.15);
    }
}

.notification-count {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent-red);
}

.notification-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(239, 68, 68, 0.8);
}

/* Avatar color classes */
.avatar-a {
    background: var(--gradient-1);
}

.avatar-b {
    background: var(--gradient-2);
}

.avatar-c {
    background: var(--gradient-3);
}

.avatar-d {
    background: var(--gradient-4);
}

.avatar-e {
    background: var(--gradient-head);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-1);
    color: #fff;
    box-shadow: 0 2px 10px rgba(79, 140, 255, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 4px 18px rgba(79, 140, 255, 0.35);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
}

.btn-icon {
    font-size: 15px;
    line-height: 1;
}

.btn-icon-only {
    padding: 7px 10px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: var(--border-glass);
    color: var(--text-secondary);
}

.btn-icon-only:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-success {
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-green);
}

.btn-success:hover {
    background: rgba(52, 211, 153, 0.25);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-warn {
    background: rgba(251, 146, 60, 0.15);
    color: var(--accent-orange);
}

.btn-warn:hover {
    background: rgba(251, 146, 60, 0.25);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
}

/* ===== Search Toolbar ===== */
.search-toolbar,
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 28px;
    background: rgba(15, 15, 26, 0.4);
    border-bottom: var(--border-glass);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.search-input-group {
    flex: 1;
    min-width: 200px;
    max-width: 420px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-group .search-icon {
    position: absolute;
    left: 12px;
    font-size: 13px;
    opacity: 0.5;
    pointer-events: none;
}

.search-input-group .search-input {
    width: 100%;
    padding: 8px 14px 8px 36px;
    background: rgba(255, 255, 255, 0.04);
    border: var(--border-glass);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-family);
    outline: none;
    transition: all var(--transition-fast);
}

.search-input-group .search-input:focus {
    border-color: rgba(79, 140, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.06);
}

.search-input-group .search-input::placeholder {
    color: var(--text-muted);
}

.search-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-pills {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    max-width: 420px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    font-size: 13px;
    opacity: 0.5;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 8px 32px 8px 36px;
    background: rgba(255, 255, 255, 0.04);
    border: var(--border-glass);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-family);
    outline: none;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    border-color: rgba(79, 140, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.06);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    position: absolute;
    right: 8px;
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.search-clear:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.sort-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.sort-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.sort-select {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-family: var(--font-family);
    outline: none;
    cursor: pointer;
}

.sort-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ===== Stats Bar ===== */
.stats-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 8px 28px;
    background: rgba(15, 15, 26, 0.3);
    border-bottom: var(--border-glass);
    flex-shrink: 0;
    overflow-x: auto;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.stat-value {
    font-weight: 700;
    color: var(--text-primary);
}

.stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.stat-dot.draft {
    background: var(--text-muted);
}

.stat-dot.pending {
    background: var(--accent-orange);
}

.stat-dot.approved {
    background: var(--accent-blue);
}

.stat-dot.in_progress {
    background: var(--accent-purple);
}

.stat-dot.done {
    background: var(--accent-green);
}

.stat-dot.rejected {
    background: var(--accent-red);
}

/* ===== Board Container ===== */
.board-container {
    padding: 0 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.board-container::-webkit-scrollbar {
    width: 6px;
}

.board-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

/* ===== Flow Center (流程中心 — collapsible) ===== */
.flow-center {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    border: var(--border-glass);
    background: rgba(22, 22, 40, 0.3);
    transition: all var(--transition-normal);
}

.flow-center-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: var(--border-glass);
    user-select: none;
    flex-shrink: 0;
}

.flow-center-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.flow-center-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flow-center-indicator {
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: var(--gradient-1);
}

.flow-center-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.flow-center-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    background: rgba(79, 140, 255, 0.12);
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-blue);
}

.btn-section-toggle {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-section-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.flow-center-body {
    transition: opacity 0.3s ease;
    opacity: 1;
}

.flow-center-body.collapsed {
    display: none;
}

.flow-center-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 16px 16px 20px;
    align-items: start;
    align-content: start;
}

/* Flow center columns: taller height with scroll for cards */
.flow-center-grid .column {
    max-height: 640px;
}

.flow-center-grid .column .column-cards {
    flex: none;
    overflow-y: auto;
    max-height: 540px;
}

/* ===== Column ===== */
.column {
    display: flex;
    flex-direction: column;
    background: var(--bg-column);
    backdrop-filter: blur(12px);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    min-width: 0;
}

/* Primary column (In Progress) — pinned at top, fixed height for ~2 card rows */
.column-primary {
    border-color: rgba(168, 85, 247, 0.2);
    box-shadow: 0 0 24px rgba(168, 85, 247, 0.06), inset 0 1px 0 rgba(168, 85, 247, 0.1);
    background: rgba(22, 22, 40, 0.75);
    margin: 16px 16px 0;
    border-radius: var(--radius-lg);
    max-height: 480px;
}

.column-primary .column-header {
    padding: 16px 20px 10px;
}

.column-primary .column-indicator {
    width: 5px;
    height: 22px;
}

.column-primary .column-title {
    font-size: 15px;
}

.column-primary .column-count {
    font-size: 12px;
    min-width: 24px;
    height: 24px;
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-purple);
}

/* Responsive grid for in-progress cards — limited to ~2 rows with scroll */
.column-primary .column-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    padding: 8px 14px 14px;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
    align-content: start;
}

/* In-progress card height: show all content including action buttons */
.column-primary .card {
    min-height: 200px;
}

/* When in-progress column is empty, center the content vertically */
.column-primary .column-cards:has(.column-empty) {
    align-content: center;
}

.column-primary .column-empty {
    grid-column: 1 / -1;
}

.column-expand-bar {
    display: flex;
    justify-content: center;
    padding: 6px 14px 10px;
}

.btn-expand {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 11px;
    padding: 4px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-expand:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
    color: var(--accent-purple);
}

.column.drag-over {
    background: rgba(79, 140, 255, 0.08);
    border-color: rgba(79, 140, 255, 0.25);
    box-shadow: inset 0 0 30px rgba(79, 140, 255, 0.06), 0 0 20px rgba(79, 140, 255, 0.08);
}

/* Light theme overrides */
:root[data-theme="light"] .flow-center {
    background: rgba(230, 236, 244, 0.5);
}

:root[data-theme="light"] .flow-center-header {
    background: rgba(255, 255, 255, 0.6);
}

:root[data-theme="light"] .flow-center-header:hover {
    background: rgba(255, 255, 255, 0.8);
}

:root[data-theme="light"] .btn-section-toggle {
    background: rgba(15, 23, 42, 0.05);
}

:root[data-theme="light"] .btn-section-toggle:hover {
    background: rgba(15, 23, 42, 0.1);
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 10px;
    flex-shrink: 0;
}

.column-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-indicator {
    width: 4px;
    height: 18px;
    border-radius: 2px;
}

.column-indicator.draft {
    background: var(--text-muted);
}

.column-indicator.pending {
    background: var(--gradient-4);
}

.column-indicator.approved {
    background: var(--gradient-1);
}

.column-indicator.in_progress {
    background: var(--gradient-2);
}

.column-indicator.done {
    background: var(--gradient-3);
}

.column-indicator.rejected {
    background: var(--accent-red);
}

.column-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.column-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.column-cards {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: none;
}

.column-cards::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.column-cards:hover {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.column-cards:hover::-webkit-scrollbar {
    width: 4px;
}

.column-cards:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
}

/* Flow center column cards: taller to show full card content */
.flow-center-grid .column-cards {
    max-height: 540px;
}

/* Toggle view button */
.btn-view-toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-view-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* Column header actions group */
.column-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

/* Column bottom-edge drag resize handle */
.column-resize-handle {
    height: 6px;
    cursor: row-resize;
    background: transparent;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    position: relative;
    flex-shrink: 0;
    transition: background var(--transition-fast);
}

.column-resize-handle::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    transition: all var(--transition-fast);
}

.column-resize-handle:hover {
    background: rgba(255, 255, 255, 0.04);
}

.column-resize-handle:hover::after {
    width: 60px;
    background: rgba(255, 255, 255, 0.25);
}

.column-resize-handle.dragging::after {
    width: 80px;
    background: var(--accent-primary);
}

/* Active resize state on body */
body.col-resizing {
    cursor: row-resize !important;
    user-select: none !important;
}

/* ==================== GANTT CHART ==================== */

.gantt-section {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    position: relative;
}

.gantt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: var(--border-glass);
    background: rgba(255, 255, 255, 0.02);
}

.gantt-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.gantt-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.btn-gantt-toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    cursor: pointer;
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-gantt-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.gantt-body {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.gantt-body.collapsed {
    max-height: 0 !important;
}

.gantt-chart {
    padding: 0;
    overflow: hidden;
}

.gantt-empty {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

.gantt-empty-icon {
    font-size: 28px;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* Gantt two-column container: sticky labels + scrollable timeline */
.gantt-container {
    display: flex;
    position: relative;
    min-height: 0;
}

/* Left column: task labels (sticky) */
.gantt-labels-col {
    flex-shrink: 0;
    width: 160px;
    min-width: 160px;
    z-index: 10;
    background: var(--bg-card);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.gantt-corner {
    height: 36px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Scroll wrapper with navigation arrows */
.gantt-scroll-wrap {
    flex: 1;
    display: flex;
    align-items: stretch;
    position: relative;
    min-width: 0;
    overflow: hidden;
}

/* Navigation arrow buttons */
.gantt-scroll-btn {
    width: 28px;
    flex-shrink: 0;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 12;
}

.gantt-scroll-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
}

.gantt-scroll-btn:active {
    background: rgba(99, 102, 241, 0.25);
}

.gantt-scroll-left {
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.gantt-scroll-right {
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

/* Right column: scrollable timeline */
.gantt-scroll-area {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    cursor: grab;
    scrollbar-width: none; /* Hide native scrollbar, we have custom indicator */
}

.gantt-scroll-area::-webkit-scrollbar {
    display: none;
}

.gantt-scroll-area.grabbing {
    cursor: grabbing;
    user-select: none;
}

/* Scroll position indicator bar */
.gantt-scroll-indicator {
    height: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 2px;
    margin: 6px 28px 8px 188px;
    position: relative;
    overflow: hidden;
}

.gantt-scroll-thumb {
    position: absolute;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-purple));
    border-radius: 2px;
    min-width: 20px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.gantt-scroll-indicator:hover .gantt-scroll-thumb {
    opacity: 1;
}

.gantt-timelines {
    position: relative;
}

/* Gantt date headers */
.gantt-dates {
    display: flex;
    align-items: flex-end;
    height: 36px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg-card);
}

.gantt-date-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    flex-shrink: 0;
    padding-bottom: 6px;
}

.gantt-date-label.today {
    color: var(--accent-primary);
    font-weight: 600;
}

.gantt-date-label.weekend {
    color: rgba(255, 255, 255, 0.2);
}

/* Gantt row labels (in the sticky left column) */
.gantt-row-label {
    width: 160px;
    min-width: 160px;
    height: 36px;
    padding: 0 12px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background var(--transition-fast);
}

.gantt-row-label:hover {
    background: rgba(255, 255, 255, 0.02);
}

.gantt-row-label:hover .gantt-label-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.gantt-label-tooltip {
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 100;
    min-width: 240px;
    max-width: 320px;
    padding: 10px 14px;
    background: rgba(20, 20, 40, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    pointer-events: none;
    white-space: normal;
}

.gantt-row-label .gantt-priority-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Gantt row timeline (in the scrollable area) */
.gantt-row-timeline {
    position: relative;
    height: 36px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

/* Gantt bars */
.gantt-bar-wrapper {
    position: absolute;
    height: 20px;
    display: flex;
    align-items: center;
}

.gantt-bar {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: filter var(--transition-fast), transform var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.gantt-bar:hover {
    filter: brightness(1.2);
    transform: scaleY(1.3);
    z-index: 5;
}

.gantt-bar-bg {
    position: absolute;
    inset: 0;
    opacity: 0.25;
    border-radius: 4px;
}

.gantt-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.gantt-bar-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* Priority colors */
.gantt-bar.priority-urgent .gantt-bar-bg {
    background: var(--accent-red);
}

.gantt-bar.priority-urgent .gantt-bar-fill {
    background: var(--accent-red);
}

.gantt-bar.priority-high .gantt-bar-bg {
    background: var(--accent-orange);
}

.gantt-bar.priority-high .gantt-bar-fill {
    background: var(--accent-orange);
}

.gantt-bar.priority-normal .gantt-bar-bg {
    background: var(--accent-primary);
}

.gantt-bar.priority-normal .gantt-bar-fill {
    background: var(--accent-primary);
}

.gantt-bar.priority-low .gantt-bar-bg {
    background: var(--accent-green);
}

.gantt-bar.priority-low .gantt-bar-fill {
    background: var(--accent-green);
}

/* Today marker */
.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-primary);
    opacity: 0.6;
    z-index: 3;
    pointer-events: none;
}

.gantt-today-line::before {
    content: '今天';
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--accent-primary);
    font-weight: 600;
    white-space: nowrap;
}

/* Gantt tooltip */
.gantt-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    border: var(--border-glass);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.gantt-bar:hover .gantt-tooltip {
    opacity: 1;
}

.gantt-tooltip-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.gantt-tooltip-row {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.6;
}

/* Grid lines behind bars */
.gantt-grid-lines {
    position: absolute;
    inset: 0;
    display: flex;
    pointer-events: none;
}

.gantt-grid-line {
    flex-shrink: 0;
    height: 100%;
    border-right: 1px solid rgba(255, 255, 255, 0.03);
}

.gantt-grid-line.weekend {
    background: rgba(255, 255, 255, 0.01);
}

/* Light theme overrides for gantt scroll */
:root[data-theme="light"] .gantt-labels-col {
    background: var(--bg-card);
}

:root[data-theme="light"] .gantt-dates {
    background: var(--bg-card);
}

:root[data-theme="light"] .gantt-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
}

:root[data-theme="light"] .gantt-scroll-area::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

:root[data-theme="light"] .gantt-scroll-area {
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

:root[data-theme="light"] .gantt-date-label.weekend {
    color: rgba(0, 0, 0, 0.25);
}

:root[data-theme="light"] .gantt-row-label:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* Compact card */
.card-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-card);
    border: var(--border-glass);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    cursor: default;
    min-height: 32px;
}

/* Enhanced compact card for in_progress */
.card-compact-full {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: var(--border-glass);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    cursor: default;
}

.card-compact-full:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(168, 85, 247, 0.2);
}

.card-compact-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-compact-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    padding-left: 16px;
}

.card-compact-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-secondary);
    padding-left: 16px;
    flex-wrap: wrap;
}

.card-compact-dept {
    font-weight: 600;
}

.card-compact-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 16px;
}

.card-compact-progress .progress-bar-track {
    flex: 1;
}

.card-compact-prog-text {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 28px;
}

.card-compact:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.priority-dot.priority-urgent {
    background: var(--accent-red);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.priority-dot.priority-important {
    background: var(--accent-orange);
}

.priority-dot.priority-normal {
    background: var(--text-muted);
}

.card-compact-title {
    flex: 1;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.card-compact-title:hover {
    color: var(--accent-blue);
}

.card-compact-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.column-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    opacity: 0.5;
}

.column-empty-icon {
    font-size: 28px;
    margin-bottom: 6px;
    opacity: 0.4;
}

/* ===== Card ===== */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: grab;
    transition: all var(--transition-smooth);
    position: relative;
    animation: cardSlideIn 0.35s ease both;
    overflow: visible;
    flex-shrink: 0;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card:hover {
    background: rgba(35, 35, 60, 0.8);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-card);
    transform: translateY(-2px);
}

.card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    box-shadow: none;
}

/* Card border accent by status */
.card.status-pending {
    border-left: 3px solid var(--accent-orange);
}

.card.status-approved {
    border-left: 3px solid var(--accent-blue);
}

.card.status-rejected {
    border-left: 3px solid var(--accent-red);
}

.card.status-in_progress {
    border-left: 3px solid var(--accent-purple);
}

.card.status-done {
    border-left: 3px solid var(--accent-green);
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 6px;
}

.priority-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.priority-urgent {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.priority-important {
    background: rgba(251, 146, 60, 0.15);
    color: var(--accent-orange);
}

.priority-normal {
    background: rgba(79, 140, 255, 0.12);
    color: var(--accent-blue);
}

.card-dept-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.card-menu-btn {
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    opacity: 0;
    transition: all var(--transition-fast);
}

.card:hover .card-menu-btn {
    opacity: 1;
}

.card-menu-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.4;
}

.card-title.clickable {
    cursor: pointer;
    transition: color var(--transition-fast);
}

.card-title.clickable:hover {
    color: var(--accent-blue);
}

.card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

/* ===== Approval Level Badge ===== */
.approval-level-badge {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    margin: 6px 0;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.approval-level-badge.approval-step-dept {
    border-color: rgba(56, 189, 248, 0.2);
    background: rgba(56, 189, 248, 0.05);
}

.approval-level-badge.approval-step-admin {
    border-color: rgba(251, 146, 60, 0.2);
    background: rgba(251, 146, 60, 0.05);
}

.approval-steps {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
}

.approval-step {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    transition: all var(--transition-fast);
}

.approval-step.done {
    color: var(--accent-green);
    background: rgba(52, 211, 153, 0.12);
}

.approval-step.active {
    color: var(--accent-orange);
    background: rgba(251, 146, 60, 0.15);
    animation: stepPulse 2s ease-in-out infinite;
}

@keyframes stepPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(251, 146, 60, 0);
    }

    50% {
        box-shadow: 0 0 8px 2px rgba(251, 146, 60, 0.15);
    }
}

.approval-arrow {
    color: var(--text-muted);
    font-size: 10px;
}

.approval-current {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

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

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.card-assignee {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
}

.card-creator {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
}

.card-comment-badge {
    font-size: 10px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
}

/* Card action buttons */
.card-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-wrap: wrap;
}

/* ===== Context Menu ===== */
.card-context-menu {
    position: absolute;
    top: 34px;
    right: 8px;
    z-index: 50;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border: var(--border-glass);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-modal);
    min-width: 130px;
    padding: 4px;
    animation: menuAppear 0.15s ease;
}

@keyframes menuAppear {
    from {
        opacity: 0;
        transform: translateY(-4px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: var(--font-family);
    cursor: pointer;
    border-radius: 6px;
    width: 100%;
    transition: all var(--transition-fast);
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.context-menu-item.danger {
    color: var(--accent-red);
}

.context-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal-overlay);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-secondary);
    border: var(--border-glass);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-modal);
    width: 90%;
    max-width: 480px;
    padding: 28px;
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-smooth);
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.modal::-webkit-scrollbar {
    width: 4px;
}

.modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.detail-modal-body {
    max-width: 600px;
}

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

.modal-title {
    font-size: 17px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Form */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-family);
    transition: border-color var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: rgba(79, 140, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.08);
}

.form-textarea {
    resize: vertical;
    min-height: 70px;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 22px;
}

/* Rejection area */
.rejection-area {
    margin-top: 12px;
}

.rejection-area textarea {
    width: 100%;
    padding: 10px;
    min-height: 60px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-family);
    outline: none;
    resize: vertical;
}

/* ===== Detail Modal Sections ===== */
.detail-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: var(--border-glass);
}

.detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.detail-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-field-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-field span:not(.detail-field-label) {
    font-size: 13px;
    color: var(--text-primary);
}

.detail-desc {
    margin-top: 12px;
}

.detail-desc p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 4px;
}

.detail-progress-wrap {
    margin-top: 12px;
}

.detail-rejection {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(239, 68, 68, 0.06);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-red);
}

.detail-rejection p {
    font-size: 13px;
    color: var(--accent-red);
    margin-top: 4px;
}

/* Status tag in detail */
.detail-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.status-tag-draft {
    background: rgba(106, 106, 128, 0.15);
    color: var(--text-muted);
}

.status-tag-pending {
    background: rgba(251, 146, 60, 0.15);
    color: var(--accent-orange);
}

.status-tag-approved {
    background: rgba(79, 140, 255, 0.15);
    color: var(--accent-blue);
}

.status-tag-in_progress {
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-purple);
}

.status-tag-done {
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-green);
}

.status-tag-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

/* Timeline (Activity Log) */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-left: 2px solid rgba(255, 255, 255, 0.06);
    padding-left: 14px;
    margin-left: 8px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(79, 140, 255, 0.4);
    border: 2px solid var(--bg-secondary);
}

.timeline-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.timeline-content {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 12px;
    line-height: 1.5;
}

.timeline-actor {
    font-weight: 600;
    color: var(--accent-blue);
}

.timeline-detail {
    color: var(--text-secondary);
}

.timeline-time {
    color: var(--text-muted);
    font-size: 11px;
}

/* Comments */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.comment-bubble {
    background: rgba(255, 255, 255, 0.03);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    padding: 10px 12px;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.comment-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.comment-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: auto;
}

.comment-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.comment-input-area {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    align-items: flex-end;
}

.comment-input-area textarea {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-family);
    outline: none;
    resize: none;
    min-height: 40px;
    transition: border-color var(--transition-fast);
}

.comment-input-area textarea:focus {
    border-color: rgba(79, 140, 255, 0.3);
}

.empty-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 16px 0;
    opacity: 0.6;
}

/* ===== Keyboard Shortcuts Panel ===== */
.shortcuts-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 2000;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border: var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
    padding: 16px;
    min-width: 220px;
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    pointer-events: none;
    transition: all var(--transition-smooth);
}

.shortcuts-panel.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.shortcut-item kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-family);
    color: var(--text-primary);
}

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 18px;
    background: var(--bg-secondary);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* ===== Card Progress Bar ===== */
.card-progress {
    margin-top: 8px;
}

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

.card-progress-label {
    font-size: 10px;
    color: var(--text-muted);
}

.card-progress-value {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-blue);
}

.progress-bar-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--gradient-3);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-fill.high {
    background: var(--gradient-3);
}

.progress-bar-fill.mid {
    background: var(--gradient-1);
}

.progress-bar-fill.low {
    background: var(--gradient-4);
}

/* Deadline badge */
.card-deadline {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
}

/* Start date badge */
.card-start-date {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(79, 140, 255, 0.08);
    color: var(--accent-blue);
}

.card-deadline.soon {
    background: rgba(251, 146, 60, 0.12);
    color: var(--accent-orange);
}

.card-deadline.overdue {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    animation: overduePulse 2s ease-in-out infinite;
}

@keyframes overduePulse {

    0%,
    100% {
        box-shadow: none;
    }

    50% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
    }
}

/* ===== Progress Overview Panel ===== */
.progress-panel {
    display: flex;
    align-items: stretch;
    gap: 16px;
    padding: 12px 28px;
    background: rgba(15, 15, 26, 0.5);
    border-bottom: var(--border-glass);
    flex-shrink: 0;
    overflow-x: auto;
}

.progress-card {
    flex: 1;
    min-width: 160px;
    padding: 14px 16px;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    border: var(--border-glass);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-card-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-card-value {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
}

.progress-card-value.gradient {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-card-sub {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Donut ring */
.progress-ring-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.progress-ring-label {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Overdue list */
.overdue-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 60px;
    overflow-y: auto;
}

.overdue-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--accent-red);
    padding: 2px 0;
}

.overdue-item .overdue-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-red);
    flex-shrink: 0;
}

/* ===== Drag Placeholder ===== */
.drag-placeholder {
    border: 2px dashed rgba(79, 140, 255, 0.25);
    border-radius: var(--radius-md);
    background: rgba(79, 140, 255, 0.04);
    min-height: 50px;
}

/* ===== Responsive ===== */

/* --- Tablet landscape / small desktop --- */
@media (max-width: 1024px) {
    .header {
        padding: 10px 16px;
        gap: 10px;
    }

    .search-toolbar {
        padding: 6px 16px;
    }

    .stats-bar {
        padding: 6px 16px;
        gap: 12px;
    }

    .progress-panel {
        padding: 10px 16px;
        gap: 10px;
    }

    .board {
        padding: 14px 16px;
        gap: 12px;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .progress-card {
        min-width: 140px;
    }

    .column-primary .column-cards {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* --- Tablet portrait / large phone --- */
@media (max-width: 768px) {

    html,
    body {
        overflow: auto;
        height: auto;
    }

    #app {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    #app.active {
        display: flex;
    }

    /* Header */
    .header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }

    .header-left {
        order: 1;
    }

    .header-right {
        order: 2;
        flex-wrap: wrap;
        gap: 6px;
    }

    .header-center {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .dept-tab {
        padding: 5px 10px;
        font-size: 11px;
    }

    .user-badge-name {
        display: none;
    }

    /* Search */
    .search-toolbar {
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
    }

    .search-box {
        max-width: 100%;
        width: 100%;
    }

    .sort-group {
        width: 100%;
    }

    .sort-select {
        flex: 1;
    }

    /* Stats */
    .stats-bar {
        padding: 8px 12px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .stat-item {
        font-size: 11px;
    }

    /* Progress panel */
    .progress-panel {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
    }

    .progress-card {
        min-width: 0;
        flex: 1 1 calc(50% - 8px);
    }

    .progress-card-value {
        font-size: 22px;
    }

    /* Board: switch to single column stacking */
    .board {
        grid-template-columns: 1fr !important;
        padding: 12px;
        gap: 12px;
        overflow-y: auto !important;
    }

    .column {
        max-height: none;
    }

    .column-primary .column-cards {
        grid-template-columns: 1fr !important;
    }

    .column-cards {
        overflow-y: auto;
    }

    /* Modal */
    .modal {
        width: 95%;
        max-width: 95%;
        padding: 20px;
        border-radius: var(--radius-lg);
    }

    .detail-modal-body {
        max-width: 95%;
    }

    .detail-meta-grid {
        grid-template-columns: 1fr;
    }

    .modal-header {
        margin-bottom: 16px;
    }

    .modal-title {
        font-size: 15px;
    }

    /* Form */
    .form-row {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
        gap: 8px;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Toast */
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .toast {
        font-size: 12px;
    }

    /* Login */
    .login-container {
        width: 90%;
        max-width: 380px;
        padding: 30px 24px;
    }

    /* Shortcuts panel */
    .shortcuts-panel {
        right: 8px;
        top: auto;
        bottom: 60px;
    }
}

/* --- Phone --- */
@media (max-width: 480px) {
    .header {
        padding: 8px 10px;
    }

    .header-title {
        font-size: 15px;
    }

    .logo {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .header-right {
        gap: 4px;
    }

    .header-right .btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .header-right .btn-icon-only {
        padding: 6px 8px;
        font-size: 13px;
    }

    .user-badge {
        padding: 3px 8px 3px 4px;
        gap: 5px;
    }

    .user-badge-avatar {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    .user-badge-role {
        font-size: 10px;
        padding: 1px 6px;
    }

    .notification-badge {
        padding: 2px 8px;
        gap: 4px;
    }

    .notification-count {
        font-size: 11px;
    }

    .notification-label {
        font-size: 9px;
    }

    /* Stats compact */
    .stats-bar {
        padding: 6px 10px;
        gap: 6px;
    }

    .stat-item {
        font-size: 10px;
    }

    /* Progress panel */
    .progress-panel {
        padding: 8px 10px;
    }

    .progress-card {
        flex: 1 1 100%;
        padding: 10px 12px;
    }

    .progress-card-value {
        font-size: 20px;
    }

    .progress-ring {
        width: 40px;
        height: 40px;
    }

    .progress-ring>div {
        width: 30px !important;
        height: 30px !important;
        font-size: 10px !important;
    }

    /* Board */
    .board {
        padding: 10px 8px;
        gap: 10px;
    }

    .column {
        border-radius: var(--radius-md);
    }

    .column-header {
        padding: 12px 12px 8px;
    }

    .column-primary .column-header {
        padding: 12px 12px 8px;
    }

    .column-title {
        font-size: 13px;
    }

    .column-cards {
        padding: 4px 8px 8px;
        gap: 6px;
    }

    /* Cards */
    .card {
        padding: 10px 12px;
    }

    .card-title {
        font-size: 13px;
    }

    .card-desc {
        font-size: 11px;
    }

    .card-footer {
        flex-wrap: wrap;
        gap: 4px;
    }

    .card-creator {
        font-size: 10px;
    }

    .card-actions {
        gap: 3px;
    }

    .card-actions .btn-sm {
        padding: 3px 8px;
        font-size: 10px;
    }

    /* Approval badge compact */
    .approval-level-badge {
        padding: 6px 8px;
        margin: 4px 0;
    }

    .approval-steps {
        font-size: 10px;
        gap: 4px;
    }

    .approval-step {
        padding: 1px 6px;
    }

    .approval-current {
        font-size: 9px;
    }

    /* Modal */
    .modal {
        width: 98%;
        max-width: 98%;
        padding: 16px;
        border-radius: var(--radius-md);
        max-height: 85vh;
    }

    .modal-title {
        font-size: 14px;
    }

    .modal-close {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }

    .form-label {
        font-size: 12px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        font-size: 13px;
        padding: 10px 12px;
    }

    /* Detail modal */
    .detail-section-title {
        font-size: 13px;
    }

    .timeline-item {
        gap: 8px;
    }

    .comment-bubble {
        padding: 8px 10px;
    }

    .comment-input-area textarea {
        font-size: 13px;
    }

    /* Login */
    .login-container {
        width: 95%;
        padding: 24px 20px;
    }

    .login-logo-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .login-logo-text {
        font-size: 22px;
    }

    .login-subtitle {
        font-size: 12px;
    }

    .login-btn {
        padding: 11px;
        font-size: 14px;
    }

    /* Toast */
    .toast {
        padding: 8px 14px;
        font-size: 11px;
    }

    /* Context menu */
    .card-context-menu {
        min-width: 110px;
    }

    .context-menu-item {
        padding: 6px 8px;
        font-size: 11px;
    }

    /* Shortcuts panel */
    .shortcuts-panel {
        width: 200px;
        right: 8px;
    }
}

/* --- Very small phone --- */
@media (max-width: 360px) {
    .header-title {
        font-size: 13px;
    }

    .logo {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .header-right .btn {
        padding: 5px 8px;
        font-size: 10px;
    }

    .dept-tab {
        padding: 4px 8px;
        font-size: 10px;
    }

    .column-cards {}

    .card {
        padding: 8px 10px;
    }

    .modal {
        padding: 14px;
    }

    .login-container {
        padding: 20px 16px;
    }
}

/* ==================== LIGHT THEME ==================== */
body.light-theme {
    /* TeamBoard root variable overrides */
    --bg-primary: #f0f2f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-column: rgba(230, 236, 244, 0.9);
    --bg-modal-overlay: rgba(15, 23, 42, 0.5);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-glass: 1px solid rgba(15, 23, 42, 0.1);
    --shadow-card: 0 1px 4px rgba(15, 23, 42, 0.06);
    --shadow-drag: 0 12px 40px rgba(79, 140, 255, 0.15);
    --shadow-modal: 0 24px 48px rgba(15, 23, 42, 0.12);
    --shadow-glow-blue: 0 0 20px rgba(79, 140, 255, 0.1);
    --shadow-glow-purple: 0 0 20px rgba(168, 85, 247, 0.08);
    /* TradeTracker variable overrides */
    --bg-tertiary: #e8ecf4;
    --bg-elevated: rgba(255, 255, 255, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --text-accent: #6366f1;
    --gradient-1: linear-gradient(135deg, #6366f1, #8b5cf6);
    background: #f0f2f8;
    color: #1e293b;
}

body.light-theme::before {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
}

body.light-theme::after {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.04) 0%, transparent 70%);
}

/* --- Hardcoded dark background overrides --- */
body.light-theme .search-bar {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .stats-bar {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-theme .progress-panel {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .column {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .column-primary {
    background: #f8faff !important;
}

body.light-theme .trade-sidebar {
    background: #ffffff !important;
    border-right-color: #e2e8f0 !important;
}

body.light-theme .trade-sidebar .nav-item {
    color: #475569;
}

body.light-theme .trade-sidebar .nav-item:hover {
    color: #1e293b;
    background: #f1f5f9;
}

body.light-theme .trade-sidebar .nav-item.active {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

body.light-theme .trade-sidebar .sidebar-footer {
    border-color: #e2e8f0 !important;
}

body.light-theme .gantt-section {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .gantt-header {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .gantt-body {
    background: #ffffff;
}

body.light-theme .gantt-row {
    background: #ffffff;
    border-color: #f1f5f9;
}

body.light-theme .gantt-row:hover {
    background: #f8fafc;
}

body.light-theme .gantt-row-label {
    color: #475569;
}

body.light-theme .gantt-title {
    color: #1e293b;
}

body.light-theme .gantt-subtitle {
    color: #94a3b8;
}

body.light-theme .gantt-date-label {
    color: #64748b;
    border-color: #e2e8f0;
}

body.light-theme .gantt-grid-line {
    border-color: #f1f5f9;
}

body.light-theme .gantt-grid-line.weekend {
    background: rgba(0, 0, 0, 0.02);
}

body.light-theme .gantt-empty {
    color: #94a3b8;
}

body.light-theme .flow-center {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .flow-center-header {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .flow-center-header:hover {
    background: #f1f5f9 !important;
}

body.light-theme .flow-center-body {
    background: #ffffff;
}

body.light-theme .flow-center-title {
    color: #1e293b;
}

body.light-theme .flow-center-count {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

body.light-theme .flow-center-indicator {
    background: #6366f1;
}

/* --- Left Module Sidebar --- */
body.light-theme .module-sidebar {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light-theme .module-nav-item {
    color: #64748b;
}

body.light-theme .module-nav-item:hover {
    color: #1e293b;
    background: #f1f5f9;
}

body.light-theme .module-nav-item.active {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

/* --- TeamBoard Header --- */
body.light-theme .header {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-theme .header-title {
    color: #1e293b;
}

body.light-theme .header-left .logo {
    background: var(--gradient-1);
}

body.light-theme .user-badge {
    color: #475569;
}

body.light-theme .user-badge-name {
    color: #1e293b;
}

/* --- Module Panel --- */
body.light-theme .module-panel {
    background: #f0f2f8;
}

/* --- Dept Tabs --- */
body.light-theme .dept-tab {
    color: #475569;
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light-theme .dept-tab:hover {
    background: #f8fafc;
    color: #1e293b;
}

body.light-theme .dept-tab.active {
    color: #fff;
    background: var(--gradient-1);
    border-color: #6366f1;
}

/* --- Search Bar --- */
body.light-theme .search-bar,
body.light-theme .search-input {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1e293b;
}

body.light-theme .search-input::placeholder {
    color: #94a3b8;
}

/* --- Stat Summary Bar --- */
body.light-theme .stat-summary {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-theme .stat-item {
    color: #475569;
}

body.light-theme .stat-item .stat-count {
    color: #1e293b;
}

body.light-theme .stat-item .stat-label {
    color: #64748b;
}

/* --- Board Columns --- */
body.light-theme .board-column {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-theme .column-header {
    border-color: #e2e8f0;
}

body.light-theme .column-header h2 {
    color: #1e293b;
}

body.light-theme .column-count {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

/* --- Gantt Chart --- */
body.light-theme .gantt-section {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-theme .gantt-section h3 {
    color: #1e293b;
}

body.light-theme .gantt-header-cell {
    color: #64748b;
    border-color: #e2e8f0;
}

body.light-theme .gantt-row {
    border-color: #f1f5f9;
}

body.light-theme .gantt-task-label {
    color: #475569;
}

body.light-theme .gantt-empty {
    color: #94a3b8;
}

/* --- Flow Center & In Progress --- */
body.light-theme .flow-center {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-theme .flow-center-header,
body.light-theme .flow-center-header h3 {
    color: #1e293b;
}

body.light-theme .in-progress-section {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.light-theme .in-progress-header h3 {
    color: #1e293b;
}

/* --- Cards --- */
body.light-theme .card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.light-theme .card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

body.light-theme .card-title {
    color: #1e293b;
}

body.light-theme .card-desc {
    color: #64748b;
}

body.light-theme .card-creator {
    color: #94a3b8;
}

body.light-theme .card-footer {
    border-color: #f1f5f9;
}

/* --- Buttons --- */
body.light-theme .btn-ghost {
    color: #475569;
}

body.light-theme .btn-ghost:hover {
    color: #1e293b;
    background: #f1f5f9;
}

body.light-theme .header-right .btn {
    color: #475569;
}

body.light-theme .header-right .btn:hover {
    color: #1e293b;
    background: #f1f5f9;
}

/* --- Modal --- */
body.light-theme .modal-overlay {
    background: rgba(15, 23, 42, 0.4);
}

body.light-theme .modal {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1e293b;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body.light-theme .modal-title {
    color: #1e293b;
}

body.light-theme .modal-close {
    color: #64748b;
}

body.light-theme .modal-close:hover {
    color: #1e293b;
    background: #f1f5f9;
}

/* --- Forms --- */
body.light-theme .form-input,
body.light-theme .form-select,
body.light-theme .form-textarea {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
}

body.light-theme .form-input:focus,
body.light-theme .form-select:focus,
body.light-theme .form-textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

body.light-theme .form-label {
    color: #475569;
}

body.light-theme .detail-section-title {
    color: #1e293b;
}

/* --- Login --- */
body.light-theme #login-page {
    background: linear-gradient(135deg, #e0e7ff, #f0f2f8, #ede9fe);
}

body.light-theme .login-container {
    background: rgba(255, 255, 255, 0.95);
    border-color: #e2e8f0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

body.light-theme .login-subtitle {
    color: #64748b;
}

/* --- Toast --- */
body.light-theme .toast {
    background: #ffffff;
    color: #1e293b;
    border-color: #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* --- Scrollbar --- */
body.light-theme ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
}

body.light-theme ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* --- Context Menu --- */
body.light-theme .card-context-menu {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body.light-theme .context-menu-item {
    color: #475569;
}

body.light-theme .context-menu-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* --- Approval / Comments --- */
body.light-theme .approval-level-badge {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.15);
}

body.light-theme .comment-bubble {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

/* ========== TradeTracker Light ========== */
body.light-theme .topbar {
    background: rgba(255, 255, 255, 0.92);
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-theme .logo-text {
    color: #1e293b;
}

body.light-theme .sidebar {
    background: rgba(255, 255, 255, 0.85);
    border-color: #e2e8f0;
}

body.light-theme .sidebar-footer {
    border-color: #e2e8f0;
}

body.light-theme .stat-mini-value {
    color: #1e293b;
}

body.light-theme .stat-mini-label {
    color: #94a3b8;
}

body.light-theme .nav-item {
    color: #64748b;
}

body.light-theme .nav-item:hover {
    color: #1e293b;
    background: #f1f5f9;
}

body.light-theme .nav-item.active {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
}

body.light-theme .main-content {
    background: #f0f2f8;
}

body.light-theme .stat-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-theme .stat-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

body.light-theme .stat-card .stat-label {
    color: #64748b;
}

body.light-theme .stat-card .stat-value {
    color: #1e293b;
}

body.light-theme .stage-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-theme .stage-label {
    color: #475569;
}

body.light-theme .stage-count {
    color: #1e293b;
}

body.light-theme .stage-bar-bg {
    background: #e2e8f0;
}

body.light-theme .view-header h1 {
    background: linear-gradient(135deg, #1e293b, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-theme .search-box {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light-theme .search-box:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

body.light-theme .search-box input {
    color: #1e293b;
}

body.light-theme .search-box svg {
    color: #94a3b8;
}

body.light-theme .search-box kbd {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #64748b;
}

body.light-theme .current-date {
    color: #475569;
}

body.light-theme .filter-select {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1e293b;
}

body.light-theme .filter-select option {
    background: #ffffff;
}

body.light-theme .table-container,
body.light-theme .panel {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light-theme table th {
    color: #64748b;
    border-color: #e2e8f0;
    background: #f8fafc;
}

body.light-theme table td {
    color: #475569;
    border-color: #f1f5f9;
}

body.light-theme table tr:hover td {
    background: #f8fafc;
}

body.light-theme .btn-secondary {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #475569;
}

body.light-theme .btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

body.light-theme .detail-card,
body.light-theme .info-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light-theme .detail-label {
    color: #94a3b8;
}

body.light-theme .detail-value {
    color: #1e293b;
}

body.light-theme .empty-state {
    color: #94a3b8;
}

/* ==================== TRADE TRACKER STYLES ==================== */

/* ================================================
   TRADE TRACKER — Design System & Styles
   Dark Glassmorphism Theme
   ================================================ */

/* ---------- Design Tokens ---------- */
:root {
    /* Base Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2236;
    --bg-elevated: rgba(30, 41, 70, 0.6);

    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glass-blur: blur(20px);

    /* Text Colors */
    --text-primary: #f0f2f8;
    --text-secondary: #8b95b0;
    --text-muted: #5a6480;
    --text-accent: #a5b4fc;

    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-primary-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.25);
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);

    /* Stat Card Gradients */
    --gradient-total: linear-gradient(135deg, #3b82f6, #6366f1);
    --gradient-active: linear-gradient(135deg, #f59e0b, #ef4444);
    --gradient-pending: linear-gradient(135deg, #06b6d4, #3b82f6);
    --gradient-done: linear-gradient(135deg, #10b981, #06b6d4);

    /* Stage Colors */
    --stage-inquiry: #f59e0b;
    --stage-requirement: #8b5cf6;
    --stage-quotation: #3b82f6;
    --stage-feedback: #10b981;
    --stage-closed: #6b7280;

    /* Priority Colors */
    --priority-high: #ef4444;
    --priority-medium: #f59e0b;
    --priority-low: #10b981;

    /* Semantic */
    --danger: #ef4444;
    --danger-hover: #f87171;
    --success: #10b981;
    --warning: #f59e0b;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 999px;

    /* Layout */
    --topbar-height: 60px;
    --sidebar-width: 240px;
    --sidebar-collapsed: 64px;

    /* Transition */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Font */
    --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background ambient glow */
body::before {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -200px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

input,
select,
textarea,
button {
    font-family: inherit;
    font-size: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============ TOP BAR ============ */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    z-index: 50;
    flex-shrink: 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
}

.sidebar-toggle:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

#module-trade .logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: auto;
    height: auto;
    background: none;
    box-shadow: none;
    font-size: inherit;
    border-radius: 0;
    justify-content: flex-start;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 20px var(--accent-glow);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.logo-accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 480px;
    margin: 0 var(--space-xl);
}

.search-box {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    padding: var(--space-sm) var(--space-md);
    transition: all var(--transition-base);
}

.search-box:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box kbd {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.current-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ============ SIDEBAR ============ */
.app-container {
    display: flex;
    height: 100%;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-slow);
    overflow: hidden;
    z-index: 50;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
    min-width: var(--sidebar-collapsed);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: var(--space-md) var(--space-sm);
    gap: var(--space-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-base);
    white-space: nowrap;
    position: relative;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.nav-item.active {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.12);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nav-item svg {
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid var(--glass-border);
}

.sidebar-stats {
    display: flex;
    gap: var(--space-md);
}

.stat-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-mini-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-mini-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-xl);
    position: relative;
    z-index: 1;
}

.view {
    display: none;
    animation: fadeIn 0.35s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.view-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), var(--text-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.view-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-ghost {
    background: none;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.btn-archive-toggle.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
}

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

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-upload {
    cursor: pointer;
}

/* ---------- Filter ---------- */
.filter-group {
    display: flex;
    gap: var(--space-sm);
}

.filter-select {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    outline: none;
    transition: all var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}

.filter-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-select option {
    background: var(--bg-secondary);
}

/* ============ STAT CARDS ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.stat-card:active {
    transform: translateY(0);
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.08;
    border-radius: inherit;
}

.stat-total::before {
    background: var(--gradient-total);
}

.stat-active::before {
    background: var(--gradient-active);
}

.stat-pending::before {
    background: var(--gradient-pending);
}

.stat-done::before {
    background: var(--gradient-done);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-total .stat-card-icon {
    background: var(--gradient-total);
    color: white;
}

.stat-active .stat-card-icon {
    background: var(--gradient-active);
    color: white;
}

.stat-pending .stat-card-icon {
    background: var(--gradient-pending);
    color: white;
}

.stat-done .stat-card-icon {
    background: var(--gradient-done);
    color: white;
}

.stat-card-info {
    display: flex;
    flex-direction: column;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-card-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

/* ============ DASHBOARD GRID ============ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

/* ---------- Card ---------- */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-body {
    padding: var(--space-lg);
}

/* ---------- Stage Bars ---------- */
.stage-bars {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.stage-bar-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.stage-bar-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    width: 70px;
    flex-shrink: 0;
    text-align: right;
}

.stage-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.stage-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    min-width: 0;
}

.stage-bar-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    width: 28px;
    text-align: center;
}

/* ---------- Recent List ---------- */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 320px;
    overflow-y: auto;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.recent-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.recent-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.recent-item-info {
    flex: 1;
    min-width: 0;
}

.recent-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.recent-item-stage {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ============ PROJECT CARDS ============ */
.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-md);
}

.project-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.3s ease backwards;
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), 0 0 20px var(--accent-glow);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.project-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
    margin-right: var(--space-sm);
}

.priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.priority-dot.high {
    background: var(--priority-high);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.priority-dot.medium {
    background: var(--priority-medium);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.priority-dot.low {
    background: var(--priority-low);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.project-card-customer {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* Mini Pipeline */
.pipeline-mini {
    display: flex;
    gap: 3px;
    margin-bottom: var(--space-md);
}

.pipeline-mini-step {
    flex: 1;
    height: 4px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    transition: background var(--transition-base);
}

.pipeline-mini-step.completed {
    background: var(--accent-primary);
}

.pipeline-mini-step.current {
    background: var(--accent-primary);
    box-shadow: 0 0 6px var(--accent-glow);
}

.project-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-card-stage {
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.project-card-amount {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-accent);
}

.project-card-tags {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(165, 180, 252, 0.1);
    color: var(--text-accent);
    border: 1px solid rgba(165, 180, 252, 0.15);
}

/* Stage badge colors */
.stage-badge-inquiry {
    background: rgba(245, 158, 11, 0.15);
    color: var(--stage-inquiry);
}

.stage-badge-requirement {
    background: rgba(139, 92, 246, 0.15);
    color: var(--stage-requirement);
}

.stage-badge-quotation {
    background: rgba(59, 130, 246, 0.15);
    color: var(--stage-quotation);
}

.stage-badge-feedback {
    background: rgba(16, 185, 129, 0.15);
    color: var(--stage-feedback);
}

.stage-badge-closed {
    background: rgba(107, 114, 128, 0.15);
    color: #9ca3af;
}

.pipeline-mini-closed {
    font-size: 0.65rem;
    line-height: 4px;
    margin-left: 2px;
    opacity: 0.6;
}

/* ============ CUSTOMER CARDS ============ */
.customers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-md);
}

.customer-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-base);
    animation: slideUp 0.3s ease backwards;
}

.customer-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.customer-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.customer-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.customer-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.customer-card-contact {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.customer-card-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.customer-detail-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.customer-detail-row svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.customer-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-md);
    border-top: 1px solid var(--glass-border);
}

.customer-project-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.customer-card-actions {
    display: flex;
    gap: var(--space-sm);
}

/* ============ DATA VIEW ============ */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.data-card .card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.data-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.data-actions {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.data-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.data-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--glass-border);
}

.data-stat-row:last-child {
    border-bottom: none;
}

.data-stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.data-stat-value {
    font-weight: 700;
    color: var(--text-primary);
}

/* ============ MODALS ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    padding: var(--space-lg);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-base);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--glass-bg);
}

.modal-body {
    padding: var(--space-lg);
}

/* ---------- Forms ---------- */
.form-row {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-group-wide {
    flex: 1 1 100%;
}

.tag-select {
    position: relative;
}

.tag-select-display {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    min-height: 38px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.tag-select-display:hover {
    border-color: var(--primary);
}

.tag-select-placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.tag-select-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--primary);
    color: #fff;
    font-size: 0.78rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    white-space: nowrap;
}

.tag-select-chip-remove {
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.tag-select-chip-remove:hover {
    opacity: 1;
}

.tag-select-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-top: 4px;
    max-height: 160px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.tag-select-dropdown.open {
    display: block;
}

.tag-select-dropdown label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary) !important;
    font-weight: 400 !important;
    transition: background 0.15s;
}

.tag-select-dropdown label:hover {
    background: rgba(255, 255, 255, 0.06);
}

.tag-select-dropdown input[type="checkbox"] {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.tag-select-dropdown-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.75rem;
    text-align: center;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group select {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.form-group select option {
    background: var(--bg-secondary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--glass-border);
}

/* ============ PROJECT DETAIL ============ */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
}

.detail-section {
    margin-bottom: var(--space-lg);
}

.detail-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.detail-section-header h3 {
    margin-bottom: 0;
}

.detail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.detail-info-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-info-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Pipeline */
.pipeline {
    display: flex;
    gap: 2px;
    align-items: center;
}

.pipeline-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-xs);
}

.pipeline-step-bar {
    width: 100%;
    height: 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    transition: all var(--transition-base);
}

.pipeline-step.completed .pipeline-step-bar {
    background: var(--accent-primary);
}

.pipeline-step.current .pipeline-step-bar {
    background: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
}

.pipeline-step-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
}

.pipeline-step.completed .pipeline-step-label,
.pipeline-step.current .pipeline-step-label {
    color: var(--text-accent);
}

/* Follow-up */
.followup-form {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    animation: fadeIn 0.2s ease;
}

.followup-form .form-group {
    margin-bottom: var(--space-sm);
}

.followup-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

.followup-timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 360px;
    overflow-y: auto;
}

.followup-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--glass-border);
    transition: all var(--transition-fast);
    animation: slideUp 0.2s ease;
}

.followup-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.followup-item.type-email {
    border-left-color: var(--stage-quotation);
}

.followup-item.type-phone {
    border-left-color: var(--stage-inquiry);
}

.followup-item.type-meeting {
    border-left-color: var(--stage-sample);
}

.followup-item.type-other {
    border-left-color: var(--text-muted);
}

.followup-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.followup-content {
    flex: 1;
    min-width: 0;
}

.followup-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
}

.followup-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.followup-next {
    color: var(--warning);
    font-weight: 500;
}

.detail-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--glass-border);
}

/* ============ EMPTY STATE ============ */
.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
}

.empty-state-icon {
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.empty-state-mini {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============ TOAST ============ */
.toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    display: flex;
    flex-direction: column-reverse;
    gap: var(--space-sm);
    z-index: 300;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    color: var(--text-primary);
    font-size: 0.9rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    max-width: 360px;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.info {
    border-left: 3px solid var(--accent-primary);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: var(--topbar-height);
        left: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 90;
        background: var(--bg-secondary);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        padding: var(--space-md);
    }

    .topbar-center {
        display: none;
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .projects-list,
    .customers-list {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
    }

    .modal {
        max-width: 100%;
        border-radius: var(--radius-lg);
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        flex: 1;
    }

    .data-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .pipeline-step-label {
        font-size: 0.55rem;
    }
}

/* ==================== WORKSTATION MODULE SHELL ==================== */

/* Module Sidebar */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100%;
}

.module-sidebar {
    width: 64px;
    min-width: 64px;
    height: 100vh;
    position: sticky;
    top: 0;
    background: rgba(10, 10, 20, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px 0;
    z-index: 100;
    overflow-y: auto;
}

.module-sidebar-top,
.module-sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.module-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.module-nav-item {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: rgba(255, 255, 255, 0.45);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 12px;
}

.module-nav-item:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.06);
}

.module-nav-item.active {
    color: #fff;
    background: rgba(99, 102, 241, 0.2);
}

.module-nav-label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Module Content */
.module-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.module-panel {
    display: none;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    position: absolute;
    top: 0;
    left: 0;
}

.module-panel.active {
    display: flex;
    flex-direction: column;
}

/* TeamBoard module full width */
#module-teamboard .app-content {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

/* Trade module layout */
.trade-app-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.trade-sidebar {
    width: 220px;
    min-width: 220px;
    background: rgba(15, 15, 30, 0.6);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
}

.trade-sidebar .sidebar-nav {
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trade-sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
}

.trade-sidebar .nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
}

.trade-sidebar .nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
    font-weight: 600;
}

.trade-sidebar .nav-badge {
    margin-left: auto;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.trade-sidebar .sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.stat-mini {
    text-align: center;
}

.stat-mini-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.stat-mini-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}

.trade-main-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Trade View Styles */
.trade-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.trade-view-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.trade-view-actions {
    display: flex;
    gap: 8px;
}

.trade-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.trade-stat-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px 20px;
}

.trade-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.trade-stat-value {
    font-size: 24px;
    font-weight: 800;
}

.trade-section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.trade-pipeline-overview {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.pipeline-overview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    min-width: 72px;
}

.pipeline-overview-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.pipeline-overview-label {
    font-size: 11px;
    color: var(--text-muted);
}

.pipeline-overview-count {
    font-size: 18px;
    font-weight: 700;
}

/* Stage Bar Distribution */
.trade-stage-bars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-bottom: 24px;
}

.stage-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    transition: all 0.25s ease;
    cursor: default;
}

.stage-bar-item:hover {
    background: rgba(35, 35, 60, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stage-bar-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stage-bar-track {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    min-width: 40px;
}

.stage-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
    box-shadow: 0 0 8px currentColor;
    opacity: 0.9;
}

.stage-bar-count {
    font-size: 16px;
    font-weight: 800;
    min-width: 28px;
    text-align: right;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.trade-recent-pending {
    font-size: 11px;
    color: #f59e0b;
    font-weight: 600;
    white-space: nowrap;
}

.trade-recent-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trade-recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.15s;
}

.trade-recent-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.trade-recent-stage {
    font-size: 16px;
}

.trade-recent-name {
    flex: 1;
    font-weight: 500;
    font-size: 13px;
}

.trade-recent-customer {
    font-size: 12px;
    color: var(--text-muted);
}

.trade-recent-time {
    font-size: 11px;
    color: var(--text-muted);
}

.trade-project-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 12px;
}

.trade-project-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.15s;
}

.trade-project-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

.trade-project-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.trade-project-stage {
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.trade-project-amount {
    margin-left: auto;
    font-weight: 700;
    font-size: 14px;
    color: #10b981;
}

.trade-project-card-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.trade-project-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.trade-project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.trade-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.trade-detail-content {
    padding: 0 4px;
}

.trade-detail-pipeline {
    display: flex;
    gap: 2px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding: 8px 0;
}

.trade-detail-actions {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.trade-followups-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.trade-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.trade-data-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px;
}

.trade-data-card h3 {
    margin-bottom: 8px;
    font-size: 16px;
}

.trade-data-card p {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.empty-state-mini {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Pipeline steps in detail */
.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 60px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.pipeline-step.completed,
.pipeline-step.current {
    opacity: 1;
}

.pipeline-step-bar {
    height: 4px;
    width: 100%;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.pipeline-step.completed .pipeline-step-bar {
    background: var(--step-color, #6366f1);
}

.pipeline-step.current .pipeline-step-bar {
    background: var(--step-color, #6366f1);
    box-shadow: 0 0 8px var(--step-color, #6366f1);
}

.pipeline-step-label {
    font-size: 11px;
    text-align: center;
    line-height: 1.3;
}

.pipeline-closed {
    text-align: center;
    padding: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Followup items */
.followup-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.followup-icon {
    font-size: 16px;
    margin-top: 2px;
}

.followup-content {
    flex: 1;
}

.followup-text {
    font-size: 13px;
    margin-bottom: 4px;
}

.followup-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.followup-next {
    color: #f59e0b;
}

/* Tag styles */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

/* Trade topbar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(10, 10, 20, 0.5);
    backdrop-filter: blur(12px);
    min-height: 48px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    font-size: 15px;
    font-weight: 700;
}

.logo-accent {
    color: #818cf8;
}

.current-date {
    font-size: 12px;
    color: var(--text-muted);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 13px;
    width: 100%;
}

.search-box kbd {
    font-size: 10px;
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    color: var(--text-muted);
}

/* Login page - ensure it overlays module sidebar */
.login-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

/* Customer card styles (shared between trade views) */
.customer-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.15s;
}

.customer-card:hover {
    border-color: rgba(99, 102, 241, 0.2);
}

.customer-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.customer-card-name {
    font-weight: 600;
    font-size: 14px;
}

.customer-card-contact {
    font-size: 12px;
    color: var(--text-muted);
}

.customer-card-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.customer-detail-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.customer-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.customer-project-count {
    font-size: 11px;
    color: var(--text-muted);
}

.customer-card-actions {
    display: flex;
    gap: 6px;
}

/* ==================== FINANALYTICS MODULE STYLES ==================== */

#module-finance .logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: auto;
    height: auto;
    background: none;
    box-shadow: none;
    font-size: inherit;
    border-radius: 0;
    justify-content: flex-start;
}

/* -- View Header -- */
.fin-view-header {
    margin-bottom: var(--space-xl);
}
.fin-view-title {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), var(--text-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}
.fin-view-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* -- Cards -- */
.fin-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    overflow: hidden;
    transition: all var(--transition-base);
}
.fin-card:hover {
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.fin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}
.fin-card-icon {
    margin-right: 6px;
}
.fin-card-body {
    padding: 16px 18px;
}

/* -- Dashboard Grid -- */
.fin-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.fin-card-wide {
    grid-column: 1 / -1;
}

/* -- Index Cards -- */
.fin-indices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.fin-index-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition-base);
}
.fin-index-card:hover {
    background: rgba(255,255,255,0.06);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.fin-index-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}
.fin-index-price {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.fin-index-change {
    font-size: 0.85rem;
    font-weight: 600;
}

/* -- Color Classes -- */
.fin-up { color: #ef5350 !important; }
.fin-down { color: #26a69a !important; }
.fin-flat { color: var(--text-muted) !important; }

/* -- Loading, Error, Empty -- */
.fin-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 24px;
    font-size: 0.9rem;
}
.fin-loading::before {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    border: 2px solid var(--glass-border);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: finSpin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes finSpin {
    to { transform: rotate(360deg); }
}
.fin-error {
    text-align: center;
    color: var(--danger);
    padding: 16px;
    font-size: 0.9rem;
}
.fin-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 16px;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* -- Buttons -- */
.fin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.fin-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
}
.fin-btn-primary {
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: 0 2px 8px var(--accent-glow);
}
.fin-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}
.fin-btn-sm {
    padding: 4px 10px;
    font-size: 0.8rem;
}
.fin-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.85rem;
}
.fin-btn-danger-icon:hover {
    background: rgba(239,68,68,0.15);
}

/* -- Search Group -- */
.fin-search-group {
    display: flex;
    gap: 8px;
    position: relative;
}
.fin-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-base);
}
.fin-search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.fin-search-input::placeholder {
    color: var(--text-muted);
}

/* -- Search Dropdown -- */
.fin-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.fin-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
}
.fin-search-item:hover {
    background: rgba(255,255,255,0.06);
}
.fin-si-symbol {
    font-weight: 700;
    color: var(--accent-primary);
    min-width: 70px;
}
.fin-si-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fin-si-region {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--glass-bg);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}
.fin-empty-item {
    color: var(--text-muted);
    cursor: default;
    justify-content: center;
}

/* -- Watchlist -- */
.fin-watchlist-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.fin-watchlist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}
.fin-watchlist-row:hover {
    background: rgba(255,255,255,0.04);
}
.fin-wl-info {
    flex: 1;
    min-width: 0;
}
.fin-wl-symbol {
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 8px;
}
.fin-wl-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.fin-wl-price {
    text-align: right;
}
.fin-wl-val {
    font-weight: 600;
    font-size: 0.9rem;
    display: block;
}
.fin-wl-change {
    font-size: 0.8rem;
    font-weight: 500;
}

/* -- Quick Quote -- */
.fin-quick-quote {
    margin-top: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
    padding: 16px;
}
.fin-qq-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}
.fin-qq-symbol {
    font-weight: 800;
    font-size: 1.1rem;
}
.fin-qq-day {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.fin-qq-price {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
}
.fin-qq-change {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
}
.fin-qq-details {
    display: flex;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.fin-qq-actions {
    display: flex;
    gap: 8px;
}

/* -- Stock Detail -- */
.fin-stock-search-bar {
    margin-bottom: 20px;
}
.fin-stock-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.fin-sh-symbol {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
}
.fin-sh-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-left: 8px;
}
.fin-sh-exchange {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--glass-bg);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-left: 8px;
}
.fin-sh-right {
    text-align: right;
}
.fin-sh-price {
    font-size: 2rem;
    font-weight: 800;
}
.fin-sh-change {
    font-size: 1rem;
    font-weight: 600;
}
.fin-stock-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

/* -- Stock Grid -- */
.fin-stock-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 16px;
}
.fin-card-chart {
    min-height: 460px;
}
.fin-chart-container {
    padding: 12px;
    min-height: 400px;
}

/* -- Indicator Buttons -- */
.fin-indicator-btns {
    display: flex;
    gap: 4px;
}
.fin-ind-btn {
    padding: 3px 10px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.fin-ind-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
}
.fin-ind-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* -- Metrics Grid -- */
.fin-metrics-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.fin-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.fin-metric-row:last-child {
    border-bottom: none;
}
.fin-metric-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.fin-metric-value {
    font-weight: 600;
    font-size: 0.9rem;
}
.fin-company-desc {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* -- Portfolio -- */
.fin-portfolio-actions {
    margin-bottom: 16px;
}
.fin-portfolio-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.fin-ps-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}
.fin-ps-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}
.fin-ps-value {
    font-size: 1.4rem;
    font-weight: 800;
}
.fin-ps-card.fin-up .fin-ps-value { color: #ef5350; }
.fin-ps-card.fin-down .fin-ps-value { color: #26a69a; }

/* -- Allocation Bars -- */
.fin-alloc-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.fin-alloc-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fin-alloc-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 500;
}
.fin-alloc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.fin-alloc-pct {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.78rem;
}
.fin-alloc-bar {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}
.fin-alloc-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* -- Table -- */
.fin-table-wrap {
    overflow-x: auto;
}
.fin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.fin-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
    font-size: 0.8rem;
}
.fin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    white-space: nowrap;
}
.fin-table tr:hover td {
    background: rgba(255,255,255,0.02);
}
.fin-cell-symbol {
    font-weight: 700;
    color: var(--accent-primary);
}

/* -- Forex -- */
.fin-forex-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.fin-forex-pair {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.fin-fx-arrow {
    font-size: 1.2rem;
    color: var(--text-muted);
}
.fin-select {
    padding: 8px 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}
.fin-select:focus {
    border-color: var(--accent-primary);
}
.fin-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.fin-fx-rate-display {
    margin-top: 16px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-md);
    padding: 16px;
}
.fin-fx-big-rate {
    font-size: 1.2rem;
    margin-bottom: 8px;
}
.fin-fx-big-rate strong {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-primary);
}
.fin-fx-rate-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

/* -- Converter -- */
.fin-converter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}
.fin-conv-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.fin-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}
.fin-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.fin-conv-curr {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 40px;
}
.fin-conv-eq {
    font-size: 1.4rem;
    color: var(--text-muted);
}
.fin-conv-result {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-primary);
}

/* -- Statements -- */
.fin-stmt-search {
    margin-bottom: 20px;
}
.fin-stmt-header {
    margin-bottom: 16px;
}
.fin-stmt-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}
.fin-stmt-ratios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.fin-ratio-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
}
.fin-ratio-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}
.fin-ratio-value {
    font-size: 1.15rem;
    font-weight: 700;
}

/* -- Statement Tabs -- */
.fin-stmt-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0;
}
.fin-tab {
    padding: 10px 18px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
    margin-bottom: -1px;
}
.fin-tab:hover {
    color: var(--text-primary);
}
.fin-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}
.fin-stmt-panel {
    display: none;
}
.fin-stmt-panel.active {
    display: block;
    animation: fadeIn 0.25s ease;
}
.fin-stmt-table th {
    text-align: right;
    font-size: 0.82rem;
}
.fin-stmt-table th:first-child,
.fin-stmt-table td:first-child {
    text-align: left;
}
.fin-stmt-table td {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.fin-cell-label {
    font-weight: 600;
    color: var(--text-primary);
}

/* ========== FinAnalytics Light Theme ========== */
body.light-theme .fin-card {
    background: rgba(255,255,255,0.85);
    border-color: #e2e8f0;
}
body.light-theme .fin-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}
body.light-theme .fin-card-header {
    border-bottom-color: #e2e8f0;
    color: #1e293b;
}
body.light-theme .fin-index-card {
    background: #f8fafc;
    border-color: #e2e8f0;
}
body.light-theme .fin-index-card:hover {
    background: #f1f5f9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
body.light-theme .fin-index-name { color: #64748b; }
body.light-theme .fin-search-input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
}
body.light-theme .fin-search-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
body.light-theme .fin-search-dropdown {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
body.light-theme .fin-search-item:hover {
    background: #f1f5f9;
}
body.light-theme .fin-btn {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
}
body.light-theme .fin-btn:hover {
    background: #f1f5f9;
}
body.light-theme .fin-select {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
}
body.light-theme .fin-select option {
    background: #ffffff;
}
body.light-theme .fin-input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
}
body.light-theme .fin-watchlist-row:hover { background: #f8fafc; }
body.light-theme .fin-quick-quote,
body.light-theme .fin-fx-rate-display {
    background: #f1f5f9;
}
body.light-theme .fin-ps-card {
    background: rgba(255,255,255,0.9);
    border-color: #e2e8f0;
}
body.light-theme .fin-alloc-bar { background: #e2e8f0; }
body.light-theme .fin-table th {
    color: #64748b;
    border-bottom-color: #e2e8f0;
}
body.light-theme .fin-table td { border-bottom-color: #f1f5f9; }
body.light-theme .fin-table tr:hover td { background: #f8fafc; }
body.light-theme .fin-ratio-card {
    background: rgba(255,255,255,0.9);
    border-color: #e2e8f0;
}
body.light-theme .fin-metric-row { border-bottom-color: #f1f5f9; }
body.light-theme .fin-ind-btn {
    border-color: #e2e8f0;
    color: #64748b;
}
body.light-theme .fin-ind-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}
body.light-theme .fin-stmt-tabs {
    border-bottom-color: #e2e8f0;
}
body.light-theme .fin-tab {
    color: #64748b;
}
body.light-theme .fin-tab:hover { color: #1e293b; }

/* Responsive */
@media (max-width: 768px) {
    .module-sidebar {
        width: 48px;
        min-width: 48px;
    }

    .module-nav-label {
        display: none;
    }

    .trade-sidebar {
        display: none;
    }

    .trade-app-container {
        flex-direction: column;
    }

    .trade-card-grid {
        grid-template-columns: 1fr;
    }

    .topbar-center {
        display: none;
    }

    .fin-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .fin-stock-grid {
        grid-template-columns: 1fr;
    }

    .fin-forex-grid {
        grid-template-columns: 1fr;
    }

    .fin-portfolio-summary {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   READING MODULE — BookCards Styles
   Scoped under #module-reading
   ============================================ */

/* --- Reading Module Layout --- */
#module-reading .rd-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    background: var(--bg-main);
}

/* --- Reading Header --- */
#module-reading .rd-header {
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(10,10,20,0.5);
    backdrop-filter: blur(12px);
}

#module-reading .rd-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#module-reading .rd-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

#module-reading .rd-logo-icon {
    font-size: 28px;
    animation: rd-float 3s ease-in-out infinite;
}

#module-reading .rd-logo-text {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#module-reading .rd-logo-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    padding-left: 10px;
    border-left: 2px solid rgba(255,255,255,0.1);
}

#module-reading .rd-settings-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50px;
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

#module-reading .rd-settings-btn:hover {
    border-color: #818cf8;
    color: #a5b4fc;
    background: rgba(99,102,241,0.1);
}

/* --- Reading Main --- */
#module-reading .rd-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 60px;
    width: 100%;
}

/* --- Reading Sections --- */
#module-reading .rd-section {
    margin-bottom: 32px;
}

#module-reading .rd-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#module-reading .rd-step-badge {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

#module-reading .rd-section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

#module-reading .rd-section-desc {
    width: 100%;
    padding-left: 44px;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: -4px;
}

/* --- Reading Input Area --- */
#module-reading .rd-input-area {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: stretch;
}

#module-reading .rd-upload-zone {
    border: 2px dashed rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.02);
    text-align: center;
}

#module-reading .rd-upload-zone:hover,
#module-reading .rd-upload-zone.rd-drag-over {
    border-color: #818cf8;
    background: rgba(99,102,241,0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99,102,241,0.15);
}

#module-reading .rd-upload-zone.rd-drag-over {
    border-style: solid;
}

#module-reading .rd-upload-icon {
    font-size: 48px;
    animation: rd-bounce 2s ease-in-out infinite;
}

#module-reading .rd-upload-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#module-reading .rd-upload-text strong {
    font-size: 15px;
    color: var(--text-primary);
}

#module-reading .rd-upload-text span {
    font-size: 12px;
    color: var(--text-muted);
}

#module-reading .rd-upload-formats {
    font-size: 11px;
    color: var(--text-muted);
    padding: 4px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 50px;
}

#module-reading .rd-input-divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

#module-reading .rd-input-divider span {
    padding: 8px 14px;
    background: rgba(255,255,255,0.04);
    border-radius: 50px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

#module-reading .rd-text-input-wrapper {
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.02);
    border-radius: 16px;
    border: 2px solid rgba(255,255,255,0.08);
    overflow: hidden;
    transition: border-color 0.15s ease;
}

#module-reading .rd-text-input-wrapper:focus-within {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

#module-reading #rd-textInput {
    border: none;
    outline: none;
    padding: 16px 20px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.8;
    resize: vertical;
    min-height: 180px;
    color: var(--text-primary);
    background: transparent;
}

#module-reading #rd-textInput::placeholder {
    color: var(--text-muted);
}

#module-reading .rd-text-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(255,255,255,0.02);
    border-top: 1px solid rgba(255,255,255,0.06);
}

#module-reading .rd-char-count {
    font-size: 11px;
    color: var(--text-muted);
}

/* --- File Info --- */
#module-reading .rd-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 12px;
    margin-top: 12px;
    animation: rd-slideDown 0.3s ease;
}

#module-reading .rd-file-icon { font-size: 20px; }
#module-reading .rd-file-name { font-weight: 600; font-size: 13px; color: #34d399; }
#module-reading .rd-file-size { font-size: 11px; color: var(--text-muted); }
/* --- Platform Selector --- */
#module-reading .rd-platform-section {
    margin-bottom: 16px;
}

#module-reading .rd-platform-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-width: 720px;
}

#module-reading .rd-platform-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 12px;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    background: rgba(255,255,255,0.02);
    text-align: center;
}

#module-reading .rd-platform-card:hover {
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    transform: translateY(-2px);
}

#module-reading .rd-platform-card.active {
    border-color: #818cf8;
    background: rgba(99,102,241,0.12);
    box-shadow: 0 4px 16px rgba(99,102,241,0.2);
}

#module-reading .rd-platform-icon {
    font-size: 32px;
    line-height: 1;
}

#module-reading .rd-platform-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

#module-reading .rd-platform-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

#module-reading .rd-platform-card.active .rd-platform-name {
    color: #a5b4fc;
}

/* ============================================
   Platform-Specific Card Layouts
   Applied via class on .rd-cards-container
   ============================================ */

/* --- 小红书 (Xiaohongshu): phone-slide carousel format --- */
#module-reading .rd-cards-container.rd-plat-xiaohongshu {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 420px;
    margin: 0 auto;
}

#module-reading .rd-plat-xiaohongshu .rd-book-card {
    width: 375px;
    min-height: 500px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}

/* Slide page number indicator */
#module-reading .rd-plat-xiaohongshu .rd-book-card::after {
    content: attr(data-slide-num);
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    letter-spacing: 1px;
    pointer-events: none;
}

/* --- Overview: split cover slide --- */
#module-reading .rd-plat-xiaohongshu .rd-card-overview {
    min-height: 500px;
    height: 500px;
    justify-content: stretch;
}

#module-reading .rd-plat-xiaohongshu .rd-card-overview .rd-cover-hero {
    height: 280px;
}

#module-reading .rd-plat-xiaohongshu .rd-card-overview .rd-cover-text-area {
    padding: 20px 24px;
}

#module-reading .rd-plat-xiaohongshu .rd-card-overview .rd-book-title { font-size: 20px; margin-bottom: 6px; }
#module-reading .rd-plat-xiaohongshu .rd-card-overview .rd-book-author { font-size: 12px; margin-bottom: 10px; }
#module-reading .rd-plat-xiaohongshu .rd-card-overview .rd-book-summary { font-size: 12px; line-height: 1.7; }
#module-reading .rd-plat-xiaohongshu .rd-card-overview .rd-card-overview-tags { margin-top: 4px; }
#module-reading .rd-plat-xiaohongshu .rd-card-overview .rd-tag { font-size: 10px; padding: 4px 10px; }

/* --- Quote: full-page centered --- */
#module-reading .rd-plat-xiaohongshu .rd-card-quote {
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

#module-reading .rd-plat-xiaohongshu .rd-card-quote .rd-quote-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 32px 40px;
}

#module-reading .rd-plat-xiaohongshu .rd-card-quote .rd-quote-mark {
    position: static;
    font-size: 56px;
    opacity: 0.2;
    margin-bottom: 16px;
}

#module-reading .rd-plat-xiaohongshu .rd-card-quote .rd-quote-text {
    font-size: 18px;
    line-height: 2;
    font-weight: 600;
    text-align: center;
    max-width: 300px;
}

#module-reading .rd-plat-xiaohongshu .rd-card-quote .rd-quote-footer {
    padding: 16px 28px 28px;
    justify-content: center;
}

#module-reading .rd-plat-xiaohongshu .rd-card-quote .rd-quote-source { font-size: 13px; }

/* --- Insight: compact slide --- */
#module-reading .rd-plat-xiaohongshu .rd-card-insight {
    padding: 28px 24px 36px;
    min-height: 500px;
    justify-content: center;
}

#module-reading .rd-plat-xiaohongshu .rd-card-insight .rd-card-accent-bar { margin-bottom: 14px; }
#module-reading .rd-plat-xiaohongshu .rd-card-insight .rd-card-title-row { margin-bottom: 10px; }
#module-reading .rd-plat-xiaohongshu .rd-card-title { font-size: 16px !important; }
#module-reading .rd-plat-xiaohongshu .rd-card-emoji { font-size: 24px !important; }
#module-reading .rd-plat-xiaohongshu .rd-card-subtitle { font-size: 13px; padding-left: 34px; line-height: 1.7; margin-bottom: 12px; }
#module-reading .rd-plat-xiaohongshu .rd-insight-point { padding: 10px 12px; font-size: 13px; line-height: 1.6; }
#module-reading .rd-plat-xiaohongshu .rd-point-icon { font-size: 15px; }

/* --- List: compact slide --- */
#module-reading .rd-plat-xiaohongshu .rd-card-list {
    padding: 28px 24px 36px;
    min-height: 500px;
    justify-content: center;
}
#module-reading .rd-plat-xiaohongshu .rd-list-item { padding: 10px 12px; }
#module-reading .rd-plat-xiaohongshu .rd-item-title { font-size: 14px; }
#module-reading .rd-plat-xiaohongshu .rd-item-desc { font-size: 12px; line-height: 1.6; }
#module-reading .rd-plat-xiaohongshu .rd-item-number { width: 28px; height: 28px; font-size: 12px; }

/* --- Action: compact slide --- */
#module-reading .rd-plat-xiaohongshu .rd-card-action {
    padding: 28px 24px 36px;
    min-height: 500px;
    justify-content: center;
}
#module-reading .rd-plat-xiaohongshu .rd-action-item { padding: 10px 12px; font-size: 13px; }

/* --- Comparison: compact slide --- */
#module-reading .rd-plat-xiaohongshu .rd-card-comparison {
    padding: 28px 24px 36px;
    min-height: 500px;
    justify-content: center;
}
#module-reading .rd-plat-xiaohongshu .rd-comparison-grid { grid-template-columns: 1fr; gap: 12px; }
#module-reading .rd-plat-xiaohongshu .rd-comparison-side { padding: 16px; }

/* --- Article: compact slide --- */
#module-reading .rd-plat-xiaohongshu .rd-card-article {
    padding: 28px 24px 36px;
    min-height: 500px;
}
#module-reading .rd-plat-xiaohongshu .rd-article-body { font-size: 13px; line-height: 1.8; padding: 16px 18px; }
#module-reading .rd-plat-xiaohongshu .rd-article-subtitle { font-size: 13px; padding-left: 34px; }
#module-reading .rd-plat-xiaohongshu .rd-article-takeaway { padding: 14px 16px; }

/* --- Export button repositioned --- */
#module-reading .rd-plat-xiaohongshu .rd-book-card .rd-card-export-btn {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    font-size: 14px;
}

/* --- 公众号 (WeChat): narrow single-column, elegant --- */
#module-reading .rd-cards-container.rd-plat-gongzhonghao {
    max-width: 420px;
    margin: 0 auto;
    gap: 24px;
}

#module-reading .rd-plat-gongzhonghao .rd-book-card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

#module-reading .rd-plat-gongzhonghao .rd-card-overview .rd-card-overview-header {
    padding: 32px 24px 24px;
}
#module-reading .rd-plat-gongzhonghao .rd-card-overview .rd-book-title { font-size: 20px; }
#module-reading .rd-plat-gongzhonghao .rd-card-overview .rd-book-summary { font-size: 13px; line-height: 2; }
#module-reading .rd-plat-gongzhonghao .rd-card-overview .rd-card-overview-tags { padding: 16px 24px 20px; }

#module-reading .rd-plat-gongzhonghao .rd-card-insight,
#module-reading .rd-plat-gongzhonghao .rd-card-list,
#module-reading .rd-plat-gongzhonghao .rd-card-action,
#module-reading .rd-plat-gongzhonghao .rd-card-article {
    padding: 24px 22px;
}

#module-reading .rd-plat-gongzhonghao .rd-card-title { font-size: 16px !important; }
#module-reading .rd-plat-gongzhonghao .rd-card-subtitle { font-size: 13px; line-height: 1.9; }
#module-reading .rd-plat-gongzhonghao .rd-insight-point { font-size: 13px; line-height: 1.8; padding: 10px 12px; }
#module-reading .rd-plat-gongzhonghao .rd-article-body { font-size: 14px; line-height: 2.1; padding: 18px 20px; }
#module-reading .rd-plat-gongzhonghao .rd-article-subtitle { font-size: 13px; font-style: normal; line-height: 1.9; }
#module-reading .rd-plat-gongzhonghao .rd-quote-body { padding: 36px 24px 28px; }
#module-reading .rd-plat-gongzhonghao .rd-quote-text { font-size: 16px; line-height: 2; }
#module-reading .rd-plat-gongzhonghao .rd-comparison-grid { grid-template-columns: 1fr; }
#module-reading .rd-plat-gongzhonghao .rd-side-item { font-size: 13px; line-height: 1.8; }
#module-reading .rd-plat-gongzhonghao .rd-action-item { font-size: 13px; line-height: 1.9; }
#module-reading .rd-plat-gongzhonghao .rd-list-item { padding: 12px 14px; }
#module-reading .rd-plat-gongzhonghao .rd-item-desc { font-size: 12px; line-height: 1.8; }

/* --- 知乎 (Zhihu): medium-width, structured professional --- */
#module-reading .rd-cards-container.rd-plat-zhihu {
    max-width: 700px;
    margin: 0 auto;
    gap: 20px;
}

#module-reading .rd-plat-zhihu .rd-book-card {
    border-radius: 8px;
    border-color: rgba(255,255,255,0.1);
}

#module-reading .rd-plat-zhihu .rd-card-overview .rd-card-overview-header {
    border-radius: 8px 8px 0 0;
    padding: 28px 28px 24px;
}
#module-reading .rd-plat-zhihu .rd-card-overview .rd-book-title { font-size: 22px; }
#module-reading .rd-plat-zhihu .rd-card-overview .rd-book-summary { font-size: 14px; line-height: 1.9; }

#module-reading .rd-plat-zhihu .rd-card-insight,
#module-reading .rd-plat-zhihu .rd-card-list,
#module-reading .rd-plat-zhihu .rd-card-action,
#module-reading .rd-plat-zhihu .rd-card-article {
    padding: 26px 28px;
}

#module-reading .rd-plat-zhihu .rd-card-title { font-size: 17px !important; font-weight: 800; }
#module-reading .rd-plat-zhihu .rd-card-emoji { font-size: 22px !important; }
#module-reading .rd-plat-zhihu .rd-card-subtitle { font-size: 14px; line-height: 1.8; }
#module-reading .rd-plat-zhihu .rd-insight-point { font-size: 14px; line-height: 1.7; padding: 10px 12px; }
#module-reading .rd-plat-zhihu .rd-article-body { font-size: 15px; line-height: 1.9; padding: 20px 24px; }
#module-reading .rd-plat-zhihu .rd-article-subtitle { font-size: 14px; }
#module-reading .rd-plat-zhihu .rd-quote-text { font-size: 17px; line-height: 1.9; }
#module-reading .rd-plat-zhihu .rd-quote-body { padding: 40px 32px 32px; }
#module-reading .rd-plat-zhihu .rd-action-item { font-size: 14px; line-height: 1.7; }
#module-reading .rd-plat-zhihu .rd-list-item { padding: 14px 16px; }
#module-reading .rd-plat-zhihu .rd-item-title { font-size: 15px; }
#module-reading .rd-plat-zhihu .rd-item-desc { font-size: 13px; line-height: 1.7; }
#module-reading .rd-plat-zhihu .rd-comparison-side { padding: 18px; }
#module-reading .rd-plat-zhihu .rd-side-item { font-size: 13px; }

/* --- Generate Button Area (Dual Mode) --- */
#module-reading .rd-generate-area {
    text-align: center;
    margin: 32px 0;
}

#module-reading .rd-generate-mode-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

#module-reading .rd-generate-mode-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 640px;
    margin: 0 auto;
}

#module-reading .rd-btn-generate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 20px;
    font-family: inherit;
    border: 2px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

#module-reading .rd-btn-generate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.6s ease;
}

#module-reading .rd-btn-generate:not(:disabled):hover::before {
    left: 100%;
}

#module-reading .rd-btn-mode-simple {
    background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(118,75,162,0.15) 100%);
}

#module-reading .rd-btn-mode-simple:not(:disabled):hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(99,102,241,0.35);
}
#module-reading .rd-btn-mode-simple:not(:disabled):hover .rd-btn-mode-label,
#module-reading .rd-btn-mode-simple:not(:disabled):hover .rd-btn-mode-desc {
    color: #fff;
}

#module-reading .rd-btn-mode-detailed {
    background: linear-gradient(135deg, rgba(245,158,11,0.15) 0%, rgba(239,68,68,0.12) 100%);
}

#module-reading .rd-btn-mode-detailed:not(:disabled):hover {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    border-color: transparent;
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(245,158,11,0.35);
}
#module-reading .rd-btn-mode-detailed:not(:disabled):hover .rd-btn-mode-label,
#module-reading .rd-btn-mode-detailed:not(:disabled):hover .rd-btn-mode-desc {
    color: #fff;
}

#module-reading .rd-btn-mode-icon {
    font-size: 36px;
    line-height: 1;
}

#module-reading .rd-btn-mode-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.35s ease;
}

#module-reading .rd-btn-mode-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    transition: color 0.35s ease;
}

#module-reading .rd-btn-generate:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.3);
}

#module-reading .rd-generate-hint {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-muted);
}

/* --- Article Card (Detailed Mode) --- */
#module-reading .rd-card-article {
    padding: 32px;
}

#module-reading .rd-card-article .rd-card-accent-bar {
    width: 60px;
    height: 4px;
    border-radius: 2px;
    margin-bottom: 16px;
}

#module-reading .rd-card-article .rd-card-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

#module-reading .rd-card-article .rd-card-emoji {
    font-size: 28px;
    flex-shrink: 0;
}

#module-reading .rd-card-article .rd-card-title {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--text-primary);
}

#module-reading .rd-card-article .rd-article-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    padding-left: 38px;
    font-style: italic;
}

#module-reading .rd-card-article .rd-article-body {
    font-size: 14px;
    line-height: 2;
    color: var(--text-primary);
    padding: 20px 24px;
    border-radius: 14px;
    white-space: pre-line;
}

#module-reading .rd-card-article .rd-article-takeaway {
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 4px solid;
}

#module-reading .rd-card-article .rd-article-takeaway-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

#module-reading .rd-card-article .rd-article-takeaway-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#module-reading .rd-card-article .rd-article-takeaway-item {
    font-size: 13px;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text-primary);
}

#module-reading .rd-card-article .rd-article-takeaway-item::before {
    content: '→';
    flex-shrink: 0;
    font-weight: 700;
    margin-top: 1px;
}

/* Article card theme colors */
#module-reading .rd-theme-green .rd-article-body { background: rgba(16,185,129,0.06); }
#module-reading .rd-theme-green .rd-article-takeaway { background: rgba(16,185,129,0.08); border-left-color: #10b981; }
#module-reading .rd-theme-green .rd-article-takeaway-title { color: #34d399; }
#module-reading .rd-theme-green .rd-article-takeaway-item::before { color: #34d399; }

#module-reading .rd-theme-blue .rd-article-body { background: rgba(59,130,246,0.06); }
#module-reading .rd-theme-blue .rd-article-takeaway { background: rgba(59,130,246,0.08); border-left-color: #3b82f6; }
#module-reading .rd-theme-blue .rd-article-takeaway-title { color: #60a5fa; }
#module-reading .rd-theme-blue .rd-article-takeaway-item::before { color: #60a5fa; }

#module-reading .rd-theme-orange .rd-article-body { background: rgba(249,115,22,0.06); }
#module-reading .rd-theme-orange .rd-article-takeaway { background: rgba(249,115,22,0.08); border-left-color: #f97316; }
#module-reading .rd-theme-orange .rd-article-takeaway-title { color: #fb923c; }
#module-reading .rd-theme-orange .rd-article-takeaway-item::before { color: #fb923c; }

#module-reading .rd-theme-purple .rd-article-body { background: rgba(139,92,246,0.06); }
#module-reading .rd-theme-purple .rd-article-takeaway { background: rgba(139,92,246,0.08); border-left-color: #8b5cf6; }
#module-reading .rd-theme-purple .rd-article-takeaway-title { color: #a78bfa; }
#module-reading .rd-theme-purple .rd-article-takeaway-item::before { color: #a78bfa; }

#module-reading .rd-theme-teal .rd-article-body { background: rgba(20,184,166,0.06); }
#module-reading .rd-theme-teal .rd-article-takeaway { background: rgba(20,184,166,0.08); border-left-color: #14b8a6; }
#module-reading .rd-theme-teal .rd-article-takeaway-title { color: #2dd4bf; }
#module-reading .rd-theme-teal .rd-article-takeaway-item::before { color: #2dd4bf; }

#module-reading .rd-theme-pink .rd-article-body { background: rgba(236,72,153,0.06); }
#module-reading .rd-theme-pink .rd-article-takeaway { background: rgba(236,72,153,0.08); border-left-color: #ec4899; }
#module-reading .rd-theme-pink .rd-article-takeaway-title { color: #f472b6; }
#module-reading .rd-theme-pink .rd-article-takeaway-item::before { color: #f472b6; }

/* --- Loading --- */
#module-reading .rd-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10,10,20,0.92);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: rd-fadeIn 0.3s ease;
}

#module-reading .rd-loading-content { text-align: center; padding: 40px; }

#module-reading .rd-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: #a78bfa;
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: rd-spin 1s linear infinite;
}

#module-reading .rd-loading-title { font-size: 20px; margin-bottom: 8px; color: var(--text-primary); }
#module-reading .rd-loading-desc { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }

#module-reading .rd-loading-progress {
    width: 280px;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto;
}

#module-reading .rd-loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* --- Export Toolbar --- */
#module-reading .rd-export-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
}

#module-reading .rd-card-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

#module-reading .rd-export-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* --- Cards Container --- */
#module-reading .rd-cards-container {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ============================================
   Reading Card Base Styles
   ============================================ */
#module-reading .rd-book-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    overflow: hidden;
    animation: rd-cardSlideUp 0.5s ease both;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

#module-reading .rd-book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.1);
}

#module-reading .rd-book-card .rd-card-export-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(4px);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.15s ease;
    z-index: 10;
}

#module-reading .rd-book-card:hover .rd-card-export-btn { opacity: 1; }

#module-reading .rd-book-card .rd-card-export-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: scale(1.1);
}

/* ============================================
   Card Type: Overview — Split Cover Layout
   ============================================ */
#module-reading .rd-card-overview {
    padding: 0;
    overflow: hidden;
    border: none;
    display: flex;
    flex-direction: column;
}

/* --- Cover Hero: top image area (40%) --- */
#module-reading .rd-cover-hero {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a3e 0%, #2d1b4e 30%, #1e3a5f 60%, #0f2027 100%);
    flex-shrink: 0;
}

/* Cover Image */
#module-reading .rd-cover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#module-reading .rd-card-overview:hover .rd-cover-image {
    transform: scale(1.03);
    transition: transform 0.6s ease, opacity 0.8s ease;
}

/* Shimmer Loading */
#module-reading .rd-cover-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
    overflow: hidden;
}

#module-reading .rd-cover-shimmer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
    animation: rd-shimmerSlide 2s ease-in-out infinite;
}

@keyframes rd-shimmerSlide {
    0% { left: -100%; }
    100% { left: 100%; }
}

#module-reading .rd-cover-shimmer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 1;
}

#module-reading .rd-shimmer-icon {
    font-size: 36px;
    animation: rd-shimmerPulse 1.5s ease-in-out infinite;
}

@keyframes rd-shimmerPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

#module-reading .rd-shimmer-text {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    font-weight: 500;
    letter-spacing: 1px;
}

#module-reading .rd-cover-shimmer.rd-shimmer-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Fallback gradient */
#module-reading .rd-cover-hero.rd-cover-fallback {
    background: linear-gradient(135deg,
        #0f2027 0%, #203a43 25%, #2c5364 50%, #1a3a4a 75%, #0f2027 100%);
    background-size: 300% 300%;
    animation: rd-gradientShift 8s ease infinite;
}

@keyframes rd-gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Text Area: bottom content --- */
#module-reading .rd-cover-text-area {
    padding: 20px 28px;
    text-align: center;
    background: var(--bg-card);
}

/* Book title */
#module-reading .rd-card-overview .rd-book-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Author */
#module-reading .rd-card-overview .rd-book-author {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#module-reading .rd-author-icon { font-size: 14px; }

/* Summary */
#module-reading .rd-card-overview .rd-book-summary {
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* --- Tags --- */
#module-reading .rd-card-overview .rd-card-overview-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
}

#module-reading .rd-card-overview .rd-tag {
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(167,139,250,0.12);
    color: #a78bfa;
    border: 1px solid rgba(167,139,250,0.2);
    transition: all 0.2s ease;
}

#module-reading .rd-card-overview .rd-tag:hover {
    background: rgba(167,139,250,0.25);
    transform: translateY(-1px);
}

#module-reading .rd-card-overview .rd-tag:nth-child(2) { background: rgba(96,165,250,0.12); color: #60a5fa; border-color: rgba(96,165,250,0.2); }
#module-reading .rd-card-overview .rd-tag:nth-child(3) { background: rgba(52,211,153,0.12); color: #34d399; border-color: rgba(52,211,153,0.2); }
#module-reading .rd-card-overview .rd-tag:nth-child(4) { background: rgba(251,146,60,0.12); color: #fb923c; border-color: rgba(251,146,60,0.2); }
#module-reading .rd-card-overview .rd-tag:nth-child(5) { background: rgba(45,212,191,0.12); color: #2dd4bf; border-color: rgba(45,212,191,0.2); }
#module-reading .rd-card-overview .rd-tag:nth-child(6) { background: rgba(244,114,182,0.12); color: #f472b6; border-color: rgba(244,114,182,0.2); }


/* ============================================
   Card Type: Insight
   ============================================ */
#module-reading .rd-card-insight { padding: 28px; }
#module-reading .rd-card-insight .rd-card-accent-bar { width: 60px; height: 4px; border-radius: 2px; margin-bottom: 16px; }
#module-reading .rd-card-insight .rd-card-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
#module-reading .rd-card-insight .rd-card-emoji { font-size: 28px; flex-shrink: 0; }
#module-reading .rd-card-insight .rd-card-title { font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--text-primary); }
#module-reading .rd-card-insight .rd-card-subtitle { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; padding-left: 38px; }

#module-reading .rd-card-insight .rd-insight-points { list-style: none; display: flex; flex-direction: column; gap: 10px; }

#module-reading .rd-card-insight .rd-insight-point {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
    transition: transform 0.15s ease;
    color: var(--text-primary);
}

#module-reading .rd-card-insight .rd-insight-point:hover { transform: translateX(4px); }
#module-reading .rd-card-insight .rd-point-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; }

/* ============================================
   Card Type: Quote
   ============================================ */
#module-reading .rd-card-quote { padding: 0; text-align: center; }

#module-reading .rd-card-quote .rd-quote-body { padding: 48px 40px 36px; position: relative; }

#module-reading .rd-card-quote .rd-quote-mark {
    font-size: 64px; line-height: 1; opacity: 0.12;
    position: absolute; top: 16px; left: 28px; font-family: Georgia, serif;
    color: var(--text-primary);
}

#module-reading .rd-card-quote .rd-quote-text { font-size: 18px; font-weight: 600; line-height: 1.8; position: relative; max-width: 600px; margin: 0 auto; }

#module-reading .rd-card-quote .rd-quote-footer { padding: 16px 32px 20px; display: flex; align-items: center; justify-content: center; gap: 8px; }
#module-reading .rd-card-quote .rd-quote-source { font-size: 12px; color: var(--text-muted); font-style: italic; }
#module-reading .rd-card-quote .rd-quote-emoji { font-size: 18px; }

/* ============================================
   Card Type: List
   ============================================ */
#module-reading .rd-card-list { padding: 28px; }
#module-reading .rd-card-list .rd-card-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
#module-reading .rd-card-list .rd-card-emoji { font-size: 28px; }
#module-reading .rd-card-list .rd-card-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
#module-reading .rd-card-list .rd-list-items { display: flex; flex-direction: column; gap: 12px; }

#module-reading .rd-card-list .rd-list-item {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 14px 16px; border-radius: 12px;
    transition: transform 0.15s ease;
}

#module-reading .rd-card-list .rd-list-item:hover { transform: translateX(4px); }

#module-reading .rd-card-list .rd-item-number {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; flex-shrink: 0; color: #fff;
}

#module-reading .rd-card-list .rd-item-content { flex: 1; }
#module-reading .rd-card-list .rd-item-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--text-primary); }
#module-reading .rd-card-list .rd-item-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

/* ============================================
   Card Type: Comparison
   ============================================ */
#module-reading .rd-card-comparison { padding: 28px; }
#module-reading .rd-card-comparison .rd-card-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; text-align: center; justify-content: center; }
#module-reading .rd-card-comparison .rd-card-emoji { font-size: 28px; }
#module-reading .rd-card-comparison .rd-card-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }

#module-reading .rd-comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

#module-reading .rd-comparison-side { padding: 20px; border-radius: 12px; }
#module-reading .rd-side-positive { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); }
#module-reading .rd-side-negative { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); }
#module-reading .rd-side-header { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-weight: 700; font-size: 14px; }
#module-reading .rd-side-positive .rd-side-header { color: #34d399; }
#module-reading .rd-side-negative .rd-side-header { color: #f87171; }

#module-reading .rd-side-items { list-style: none; display: flex; flex-direction: column; gap: 8px; }

#module-reading .rd-side-item { font-size: 12px; line-height: 1.6; display: flex; align-items: flex-start; gap: 6px; color: var(--text-primary); }
#module-reading .rd-side-item::before { content: ''; width: 6px; height: 6px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; }
#module-reading .rd-side-positive .rd-side-item::before { background: #34d399; }
#module-reading .rd-side-negative .rd-side-item::before { background: #f87171; }

/* ============================================
   Card Type: Action
   ============================================ */
#module-reading .rd-card-action { padding: 28px; }
#module-reading .rd-card-action .rd-card-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
#module-reading .rd-card-action .rd-card-emoji { font-size: 28px; }
#module-reading .rd-card-action .rd-card-title { font-size: 17px; font-weight: 700; color: var(--text-primary); }
#module-reading .rd-action-items { display: flex; flex-direction: column; gap: 12px; }

#module-reading .rd-action-item {
    display: flex; align-items: flex-start; gap: 12px;
    font-size: 13px; line-height: 1.7;
    padding: 10px 14px; border-radius: 12px;
    transition: all 0.15s ease;
    color: var(--text-primary);
}

#module-reading .rd-action-item:hover { transform: translateX(4px); }

#module-reading .rd-action-check {
    width: 22px; height: 22px; border-radius: 6px;
    border: 2px solid; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0; margin-top: 1px; font-size: 12px;
}

#module-reading .rd-action-text { flex: 1; }
#module-reading .rd-action-highlight { font-weight: 600; }

/* ============================================
   Color Themes
   ============================================ */
/* Green */
#module-reading .rd-theme-green .rd-card-accent-bar { background: #34d399; }
#module-reading .rd-theme-green .rd-insight-point { background: rgba(16,185,129,0.08); }
#module-reading .rd-theme-green .rd-point-icon { color: #34d399; }
#module-reading .rd-theme-green .rd-item-number { background: #10b981; }
#module-reading .rd-theme-green .rd-list-item { background: rgba(16,185,129,0.08); }
#module-reading .rd-theme-green .rd-action-check { border-color: #10b981; color: #34d399; }
#module-reading .rd-theme-green .rd-action-item { background: rgba(16,185,129,0.08); }
#module-reading .rd-theme-green .rd-action-highlight { color: #6ee7b7; }
#module-reading .rd-theme-green .rd-quote-body { background: rgba(16,185,129,0.06); }
#module-reading .rd-theme-green .rd-quote-text { color: #6ee7b7; }

/* Blue */
#module-reading .rd-theme-blue .rd-card-accent-bar { background: #60a5fa; }
#module-reading .rd-theme-blue .rd-insight-point { background: rgba(59,130,246,0.08); }
#module-reading .rd-theme-blue .rd-point-icon { color: #60a5fa; }
#module-reading .rd-theme-blue .rd-item-number { background: #3b82f6; }
#module-reading .rd-theme-blue .rd-list-item { background: rgba(59,130,246,0.08); }
#module-reading .rd-theme-blue .rd-action-check { border-color: #3b82f6; color: #60a5fa; }
#module-reading .rd-theme-blue .rd-action-item { background: rgba(59,130,246,0.08); }
#module-reading .rd-theme-blue .rd-action-highlight { color: #93c5fd; }
#module-reading .rd-theme-blue .rd-quote-body { background: rgba(59,130,246,0.06); }
#module-reading .rd-theme-blue .rd-quote-text { color: #93c5fd; }

/* Orange */
#module-reading .rd-theme-orange .rd-card-accent-bar { background: #fb923c; }
#module-reading .rd-theme-orange .rd-insight-point { background: rgba(249,115,22,0.08); }
#module-reading .rd-theme-orange .rd-point-icon { color: #fb923c; }
#module-reading .rd-theme-orange .rd-item-number { background: #f97316; }
#module-reading .rd-theme-orange .rd-list-item { background: rgba(249,115,22,0.08); }
#module-reading .rd-theme-orange .rd-action-check { border-color: #f97316; color: #fb923c; }
#module-reading .rd-theme-orange .rd-action-item { background: rgba(249,115,22,0.08); }
#module-reading .rd-theme-orange .rd-action-highlight { color: #fdba74; }
#module-reading .rd-theme-orange .rd-quote-body { background: rgba(249,115,22,0.06); }
#module-reading .rd-theme-orange .rd-quote-text { color: #fdba74; }

/* Purple */
#module-reading .rd-theme-purple .rd-card-accent-bar { background: #a78bfa; }
#module-reading .rd-theme-purple .rd-insight-point { background: rgba(139,92,246,0.08); }
#module-reading .rd-theme-purple .rd-point-icon { color: #a78bfa; }
#module-reading .rd-theme-purple .rd-item-number { background: #8b5cf6; }
#module-reading .rd-theme-purple .rd-list-item { background: rgba(139,92,246,0.08); }
#module-reading .rd-theme-purple .rd-action-check { border-color: #8b5cf6; color: #a78bfa; }
#module-reading .rd-theme-purple .rd-action-item { background: rgba(139,92,246,0.08); }
#module-reading .rd-theme-purple .rd-action-highlight { color: #c4b5fd; }
#module-reading .rd-theme-purple .rd-quote-body { background: rgba(139,92,246,0.06); }
#module-reading .rd-theme-purple .rd-quote-text { color: #c4b5fd; }

/* Teal */
#module-reading .rd-theme-teal .rd-card-accent-bar { background: #2dd4bf; }
#module-reading .rd-theme-teal .rd-insight-point { background: rgba(20,184,166,0.08); }
#module-reading .rd-theme-teal .rd-point-icon { color: #2dd4bf; }
#module-reading .rd-theme-teal .rd-item-number { background: #14b8a6; }
#module-reading .rd-theme-teal .rd-list-item { background: rgba(20,184,166,0.08); }
#module-reading .rd-theme-teal .rd-action-check { border-color: #14b8a6; color: #2dd4bf; }
#module-reading .rd-theme-teal .rd-action-item { background: rgba(20,184,166,0.08); }
#module-reading .rd-theme-teal .rd-action-highlight { color: #5eead4; }
#module-reading .rd-theme-teal .rd-quote-body { background: rgba(20,184,166,0.06); }
#module-reading .rd-theme-teal .rd-quote-text { color: #5eead4; }

/* Pink */
#module-reading .rd-theme-pink .rd-card-accent-bar { background: #f472b6; }
#module-reading .rd-theme-pink .rd-insight-point { background: rgba(236,72,153,0.08); }
#module-reading .rd-theme-pink .rd-point-icon { color: #f472b6; }
#module-reading .rd-theme-pink .rd-item-number { background: #ec4899; }
#module-reading .rd-theme-pink .rd-list-item { background: rgba(236,72,153,0.08); }
#module-reading .rd-theme-pink .rd-action-check { border-color: #ec4899; color: #f472b6; }
#module-reading .rd-theme-pink .rd-action-item { background: rgba(236,72,153,0.08); }
#module-reading .rd-theme-pink .rd-action-highlight { color: #f9a8d4; }
#module-reading .rd-theme-pink .rd-quote-body { background: rgba(236,72,153,0.06); }
#module-reading .rd-theme-pink .rd-quote-text { color: #f9a8d4; }

/* ============================================
   Reading Module Animations
   ============================================ */
@keyframes rd-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes rd-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes rd-spin {
    to { transform: rotate(360deg); }
}

@keyframes rd-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rd-slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes rd-cardSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Card stagger */
#module-reading .rd-book-card:nth-child(1) { animation-delay: 0s; }
#module-reading .rd-book-card:nth-child(2) { animation-delay: 0.08s; }
#module-reading .rd-book-card:nth-child(3) { animation-delay: 0.16s; }
#module-reading .rd-book-card:nth-child(4) { animation-delay: 0.24s; }
#module-reading .rd-book-card:nth-child(5) { animation-delay: 0.32s; }
#module-reading .rd-book-card:nth-child(6) { animation-delay: 0.40s; }
#module-reading .rd-book-card:nth-child(7) { animation-delay: 0.48s; }
#module-reading .rd-book-card:nth-child(8) { animation-delay: 0.56s; }
#module-reading .rd-book-card:nth-child(9) { animation-delay: 0.64s; }
#module-reading .rd-book-card:nth-child(10) { animation-delay: 0.72s; }
#module-reading .rd-book-card:nth-child(11) { animation-delay: 0.80s; }
#module-reading .rd-book-card:nth-child(12) { animation-delay: 0.88s; }

/* ============================================
   Reading Module Responsive
   ============================================ */
@media (max-width: 768px) {
    #module-reading .rd-input-area {
        grid-template-columns: 1fr;
    }

    #module-reading .rd-input-divider {
        padding: 8px 0;
    }

    #module-reading .rd-header-inner {
        padding: 12px 16px;
    }

    #module-reading .rd-logo-subtitle {
        display: none;
    }

    #module-reading .rd-main {
        padding: 20px 16px 40px;
    }

    #module-reading .rd-platform-group {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    #module-reading .rd-platform-card {
        padding: 14px 8px;
    }

    #module-reading .rd-platform-icon {
        font-size: 26px;
    }

    #module-reading .rd-platform-name {
        font-size: 12px;
    }

    #module-reading .rd-platform-desc {
        font-size: 10px;
    }

    #module-reading .rd-generate-mode-group {
        grid-template-columns: 1fr;
        max-width: 320px;
    }

    #module-reading .rd-btn-generate {
        padding: 20px 16px;
    }

    #module-reading .rd-plat-xiaohongshu .rd-book-card {
        width: 100%;
        max-width: 375px;
        min-height: 480px;
    }

    #module-reading .rd-comparison-grid {
        grid-template-columns: 1fr;
    }

    #module-reading .rd-card-overview .rd-card-overview-header {
        padding: 28px 20px 24px;
    }

    #module-reading .rd-card-overview .rd-book-title {
        font-size: 20px;
    }

    #module-reading .rd-card-quote .rd-quote-body {
        padding: 36px 24px 28px;
    }

    #module-reading .rd-card-quote .rd-quote-text {
        font-size: 16px;
    }

    #module-reading .rd-export-toolbar {
        flex-direction: column;
        gap: 12px;
    }

    #module-reading .rd-export-right {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Light theme overrides for Reading module */
.light-theme #module-reading .rd-platform-card {
    background: #fff;
    border-color: rgba(0,0,0,0.1);
}

.light-theme #module-reading .rd-platform-card:hover {
    border-color: rgba(0,0,0,0.2);
    background: #f9fafb;
}

.light-theme #module-reading .rd-platform-card.active {
    border-color: #818cf8;
    background: rgba(99,102,241,0.08);
}

.light-theme #module-reading .rd-platform-card.active .rd-platform-name {
    color: #6366f1;
}

.light-theme #module-reading .rd-header {
    background: rgba(255,255,255,0.9);
    border-bottom-color: rgba(0,0,0,0.08);
}

.light-theme #module-reading .rd-logo-subtitle {
    color: #6b7280;
    border-left-color: rgba(0,0,0,0.12);
}

.light-theme #module-reading .rd-settings-btn {
    background: #fff;
    border-color: rgba(0,0,0,0.12);
    color: #4b5563;
}

.light-theme #module-reading .rd-settings-btn:hover {
    border-color: #818cf8;
    color: #6366f1;
    background: rgba(99,102,241,0.05);
}

.light-theme #module-reading .rd-upload-zone {
    border-color: rgba(0,0,0,0.12);
    background: #fff;
}

.light-theme #module-reading .rd-upload-zone:hover,
.light-theme #module-reading .rd-upload-zone.rd-drag-over {
    border-color: #818cf8;
    background: rgba(99,102,241,0.04);
}

.light-theme #module-reading .rd-text-input-wrapper {
    background: #fff;
    border-color: rgba(0,0,0,0.12);
}

.light-theme #module-reading .rd-text-input-wrapper:focus-within {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.light-theme #module-reading .rd-text-input-footer {
    background: #f9fafb;
    border-top-color: rgba(0,0,0,0.06);
}

.light-theme #module-reading .rd-input-divider span {
    background: #f3f4f6;
}

.light-theme #module-reading .rd-upload-formats {
    background: #f3f4f6;
}

.light-theme #module-reading .rd-book-card {
    background: #fff;
    border-color: rgba(0,0,0,0.08);
}

.light-theme #module-reading .rd-book-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.12);
}

.light-theme #module-reading .rd-export-toolbar {
    background: #fff;
    border-color: rgba(0,0,0,0.08);
}

.light-theme #module-reading .rd-loading-overlay {
    background: rgba(240,244,248,0.95);
}

.light-theme #module-reading .rd-loading-spinner {
    border-color: rgba(0,0,0,0.08);
    border-top-color: #a78bfa;
}

.light-theme #module-reading .rd-file-info {
    background: rgba(16,185,129,0.06);
    border-color: rgba(16,185,129,0.15);
}

/* Light theme: Overview cover card */
.light-theme #module-reading .rd-cover-text-area {
    background: #fff;
}

.light-theme #module-reading .rd-card-overview .rd-book-title {
    color: #0f172a;
    text-shadow: none;
}

.light-theme #module-reading .rd-card-overview .rd-book-author {
    color: #475569;
}

.light-theme #module-reading .rd-card-overview .rd-book-summary {
    color: #334155;
}

.light-theme #module-reading .rd-cover-badge {
    background: rgba(99,102,241,0.08);
    border-color: rgba(99,102,241,0.15);
}

.light-theme #module-reading .rd-cover-badge-label {
    color: #6366f1;
}

.light-theme #module-reading .rd-card-overview .rd-tag {
    background: rgba(99,102,241,0.08);
    color: #6366f1;
    border-color: rgba(99,102,241,0.12);
}

.light-theme #module-reading .rd-card-overview .rd-tag:hover {
    background: rgba(99,102,241,0.15);
    box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}

.light-theme #module-reading .rd-cover-overlay {
    background:
        linear-gradient(to bottom, #fff 0%, transparent 8%),
        linear-gradient(to top, #fff 0%, transparent 15%);
}

.light-theme #module-reading .rd-shimmer-text {
    color: rgba(0,0,0,0.3);
}

/* ==================== OPTIONS STRATEGY ADVISOR ==================== */
.opt-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.opt-input-wrap {
    flex: 1;
    position: relative;
}
.opt-dollar {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-family: monospace;
    font-size: 14px;
    color: var(--text-accent);
    opacity: 0.5;
    pointer-events: none;
}
.opt-input {
    width: 100%;
    padding: 12px 12px 12px 28px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    font-family: monospace;
    font-weight: 600;
    letter-spacing: 2px;
    outline: none;
    transition: border-color 0.2s;
}
.opt-input:focus {
    border-color: var(--text-accent);
}
.opt-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

#opt-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-family: monospace;
    font-size: 12px;
    color: var(--text-accent);
}
.opt-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-accent);
    animation: blink 0.8s ease infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

#opt-error, #opt-bt-error {
    background: rgba(255,77,79,0.06);
    border: 1px solid rgba(255,77,79,0.2);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 16px;
}
.opt-err-text {
    font-family: monospace;
    font-size: 12px;
    color: #ff4d4f;
}

.opt-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-family: monospace;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}
.opt-tag.fin-up {
    background: rgba(0,185,107,0.12);
    color: #00b96b;
}
.opt-tag.fin-down {
    background: rgba(255,77,79,0.12);
    color: #ff4d4f;
}
.opt-tag.fin-flat {
    background: rgba(250,173,20,0.12);
    color: #faad14;
}

.opt-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
}
.opt-meta { padding: 4px 0; }
.opt-meta-label {
    font-size: 9px;
    color: var(--text-muted);
    font-family: monospace;
    letter-spacing: 1px;
    margin-bottom: 2px;
}
.opt-meta-val {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: monospace;
}

.opt-event {
    background: rgba(250,173,20,0.06);
    border: 1px solid rgba(250,173,20,0.12);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    margin-bottom: 10px;
    font-family: monospace;
    font-size: 11px;
    color: #faad14;
}

/* Strategy Cards */
.opt-strat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.opt-strat-card:hover {
    border-color: rgba(255,255,255,0.12);
}
.opt-strat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 16px 6px;
}
.opt-conf-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
    max-width: 120px;
}
.opt-conf-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}
.opt-strat-detail {
    padding: 0 16px 16px;
    border-top: 1px solid var(--glass-border);
}
.opt-pl-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}
.opt-pl-box {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: monospace;
}
.opt-pl-profit {
    background: rgba(0,185,107,0.04);
    border-left: 2px solid #00b96b;
    color: #00b96b;
}
.opt-pl-loss {
    background: rgba(255,77,79,0.04);
    border-left: 2px solid #ff4d4f;
    color: #ff4d4f;
}
.opt-pl-label {
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 3px;
}
.opt-section {
    margin-bottom: 12px;
}
.opt-section-label {
    font-size: 9px;
    color: var(--text-muted);
    font-family: monospace;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.opt-warning {
    background: rgba(250,173,20,0.06);
    border: 1px solid rgba(250,173,20,0.1);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}
.opt-warning-label {
    font-size: 9px;
    color: #faad14;
    font-family: monospace;
    letter-spacing: 1px;
    margin-bottom: 3px;
}
.opt-warning div:last-child {
    font-size: 12px;
    color: rgba(250,173,20,0.75);
    line-height: 1.6;
}

/* Backtest button */
.opt-bt-btn {
    margin-top: 20px;
    width: 100%;
    padding: 14px;
    font-family: monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
}

/* Backtest Results */
.opt-bt-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.opt-bt-card:hover {
    border-color: rgba(0,185,107,0.15);
}
.opt-bt-header {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.opt-bt-detail {
    padding: 0 16px 16px;
    border-top: 1px solid var(--glass-border);
}
.opt-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 14px 0 16px;
}
.opt-stat-box {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 10px;
}
.opt-stat-label {
    font-size: 9px;
    color: var(--text-muted);
    font-family: monospace;
    letter-spacing: 1px;
    margin-bottom: 4px;
}
.opt-stat-val {
    font-size: 16px;
    font-weight: 700;
    font-family: monospace;
}

.opt-chart-section {
    margin-bottom: 16px;
}
.opt-chart-label {
    font-size: 10px;
    color: var(--text-muted);
    font-family: monospace;
    letter-spacing: 1px;
    margin-bottom: 6px;
}
.opt-chart {
    display: block;
    border-radius: var(--radius-sm);
}

.opt-bt-note {
    margin-top: 12px;
    background: rgba(250,173,20,0.04);
    border: 1px solid rgba(250,173,20,0.08);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 10px;
    color: rgba(250,173,20,0.6);
    font-family: monospace;
    line-height: 1.5;
}

.opt-disclaimer {
    margin-top: 20px;
    padding: 10px;
    border-top: 1px solid var(--glass-border);
    font-family: monospace;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.4;
    line-height: 1.6;
}

/* Light theme overrides */
body.light-theme .opt-input {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.1);
    color: var(--text-primary);
}
body.light-theme .opt-strat-card,
body.light-theme .opt-bt-card {
    border-color: rgba(0,0,0,0.08);
}
body.light-theme .opt-strat-card:hover,
body.light-theme .opt-bt-card:hover {
    border-color: rgba(0,0,0,0.15);
}
body.light-theme .opt-stat-box {
    background: rgba(0,0,0,0.02);
    border-color: rgba(0,0,0,0.06);
}