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

/* ─── VARIABLES ─────────────────────────── */
:root {
    --navy: #0D2137;
    --navy-mid: #163050;
    --blue: #2563EB;
    --blue-hover: #1D4ED8;
    --blue-light: #EFF6FF;
    --red: #DC2626;
    --red-light: #FEF2F2;
    --green: #16A34A;
    --green-light: #F0FDF4;
    --amber: #D97706;
    --amber-light: #FFFBEB;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-700: #334155;
    --gray-900: #0F172A;
    --white: #FFFFFF;
    --sidebar-w: 270px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.10);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    color: var(--gray-700);
    background: var(--gray-50);
    line-height: 1.6;
}

a {
    text-decoration: none;
}

/* ─── LAYOUT ────────────────────────────── */
.page {
    display: flex;
    min-height: 100vh;
}

/* ─── SIDEBAR ───────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--navy);
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

/* LOGO */
.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px 26px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-decoration: none;
    gap: 14px;
}

.logo-img-wrapper {
    width: 84px;
    height: 84px;
    background: white;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.30);
}

    .logo-img-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.sidebar-logo-text {
    text-align: center;
}

    .sidebar-logo-text .brand {
        display: block;
        font-size: 18px;
        font-weight: 800;
        color: white;
        letter-spacing: 1px;
        line-height: 1.3;
    }

    .sidebar-logo-text .sub {
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: #E8303A;
        text-transform: uppercase;
        letter-spacing: 2px;
        margin-top: 2px;
    }

/* NAV */
.sidebar-nav {
    flex: 1;
    padding: 18px 12px;
    overflow-y: auto;
}

.nav-section-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-400);
    padding: 0 10px;
    margin: 22px 0 7px;
}

    .nav-section-label:first-child {
        margin-top: 4px;
    }

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.62);
    font-size: 15px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 3px;
    cursor: pointer;
}

    .nav-link:hover {
        background: rgba(255,255,255,0.08);
        color: white;
    }

    .nav-link.active {
        background: var(--blue);
        color: white;
    }

    .nav-link svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: 12px;
    color: var(--gray-400);
    text-align: center;
}

/* ─── MAIN CONTENT ──────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    background: var(--gray-50);
    padding: 36px 44px;
}

/* ─── HEADINGS ──────────────────────────── */
h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.4px;
}

h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}

h5 {
    font-size: 17px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 14px;
}

h6 {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}

p {
    font-size: 15px;
}

/* ─── CARDS ─────────────────────────────── */
.card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.card-body {
    padding: 22px 24px;
}

.card-title {
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--gray-400) !important;
    margin-bottom: 14px !important;
}

/* ─── TABLES ─────────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

    .table thead th {
        background: var(--navy);
        color: rgba(255,255,255,0.80);
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.7px;
        padding: 13px 18px;
        border-bottom: none;
        text-align: left;
        white-space: nowrap;
    }

    .table tbody tr {
        border-bottom: 1px solid var(--gray-100);
        transition: background 0.1s;
    }

        .table tbody tr:last-child {
            border-bottom: none;
        }

        .table tbody tr:hover {
            background: var(--gray-50);
        }

    .table tbody td {
        padding: 14px 18px;
        color: var(--gray-700);
        font-size: 15px;
        vertical-align: middle;
    }

.table-hover tbody tr {
    cursor: pointer;
}

.table-bordered {
    border: 1px solid var(--gray-200);
}

    .table-bordered td, .table-bordered th {
        border: 1px solid var(--gray-100);
    }

.table-light th {
    background: var(--navy) !important;
    color: rgba(255,255,255,0.80) !important;
}

/* ─── BADGES ─────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.bg-primary {
    background: var(--blue-light) !important;
    color: var(--blue) !important;
}

.bg-success {
    background: var(--green-light) !important;
    color: var(--green) !important;
}

.bg-warning {
    background: var(--amber-light) !important;
    color: var(--amber) !important;
}

.bg-danger {
    background: var(--red-light) !important;
    color: var(--red) !important;
}

.bg-secondary {
    background: var(--gray-100) !important;
    color: var(--gray-500) !important;
}

.bg-info {
    background: #F0F9FF !important;
    color: #0369A1 !important;
}

.bg-light {
    background: var(--gray-100) !important;
    color: var(--gray-500) !important;
}

.text-dark {
    color: inherit !important;
}

/* ─── BUTTONS ─────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary {
    background: var(--blue);
    color: white;
    border-color: var(--blue);
}

    .btn-primary:hover {
        background: var(--blue-hover);
        border-color: var(--blue-hover);
        color: white;
    }

.btn-success {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

    .btn-success:hover {
        background: #15803D;
        color: white;
    }

.btn-warning {
    background: #F59E0B;
    color: white;
    border-color: #F59E0B;
}

    .btn-warning:hover {
        background: var(--amber);
        color: white;
    }

.btn-danger {
    background: var(--red);
    color: white;
    border-color: var(--red);
}

    .btn-danger:hover {
        background: #B91C1C;
        color: white;
    }

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border-color: var(--gray-200);
}

    .btn-secondary:hover {
        background: var(--gray-200);
    }

.btn-outline-primary {
    background: transparent;
    color: var(--blue);
    border-color: var(--blue);
}

    .btn-outline-primary:hover {
        background: var(--blue);
        color: white;
    }

.btn-outline-secondary {
    background: transparent;
    color: var(--gray-500);
    border-color: var(--gray-300);
}

    .btn-outline-secondary:hover {
        background: var(--gray-100);
        color: var(--gray-700);
    }

.btn-outline-danger {
    background: transparent;
    color: var(--red);
    border-color: #FECACA;
}

    .btn-outline-danger:hover {
        background: var(--red-light);
    }

.btn-sm {
    padding: 6px 14px;
    font-size: 13.5px;
    border-radius: 5px;
}

.btn-lg {
    padding: 12px 26px;
    font-size: 16px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--blue);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    font-family: 'Inter', sans-serif;
    padding: 0;
}

/* ─── FORMS ──────────────────────────────── */
.form-control,
.form-select,
textarea.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    color: var(--gray-900);
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    line-height: 1.5;
}

    .form-control:focus,
    .form-select:focus,
    textarea.form-control:focus {
        border-color: var(--blue);
        box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
    }

    .form-control::placeholder {
        color: var(--gray-400);
    }

