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

:root {
    --bg-base: #050811;
    --bg-surface: #0b1120;
    --bg-card: rgba(15, 23, 42, 0.7);
    --bg-card-hover: rgba(20, 30, 55, 0.85);
    --sidebar-bg: #060c1a;
    --border: rgba(99, 130, 255, 0.1);
    --border-hover: rgba(99, 130, 255, 0.3);

    --indigo: #6366f1;
    --indigo-light: #818cf8;
    --violet: #8b5cf6;
    --emerald: #10b981;
    --rose: #f43f5e;
    --amber: #f59e0b;
    --cyan: #06b6d4;
    --sky: #38bdf8;

    --grad-1: linear-gradient(135deg, #6366f1, #8b5cf6);
    --grad-2: linear-gradient(135deg, #10b981, #06b6d4);
    --grad-3: linear-gradient(135deg, #f43f5e, #f97316);
    --grad-4: linear-gradient(135deg, #f59e0b, #ef4444);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #475569;

    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --sidebar-w: 260px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --radius-card: 20px;
    --radius-sm: 12px;
    --radius-xs: 8px;
}

*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    line-height: 1.6;
}

/* ============ AURORA BACKGROUND ============ */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 110%, rgba(139, 92, 246, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 50% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.app-layout {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.75rem 1.25rem;
    position: relative;
    flex-shrink: 0;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 1px; height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(99, 102, 241, 0.3), transparent);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}

.brand-logo {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    flex-shrink: 0;
    overflow: hidden;
    background: transparent;
}
.brand-logo img {
    width: 100%; height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.brand-name {
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #f1f5f9, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-name span {
    background: var(--grad-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Nav section label */
.nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 0 0.75rem;
    margin: 0.5rem 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-grow: 1;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 0.875rem;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    text-align: left;
    font-weight: 500;
    font-size: 0.875rem;
    font-family: var(--font-body);
    position: relative;
    width: 100%;
}

.nav-item svg { opacity: 0.7; flex-shrink: 0; transition: all 0.2s var(--ease); }

.nav-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}
.nav-item:hover svg { opacity: 1; color: var(--indigo-light); }

.nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--indigo-light);
    font-weight: 600;
}
.nav-item.active svg { opacity: 1; color: var(--indigo-light); }
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px;
    background: var(--indigo);
    border-radius: 0 3px 3px 0;
}

/* Sidebar footer */
.sidebar-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.user-profile {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-xs);
    cursor: default;
}

.user-avatar {
    width: 34px; height: 34px;
    background: var(--grad-1);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.875rem;
    flex-shrink: 0;
}

.user-name { font-size: 0.8125rem; font-weight: 600; line-height: 1.3; }
.user-status { font-size: 0.6875rem; color: var(--text-muted); line-height: 1.3; }

/* ============ MAIN CONTENT ============ */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-surface);
}

/* ============ TOP BAR ============ */
.top-bar {
    padding: 1.25rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(11, 17, 32, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.page-title h2 {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.page-title p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 1px;
}

.top-bar-actions { display: flex; gap: 0.75rem; align-items: center; }

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-xs);
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    display: inline-flex; align-items: center; gap: 0.5rem;
    border: none;
    font-family: var(--font-body);
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--indigo);
    color: #fff;
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
}
.btn-primary:not(:disabled):hover {
    background: #4f46e5;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-hover);
    color: var(--text-secondary);
    margin-top: 1.5rem;
}
.btn-outline:hover { background: rgba(99, 102, 241, 0.1); color: var(--indigo-light); border-color: var(--indigo); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============ CONTENT SCROLL ============ */
.content-scroll {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem 2.5rem;
    scrollbar-width: thin;
    scrollbar-color: #1e293b transparent;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #334155; }

/* ============ VIEW CONTAINERS ============ */
.view-container { display: none; }
.view-container.active {
    display: block;
    animation: viewIn 0.35s var(--ease);
}

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

/* ============ METRICS GRID ============ */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    cursor: default;
    transition: all 0.25s var(--ease);
    animation: cardIn 0.5s var(--ease) both;
}

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

.metric-card:nth-child(1) { animation-delay: 0.05s; }
.metric-card:nth-child(2) { animation-delay: 0.1s; }
.metric-card:nth-child(3) { animation-delay: 0.15s; }
.metric-card:nth-child(4) { animation-delay: 0.2s; }

.metric-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
    opacity: 0;
    transition: opacity 0.25s;
}

