/* ============================================
   Podcast Management — Elegant Modern UI
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Light theme — warm neutrals with indigo accent */
    --bg: #fafaf9;
    --bg-subtle: #f4f4f3;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-hover: #f7f7f6;
    --text: #09090b;
    --text-secondary: #404040;
    --text-muted: #737373;
    --text-faint: #a3a3a3;
    --border: #e7e5e4;
    --border-strong: #d6d3d1;
    --border-subtle: #f4f4f3;

    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-soft: rgba(99, 102, 241, 0.08);
    --primary-ring: rgba(99, 102, 241, 0.18);
    --accent: #8b5cf6;

    --success: #059669;
    --success-soft: rgba(5, 150, 105, 0.1);
    --warning: #d97706;
    --warning-soft: rgba(217, 119, 6, 0.1);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.1);
    --info: #2563eb;
    --info-soft: rgba(37, 99, 235, 0.1);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 0 1px var(--primary-ring), 0 8px 24px rgba(99, 102, 241, 0.15);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;

    --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    --header-h: 64px;
    --sidebar-w: 248px;
}

[data-theme="dark"] {
    --bg: #0a0a0b;
    --bg-subtle: #101012;
    --bg-card: #151518;
    --bg-elevated: #1c1c20;
    --bg-hover: #1f1f23;
    --text: #fafafa;
    --text-secondary: #d4d4d4;
    --text-muted: #a3a3a3;
    --text-faint: #737373;
    --border: #27272a;
    --border-strong: #3f3f46;
    --border-subtle: #1c1c20;

    --primary: #818cf8;
    --primary-hover: #a5b4fc;
    --primary-soft: rgba(129, 140, 248, 0.12);
    --primary-ring: rgba(129, 140, 248, 0.24);
    --accent: #a78bfa;

    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.12);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.12);
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, 0.12);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6), 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.7), 0 8px 16px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 0 1px var(--primary-ring), 0 8px 24px rgba(129, 140, 248, 0.2);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-feature-settings: 'cv11', 'ss01';
    font-variation-settings: 'opsz' 32;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition), color var(--transition);
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
p { margin: 0; }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

button { font-family: inherit; }

::selection { background: var(--primary-soft); color: var(--text); }

/* ============================================
   AUTH PAGES (login / forgot)
   ============================================ */
.auth-page {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.18), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.14), transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.08), transparent 60%),
        var(--bg);
}
[data-theme="dark"] .auth-bg {
    background:
        radial-gradient(circle at 20% 20%, rgba(129, 140, 248, 0.15), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(167, 139, 250, 0.12), transparent 50%),
        var(--bg);
}
.auth-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border-subtle) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.4;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.auth-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(12px);
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
    color: var(--text);
}
.auth-brand:hover { color: var(--text); }
.auth-brand-name { font-weight: 700; font-size: 16px; line-height: 1.2; }
.auth-brand-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.auth-title { font-size: 26px; margin-bottom: 6px; }
.auth-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.auth-form .form-group { margin-bottom: 18px; }
.auth-links {
    margin-top: 22px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.auth-links a { font-weight: 500; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-faint);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-hint {
    margin-top: 20px;
    padding: 12px 14px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}
.auth-hint strong { color: var(--text-secondary); font-weight: 600; }
.auth-hint code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--bg-card);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-size: 11px;
}
.auth-success { text-align: center; }
.auth-success-icon {
    width: 64px; height: 64px;
    margin: 0 auto 20px;
    background: var(--success-soft);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
}
.auth-theme-toggle {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.forgot-link {
    float: right;
    font-size: 12px;
    font-weight: 500;
    margin-top: -4px;
}

/* ============================================
   TOP BAR
   ============================================ */
.topbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.85);
}
[data-theme="dark"] .topbar { background: rgba(21, 21, 24, 0.85); }
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
}
.brand:hover { color: var(--text); }
.brand-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    letter-spacing: -0.02em;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.theme-toggle {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 38px; height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    transition: all var(--transition);
}
.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--border-strong);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}
.user-chip-avatar {
    width: 26px; height: 26px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: calc(100vh - var(--header-h));
}