.form-control-sm, .form-select-sm {
    padding: 6px 11px;
    font-size: 14px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 7px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 9px;
}

.form-check-input {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--blue);
    flex-shrink: 0;
}

.form-check-label {
    font-size: 15px;
    color: var(--gray-700);
    cursor: pointer;
}

/* ─── ALERTS ──────────────────────────────── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    position: relative;
    line-height: 1.5;
}

.alert-success {
    background: var(--green-light);
    border: 1px solid #BBF7D0;
    color: #15803D;
}

.alert-danger {
    background: var(--red-light);
    border: 1px solid #FECACA;
    color: #B91C1C;
}

.alert-dismissible .btn-close {
    position: absolute;
    right: 14px;
    top: 14px;
    background: none;
    border: none;
    font-size: 17px;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    line-height: 1;
    padding: 0;
}

    .alert-dismissible .btn-close:hover {
        opacity: 1;
    }

/* ─── PROGRESS ────────────────────────────── */
.progress {
    background: var(--gray-100);
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--blue);
    border-radius: 99px;
    transition: width 0.4s ease;
}

.bg-success.progress-bar {
    background: var(--green);
}

/* ─── LIST GROUP ──────────────────────────── */
.list-group-flush .list-group-item {
    padding: 14px 22px;
    border: none;
    border-bottom: 1px solid var(--gray-100);
    font-size: 15px;
    color: var(--gray-700);
}

    .list-group-flush .list-group-item:last-child {
        border-bottom: none;
    }

/* ─── SPACING ──────────────────────────────── */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}

.col-md-2 {
    width: 16.66%;
    padding: 0 8px;
}

.col-md-3 {
    width: 25%;
    padding: 0 8px;
}

.col-md-4 {
    width: 33.33%;
    padding: 0 8px;
}

.col-md-6 {
    width: 50%;
    padding: 0 8px;
}

.col-md-8 {
    width: 66.66%;
    padding: 0 8px;
}

.col-md-12 {
    width: 100%;
    padding: 0 8px;
}

.g-2 {
    gap: 8px;
}

.g-3 {
    gap: 12px;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 10px;
}

.mb-3 {
    margin-bottom: 18px;
}

.mb-4 {
    margin-bottom: 26px;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 10px;
}

.mt-3 {
    margin-top: 18px;
}

.mt-4 {
    margin-top: 26px;
}

.me-1 {
    margin-right: 5px;
}

.me-2 {
    margin-right: 10px;
}

.ms-2 {
    margin-left: 10px;
}

.ms-3 {
    margin-left: 18px;
}

.p-0 {
    padding: 0;
}

/* ─── UTILITIES ──────────────────────────── */
.d-flex {
    display: flex;
}

.gap-1 {
    gap: 7px;
}

.gap-2 {
    gap: 12px;
}

.gap-3 {
    gap: 18px;
}

.flex-wrap {
    flex-wrap: wrap;
}

.align-items-center {
    align-items: center;
}

.align-items-start {
    align-items: flex-start;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-end {
    justify-content: flex-end;
}

.w-100 {
    width: 100%;
}

.w-auto {
    width: auto;
}

.fw-bold {
    font-weight: 700;
}

.small {
    font-size: 13px;
}

.text-muted {
    color: var(--gray-400) !important;
}

.text-center {
    text-align: center;
}

.text-end {
    text-align: right;
}

.border {
    border: 1.5px solid var(--gray-200) !important;
}

.border-danger {
    border-color: #FECACA !important;
}

.border-primary {
    border-color: #BFDBFE !important;
}

/* ─── BLAZOR ERROR ─────────────────────────── */
#blazor-error-ui {
    background: var(--navy);
    bottom: 0;
    left: 0;
    padding: 12px 20px;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: white;
    font-size: 14px;
    display: none;
}

    #blazor-error-ui .dismiss {
        float: right;
        cursor: pointer;
        font-size: 18px;
    }