.metric-card:hover { border-color: var(--border-hover); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.metric-card:hover::before { opacity: 1; }

.metric-card[data-accent="indigo"]::before { background: linear-gradient(135deg, rgba(99,102,241,0.06), transparent); }
.metric-card[data-accent="emerald"]::before { background: linear-gradient(135deg, rgba(16,185,129,0.06), transparent); }
.metric-card[data-accent="rose"]::before { background: linear-gradient(135deg, rgba(244,63,94,0.06), transparent); }
.metric-card[data-accent="amber"]::before { background: linear-gradient(135deg, rgba(245,158,11,0.06), transparent); }

.metric-icon-wrap {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 1;
}
.ic-indigo { background: rgba(99, 102, 241, 0.15); }
.ic-emerald { background: rgba(16, 185, 129, 0.15); }
.ic-rose { background: rgba(244, 63, 94, 0.15); }
.ic-amber { background: rgba(245, 158, 11, 0.15); }

.metric-icon-wrap svg { width: 18px; height: 18px; }
.ic-indigo svg { color: var(--indigo-light); }
.ic-emerald svg { color: var(--emerald); }
.ic-rose svg { color: var(--rose); }
.ic-amber svg { color: var(--amber); }

.metric-value {
    font-family: var(--font-sans);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 0.375rem;
    position: relative; z-index: 1;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    position: relative; z-index: 1;
}

.metric-change {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 0.7rem; font-weight: 600;
    margin-top: 0.5rem; padding: 2px 6px;
    border-radius: 20px;
    position: relative; z-index: 1;
}
.change-up { background: rgba(16,185,129,0.12); color: var(--emerald); }
.change-val { font-family: var(--font-mono); }

/* ============ VISUALS GRID (CHARTS) ============ */
.visuals-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
}

.visual-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    backdrop-filter: blur(20px);
    transition: border-color 0.25s;
}
.visual-card:hover { border-color: var(--border-hover); }

.chart-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 1.25rem;
}

.chart-title {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.chart-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--indigo-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
    white-space: nowrap;
}

.chart-wrapper {
    height: 260px;
    width: 100%;
    position: relative;
}

.visual-card.span-2 { grid-column: span 2; }

/* ============ GRID VIEW ============ */
.grid-controls {
    display: flex; gap: 1rem; align-items: center;
    margin-bottom: 1.25rem;
}

.search-input-wrap {
    position: relative; flex-grow: 1;
}

.search-input-wrap svg {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); pointer-events: none;
}

.search-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }

.campaign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.campaign-card-premium {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    transition: all 0.25s var(--ease);
    position: relative;
    overflow: visible;
    backdrop-filter: blur(20px);
    animation: cardIn 0.4s var(--ease) both;
    display: flex;
    flex-direction: column;
}

.campaign-card-premium:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
}

/* Accent line at top of card */
.campaign-card-premium::before {
    content: '';
    position: absolute;
    top: 0; left: 1.5rem; right: 1.5rem;
    height: 2px;
    background: var(--grad-1);
    border-radius: 0 0 10px 10px;
    opacity: 0;
    transition: opacity 0.25s;
}
.campaign-card-premium:hover::before { opacity: 1; }

.card-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 1.25rem;
    gap: 0.75rem;
}

.card-name {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
}

.card-status-badge {
    flex-shrink: 0;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.2); }
.status-ended { background: rgba(244,63,94,0.1); color: #fb7185; border: 1px solid rgba(244,63,94,0.2); }
.status-paused { background: rgba(245,158,11,0.1); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }

.card-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-grow: 1;
    align-content: start;
}

.mini-metric {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 0.625rem 0.75rem;
}

.mini-metric label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.25rem;
}

.mini-metric span {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.card-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    flex-shrink: 0;
}