.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    height: calc(100vh - var(--header-h));
    position: sticky;
    top: var(--header-h);
    overflow-y: auto;
}
.sidebar-section {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    padding: 8px 12px;
    margin-top: 16px;
}
.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
    transition: all var(--transition);
    position: relative;
}
.sidebar a:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.sidebar a.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}
.sidebar a.active::before {
    content: '';
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}
.nav-icon {
    width: 20px;
    font-size: 16px;
    display: inline-flex;
    justify-content: center;
    flex-shrink: 0;
}

.main {
    padding: 32px 36px;
    max-width: 100%;
    overflow-x: hidden;
}
.main > * + * { margin-top: 0; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-header h1 { margin-bottom: 4px; }
.page-header .page-sub { color: var(--text-muted); font-size: 14px; }
.page-header .page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--transition), border-color var(--transition);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-head { margin-bottom: 20px; }
.card-head h2 { margin-bottom: 4px; }
.card-head .muted-small { margin-top: 4px; }

.muted-small { font-size: 13px; color: var(--text-muted); }

/* ============================================
   STATS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, var(--primary-soft) 150%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
.stat-card:hover::before { opacity: 1; }
.stat-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.stat-icon.blue { background: var(--info-soft); color: var(--info); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.yellow { background: var(--warning-soft); color: var(--warning); }
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
[data-theme="dark"] .stat-icon.purple { color: #a78bfa; }
.stat-body { position: relative; z-index: 1; min-width: 0; }
.stat-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.stat-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    margin-top: 2px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 16px; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
    letter-spacing: -0.005em;
}
.field-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

input[type="text"], input[type="password"], input[type="url"],
input[type="number"], input[type="date"], input[type="email"],
textarea, select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition);
    line-height: 1.5;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:hover, textarea:hover, select:hover { border-color: var(--border-strong); }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
    background: var(--bg-card);
}
textarea { resize: vertical; min-height: 90px; }
select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1;
    position: relative;
    box-shadow: var(--shadow-xs);
    white-space: nowrap;
}
.btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    color: white;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-ring);
}

.btn-primary { /* alias */ }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border-color: var(--border);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
    box-shadow: none;
}
.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text);
    transform: none;
    box-shadow: none;
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}
.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

/* View toggle */
.view-toggle {
    display: inline-flex;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
}
.view-toggle a {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 7px;
    transition: all var(--transition);
}
.view-toggle a:hover { color: var(--text); }
.view-toggle a.active {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: var(--shadow-xs);
}

/* ============================================
   TABLES
   ============================================ */
.table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}
.table-scroll { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}
th {
    background: var(--bg-subtle);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    padding-top: 12px;
    padding-bottom: 12px;
}
tbody tr { transition: background var(--transition); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-subtle); }

td strong { font-weight: 600; }

.table-inline-select {
    padding: 5px 28px 5px 10px !important;
    font-size: 12px !important;
    min-width: 120px;
    font-weight: 500;
}

/* ============================================
   BADGES & CHIPS
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.01em;
    line-height: 1.5;
    white-space: nowrap;
}
.badge::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.badge-pending { background: var(--warning-soft); color: var(--warning); }
.badge-progress { background: var(--info-soft); color: var(--info); }
.badge-done { background: var(--success-soft); color: var(--success); }
.badge-low { background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border); }
.badge-low::before { display: none; }
.badge-medium { background: var(--info-soft); color: var(--info); }
.badge-high { background: var(--danger-soft); color: var(--danger); }

.chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}
.chip-success { background: var(--success-soft); color: var(--success); }

/* ============================================
   ALERTS & INFO BOXES
   ============================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid transparent;
    line-height: 1.5;
}
.alert-icon {
    flex-shrink: 0;
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
}
.alert-error {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger-soft);
}
.alert-error .alert-icon { background: var(--danger); }
.alert-success {
    background: var(--success-soft);
    color: var(--success);
    border-color: var(--success-soft);
}
.alert-success .alert-icon { background: var(--success); }

.info-box {
    background: var(--primary-soft);
    border: 1px solid var(--primary-ring);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 18px;
}
.info-box strong { color: var(--primary); font-weight: 600; }

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.empty-state .big-icon {
    font-size: 40px;
    margin-bottom: 14px;
    opacity: 0.5;
    display: block;
}
.empty-state h3 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 6px;
    font-weight: 600;
}
.empty-state p { font-size: 13px; }

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}
.filter-bar input, .filter-bar select {
    max-width: 220px;
    padding: 8px 14px;
    font-size: 13px;
}
.filter-bar select { min-width: 150px; padding-right: 32px; }

/* ============================================
   ACTIONS
   ============================================ */
