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

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

:root {
    --background: 210 33% 97%;
    --foreground: 221 39% 13%;
    --card: 0 0% 100%;
    --card-foreground: 221 39% 13%;
    --popover: 0 0% 100%;
    --popover-foreground: 221 39% 13%;
    --primary: 218 72% 45%;
    --primary-foreground: 0 0% 100%;
    --secondary: 210 22% 92%;
    --secondary-foreground: 221 39% 17%;
    --muted: 210 32% 95%;
    --muted-foreground: 219 15% 42%;
    --accent: 174 68% 37%;
    --accent-foreground: 0 0% 100%;
    --destructive: 0 72% 51%;
    --destructive-foreground: 0 0% 100%;
    --border: 214 27% 87%;
    --input: 214 27% 87%;
    --ring: 218 72% 45%;
    --radius: 1rem;
    --sidebar-background: 0 0% 98%;
    --sidebar-foreground: 240 5.3% 26.1%;
    --sidebar-primary: 240 5.9% 10%;
    --sidebar-primary-foreground: 0 0% 98%;
    --sidebar-accent: 240 4.8% 95.9%;
    --sidebar-accent-foreground: 240 5.9% 10%;
    --sidebar-border: 220 13% 91%;
    --sidebar-ring: 217.2 91.2% 59.8%;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    background-image:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.10), transparent 28%),
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.10), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(241, 245, 249, 0.95));
}

body {
    min-height: 100vh;
}

* { border-color: hsl(var(--border)); }

.sidebar-collapsed { width: 3.5rem !important; }
.sidebar-expanded { width: 16rem; }
.sidebar-transition { transition: width 0.2s ease, transform 0.25s ease; }

.app-shell {
    position: relative;
}

.app-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.08), transparent 18%),
        radial-gradient(circle at 85% 10%, rgba(20, 184, 166, 0.07), transparent 20%);
}

.app-sidebar {
    position: relative;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.98)),
        linear-gradient(180deg, #0f172a, #1e293b);
    box-shadow: 18px 0 48px rgba(15, 23, 42, 0.22);
}

.app-sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 24%),
        radial-gradient(circle at bottom left, rgba(129, 140, 248, 0.14), transparent 26%);
    pointer-events: none;
}

.app-sidebar-brand,
.app-user-card,
.app-sidebar-nav,
.app-sidebar-footer {
    position: relative;
    z-index: 1;
}

.app-header {
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 30px rgba(148, 163, 184, 0.12);
}

.app-brand img {
    box-shadow: 0 12px 24px rgba(59, 130, 246, 0.18);
}

.app-main {
    position: relative;
}

.dashboard-shell {
    position: relative;
    max-width: 1440px;
}

.dashboard-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
    gap: 1.25rem;
    padding: 1.6rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.75rem;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.90)),
        linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(249, 115, 22, 0.18));
    color: #f8fafc;
    box-shadow: 0 28px 64px rgba(15, 23, 42, 0.20);
    overflow: hidden;
}

.dashboard-hero--compact h2 {
    max-width: 15ch;
}

.dashboard-hero::before,
.dashboard-hero::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(8px);
    pointer-events: none;
}

.dashboard-hero::before {
    width: 260px;
    height: 260px;
    top: -80px;
    right: -40px;
    background: rgba(20, 184, 166, 0.16);
}

.dashboard-hero::after {
    width: 220px;
    height: 220px;
    bottom: -90px;
    left: -70px;
    background: rgba(245, 158, 11, 0.14);
}

.dashboard-hero-copy,
.dashboard-hero-panel {
    position: relative;
    z-index: 1;
}

