* {
    box-sizing: border-box;
}

:root {
    --brand: #0f766e;
    --brand-dark: #115e59;
    --accent: #f59e0b;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --soft: #f8fafc;
    --panel: rgba(255, 255, 255, .92);
    --shadow: 0 18px 45px rgba(15, 23, 42, .10);
    --shadow-sm: 0 8px 22px rgba(15, 23, 42, .08);
}

body {
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, .14), transparent 34rem),
        linear-gradient(135deg, #f8fafc 0%, #eef7f6 44%, #f7f4ed 100%) !important;
    color: var(--ink);
    min-height: 100vh;
}

a,
.btn {
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.brand-lockup {
    align-items: center;
    display: flex;
    gap: .75rem;
}

.brand-mark {
    align-items: center;
    background: linear-gradient(135deg, var(--brand), #14b8a6);
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(15, 118, 110, .26);
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-weight: 800;
    height: 44px;
    justify-content: center;
    letter-spacing: .5px;
    width: 44px;
}

.brand-title {
    color: inherit;
    font-weight: 800;
    line-height: 1.05;
}

.brand-subtitle {
    color: rgba(255, 255, 255, .62);
    font-size: .78rem;
}

.sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #134e4a 100%) !important;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, .08);
}

.sidebar nav a {
    border-radius: 10px;
    padding: .7rem .85rem;
    transform-origin: left center;
}

.sidebar nav a:hover {
    background: rgba(255, 255, 255, .10);
    transform: translateX(4px) scale(1.035);
}

.card {
    background: var(--panel);
    border: 1px solid rgba(226, 232, 240, .86) !important;
    border-radius: 14px;
    box-shadow: var(--shadow-sm) !important;
    display: flex;
    max-height: min(72vh, 720px);
    overflow: hidden;
}

.card > .card-body {
    overflow: auto;
    scrollbar-color: rgba(15, 118, 110, .38) transparent;
    scrollbar-width: thin;
}

.card > .card-body::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.card > .card-body::-webkit-scrollbar-thumb {
    background: rgba(15, 118, 110, .38);
    border-radius: 999px;
}

.card > .card-body::-webkit-scrollbar-track {
    background: transparent;
}

.card:hover {
    box-shadow: var(--shadow) !important;
    transform: translateY(-2px) scale(1.006);
}

.stat-card {
    max-height: none;
    position: relative;
}

.stat-card > .card-body {
    overflow: visible;
}

.stat-card::before {
    background: linear-gradient(90deg, var(--brand), var(--accent));
    content: "";
    display: block;
    height: 4px;
    inset: 0 0 auto;
    position: absolute;
}

.stat-card h3 {
    color: var(--ink);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand), #14b8a6);
    border-color: transparent;
    box-shadow: 0 10px 18px rgba(15, 118, 110, .20);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
    border-color: transparent;
    box-shadow: 0 14px 24px rgba(15, 118, 110, .26);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    background: #fff;
    border-color: var(--line);
    color: #334155;
}

.btn-outline-secondary:hover {
    background: var(--soft);
    border-color: #cbd5e1;
    color: var(--ink);
    transform: translateY(-1px) scale(1.01);
}

.btn-dark {
    background: var(--ink);
    border-color: var(--ink);
}

.btn-dark:hover {
    transform: translateY(-1px) scale(1.01);
}

.btn-sm:hover {
    transform: translateY(-1px) scale(1.035);
}

.form-control,
.form-select {
    border-color: var(--line);
    border-radius: 10px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 118, 110, .55);
    box-shadow: 0 0 0 .22rem rgba(15, 118, 110, .14);
}

.table {
    --bs-table-hover-bg: rgba(15, 118, 110, .055);
}

.table thead th {
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: .78rem;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.table-responsive {
    max-height: min(54vh, 560px);
    overflow: auto;
    scrollbar-color: rgba(15, 118, 110, .38) transparent;
    scrollbar-width: thin;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(15, 118, 110, .38);
    border-radius: 999px;
}

.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

.table-responsive thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.table tbody tr {
    animation: rowIn .28s ease both;
}

.badge {
    border-radius: 999px;
    font-weight: 700;
    padding: .45em .7em;
}

.page-header,
.card,
.stat-card {
    animation: fadeUp .34s ease both;
}

.login-card {
    backdrop-filter: blur(16px);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rowIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 991.98px) {
    .sidebar nav a:hover {
        transform: translateY(-1px) scale(1.025);
    }

    .card {
        max-height: min(76vh, 680px);
    }

    .table-responsive {
        max-height: 52vh;
    }
}