.action-buttons { display: flex; gap: 4px; }
.icon-btn {
    width: 32px; height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center; justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition);
}
.icon-btn:hover {
    background: var(--bg-subtle);
    color: var(--text);
    border-color: var(--border);
}
.icon-btn.danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: var(--danger-soft);
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.active { display: flex; }
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-header h2 { font-size: 17px; }
.modal-body { padding: 24px; }
.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 8px;
}
.modal-close {
    background: transparent;
    border: none;
    width: 32px; height: 32px;
    border-radius: 8px;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: all var(--transition);
}
.modal-close:hover {
    background: var(--bg-subtle);
    color: var(--text);
}

/* ============================================
   DASHBOARD WIDGETS
   ============================================ */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.widget-list { }
.widget-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-subtle);
}
.widget-item:last-child { border-bottom: none; padding-bottom: 0; }
.widget-item:first-child { padding-top: 4px; }
.widget-item-title { font-weight: 500; font-size: 14px; margin-bottom: 2px; }
.widget-item-meta { font-size: 12px; color: var(--text-muted); }

/* ============================================
   BOARD VIEW (Kanban)
   ============================================ */
.board-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.board-col {
    padding: 18px;
    background: var(--bg-card);
}
.board-col-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.board-col-head h3 {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.board-col-count {
    background: var(--bg-subtle);
    color: var(--text-muted);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.board-item {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.5;
    transition: all var(--transition);
}
.board-item:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}
.board-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.board-item-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.board-empty {
    text-align: center;
    color: var(--text-faint);
    padding: 24px 0;
    font-size: 12px;
}

/* ============================================
   ACCOUNT PAGE
   ============================================ */
.account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.account-profile {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 22px 24px;
}
.account-profile h3 { font-size: 18px; margin-bottom: 4px; }
.profile-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}
.profile-badges {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.account-profile > div:nth-child(2) { flex: 1; }
.account-recovery { grid-column: 1 / -1; }

/* ============================================
   MENU TOGGLE (MOBILE)
   ============================================ */
.menu-toggle {
    display: none;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text);
    width: 38px; height: 38px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.menu-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--border-strong);
}

/* ============================================
   SCROLLBARS
   ============================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 999px;
    border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
    .dash-grid, .account-grid { grid-template-columns: 1fr; }
    .main { padding: 24px 22px; }
}

@media (max-width: 860px) {
    .container { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: var(--header-h);
        left: -280px;
        width: 260px;
        height: calc(100vh - var(--header-h));
        z-index: 49;
        transition: left var(--transition-slow);
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { left: 0; }
    .sidebar::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition);
        z-index: -1;
    }
    .sidebar.open::after {
        opacity: 1;
        pointer-events: auto;
        left: 260px;
        right: -100vw;
    }
    .menu-toggle { display: flex; }
    .topbar { padding: 0 16px; }
    .main { padding: 20px 18px; }
    .user-chip { padding: 5px 10px 5px 5px; font-size: 12px; }
    .user-chip span { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .board-grid { grid-template-columns: 1fr; }
    th, td { padding: 10px 14px; font-size: 13px; }
    h1 { font-size: 22px; }
    .page-header { flex-direction: column; align-items: stretch; }
    .auth-card { padding: 32px 24px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; gap: 10px; }
    .main { padding: 18px 14px; }
    .card { padding: 18px; }
    .account-profile { flex-direction: column; text-align: center; gap: 14px; }
    .modal-header, .modal-body { padding: 18px; }
    .auth-card { padding: 28px 20px; }
    .auth-title { font-size: 22px; }
    .filter-bar input, .filter-bar select { max-width: 100%; flex: 1; }
}
