
:root {
    --navy: #0b2447;
    --navy-2: #19376d;
    --navy-3: #244a83;
    --surface: #f4f6fb;
    --surface-2: #eef2f8;
    --card: #ffffff;
    --border: #dfe5ee;
    --text: #172033;
    --muted: #6b7280;
    --success-soft: #eaf8f1;
    --warning-soft: #fff7df;
    --danger-soft: #fff0f0;
    --info-soft: #edf6ff;
    --radius: .85rem;
    --shadow: 0 .35rem 1.25rem rgba(15, 23, 42, .065);
    --sidebar-width: 248px;
}

html { scroll-behavior: smooth; }

body {
    background: var(--surface);
    color: var(--text);
    font-size: .925rem;
    min-height: 100vh;
}

a { text-underline-offset: 2px; }

.bg-navy,
.btn-navy {
    background-color: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.btn-navy:hover,
.btn-navy:focus {
    background-color: var(--navy-2);
    border-color: var(--navy-2);
    color: #fff;
}

.app-navbar {
    min-height: 58px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, .12);
    z-index: 1035;
}

.app-navbar .navbar-brand {
    letter-spacing: -.02em;
}

.app-user {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.app-user-badge {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .3rem .65rem;
    border-radius: 999px;
    background: rgba(255,255,255,.09);
    white-space: nowrap;
}

.app-avatar {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    font-size: .85rem;
}

.sidebar {
    min-height: calc(100vh - 58px);
    background: #fff;
    border-right: 1px solid var(--border);
    position: sticky;
    top: 58px;
    height: calc(100vh - 58px);
    overflow-y: auto;
}

.sidebar-inner {
    padding: 1.05rem .8rem 2rem;
}

.sidebar-section-title {
    margin: 1.25rem .65rem .45rem;
    color: #8a94a6;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sidebar-section-title:first-child {
    margin-top: .25rem;
}

.nav-link-side {
    display: flex;
    gap: .72rem;
    align-items: center;
    padding: .65rem .72rem;
    margin-bottom: .12rem;
    border-radius: .65rem;
    color: #445066;
    text-decoration: none;
    font-weight: 500;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.nav-link-side i {
    width: 1.15rem;
    text-align: center;
    font-size: 1rem;
}

.nav-link-side:hover {
    background: #f0f4fb;
    color: var(--navy);
    transform: translateX(2px);
}

.nav-link-side.active {
    color: var(--navy);
    background: #eaf0fa;
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--navy);
}

.nav-link-side.disabled {
    opacity: .45;
    cursor: not-allowed;
}

.app-main {
    min-width: 0;
    padding: 1.5rem 1.65rem 3rem !important;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-header h1,
.app-main > .d-flex h1 {
    letter-spacing: -.025em;
    color: #15233c;
}

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

/* Cards */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--card);
    overflow: hidden;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: .82rem 1rem;
    color: #24314a;
}

.card-body { padding: 1rem; }
.card-footer {
    background: #fbfcfe;
    border-top: 1px solid var(--border);
}

.stat-card {
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    height: 100%;
}

.stat-card .display-6 {
    font-size: 2rem;
    letter-spacing: -.04em;
}

/* Forms */
.form-label {
    color: #4d596f;
    font-size: .78rem;
    font-weight: 650;
    margin-bottom: .32rem;
}

.form-control,
.form-select {
    min-height: 39px;
    border-color: #d7deea;
    border-radius: .58rem;
    background-color: #fff;
    font-size: .88rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #7d9cc9;
    box-shadow: 0 0 0 .2rem rgba(25,55,109,.10);
}

textarea.form-control { min-height: 88px; }

input[type="file"].form-control {
    padding: .35rem .45rem;
}

input[type="file"].form-control::file-selector-button {
    border: 0;
    border-right: 1px solid #d7deea;
    background: #f3f6fa;
    color: #334155;
    margin: -.35rem .7rem -.35rem -.45rem;
    padding: .52rem .75rem;
}

/* Buttons */
.btn {
    border-radius: .58rem;
    font-weight: 600;
    font-size: .84rem;
}

.btn-sm {
    border-radius: .48rem;
    font-size: .78rem;
}

.btn-group > .btn {
    box-shadow: none !important;
}

/* Alerts */
.alert {
    border-radius: .7rem;
    border-width: 1px;
    box-shadow: 0 .15rem .65rem rgba(15,23,42,.035);
}

.alert-info { background: var(--info-soft); }
.alert-success { background: var(--success-soft); }
.alert-warning { background: var(--warning-soft); }
.alert-danger { background: var(--danger-soft); }

/* Tables - global modernization */
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: #b8c2d1 transparent;
}