.dashboard-eyebrow {
    display: inline-flex;
    margin-bottom: 0.85rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.dashboard-hero h2 {
    margin: 0;
    max-width: 12ch;
    font-size: clamp(1.9rem, 4vw, 3.35rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
}

.dashboard-hero p {
    margin: 1rem 0 0;
    max-width: 62ch;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.98rem;
    line-height: 1.75;
}

.dashboard-hero-pills,
.dashboard-filter-row,
.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dashboard-hero-pills {
    margin-top: 1.1rem;
}

.dashboard-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    font-weight: 700;
}

.dashboard-hero-panel {
    display: grid;
    gap: 0.85rem;
    align-content: center;
}

.hero-mini-stat {
    padding: 1rem 1.1rem;
    border-radius: 1.3rem;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}

.hero-mini-label {
    display: block;
    margin-bottom: 0.45rem;
    color: rgba(255, 255, 255, 0.70);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.hero-mini-stat strong {
    font-size: 1.65rem;
    line-height: 1;
}

.dashboard-metrics {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-metrics--viewer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    min-height: 132px;
    padding: 1.15rem 1.2rem;
    border-radius: 1.4rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 18px 40px rgba(148, 163, 184, 0.16);
    backdrop-filter: blur(18px);
}

.metric-card--blue { background: linear-gradient(135deg, rgba(219, 234, 254, 0.88), rgba(255, 255, 255, 0.86)); }
.metric-card--teal { background: linear-gradient(135deg, rgba(204, 251, 241, 0.88), rgba(255, 255, 255, 0.86)); }
.metric-card--amber { background: linear-gradient(135deg, rgba(254, 243, 199, 0.90), rgba(255, 255, 255, 0.88)); }
.metric-card--rose { background: linear-gradient(135deg, rgba(255, 228, 230, 0.90), rgba(255, 255, 255, 0.88)); }

.metric-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 1.1rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(29, 78, 216, 0.92));
    box-shadow: 0 16px 28px rgba(37, 99, 235, 0.26);
    flex-shrink: 0;
}

.metric-card--teal .metric-icon {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.95), rgba(15, 118, 110, 0.92));
    box-shadow: 0 16px 28px rgba(13, 148, 136, 0.22);
}

.metric-card--amber .metric-icon {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.95), rgba(180, 83, 9, 0.92));
    box-shadow: 0 16px 28px rgba(217, 119, 6, 0.22);
}

.metric-card--rose .metric-icon {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.95), rgba(190, 24, 93, 0.92));
    box-shadow: 0 16px 28px rgba(225, 29, 72, 0.18);
}

.metric-copy {
    min-width: 0;
}

.metric-label {
    display: block;
    margin-bottom: 0.35rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.metric-value {
    display: block;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    line-height: 1;
    letter-spacing: -0.05em;
}

.metric-note {
    display: block;
    margin-top: 0.4rem;
    color: #475569;
    font-size: 0.83rem;
}

.dashboard-toolbar,
.activity-card,
.premium-table-wrap {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 20px 40px rgba(148, 163, 184, 0.14);
    backdrop-filter: blur(18px);
}

.dashboard-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}

.dashboard-search-wrap {
    flex: 1 1 440px;
}

.dashboard-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 1rem;
    background: rgba(248, 250, 252, 0.9);
}

.dashboard-search:focus-within {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10);
}

.dashboard-filter-row {
    margin-top: 0.85rem;
}

.dashboard-filter-chip,
.dashboard-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.6rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.88);
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.dashboard-filter-chip:hover,
.dashboard-action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(148, 163, 184, 0.16);
}

.dashboard-filter-chip--accent,
.dashboard-action-button--primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: transparent;
    color: #fff;
}

.dashboard-filter-chip--warn {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-color: transparent;
    color: #fff;
}

.dashboard-filter-chip--active,
.dashboard-action-button--indigo {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    border-color: transparent;
    color: #fff;
}

.dashboard-action-button--ghost {
    background: rgba(248, 250, 252, 0.88);
}

.dashboard-selection {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 0.95rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 800;
}

.premium-table-wrap {
    overflow: hidden;
}

.premium-table-wrap table {
    border-collapse: separate;
    border-spacing: 0;
}

.premium-table-wrap thead tr {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.88));
}

.premium-table-wrap tbody tr {
    transition: transform 0.18s ease, background 0.18s ease;
}

.premium-table-row:hover {
    transform: translateY(-1px);
}

.activity-card {
    position: relative;
    overflow: hidden;
}

.activity-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.05), transparent 40%);
    pointer-events: none;
}

@media (max-width: 1100px) {
    .dashboard-hero,
    .dashboard-metrics,
    .dashboard-metrics--viewer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .dashboard-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-actions {
        width: 100%;
    }

    .dashboard-action-button {
        flex: 1 1 180px;
    }
}

@media (max-width: 640px) {
    .dashboard-shell {
        padding-top: 1rem;
    }

    .dashboard-hero {
        padding: 1.2rem;
        border-radius: 1.35rem;
    }

    .dashboard-hero h2 {
        max-width: none;
        font-size: 1.9rem;
    }

    .metric-card {
        min-height: auto;
    }

    .dashboard-toolbar,
    .activity-card,
    .premium-table-wrap {
        border-radius: 1.2rem;
    }
}
