:root {
    --sidebar-width: 278px;
    --header-height: 82px;
    --surface: #ffffff;
    --surface-soft: #f5f7fb;
    --ink: #10203d;
    --muted: #6d7890;
    --line: #e5eaf2;
    --primary: #0f766e;
    --primary-dark: #0b5c56;
    --navy: #0b1739;
    --navy-soft: #15244c;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 25rem),
        var(--surface-soft);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

a {
    text-decoration: none;
}

.min-w-0 {
    min-width: 0;
}

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

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    width: var(--sidebar-width);
    flex-direction: column;
    overflow-y: auto;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(15, 118, 110, 0.17), transparent 38%),
        var(--navy);
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: #fff;
}

.brand-link:hover {
    color: #fff;
}

.brand-logo {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.25));
}

.brand-link strong {
    display: block;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.brand-link small {
    display: block;
    margin-top: 0.1rem;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72rem;
}

.sidebar-close {
    color: #fff;
}

.sidebar-nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.35rem 1rem;
}

.sidebar-label {
    padding: 0 0.8rem 0.5rem;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-height: 46px;
    padding: 0.7rem 0.85rem;
    border-radius: 0.85rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.93rem;
    font-weight: 600;
    transition: 0.2s ease;
}

.sidebar-link i {
    width: 22px;
    font-size: 1.08rem;
    text-align: center;
}

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

.sidebar-link.active {
    box-shadow: inset 3px 0 0 #34d399;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user small {
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-backdrop {
    display: none;
}

.app-main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    min-height: var(--header-height);
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(229, 234, 242, 0.9);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
}

.eyebrow {
    color: var(--primary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.page-title {
    font-size: clamp(1.3rem, 2vw, 1.7rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.btn-icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: #fff;
    color: var(--ink);
}

.btn-icon:hover {
    border-color: rgba(15, 118, 110, 0.25);
    background: rgba(15, 118, 110, 0.06);
    color: var(--primary);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 9px;
    height: 9px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #ef4444;
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 0;
    background: transparent;
}

.header-profile::after {
    margin-left: 0.25rem;
}

.header-profile strong,
.header-profile small {
    display: block;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-profile strong {
    font-size: 0.86rem;
}

.header-profile small {
    color: var(--muted);
    font-size: 0.7rem;
}

.avatar {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f766e, #34d399);
    color: #fff;
    font-weight: 800;
}

.avatar-sm {
    width: 38px;
    height: 38px;
    font-size: 0.78rem;
}

.avatar-lg {
    width: 58px;
    height: 58px;
    font-size: 1rem;
}

.avatar-xl {
    width: 92px;
    height: 92px;
    font-size: 1.8rem;
}

.app-content {
    min-height: calc(100vh - var(--header-height) - 64px);
    padding: 2rem;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 2rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
}

.panel-card,
.metric-card {
    border: 1px solid rgba(229, 234, 242, 0.9);
    border-radius: 1.1rem;
    box-shadow: var(--shadow);
}

.metric-card {
    height: 100%;
    overflow: hidden;
    background: var(--surface);
}

.metric-card .card-body {
    position: relative;
    padding: 1.35rem;
}

.metric-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 1rem;
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary);
    font-size: 1.35rem;
}

.metric-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.metric-value {
    margin: 0.35rem 0 0;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.hero-card {
    position: relative;
    overflow: hidden;
    border: 0;
    border-radius: 1.25rem;
    background:
        linear-gradient(120deg, rgba(10, 31, 75, 0.96), rgba(15, 118, 110, 0.92)),
        var(--navy);
    box-shadow: 0 18px 45px rgba(11, 23, 57, 0.2);
    color: #fff;
}

.hero-card::after {
    position: absolute;
    right: -6rem;
    bottom: -8rem;
    width: 22rem;
    height: 22rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    content: "";
    box-shadow: 0 0 0 3rem rgba(255, 255, 255, 0.04), 0 0 0 6rem rgba(255, 255, 255, 0.025);
}

.hero-card .card-body {
    position: relative;
    z-index: 1;
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.table {
    --bs-table-color: var(--ink);
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 1rem 0.9rem;
    border-bottom-color: var(--line);
    vertical-align: middle;
}

.table thead th {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.table-responsive {
    border-radius: 1rem;
}

.form-control,
.form-select {
    min-height: 46px;
    border-color: #dfe5ee;
    border-radius: 0.75rem;
}

textarea.form-control {
    min-height: auto;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 118, 110, 0.55);
    box-shadow: 0 0 0 0.25rem rgba(15, 118, 110, 0.1);
}

.form-label {
    color: #34425b;
    font-size: 0.82rem;
    font-weight: 700;
}

.btn {
    border-radius: 0.75rem;
    font-weight: 700;
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-dark);
    --bs-btn-hover-border-color: var(--primary-dark);
    --bs-btn-active-bg: var(--primary-dark);
    --bs-btn-active-border-color: var(--primary-dark);
}

.progress {
    height: 10px;
    border-radius: 999px;
    background: #e9eef5;
}

.progress-bar {
    background: linear-gradient(90deg, #0f766e, #22c55e);
}

.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0.38rem;
    width: 2px;
    background: var(--line);
    content: "";
}

.timeline-item {
    position: relative;
    padding: 0 0 1.4rem 1.1rem;
}

.timeline-item::before {
    position: absolute;
    top: 0.25rem;
    left: -1.36rem;
    width: 12px;
    height: 12px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2);
    content: "";
}

.empty-state {
    padding: 4rem 1.5rem;
    text-align: center;
}

.empty-state > i {
    display: block;
    margin-bottom: 1rem;
    color: #a7b2c5;
    font-size: 3rem;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
}

.notification-item.is-unread {
    background: rgba(15, 118, 110, 0.055);
}

.notification-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 0.85rem;
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary);
}

