*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #0A6B59;
    --primary-dark: #074D40;
    --primary-mid: #0D8A72;
    --primary-light: #E0F3EE;
    --primary-pale: #F2FAF7;
    --accent: #F5A623;
    --accent-light: #FEF5E4;
    --bg: #F4F7F5;
    --surface: #FFFFFF;
    --surface2: #F0F5F2;
    --text: #122820;
    --text2: #3D5A52;
    --text3: #7A9990;
    --border: #DCE8E3;
    --danger: #D9534F;
    --success: #28A745;
    --success-light: #E8F8EC;
    --sidebar-w: 240px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 1px 3px rgba(10,60,40,0.08), 0 1px 6px rgba(10,60,40,0.04);
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--primary-dark);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-mark {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-mid);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .logo-icon svg {
        width: 20px;
        height: 20px;
        fill: #fff;
    }

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: #fff;
}

.logo-sub {
    font-size: 10px;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
}

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    font-size: 10px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    padding: 12px 8px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.65);
    font-size: 13.5px;
    text-decoration: none;
}

    .nav-item:hover, .nav-item.active {
        background: rgba(255,255,255,0.12);
        color: #fff;
    }

    .nav-item svg {
        width: 16px;
        height: 16px;
        opacity: 0.8;
    }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.admin-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
}

.admin-name {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}

.admin-role {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}

/* ── MAIN & TOPBAR ── */
.main {
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 18px;
    color: var(--text);
}

.page-subtitle {
    font-size: 12px;
    color: var(--text3);
}

.content {
    padding: 24px 28px;
    flex: 1;
}

/* ── BUTTONS ── */
.btn-custom {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: 0.15s;
}

.btn-primary-custom {
    background: var(--primary);
    color: #fff;
}

    .btn-primary-custom:hover {
        background: var(--primary-mid);
    }

/* ── TABLES & BADGES ── */
.table-wrap {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
}

    .custom-table th {
        background: var(--surface2);
        padding: 12px 16px;
        text-align: left;
        font-size: 11.5px;
        font-weight: 500;
        color: var(--text3);
        text-transform: uppercase;
        border-bottom: 1px solid var(--border);
    }

    .custom-table td {
        padding: 12px 16px;
        font-size: 13.5px;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
    }

    .custom-table tr:hover {
        background: var(--primary-pale);
    }

.avatar-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 13px;
}

    .avatar.green {
        background: var(--primary-light);
        color: var(--primary);
    }

    .avatar.amber {
        background: var(--accent-light);
        color: #C47700;
    }

    .avatar.blue {
        background: #EFF6FF;
        color: #1D4ED8;
    }

    .avatar.purple {
        background: #F5F3FF;
        color: #6D28D9;
    }

    .avatar.rose {
        background: #FFF1F2;
        color: #BE123C;
    }

.cell-name {
    font-weight: 500;
    color: var(--text);
    font-size: 13.5px;
}

.cell-sub {
    font-size: 11.5px;
    color: var(--text3);
}

.pkr-val {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--primary);
}

.badge-custom {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
}

.badge-green {
    background: var(--success-light);
    color: #166534;
}

.badge-gray {
    background: var(--surface2);
    color: var(--text2);
}

/* ── TAB NAV ── */
.custom-nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.custom-tab {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text3);
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.2s;
}

    .custom-tab:hover {
        background: var(--surface2);
    }

    .custom-tab.active {
        background: var(--primary-light);
        color: var(--primary);
        font-weight: 600;
    }

/* ── UI FIXES & CONSISTENCY ── */
.page {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.topbar {
    flex-wrap: wrap;
    gap: 12px;
}

.letter-spacing-1 {
    letter-spacing: 0.08em;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.custom-table {
    min-width: 560px;
}

.form-control,
.form-select {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--primary-mid);
        box-shadow: 0 0 0 0.15rem rgba(13, 138, 114, 0.2);
    }

.card-accent {
    border-left: 4px solid var(--primary);
}

.card-soft {
    background-color: var(--surface2);
}

.form-header {
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-label-title {
    color: var(--text2);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-title {
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

/* ── MODAL ── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(18, 40, 32, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 2000;
}

    .modal-backdrop.open {
        display: flex;
    }

.modal {
    width: 100%;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border);
    overflow: hidden;
}

.modal-md {
    max-width: 600px;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface2);
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    color: var(--text3);
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

/* ── RESPONSIVE ── */
@media (max-width: 992px) {
    .content {
        padding: 18px;
    }

    .topbar {
        padding: 12px 18px;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 14px;
    }

    .page-title {
        font-size: 16px;
    }

    .page-subtitle {
        font-size: 11px;
    }

    .btn-custom {
        padding: 7px 12px;
        font-size: 12.5px;
    }
}
