:root {
    --bg-1: #f5f7fb;
    --bg-2: #eef4f8;
    --surface: #ffffff;
    --surface-soft: rgba(255, 255, 255, 0.78);
    --text-1: #0f172a;
    --text-2: #475569;
    --line: rgba(15, 23, 42, 0.08);
    --brand: #0f766e;
    --brand-2: #f97316;
    --brand-3: #1d4ed8;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    --radius-xl: 1.5rem;
    --radius-lg: 1rem;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-1);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.12), transparent 24%),
        linear-gradient(180deg, var(--bg-1), var(--bg-2));
    min-height: 100vh;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
}

.guest-navbar {
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.75);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.hero-panel,
.soft-card,
.chart-card,
.surface-card,
.table-card,
.form-card {
    background: var(--surface-soft);
    border: 1px solid rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    border-radius: var(--radius-xl);
}

.hero-panel {
    padding: 2rem;
}

.hero-grid {
    min-height: 440px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .55rem .9rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: var(--brand);
    font-weight: 700;
    letter-spacing: .02em;
}

.hero-title {
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1.05;
    font-weight: 800;
}

.hero-gradient {
    background: linear-gradient(120deg, #0f766e, #1d4ed8 55%, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.metric-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.metric-box {
    border-radius: 1.25rem;
    padding: 1.1rem;
    background: #fff;
    border: 1px solid var(--line);
}

.metric-box .value {
    font-size: 1.6rem;
    font-weight: 800;
}

.feature-tile {
    border-radius: 1.25rem;
    background: #fff;
    border: 1px solid var(--line);
    padding: 1.15rem;
    height: 100%;
}

.feature-icon,
.stat-icon,
.quick-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    color: #fff;
    font-size: 1.25rem;
}

.gradient-brand {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.gradient-blue {
    background: linear-gradient(135deg, #1d4ed8, #38bdf8);
}

.gradient-orange {
    background: linear-gradient(135deg, #ea580c, #fb923c);
}

.gradient-dark {
    background: linear-gradient(135deg, #0f172a, #334155);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 290px;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(15, 118, 110, 0.9)),
        linear-gradient(180deg, #0f172a, #0f766e);
    color: #fff;
    padding: 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1.4rem;
    background: rgba(255, 255, 255, 0.06);
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #14b8a6, #fb923c);
    font-weight: 800;
    font-size: 1.25rem;
}

.brand-title {
    font-weight: 800;
    font-size: 1rem;
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: .875rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .9rem 1rem;
    border-radius: 1rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all .2s ease;
    margin-bottom: .4rem;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.11);
    transform: translateX(4px);
}

.app-main {
    flex: 1;
    min-width: 0;
}

.topbar {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: .9rem;
    min-width: 0;
}

.topbar-user .text-end {
    min-width: 0;
}

.avatar-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #14b8a6, #f97316);
    color: #fff;
    font-weight: 800;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .72rem;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: .2rem;
}

.page-title {
    font-size: clamp(1.3rem, 3vw, 2rem);
}

.app-content {
    padding-bottom: 3rem !important;
}

.dashboard-hero {
    padding: 2rem;
    border-radius: 1.75rem;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.35), transparent 34%),
        radial-gradient(circle at bottom right, rgba(249, 115, 22, 0.3), transparent 32%),
        linear-gradient(135deg, #0f172a, #134e4a);
    color: #fff;
    box-shadow: var(--shadow);
}

.stat-card,
.quick-card,
.info-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: 1.35rem;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    height: 100%;
}

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

.chart-card,
.table-card,
.form-card,
.surface-card {
    padding: 1.4rem;
}

.chart-frame {
    position: relative;
    width: 100%;
    min-height: 320px;
    height: 320px;
}

.chart-frame.chart-frame-sm {
    min-height: 260px;
    height: 260px;
}

.chart-frame canvas {
    width: 100% !important;
    height: 100% !important;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 800;
}

.section-subtitle {
    color: var(--text-2);
}

.progress {
    --bs-progress-height: .7rem;
    background: rgba(148, 163, 184, 0.2);
}

.table thead th {
    border-bottom-width: 1px;
    color: var(--text-2);
    font-weight: 700;
}

.table td,
.table th,
.footer-note,
.section-subtitle,
.topbar-user .fw-semibold,
.topbar-user small,
.list-card p,
.alert {
    overflow-wrap: anywhere;
}

.empty-state {
    border: 2px dashed rgba(148, 163, 184, 0.35);
    border-radius: 1.25rem;
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--text-2);
    background: rgba(255, 255, 255, 0.54);
}

.quick-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 1.1rem;
    background: #fff;
    border: 1px solid var(--line);
    margin-bottom: .75rem;
}

.list-card {
    border-radius: 1.1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--line);
}

.soft-badge {
    display: inline-flex;
    align-items: center;
    padding: .45rem .75rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--brand);
    font-weight: 700;
}

.auth-card {
    max-width: 520px;
    margin: 0 auto;
}

.form-label {
    font-weight: 600;
}

.table-responsive {
    border-radius: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.footer-note {
    color: var(--text-2);
    font-size: .9rem;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.section-head-main,
.section-head-actions {
    min-width: 0;
}

.section-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    justify-content: flex-end;
}

.section-head-actions .section-search {
    width: min(100%, 340px);
}

.section-search {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    width: 100%;
}

.section-search > * {
    min-width: 0;
}

.section-search > .flex-grow-1 {
    flex: 1 1 220px;
}

.section-search .form-control,
.section-search .form-select {
    flex: 1 1 220px;
    min-width: 0;
}

.section-search .btn {
    flex: 0 0 auto;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    flex-wrap: wrap;
}

[data-confirm] {
    cursor: pointer;
}

@media (max-width: 991.98px) {
    .metric-stack {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        padding: 1.4rem;
    }

    .hero-grid {
        min-height: auto;
    }

    .topbar {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-user {
        width: 100%;
        justify-content: space-between;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .topbar-user .text-end {
        text-align: left !important;
    }

    .dashboard-hero,
    .chart-card,
    .table-card,
    .form-card,
    .surface-card {
        padding: 1.15rem;
    }

    .section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .section-head-actions,
    .section-head .btn,
    .section-head-actions .btn {
        width: 100%;
    }

    .section-search {
        flex-direction: column;
    }

    .section-search .form-control,
    .section-search .form-select,
    .section-search .btn {
        width: 100%;
        flex-basis: auto;
    }

    .form-actions > * {
        flex: 1 1 100%;
    }

    .quick-action {
        flex-direction: column;
        align-items: flex-start;
    }

    .quick-action i {
        align-self: flex-end;
    }

    .list-card > .d-flex {
        flex-wrap: wrap;
    }

    .chart-frame {
        min-height: 260px;
        height: 260px;
    }

    .chart-frame.chart-frame-sm {
        min-height: 220px;
        height: 220px;
    }
}

@media (max-width: 575.98px) {
    .hero-panel,
    .dashboard-hero {
        padding: 1.2rem;
    }

    .chart-card,
    .table-card,
    .form-card,
    .surface-card,
    .soft-card {
        border-radius: 1.1rem;
    }

    .app-content {
        padding-top: 1rem !important;
        padding-bottom: 2rem !important;
    }

    .chart-frame {
        min-height: 220px;
        height: 220px;
    }

    .chart-frame.chart-frame-sm {
        min-height: 200px;
        height: 200px;
    }

    .feature-icon,
    .stat-icon,
    .quick-icon,
    .avatar-badge,
    .brand-mark {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .metric-box .value,
    .stat-value {
        font-size: 1.6rem;
    }
}
