:root {
    --brand-primary: #1f4e79;
    --brand-secondary: #274060;
    --brand-sidebar: #16213e;
    --brand-topbar: #ffffff;
    --brand-card: #ffffff;
    --brand-button: #1f4e79;
}

body { background: #f4f7fb; color: #243b53; }
.admin-app { display: flex; min-height: 100vh; }
.admin-sidebar { width: 290px; background: linear-gradient(180deg, var(--brand-sidebar), #0f172a); color: #fff; padding: 24px 18px; position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 1000; }
.admin-content { margin-left: 290px; width: calc(100% - 290px); }
.sidebar-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.brand-badge { min-width: 58px; height: 48px; padding: 0 10px; border-radius: 16px; background: rgba(255,255,255,.16); display:flex; align-items:center; justify-content:center; font-weight:700; font-size: .82rem; letter-spacing: .05em; }
.brand-logo { width: 48px; height: 48px; border-radius: 16px; object-fit: contain; background: rgba(255,255,255,.12); padding: 6px; }
.brand-title { font-size: 1rem; font-weight: 700; }
.brand-subtitle { font-size: .85rem; color: rgba(255,255,255,.7); }
.sidebar-group { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.55); margin: 22px 8px 10px; }
.sidebar-link { display:flex; align-items:center; gap: 12px; color: rgba(255,255,255,.86); text-decoration:none; padding: 12px 14px; border-radius: 14px; transition: .2s ease; }
.sidebar-link:hover, .sidebar-link.active { background: rgba(255,255,255,.12); color:#fff; }
.admin-shell[data-sidebar-theme="light"] .admin-sidebar {
    background: #ffffff;
    color: #243b53;
    border-right: 1px solid #d9e2ec;
}
.admin-shell[data-sidebar-theme="light"] .brand-badge {
    background: rgba(31, 78, 121, 0.12);
    color: #1f4e79;
}
.admin-shell[data-sidebar-theme="light"] .brand-subtitle,
.admin-shell[data-sidebar-theme="light"] .sidebar-group {
    color: #6b7c93;
}
.admin-shell[data-sidebar-theme="light"] .sidebar-link {
    color: #243b53;
}
.admin-shell[data-sidebar-theme="light"] .sidebar-link:hover,
.admin-shell[data-sidebar-theme="light"] .sidebar-link.active {
    background: rgba(31, 78, 121, 0.1);
    color: #1f4e79;
}
.admin-shell[data-sidebar-theme="primary"] .admin-sidebar {
    background: var(--brand-primary);
    color: #ffffff;
}
.admin-shell[data-sidebar-theme="primary"] .brand-badge {
    background: rgba(255,255,255,.16);
    color: #ffffff;
}
.admin-shell[data-sidebar-theme="primary"] .brand-subtitle,
.admin-shell[data-sidebar-theme="primary"] .sidebar-group {
    color: rgba(255,255,255,.76);
}
.admin-shell[data-sidebar-theme="primary"] .sidebar-link {
    color: rgba(255,255,255,.92);
}
.admin-shell[data-sidebar-theme="primary"] .sidebar-link:hover,
.admin-shell[data-sidebar-theme="primary"] .sidebar-link.active {
    background: rgba(255,255,255,.16);
    color: #ffffff;
}
.admin-topbar { position: sticky; top: 0; z-index: 900; background: rgba(255,255,255,.86); backdrop-filter: blur(18px); border-bottom: 1px solid #e5ecf4; padding: 18px 28px; display:flex; justify-content:space-between; align-items:center; }
.admin-body { padding: 28px; }
.page-title { font-size: 1.35rem; font-weight: 700; }
.page-subtitle { color: #6b7c93; font-size: .92rem; }
.topbar-actions { display:flex; align-items:center; gap: 10px; }
.panel-card, .kpi-card { background: var(--brand-card); border: 1px solid #e6edf5; border-radius: 24px; box-shadow: 0 18px 40px rgba(15,23,42,.06); padding: 22px; }
.panel-header { display:flex; justify-content:space-between; align-items:center; margin-bottom: 18px; gap: 12px; }
.panel-header h3 { margin:0; font-size: 1.05rem; font-weight:700; }
.settings-shell { overflow: hidden; }
.settings-tabs { gap: 10px; }
.settings-tabs .nav-link {
    border-radius: 14px;
    padding: 10px 18px;
    color: #486581;
    background: #f8fbff;
    border: 1px solid #d9e2ec;
    font-weight: 600;
}
.settings-tabs .nav-link.active {
    background: #1f4e79;
    border-color: #1f4e79;
    color: #ffffff;
}
.settings-file-preview {
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 12px;
    background: #f8fbff;
}
.settings-preview-image {
    max-width: 100%;
    max-height: 72px;
    object-fit: contain;
    display: block;
}
.settings-brand-note {
    border-radius: 16px;
    padding: 14px 16px;
    background: #f8fbff;
    border: 1px solid #d9e2ec;
    color: #486581;
}
.kpi-card {
    min-height: 184px;
    color: #ffffff;
    border: 0;
    padding: 24px;
    position: relative;
    overflow: hidden;
}
.kpi-card::after {
    content: "";
    position: absolute;
    inset: auto -24px -24px auto;
    width: 120px;
    height: 120px;
    border-radius: 32px;
    background: rgba(255,255,255,.08);
    transform: rotate(18deg);
}
.kpi-icon {
    width: 72px;
    height: 72px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius: 24px;
    background: rgba(255,255,255,.16);
    color: #ffffff;
    font-size: 2rem;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}
.kpi-label {
    color: rgba(255,255,255,.88);
    font-size: 1rem;
    position: relative;
    z-index: 1;
}
.kpi-value {
    font-size: 2.05rem;
    font-weight: 800;
    margin-top: 10px;
    color: #ffffff;
    position: relative;
    z-index: 1;
    line-height: 1.15;
}
.kpi-card--blue { background: #1f4e79; }
.kpi-card--green { background: #1f6f5f; }
.kpi-card--teal { background: #0f766e; }
.kpi-card--red { background: #b42318; }
.kpi-card--orange { background: #b54708; }
.kpi-card--purple { background: #6941c6; }
.kpi-card--slate { background: #475467; }
.kpi-card--navy { background: #1d3557; }
.quick-link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    border-radius: 20px;
    padding: 18px 20px;
    color: #ffffff;
    min-height: 96px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
    transition: transform .18s ease, box-shadow .18s ease;
}
.quick-link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
    color: #ffffff;
}
.quick-link-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: rgba(255,255,255,.16);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size: 1.7rem;
    flex: 0 0 auto;
}
.quick-link-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.quick-link-text strong {
    font-size: 1rem;
    font-weight: 700;
}
.quick-link-text span {
    color: rgba(255,255,255,.82);
    font-size: .9rem;
}
.quick-link-arrow {
    margin-left: auto;
    font-size: 1.5rem;
    opacity: .9;
}
.link-card--blue { background: #1f4e79; }
.link-card--green { background: #1f6f5f; }
.link-card--orange { background: #b54708; }
.link-card--teal { background: #0f766e; }
.link-card--purple { background: #6941c6; }
.link-card--navy { background: #1d3557; }
.link-card--slate { background: #475467; }
.link-card--red { background: #b42318; }
.status-pill { min-width: 150px; border-radius: 18px; background: #f7fafc; padding: 16px; display:flex; justify-content:space-between; align-items:center; }
.table-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.table-search-input {
    width: min(280px, 100%);
}
.table-tools .dropdown-menu {
    min-width: 240px;
    max-height: 320px;
    overflow-y: auto;
    border-radius: 16px;
    border: 1px solid #d9e2ec;
    box-shadow: 0 18px 40px rgba(15,23,42,.08);
    padding: 10px;
}
.table-tools .form-check {
    padding: 8px 12px 8px 34px;
    border-radius: 12px;
}
.table-tools .form-check:hover {
    background: #f8fbff;
}
.btn-table-tool {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    color: #243b53;
    border-radius: 12px;
    padding: 8px 14px;
    font-weight: 600;
}
.btn-table-tool:hover,
.btn-table-tool:focus {
    background: #f8fbff;
    border-color: #c8d5e3;
    color: #1f4e79;
}
.flatpickr-calendar {
    border: 1px solid #d9e2ec;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15,23,42,.08);
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover {
    background: #1f4e79;
    border-color: #1f4e79;
}
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: #243b53;
    font-weight: 600;
}
.form-control.flatpickr-input[readonly],
.form-control.input[readonly],
input.flatpickr-input.form-control[readonly] {
    background-color: #ffffff;
    color: #243b53;
}
.admin-table thead th { color:#486581; font-size:.82rem; text-transform:uppercase; letter-spacing:.04em; background:#f8fbff; border-bottom:0; }
.admin-table td, .admin-table th { padding: 14px; vertical-align: middle; }
.detail-card { background: #f8fbff; border: 1px solid #e2eaf2; border-radius: 18px; padding: 16px; min-height: 100%; }
.detail-card span { display:block; color:#6b7c93; font-size:.85rem; margin-bottom:8px; }
.detail-card strong { font-size:1rem; }
.btn-primary {
    background: var(--brand-button);
    border-color: var(--brand-button);
    color: #ffffff;
    border-radius: 14px;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: #173b5c;
    border-color: #173b5c;
    color: #ffffff;
}
.btn, .form-control, .form-select { border-radius: 14px; }
.user-chip { background:#fff; border:1px solid #e5ecf4; border-radius: 999px; display:flex; align-items:center; gap:10px; padding:8px 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-primary), #7c3aed); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; }
.login-body { min-height:100vh; background: #eef2f6; }
.login-shell { min-height:100vh; display:grid; grid-template-columns: 1.05fr .95fr; }
.login-panel { padding: 72px 9vw; display:flex; flex-direction:column; justify-content:center; }
.login-panel h1 { font-size: 2.3rem; font-weight:800; margin-bottom:14px; }
.login-panel p { color:#52606d; max-width: 540px; }
.login-brand { display:inline-flex; align-self:flex-start; padding:8px 14px; border-radius:999px; background:#fff; border:1px solid #d9e2ec; box-shadow:0 10px 25px rgba(15,23,42,.04); margin-bottom:18px; font-weight:700; }
.login-visual { display:flex; align-items:center; justify-content:center; padding: 48px; }
.glass-card { width:min(520px, 100%); padding:32px; border-radius:28px; color:#fff; background: #274060; box-shadow:0 24px 48px rgba(15,23,42,.14); }
.glass-card .eyebrow { display:inline-flex; border-radius:999px; padding:7px 12px; background: rgba(255,255,255,.14); margin-bottom:16px; }
.glass-card ul { margin-top:18px; padding-left:20px; }
.password-card { width:min(500px, 92vw); margin:10vh auto; background:#fff; border-radius:24px; padding:32px; box-shadow:0 25px 60px rgba(15,23,42,.1); }
.notification-menu { width: 360px; }
.select2-container--default .select2-selection--multiple {
    min-height: 52px;
    border: 1px solid #ced4da;
    border-radius: 14px;
    padding: 8px 10px;
    background: #ffffff;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #1f4e79;
    box-shadow: 0 0 0 0.2rem rgba(31, 78, 121, 0.15);
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: #e7f0fb;
    border: 1px solid #c6d8ee;
    border-radius: 999px;
    color: #1f4e79;
    padding: 4px 10px;
}
.select2-dropdown {
    border: 1px solid #d9e2ec;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15,23,42,.08);
    overflow: hidden;
}
.select2-search__field {
    min-height: 28px;
}
.login-brand {
    display:inline-flex;
    align-items:center;
    gap:10px;
}
.login-brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}
.login-brand-fallback {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #1f4e79;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.login-brand--logo-only {
    padding: 10px;
}
.login-panel .form-control {
    background: #ffffff;
    border: 1px solid #cfd8e3;
    min-height: 52px;
}
.login-panel .form-control:focus {
    border-color: #1f4e79;
    box-shadow: 0 0 0 0.2rem rgba(31, 78, 121, 0.15);
}
.login-panel .btn-primary {
    min-height: 56px;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: #1f4e79;
    border-color: #1f4e79;
    box-shadow: 0 10px 24px rgba(31, 78, 121, 0.18);
}
.login-panel .btn-primary:hover,
.login-panel .btn-primary:focus,
.login-panel .btn-primary:active {
    background: #173b5c;
    border-color: #173b5c;
    box-shadow: 0 12px 28px rgba(23, 59, 92, 0.2);
}
@media (max-width: 992px) {
    .admin-sidebar { transform: translateX(-100%); transition: .25s ease; }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-content { margin-left: 0; width: 100%; }
    .login-shell { grid-template-columns: 1fr; }
    .login-visual { display:none; }
    .table-tools { justify-content: flex-start; }
    .settings-tabs { overflow-x: auto; flex-wrap: nowrap; }
}