.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-thumb {
    background: #b8c2d1;
    border-radius: 999px;
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
    color: #27334a;
}

.table > :not(caption) > * > * {
    border-bottom-color: #e7ebf2;
    padding: .72rem .78rem;
    vertical-align: middle;
}

.table thead th {
    position: relative;
    background: #f8fafc;
    color: #475569;
    font-size: .73rem;
    font-weight: 750;
    letter-spacing: .015em;
    white-space: nowrap;
    border-bottom: 1px solid #dbe2ec;
}

.table tbody tr {
    transition: background .12s ease;
}

.table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: #f7faff;
}

.table .small { line-height: 1.35; }

.table td .badge,
.table th .badge {
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .01em;
}

/* Make very wide tables usable without breaking layout */
.table-responsive > .table {
    min-width: max-content;
    width: 100%;
}

.table-responsive .table th,
.table-responsive .table td {
    max-width: 320px;
}

/* First cell easier to follow when horizontal scrolling */
@media (min-width: 992px) {
    .table-responsive[data-sticky-first="1"] table th:first-child,
    .table-responsive[data-sticky-first="1"] table td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        background: #fff;
        box-shadow: 1px 0 0 #e5eaf1;
    }

    .table-responsive[data-sticky-first="1"] table thead th:first-child {
        z-index: 4;
        background: #f8fafc;
    }
}

/* Pagination */
.pagination {
    flex-wrap: wrap;
    gap: .2rem;
}

.page-link {
    border-radius: .48rem !important;
    border-color: #dce3ed;
    color: var(--navy-2);
    min-width: 34px;
    text-align: center;
    font-size: .8rem;
}

.page-item.active .page-link {
    background: var(--navy);
    border-color: var(--navy);
}

/* Dropdowns */
.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: .7rem;
    box-shadow: 0 .6rem 1.8rem rgba(15,23,42,.12);
    padding: .4rem;
}

.dropdown-item {
    border-radius: .45rem;
    font-size: .84rem;
    padding: .5rem .65rem;
}

/* Tabs */
.nav-tabs {
    border-bottom-color: var(--border);
    gap: .2rem;
}

.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-weight: 600;
    font-size: .85rem;
}

.nav-tabs .nav-link.active {
    color: var(--navy);
    border-bottom-color: var(--navy);
    background: transparent;
}

/* Modals */
.modal-content {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(15,23,42,.18);
}

.modal-header,
.modal-footer {
    border-color: var(--border);
}

/* Empty states */
.table tbody td[colspan] {
    color: var(--muted);
}

/* Login */
.login-page {
    min-height: 100vh;
    padding: 1rem;
    background: linear-gradient(135deg, #071b37, #19376d);
}

.login-card {
    width: min(100%, 430px);
    border: 0;
    border-radius: 1rem;
}

.brand-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 1rem;
    background: #eaf0ff;
    color: var(--navy);
    font-size: 2rem;
}

/* Utility enhancements */
.badge {
    border-radius: .42rem;
}

code {
    color: #be185d;
    background: #fdf2f8;
    padding: .12rem .3rem;
    border-radius: .3rem;
}

.offcanvas.app-mobile-sidebar {
    width: min(86vw, 300px);
}

.offcanvas.app-mobile-sidebar .offcanvas-header {
    border-bottom: 1px solid var(--border);
}

.offcanvas.app-mobile-sidebar .offcanvas-body {
    padding: 0;
}

/* Responsive */
@media (max-width: 991.98px) {
    .app-main {
        padding: 1rem .85rem 2.5rem !important;
    }

    .app-user-badge .app-user-meta {
        display: none;
    }

    .page-header,
    .app-main > .d-flex.justify-content-between {
        align-items: flex-start !important;
        flex-direction: column;
    }

    .app-main > .d-flex.justify-content-between > .btn,
    .page-header > .btn {
        width: 100%;
    }

    .card-body { padding: .85rem; }

    .table > :not(caption) > * > * {
        padding: .62rem .65rem;
    }

    .table-responsive {
        border-radius: 0 0 var(--radius) var(--radius);
    }
}

@media (max-width: 575.98px) {
    body { font-size: .88rem; }

    .navbar-brand { font-size: .98rem; }

    .app-main h1.h3 { font-size: 1.35rem; }

    .stat-card .display-6 { font-size: 1.65rem; }

    .btn:not(.btn-sm) { min-height: 39px; }

    .pagination .page-link {
        min-width: 32px;
        padding: .35rem .5rem;
    }
}


/* Release 11.1 — module refinements */
.module-tabs .nav-link {
    padding: .72rem .9rem;
}
.module-tabs .badge {
    vertical-align: middle;
}
.table td .text-warning {
    color: #b7791f !important;
}