.auth-page {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1fr) minmax(450px, 0.8fr);
    background: #fff;
}

.auth-visual {
    position: relative;
    display: flex;
    min-height: 100vh;
    align-items: flex-end;
    overflow: hidden;
    padding: 4rem;
    background:
        linear-gradient(155deg, rgba(11, 23, 57, 0.7), rgba(15, 118, 110, 0.86)),
        url("https://images.unsplash.com/photo-1503387762-592deb58ef4e?auto=format&fit=crop&w=1600&q=85") center/cover;
    color: #fff;
}

.auth-visual::before {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 36px 36px;
    content: "";
}

.auth-visual-content {
    position: relative;
    z-index: 1;
    max-width: 620px;
}

.auth-panel {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 2.5rem;
}

.auth-card {
    width: min(100%, 520px);
}

.auth-logo {
    width: 58px;
    height: 58px;
}

.option-card {
    height: 100%;
    border: 1px solid var(--line);
    border-radius: 1rem;
    transition: 0.2s ease;
}

.option-card:hover {
    border-color: rgba(15, 118, 110, 0.35);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.option-card.selected {
    border: 2px solid var(--primary);
    background: rgba(15, 118, 110, 0.04);
}

.stat-ring {
    --value: 0;
    display: grid;
    width: 96px;
    height: 96px;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(closest-side, #fff 78%, transparent 80% 100%),
        conic-gradient(var(--primary) calc(var(--value) * 1%), #e7edf4 0);
    font-weight: 800;
}

.file-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: #fff;
    color: var(--ink);
}

.file-link:hover {
    border-color: rgba(15, 118, 110, 0.35);
    color: var(--primary);
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1030;
        display: block;
        visibility: hidden;
        background: rgba(5, 12, 30, 0.5);
        opacity: 0;
        transition: 0.25s ease;
    }

    .sidebar-open .sidebar-backdrop {
        visibility: visible;
        opacity: 1;
    }

    .app-main {
        margin-left: 0;
    }

    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .app-header,
    .app-content,
    .app-footer {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .app-footer {
        flex-direction: column;
    }

    .header-profile::after,
    .header-profile > span:last-of-type {
        display: none;
    }

    .table > :not(caption) > * > * {
        padding: 0.8rem 0.65rem;
    }
}


.text-bg-success-subtle {
    background-color: #dcfce7 !important;
    color: #166534 !important;
}

.text-bg-warning-subtle {
    background-color: #fef3c7 !important;
    color: #92400e !important;
}

.text-bg-danger-subtle {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.text-bg-info-subtle {
    background-color: #dbeafe !important;
    color: #1e40af !important;
}

.text-bg-secondary-subtle {
    background-color: #e5e7eb !important;
    color: #374151 !important;
}

@media print {
    .app-sidebar,
    .app-header,
    .app-footer,
    .btn,
    .sidebar-backdrop {
        display: none !important;
    }

    .app-main {
        margin: 0 !important;
    }

    .app-content {
        padding: 0 !important;
    }

    .panel-card,
    .metric-card {
        box-shadow: none !important;
        break-inside: avoid;
    }
}