.spend-label { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.spend-value {
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 700;
    background: var(--grad-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============ LIST VIEW ============ */
.list-table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.table-actions {
    padding: 1.25rem 1.75rem;
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}

.table-actions h3 {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 700;
}

.table-search {
    position: relative;
}
.table-search input {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    width: 220px;
    transition: all 0.2s;
}
.table-search input::placeholder { color: var(--text-muted); }
.table-search input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }

.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; text-align: left; }

thead tr {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
}

th {
    padding: 0.875rem 1.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
th:hover { color: var(--text-secondary); }

td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(99, 130, 255, 0.05);
    vertical-align: middle;
}

.td-name { font-family: var(--font-sans); font-weight: 600; color: var(--text-primary); }
.td-num { font-family: var(--font-mono); font-size: 0.8125rem; }
.td-spend { font-family: var(--font-mono); font-weight: 700; color: var(--indigo-light); }
.td-na { color: var(--text-muted); font-size: 0.85rem; }

tbody tr { transition: background 0.15s; }
tbody tr:hover td { background: rgba(99, 102, 241, 0.04); }
tbody tr:last-child td { border-bottom: none; }

/* Badge in table */
.badge {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============ EMPTY STATE ============ */
.center-state {
    display: flex; align-items: center; justify-content: center;
    min-height: 70vh;
}

.drop-zone-premium {
    max-width: 480px; width: 100%;
    margin: 0 auto;
    text-align: center;
    padding: 3.5rem 2.5rem;
    border: 2px dashed rgba(99, 102, 241, 0.2);
    border-radius: 28px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    transition: all 0.3s var(--ease);
    position: relative;
    overflow: hidden;
}

.drop-zone-premium::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.06), transparent 70%);
    pointer-events: none;
}

.drop-zone-premium:hover, .drop-zone-premium.dragover {
    border-color: var(--indigo);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.12);
}

.drop-visual {
    position: relative;
    width: 90px; height: 90px;
    margin: 0 auto 2rem;
    display: flex; align-items: center; justify-content: center;
}

.drop-icon-bg {
    width: 72px; height: 72px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    color: var(--indigo-light);
    position: relative; z-index: 1;
}

.pulse-ring {
    position: absolute; inset: 0;
    border: 2px solid var(--indigo);
    border-radius: 24px;
    animation: pulseRing 2.5s ease-out infinite;
    opacity: 0;
}
.pulse-ring:nth-child(2) { animation-delay: 0.8s; }

@keyframes pulseRing {
    0% { transform: scale(0.9); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

.drop-zone-premium h2 {
    font-family: var(--font-sans);
    font-size: 1.375rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
}

.drop-zone-premium p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.drop-zone-premium .file-types {
    display: flex; justify-content: center; gap: 0.5rem; margin: 1rem 0;
}

.file-type-pill {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.2rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* ============ STATS STRIP (under heading) ============ */
.stats-strip {
    display: flex; align-items: center; gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0.875rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(10px);
    font-size: 0.8125rem;
}

.strip-item { display: flex; align-items: center; gap: 0.5rem; color: var(--text-secondary); }
.strip-dot { width: 6px; height: 6px; border-radius: 50%; }
.strip-val { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }
.strip-divider { width: 1px; height: 18px; background: var(--border); }

/* ============ HIDDEN ============ */
.hidden { display: none !important; }

/* ============ LOADING SHIMMER ============ */
.shimmer {
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(30,41,59,0.5) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-xs);
    height: 1rem;
}
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }

/* ============ GRID CONTROLS ============ */
.grid-controls {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.count-badge {
    background: rgba(99,102,241,0.12);
    color: var(--indigo-light);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 20px;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

/* ============ EXPANDABLE TABLE ROWS ============ */
.tr-expandable { cursor: pointer; }
.tr-expandable:hover .td-name { color: var(--indigo-light); }
.tr-expandable.tr-open .expand-icon { transform: rotate(90deg); color: var(--indigo-light); }

.expand-icon {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 1rem;
    color: var(--text-muted);
    transition: transform 0.2s var(--ease), color 0.2s;
    line-height: 1;
}

.tr-detail td {
    padding: 0 1rem 0.75rem 1rem !important;
    background: rgba(99,102,241,0.04);
    border-bottom: 1px solid var(--border);
}

.detail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    padding: 0.75rem 0.25rem;
}

.detail-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 100px;
}
.detail-cell span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.detail-cell strong {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* ============ CARD DETAIL PILLS ============ */
.card-detail-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0 0.25rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

.detail-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 20px;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.detail-pill-label {
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.card-date-row {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    padding-top: 0.35rem;
}
