/* ===== Tokens ===== */
:root {
    --navy-950: #081a2c;
    --navy-900: #0b2239;
    --navy-800: #10304d;
    --navy-700: #17405f;
    --teal-700: #0b857d;
    --teal-600: #0f9d94;
    --teal-500: #14b8a6;
    --teal-200: #a7ebe3;
    --teal-100: #d9f5f1;
    --teal-50: #effaf8;

    --app-bg: #f3f7fa;
    --app-text: #1e3347;
    --app-muted: #6b7f92;
    --app-border: #e3ebf1;

    --bs-body-font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-bg: var(--app-bg);
    --bs-body-color: var(--app-text);
    --bs-secondary-color: var(--app-muted);
    --bs-border-color: var(--app-border);
    --bs-border-radius: .65rem;
    --bs-border-radius-lg: 1rem;

    --bs-primary: #0f9d94;
    --bs-primary-rgb: 15, 157, 148;
    --bs-link-color: #0b857d;
    --bs-link-color-rgb: 11, 133, 125;
    --bs-link-hover-color: #096b65;
    --bs-link-hover-color-rgb: 9, 107, 101;
}

body { font-size: .94rem; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { color: var(--navy-900); font-weight: 700; letter-spacing: -.01em; }

/* ===== Buttons ===== */
.btn { font-weight: 600; border-radius: .65rem; }
.btn-sm { border-radius: .55rem; }

.btn-primary {
    --bs-btn-bg: var(--teal-600);
    --bs-btn-border-color: var(--teal-600);
    --bs-btn-hover-bg: var(--teal-700);
    --bs-btn-hover-border-color: var(--teal-700);
    --bs-btn-active-bg: #09716a;
    --bs-btn-active-border-color: #09716a;
    --bs-btn-disabled-bg: var(--teal-600);
    --bs-btn-disabled-border-color: var(--teal-600);
    --bs-btn-focus-shadow-rgb: 15, 157, 148;
    box-shadow: 0 4px 12px rgba(15, 157, 148, .25);
}

.btn-outline-primary {
    --bs-btn-color: var(--teal-700);
    --bs-btn-border-color: #9fded8;
    --bs-btn-hover-bg: var(--teal-600);
    --bs-btn-hover-border-color: var(--teal-600);
    --bs-btn-active-bg: var(--teal-700);
    --bs-btn-active-border-color: var(--teal-700);
    --bs-btn-focus-shadow-rgb: 15, 157, 148;
}

.btn-outline-secondary {
    --bs-btn-color: #52677b;
    --bs-btn-border-color: #cfdbe5;
    --bs-btn-hover-bg: #eaf1f6;
    --bs-btn-hover-border-color: #cfdbe5;
    --bs-btn-hover-color: var(--navy-900);
}

/* ===== Cards ===== */
.card {
    border: 1px solid var(--app-border);
    border-radius: 1rem;
    background: #fff;
}
.card.shadow-sm { box-shadow: 0 1px 2px rgba(16, 48, 77, .04), 0 10px 28px rgba(16, 48, 77, .06) !important; }
.card .table-responsive { border-radius: 1rem; }
.card-footer { background: transparent; }

/* ===== Forms ===== */
.form-label { font-weight: 600; font-size: .85rem; color: #38506a; margin-bottom: .35rem; }
.form-control, .form-select, .input-group-text { padding: .62rem .9rem; border-color: #d5e1ea; }
.form-control:focus, .form-select:focus {
    border-color: var(--teal-500);
    box-shadow: 0 0 0 .25rem rgba(20, 184, 166, .18);
}
.form-check-input:checked { background-color: var(--teal-600); border-color: var(--teal-600); }
.form-check-input:focus { border-color: var(--teal-500); box-shadow: 0 0 0 .25rem rgba(20, 184, 166, .18); }

/* ===== Tables ===== */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--teal-50); --bs-table-hover-color: var(--app-text); }
.table > :not(caption) > * > * { padding: .8rem 1rem; border-bottom-color: var(--app-border); }
.table-light { --bs-table-bg: #f1f6f9; --bs-table-color: var(--app-muted); --bs-table-border-color: var(--app-border); }
.table thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
    color: var(--app-muted);
}

/* ===== Modal, alert, misc ===== */
.modal-content { border: 0; border-radius: 1.1rem; box-shadow: 0 24px 60px rgba(8, 26, 44, .25); }
.modal-header { border-bottom: 0; padding: 1.25rem 1.5rem .5rem; }
.modal-body { padding: .75rem 1.5rem; }
.modal-footer { border-top: 0; padding: .5rem 1.5rem 1.25rem; }
.modal-title { font-weight: 700; color: var(--navy-900); }

.alert { border: 0; border-radius: .8rem; }
.alert-success { background: var(--teal-100); color: #0a5f59; }
.alert-danger { background: #fde8ea; color: #9b1c2c; }

.badge { font-weight: 600; border-radius: 999px; padding: .4em .75em; }
.progress { background: #e6eef4; border-radius: 999px; }
.progress-bar.bg-success { background-color: var(--teal-500) !important; }
.breadcrumb { --bs-breadcrumb-divider-color: var(--app-muted); }

.page-link { color: var(--teal-700); border-color: var(--app-border); }
.page-item.active .page-link { background: var(--teal-600); border-color: var(--teal-600); }

/* ===== Sidebar ===== */
.sidebar { background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); }
@media (min-width: 992px) {
    .sidebar { position: sticky; top: 0; height: 100vh; }
}

.brand { display: flex; align-items: center; gap: .75rem; }
.brand-logo {
    width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center;
    font-size: 1.2rem; color: #fff;
    background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
    box-shadow: 0 6px 16px rgba(20, 184, 166, .35);
}
.brand-name { font-weight: 800; color: #fff; line-height: 1.1; letter-spacing: -.01em; }
.brand-sub { font-size: .72rem; color: #8fa6bb; }

.side-label {
    font-size: .68rem; letter-spacing: .09em; text-transform: uppercase;
    color: #6f8aa3; font-weight: 700; margin: 1.4rem .85rem .45rem;
}

.sidebar .nav-link {
    display: flex; align-items: center; gap: .75rem;
    color: #b8c8d8; font-weight: 500;
    padding: .62rem .85rem; border-radius: .75rem;
    position: relative; transition: background .15s, color .15s;
}
.sidebar .nav-link i { font-size: 1.1rem; opacity: .9; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar .nav-link.active { background: rgba(20, 184, 166, .16); color: #fff; font-weight: 600; }
.sidebar .nav-link.active i { color: var(--teal-500); opacity: 1; }
.sidebar .nav-link.active::before {
    content: ""; position: absolute; left: -1rem; top: 22%; bottom: 22%;
    width: 4px; border-radius: 0 4px 4px 0; background: var(--teal-500);
}

.user-card {
    display: flex; align-items: center; gap: .7rem;
    padding: .7rem; border-radius: .95rem;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .06);
}
.avatar {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700; font-size: .85rem; color: var(--navy-900);
    background: linear-gradient(135deg, var(--teal-200), var(--teal-500));
}
.user-name { color: #fff; font-weight: 600; font-size: .88rem; line-height: 1.2; }
.user-role { color: #8fa6bb; font-size: .74rem; text-transform: capitalize; }

.btn-logout {
    width: 100%; color: #c8d6e3; font-weight: 600;
    border: 1px solid rgba(255, 255, 255, .14); background: transparent;
    border-radius: .7rem; padding: .5rem;
}
.btn-logout:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.topbar { background: var(--navy-900); }

/* ===== Login ===== */
.auth-wrap { min-height: 100vh; display: flex; }

.auth-hero {
    flex: 1 1 52%; display: none; position: relative; overflow: hidden;
    color: #fff; padding: 3rem 3.5rem;
    background:
        radial-gradient(1000px 520px at 5% -10%, #1b5b73 0%, transparent 60%),
        linear-gradient(160deg, var(--navy-800), var(--navy-950));
}
@media (min-width: 992px) {
    .auth-hero { display: flex; flex-direction: column; justify-content: space-between; }
}
.auth-hero::before, .auth-hero::after { content: ""; position: absolute; border-radius: 50%; }
.auth-hero::before {
    width: 440px; height: 440px; right: -150px; bottom: -150px;
    background: radial-gradient(circle, rgba(20, 184, 166, .45), transparent 70%);
}
.auth-hero::after {
    width: 280px; height: 280px; left: -90px; top: 38%;
    background: radial-gradient(circle, rgba(94, 234, 212, .16), transparent 70%);
}
.auth-hero > * { position: relative; z-index: 1; }

.auth-title { font-size: 2.3rem; font-weight: 800; color: #fff; line-height: 1.2; letter-spacing: -.02em; }
.auth-title span { color: var(--teal-200); }
.auth-lead { color: #a9bdcf; max-width: 440px; }

.auth-feature { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.1rem; }
.auth-feature .ico {
    width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px;
    display: grid; place-items: center; font-size: 1.15rem; color: var(--teal-200);
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .09);
}
.auth-feature b { color: #fff; display: block; font-weight: 600; }
.auth-feature small { color: #93a9bd; }

.auth-panel {
    flex: 1 1 48%; display: flex; align-items: center; justify-content: center;
    padding: 2rem 1.25rem;
    background: linear-gradient(180deg, #fff 0%, var(--teal-50) 100%);
}
.auth-card { width: 100%; max-width: 400px; }

.input-icon .input-group-text { background: #f6fafc; color: var(--app-muted); border-right: 0; }
.input-icon .form-control { border-left: 0; }
.input-icon .btn-eye { border: 1px solid #d5e1ea; border-left: 0; background: #fff; color: var(--app-muted); }
.input-icon:focus-within .input-group-text,
.input-icon:focus-within .btn-eye { border-color: var(--teal-500); }