@import url(bootstrap.min.css);
@import url(bootstrap-icons.min.css);

:root {
    --sidebar-width: 264px;
    --sidebar-mini-width: 78px;
    --header-height: 68px;
    --brand: #2563eb;
    --brand-2: #4f46e5;
    --body-bg: #f5f7fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e6eaf0;
    --text: #172033;
    --muted: #718096;
    --sidebar-bg: #111827;
    --sidebar-text: #aab4c3;
    --sidebar-active: rgba(37, 99, 235, .18);
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    --shadow: 0 8px 28px rgba(15, 23, 42, .06);
}

[data-theme="dark"] {
    --body-bg: #0b1120;
    --surface: #111827;
    --surface-2: #182235;
    --border: #263247;
    --text: #eef2ff;
    --muted: #9aa7ba;
    --sidebar-bg: #080d18;
    --sidebar-text: #9ba8bb;
    --sidebar-active: rgba(59, 130, 246, .20);
    --shadow: 0 8px 28px rgba(0,0,0,.22);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    background: var(--body-bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: background .2s ease, color .2s ease;
}

a { text-decoration: none; color: inherit; }

.app-shell { min-height: 100vh; }

/* ========================================
   FORM CONTROLS - FULL DARK MODE SUPPORT
   ======================================== */

/* All form controls - base styles */
.form-control,
.form-select,
textarea.form-control,
input.form-control,
select.form-select {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

/* Form control focus states */
.form-control:focus,
.form-select:focus,
textarea.form-control:focus,
input.form-control:focus,
select.form-select:focus {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12) !important;
}

/* Form control hover states */
.form-control:hover,
.form-select:hover,
textarea.form-control:hover,
input.form-control:hover,
select.form-select:hover {
    border-color: var(--brand) !important;
}

/* Disabled and readonly states */
.form-control:disabled,
.form-control[readonly],
.form-select:disabled,
.form-select[readonly],
textarea.form-control:disabled,
textarea.form-control[readonly],
input.form-control:disabled,
input.form-control[readonly] {
    background-color: var(--surface-2) !important;
    color: var(--muted) !important;
    border-color: var(--border) !important;
    opacity: 0.7;
}

/* Placeholder text */
.form-control::placeholder,
textarea.form-control::placeholder,
input.form-control::placeholder {
    color: var(--muted) !important;
    opacity: 0.7;
}

/* Select options */
.form-select option,
select.form-select option {
    background-color: var(--surface) !important;
    color: var(--text) !important;
}

/* Select option hover/selected states */
.form-select option:hover,
.form-select option:checked,
.form-select option:focus,
select.form-select option:hover,
select.form-select option:checked,
select.form-select option:focus {
    background-color: var(--brand) !important;
    color: #fff !important;
}

/* For Firefox - select dropdown */
.form-select:-moz-focusring,
select.form-select:-moz-focusring {
    color: var(--text) !important;
    text-shadow: 0 0 0 var(--text);
}

/* Textarea specific */
textarea.form-control {
    resize: vertical;
}

/* Input groups */
.input-group .form-control,
.input-group .form-select {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.input-group .form-control:focus,
.input-group .form-select:focus {
    border-color: var(--brand) !important;
}

.input-group-text {
    background-color: var(--surface-2) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* ========================================
   BOOTSTRAP FORM CHECK (Checkboxes & Radios)
   ======================================== */

.form-check-input {
    background-color: var(--surface) !important;
    border-color: var(--border) !important;
}

.form-check-input:checked {
    background-color: var(--brand) !important;
    border-color: var(--brand) !important;
}

.form-check-input:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12) !important;
}

.form-check-label {
    color: var(--text) !important;
}

/* ========================================
   BOOTSTRAP FORM RANGE (Slider)
   ======================================== */

.form-range::-webkit-slider-thumb {
    background: var(--brand) !important;
}

.form-range::-moz-range-thumb {
    background: var(--brand) !important;
}

.form-range::-webkit-slider-runnable-track {
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
}

.form-range::-moz-range-track {
    background: var(--surface-2) !important;
    border-color: var(--border) !important;
}

/* ========================================
   BOOTSTRAP FORM FLOATING LABELS
   ======================================== */

.form-floating > .form-control,
.form-floating > .form-select {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.form-floating > label {
    color: var(--muted) !important;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    color: var(--brand) !important;
}

/* ========================================
   BOOTSTRAP FORM VALIDATION
   ======================================== */

.was-validated .form-control:valid,
.form-control.is-valid {
    border-color: var(--success) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2316a34a' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") !important;
    background-color: var(--surface) !important;
    color: var(--text) !important;
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: var(--danger) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc2626'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc2626' stroke='none'/%3e%3c/svg%3e") !important;
    background-color: var(--surface) !important;
    color: var(--text) !important;
}

.was-validated .form-select:valid,
.form-select.is-valid {
    border-color: var(--success) !important;
}

.was-validated .form-select:invalid,
.form-select.is-invalid {
    border-color: var(--danger) !important;
}

.valid-feedback,
.invalid-feedback {
    color: var(--success) !important;
}

.invalid-feedback {
    color: var(--danger) !important;
}

/* ========================================
   SIDEBAR
================================= */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width .22s ease, transform .22s ease;
    overflow: hidden;
}

.brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    color: #fff;
    white-space: nowrap;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    font-weight: 800;
    flex: 0 0 auto;
}

.brand-mark img {
    width: 100%;
}

.brand-text strong { display: block; font-size: 15px; line-height: 1.1; }
.brand-text span { display: block; font-size: 10px; opacity: .6; margin-top: 3px; letter-spacing: .08em; text-transform: uppercase; }

.sidebar-scroll { overflow-y: auto; overflow-x: hidden; padding: 16px 12px; flex: 1; }
.nav-section {
    color: #667085;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 14px 12px 8px;
}

.side-link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 43px;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--sidebar-text);
    font-size: 13px;
    margin-bottom: 3px;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.side-link:hover { background: rgba(255,255,255,.055); color: #fff; }
.side-link.active { background: var(--sidebar-active); color: #fff; }
.side-link.active::before {
    content: "";
    position: absolute;
    left: -12px;
    width: 3px;
    height: 24px;
    border-radius: 0 3px 3px 0;
    background: #60a5fa;
}
.side-icon { width: 20px; text-align: center; font-size: 17px; flex: 0 0 20px; }
.side-link .badge { margin-left: auto; font-size: 9px; }
.side-chevron { margin-left: auto; font-size: 12px; transition: transform .2s; }
.side-group.open > .side-link .side-chevron { transform: rotate(90deg); }

.side-submenu { display: none; padding-left: 32px; }
.side-group.open > .side-submenu { display: block; }
.side-submenu .side-link { min-height: 37px; font-size: 12px; }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.06);
}
.account-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255,255,255,.035);
}
.account-mini .avatar { width: 34px; height: 34px; }

/* Main */
.main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left .22s ease;
}

.topbar {
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1020;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: transparent;
    font-size: 18px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.search-box {
    width: min(360px, 32vw);
    position: relative;
    margin-left: 14px;
}
.search-box i { position: absolute; left: 13px; top: 10px; color: var(--muted); }
.search-box input {
    width: 100%;
    height: 38px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 9px;
    outline: none;
    color: var(--text);
    padding: 0 13px 0 38px;
    font-size: 12px;
}
.search-box input:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.notification-dot {
    position: absolute;
    width: 7px; height: 7px; border-radius: 50%;
    top: 7px; right: 7px; background: #ef4444;
    border: 2px solid var(--surface);
}

.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center; flex: 0 0 auto;
    color: #fff; font-weight: 700; font-size: 12px;
    background: linear-gradient(135deg, #0ea5e9, #4f46e5);
}

.profile-button {
    border: 0; background: transparent; display: flex; align-items: center;
    gap: 9px; margin-left: 8px; padding: 4px 6px; border-radius: 9px; color: var(--text);
}
.profile-button:hover { background: var(--surface-2); }
.profile-info { text-align: left; line-height: 1.1; }
.profile-info strong { display: block; font-size: 12px; }
.profile-info span { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }

.page {
    padding: 25px;
    max-width: 1700px;
    margin: 0 auto;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 22px;
}
.page-heading h1 { font-size: 22px; margin: 0 0 5px; font-weight: 700; letter-spacing: -.02em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.breadcrumb { margin: 0 0 5px; font-size: 11px; color: var(--muted); }
.breadcrumb .active { color: var(--text); }

.btn-brand {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    padding: 9px 14px;
}
.btn-brand:hover { background: #1d4ed8; color: #fff; }

.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 15px 18px;
}
.card-title { font-size: 13px; font-weight: 700; margin: 0; }
.card-subtitle { font-size: 10px; color: var(--muted); margin-top: 3px; }

.stat-card { padding: 17px; position: relative; overflow: hidden; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: 11px; color: var(--muted); font-weight: 600; }
.stat-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: grid; place-items: center; font-size: 18px;
}
.stat-value { font-size: 25px; line-height: 1; margin: 15px 0 8px; font-weight: 750; letter-spacing: -.03em; }
.stat-foot { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); }
.trend-up { color: var(--success); font-weight: 700; }
.trend-down { color: var(--danger); font-weight: 700; }

.bg-blue { background: rgba(37,99,235,.11); color: #2563eb; }
.bg-green { background: rgba(22,163,74,.11); color: #16a34a; }
.bg-orange { background: rgba(217,119,6,.11); color: #d97706; }
.bg-purple { background: rgba(124,58,237,.11); color: #7c3aed; }

.chart-wrap { position: relative; height: 300px; }
.chart-wrap.sm { height: 235px; }

.legend-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.legend-item { font-size: 10px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }

.metric-list { display: flex; flex-direction: column; gap: 18px; }
.metric-line { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 11px; }
.progress { height: 6px; background: var(--surface-2); }
.progress-bar { border-radius: 6px; }

.table-card { overflow: hidden; }
.table-responsive { overflow-x: auto; }
.table { margin: 0; color: var(--text); font-size: 11px; vertical-align: middle; }
.table > :not(caption) > * > * { background: transparent; border-bottom-color: var(--border); padding: 13px 14px; }
.table thead th { font-size: 9px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; white-space: nowrap; }
.user-cell { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.user-cell .avatar { width: 32px; height: 32px; font-size: 10px; }
.user-cell strong { display: block; font-size: 11px; }
.user-cell span { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.status {
    display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 30px;
    font-size: 9px; font-weight: 700;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.success { color: #15803d; background: rgba(22,163,74,.09); }
.status.warning { color: #b45309; background: rgba(217,119,6,.09); }
.status.danger { color: #b91c1c; background: rgba(220,38,38,.09); }

.activity { display: flex; gap: 11px; }
.activity + .activity { margin-top: 18px; }
.activity-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: 0 0 auto; font-size: 14px; }
.activity strong { font-size: 11px; }
.activity p { margin: 3px 0 0; font-size: 10px; color: var(--muted); line-height: 1.5; }
.activity time { display: block; margin-top: 4px; font-size: 9px; color: var(--muted); }

.dropdown-menu {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 10px;
    box-shadow: var(--shadow);
    font-size: 12px;
}
.dropdown-item { color: var(--text); padding: 9px 13px; }
.dropdown-item:hover { color: var(--text); background: var(--surface-2); }
.dropdown-divider { border-color: var(--border); }

.offcanvas {
    background: var(--surface);
    color: var(--text);
}
.offcanvas .offcanvas-header { border-bottom: 1px solid var(--border); }
.offcanvas .list-group-item { background: transparent; color: var(--text); border-color: var(--border); }

.mobile-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1030;
}

/* Collapsed desktop state */
body.sidebar-mini .sidebar { width: var(--sidebar-mini-width); }
body.sidebar-mini .main { margin-left: var(--sidebar-mini-width); }
body.sidebar-mini .brand { padding: 0 22px; }
body.sidebar-mini .brand-text,
body.sidebar-mini .side-link span:not(.side-icon),
body.sidebar-mini .side-link .side-chevron,
body.sidebar-mini .nav-section,
body.sidebar-mini .sidebar-footer .account-copy { display: none; }
body.sidebar-mini .side-link { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-mini .side-link.active::before { left: 0; }
body.sidebar-mini .side-submenu { display: none !important; }
body.sidebar-mini .account-mini { justify-content: center; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-width); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .mobile-backdrop { display: block; }
    .main { margin-left: 0 !important; }
    .search-box { display: none; }
    .profile-info { display: none; }
    .page { padding: 18px; }
}

@media (max-width: 575.98px) {
    .topbar { padding: 0 13px; }
    .page { padding: 14px; }
    .page-heading { flex-direction: column; }
    .page-heading .btn { width: 100%; }
    .stat-value { font-size: 22px; }
    .chart-wrap { height: 240px; }
}

/* Login Shell */
.login-shell {
    min-height: 100vh;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* ================================
    LEFT BRAND PANEL
================================= */

.login-brand-panel {
    width: 48%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 42px 48px;
    color: #fff;
    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(96, 165, 250, .35),
            transparent 32%
        ),
        radial-gradient(
            circle at 85% 75%,
            rgba(129, 140, 248, .30),
            transparent 35%
        ),
        linear-gradient(
            145deg,
            #0e5754 0%,
            #063e02 45%,
            #312e81 100%
        );
}

.login-brand-panel::before {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50%;
    right: -180px;
    top: -170px;
}

.login-brand-panel::after {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 50%;
    left: -190px;
    bottom: -160px;
}

.brand-content,
.brand-footer {
    position: relative;
    z-index: 2;
}

/* ================================
    LOGO
================================= */

.login-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.login-logo-mark {
    width: 80px;
    height: 80px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    font-size: 19px;
    font-weight: 800;
    box-shadow:
        0 10px 25px rgba(0,0,0,.18);
}
.login-logo-mark img {
    width: 100%;
}

.login-logo-text strong {
    display: block;
    font-size: 16px;
    line-height: 1.1;
    letter-spacing: -.02em;
}

.login-logo-text span {
    display: block;
    margin-top: 4px;
    font-size: 9px;
    opacity: .62;
    text-transform: uppercase;
    letter-spacing: .13em;
}

/* ================================
    BRAND MESSAGE
================================= */

.brand-message {
    max-width: 520px;
    margin-top: -100px;
}
.brand-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 30px;
    background: rgba(255,255,255,.06);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.brand-eyebrow i {
    color: #93c5fd;
}
.brand-message h1 {
    margin: 20px 0 14px;
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.04;
    font-weight: 750;
    letter-spacing: -.045em;
}
.brand-message h1 span {
    color: #93c5fd;
}
.brand-message p {
    max-width: 460px;
    margin: 0;
    color: rgba(255,255,255,.68);
    font-size: 13px;
    line-height: 1.75;
}

/* ================================
    FEATURE CARDS
================================= */

.brand-features {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 8px;
    background: rgba(255,255,255,.055);
    color: rgba(255,255,255,.72);
    font-size: 10px;
}

.brand-feature i {
    color: #93c5fd;
    font-size: 13px;
}

.brand-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;

    color: rgba(255,255,255,.42);
    font-size: 9px;
}

/* ================================
    RIGHT LOGIN PANEL
================================= */
.login-panel {
    flex: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--body-bg);
}
.login-container {
    width: 100%;
    max-width: 420px;
}
/* ================================
    TOP ACTIONS
================================= */
.login-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 5px;
}
.theme-toggle {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: var(--surface);
    cursor: pointer;
    transition:
        background .15s ease,
        color .15s ease,
        transform .15s ease;
}

.theme-toggle:hover {
    color: var(--text);
    background: var(--surface-2);
    transform: translateY(-1px);
}

/* ================================
    LOGIN CARD
================================= */

.login-card {
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

/* ================================
    FORM
================================= */

.form-group {
    margin-bottom: 19px;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
    color: var(--text);
    font-size: 11px;
    font-weight: 650;
}

.form-label span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 13px;
    top: 50%;

    transform: translateY(-50%);

    color: var(--muted);

    font-size: 15px;

    pointer-events: none;
}

.form-control-premium {
    width: 100%;
    height: 46px;

    padding: 0 42px;

    border: 1px solid var(--border);
    border-radius: 9px;

    outline: none;

    background: var(--surface-2);
    color: var(--text);

    font-size: 12px;

    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background .15s ease;
}

.form-control-premium::placeholder {
    color: #9aa5b5;
}

.form-control-premium:hover {
    border-color: #cbd5e1;
}

.form-control-premium:focus {
    border-color: #93c5fd;
    background: var(--surface);

    box-shadow:
        0 0 0 3px rgba(37,99,235,.09);
}

.password-toggle {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 7px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}
.password-toggle:hover {
    background: var(--surface-2);
    color: var(--text);
}

/* ================================
    OPTIONS
================================= */

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin: 4px 0 22px;
}

.forgot-link {
    color: var(--brand);
    font-size: 10px;
    font-weight: 650;
}

.forgot-link:hover {
    color: var(--brand-2);
}

/* ================================
    LOGIN BUTTON
================================= */

.login-button {
    width: 100%;
    height: 46px;

    border: 0;
    border-radius: 9px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    color: #fff;

    background:
        linear-gradient(
            135deg,
            var(--brand),
            var(--brand-2)
        );

    font-size: 12px;
    font-weight: 700;

    box-shadow:
        0 8px 18px rgba(37,99,235,.20);

    cursor: pointer;

    transition:
        transform .15s ease,
        box-shadow .15s ease;
}

.login-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 11px 25px rgba(37,99,235,.28);
}

.login-button:active {
    transform: translateY(0);
}

/* ================================
    DIVIDER
================================= */

.divider {
    display: flex;
    align-items: center;
    gap: 12px;

    margin: 25px 0;

    color: var(--muted);

    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.divider::before,
.divider::after {
    content: "";
    height: 1px;
    flex: 1;

    background: var(--border);
}

/* ================================
    SECURITY MESSAGE
================================= */

.security-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 12px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--surface-2);
}

.security-note i {
    color: var(--success);
    font-size: 15px;
    margin-top: 1px;
}

.security-note strong {
    display: block;

    margin-bottom: 2px;

    font-size: 10px;
}

.security-note span {
    display: block;

    color: var(--muted);

    font-size: 9px;
    line-height: 1.5;
}

/* ================================
    COPYRIGHT
================================= */

.login-copyright {
    margin-top: 20px;

    text-align: center;

    color: var(--muted);

    font-size: 9px;
}

/* ================================
    RESPONSIVE
================================= */

@media (max-width: 991.98px) {

    .login-brand-panel {
        display: none;
    }

    .login-panel {
        padding: 25px;
    }

    .login-top {
        margin-bottom: 20px;
    }
}

@media (max-width: 575.98px) {

    .login-panel {
        padding: 15px;
    }

    .login-card {
        padding: 25px 20px;
        border-radius: 13px;
    }

    .login-heading h2 {
        font-size: 21px;
    }
}

/* Scrollable */
/* Add this to your existing CSS file (yiwucms_styles.css) */

/* ========================================
   CUSTOM SCROLLBAR STYLING - THIN & HOVER
   ======================================== */

/* For WebKit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
    background: transparent;
}

::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 8px;
    transition: background 0.3s ease;
}

/* Show scrollbar thumb only on hover */
*:hover::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.3);
}

*:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.5);
}

/* Firefox scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

*:hover {
    scrollbar-color: rgba(128, 128, 128, 0.3) transparent;
}

/* ========================================
   SIDEBAR SPECIFIC SCROLLBAR
   ======================================== */

.sidebar-scroll::-webkit-scrollbar {
    width: 3px;
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 8px;
}

.sidebar-scroll:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-scroll:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Firefox */
.sidebar-scroll {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.sidebar-scroll:hover {
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* ========================================
   MAIN CONTENT SCROLLBAR
   ======================================== */

.main::-webkit-scrollbar {
    width: 4px;
    background: transparent;
}

.main::-webkit-scrollbar-track {
    background: transparent;
}

.main::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 8px;
}

.main:hover::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.2);
}

.main:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.4);
}

/* Firefox */
.main {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.main:hover {
    scrollbar-color: rgba(128, 128, 128, 0.2) transparent;
}

/* ========================================
   TABLE/ANY OTHER SCROLLABLE AREAS
   ======================================== */

.table-responsive::-webkit-scrollbar {
    width: 3px;
    height: 3px;
    background: transparent;
}

.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 8px;
}

.table-responsive:hover::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.2);
}

.table-responsive:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.4);
}

.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.table-responsive:hover {
    scrollbar-color: rgba(128, 128, 128, 0.2) transparent;
}

/* ========================================
   DARK THEME ADJUSTMENTS (if needed)
   ======================================== */

[data-theme="dark"] .sidebar-scroll:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .sidebar-scroll:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .main:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .main:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Table customization */
/* ========================================
   RESPONSIVE TABLES - VERTICAL STACK ON MOBILE
   ======================================== */

@media (max-width: 767.98px) {
    /* Force tables to display as vertical cards */
    .table-responsive table,
    .table-responsive .table {
        display: block;
        width: 100%;
    }

    .table-responsive thead {
        display: none; /* Hide table headers on mobile */
    }

    .table-responsive tbody {
        display: block;
        width: 100%;
    }

    .table-responsive tr {
        display: block;
        width: 100%;
        margin-bottom: 16px;
        padding: 16px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface);
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
        transition: all 0.2s ease;
    }

    .table-responsive tr:last-child {
        margin-bottom: 0;
    }

    .table-responsive td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border: none !important;
        border-bottom: 1px solid var(--border) !important;
        font-size: 12px;
        width: 100%;
        text-align: left !important;
    }

    .table-responsive td:last-child {
        border-bottom: none !important;
    }

    /* Add data-label attribute to each cell showing the header text */
    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--muted);
        flex-shrink: 0;
        margin-right: 16px;
    }

    /* Special handling for user cell in tables */
    .table-responsive .user-cell {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        width: 100%;
        min-width: unset;
    }

    .table-responsive .user-cell .avatar {
        width: 28px;
        height: 28px;
        font-size: 9px;
    }

    .table-responsive .user-cell strong {
        font-size: 13px;
    }

    .table-responsive .user-cell span {
        font-size: 11px;
    }

    /* Status badges */
    .table-responsive .status {
        font-size: 10px;
        padding: 3px 10px;
    }

    /* Progress bars in table */
    .table-responsive td .progress {
        width: 120px;
        margin-left: auto;
    }

    .table-responsive td small.text-muted {
        margin-left: 8px;
        font-size: 10px;
    }

    /* Actions column (dropdown) */
    .table-responsive td:last-child {
        justify-content: flex-end;
        border-bottom: none !important;
        padding-top: 12px;
        padding-bottom: 4px;
    }

    .table-responsive td:last-child::before {
        display: none; /* Hide label for actions column */
    }

    .table-responsive td .icon-btn {
        width: 32px;
        height: 32px;
    }

    /* Pagination on mobile */
    .table-responsive + .d-flex {
        flex-direction: column;
        gap: 12px;
        align-items: center !important;
    }

    .table-responsive + .d-flex .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ========================================
   TABLES - ALTERNATIVE VERTICAL LAYOUT (optional)
   ======================================== */

@media (max-width: 575.98px) {
    .table-responsive tr {
        padding: 14px;
        margin-bottom: 14px;
    }

    .table-responsive td {
        font-size: 11px;
        padding: 6px 0;
    }

    .table-responsive td::before {
        font-size: 9px;
        min-width: 80px;
    }

    .table-responsive td .progress {
        width: 90px;
    }
}

/* Additional */
/* =========================================================
   TITLES PAGE — THEME ADAPTIVE TABLE + MODALS
   Uses the application's existing:
   --body-bg
   --surface
   --surface-2
   --border
   --text
   --muted
   ========================================================= */

/* ---------------------------------------------------------
   PAGE HEADER
--------------------------------------------------------- */

.page-header-modern {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.breadcrumb-modern {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    font-size: 0.8rem;
}

.breadcrumb-modern li {
    display: inline;
}

.breadcrumb-modern .active {
    color: var(--brand);
}


/* ---------------------------------------------------------
   SEARCH / ACTION CARD
--------------------------------------------------------- */

.page .card,
.card.border-0.shadow-sm {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border) !important;
}


/* ---------------------------------------------------------
   TABLE
--------------------------------------------------------- */

.table-adaptive {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface) !important;
    color: var(--text) !important;

    /*
     * Important:
     * Bootstrap 5 uses --bs-table-bg and --bs-table-color.
     * Override them so Bootstrap cannot force a light table.
     */
    --bs-table-bg: var(--surface);
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    --bs-table-striped-bg: var(--surface-2);
    --bs-table-striped-color: var(--text);
    --bs-table-hover-bg: var(--surface-2);
    --bs-table-hover-color: var(--text);
}


/* Make every table cell inherit the theme */

.table-adaptive > :not(caption) > * > * {
    background-color: transparent !important;
    color: var(--text) !important;
    border-bottom-color: var(--border) !important;
}


/* Header */

.table-adaptive thead {
    background: var(--surface-2);
}

.table-adaptive thead th {
    background: var(--surface-2) !important;
    color: var(--muted) !important;

    border-bottom: 1px solid var(--border) !important;

    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;

    padding: 0.65rem 0.75rem;
    white-space: nowrap;
}


/* Body */

.table-adaptive tbody {
    background: var(--surface);
}

.table-adaptive tbody tr {
    background: var(--surface) !important;
    color: var(--text) !important;

    transition:
        background-color .18s ease,
        transform .18s ease;
}

.table-adaptive tbody td {
    background: transparent !important;
    color: var(--text) !important;

    padding: 0.65rem 0.75rem;
    vertical-align: middle;

    border-bottom: 1px solid var(--border) !important;
}


/* Last row */

.table-adaptive tbody tr:last-child td {
    border-bottom: 0 !important;
}


/* Hover */

.table-adaptive.table-hover tbody tr:hover {
    background: var(--surface-2) !important;
    color: var(--text) !important;
    transform: translateX(2px);
}

.table-adaptive.table-hover tbody tr:hover td {
    background: var(--surface-2) !important;
    color: var(--text) !important;
}


/* Text */

.text-adaptive {
    color: var(--text) !important;
}


/* Number badge */

.badge-adaptive {
    background: var(--surface-2) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
}


/* Title icon */

.title-icon-adaptive {
    background: color-mix(
        in srgb,
        var(--brand) 12%,
        var(--surface-2)
    ) !important;

    color: var(--brand) !important;
}


/* ---------------------------------------------------------
   MODALS
--------------------------------------------------------- */

.modal-adaptive {
    background: var(--surface) !important;
    color: var(--text) !important;

    border: 1px solid var(--border) !important;

    /*
     * Prevent Bootstrap modal variables from forcing white.
     */
    --bs-modal-bg: var(--surface);
    --bs-modal-color: var(--text);
    --bs-modal-border-color: var(--border);
}


/* Modal header */

.modal-header-adaptive {
    background: var(--surface) !important;
    color: var(--text) !important;

    border-bottom: 1px solid var(--border) !important;
}


/* Modal body */

.modal-body-adaptive {
    background: var(--surface) !important;
    color: var(--text) !important;
}


/* Modal footer */

.modal-footer-adaptive {
    background: var(--surface) !important;
    color: var(--text) !important;

    border-top: 1px solid var(--border) !important;
}


/* Modal title */

.modal-title-adaptive {
    color: var(--text) !important;
}


/* Close button */

.btn-close-adaptive {
    /*
     * Bootstrap's close icon is black by default.
     * This inverts it for dark mode.
     */
    opacity: .75;
}

[data-theme="dark"] .btn-close-adaptive {
    filter: invert(1) grayscale(100%);
}

.btn-close-adaptive:hover {
    opacity: 1;
}


/* ---------------------------------------------------------
   MODAL FORM
--------------------------------------------------------- */

.label-adaptive {
    color: var(--text) !important;
}


.input-adaptive {
    background: var(--surface-2) !important;
    color: var(--text) !important;

    border: 1px solid var(--border) !important;

    box-shadow: none !important;
}


.input-adaptive::placeholder {
    color: var(--muted) !important;
    opacity: 1;
}


.input-adaptive:hover {
    border-color: color-mix(
        in srgb,
        var(--text) 20%,
        var(--border)
    ) !important;
}


.input-adaptive:focus {
    background: var(--surface) !important;
    color: var(--text) !important;

    border-color: var(--brand) !important;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, .10) !important;
}


/* ---------------------------------------------------------
   BOOTSTRAP MODAL GLOBAL OVERRIDES
   --------------------------------------------------------- */

.modal-content {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.modal-header,
.modal-body,
.modal-footer {
    color: var(--text);
}


/* Bootstrap text utilities that otherwise look wrong */

.modal .text-muted {
    color: var(--muted) !important;
}


/* ---------------------------------------------------------
   MODAL BACKDROP
--------------------------------------------------------- */

.modal-backdrop {
    --bs-backdrop-bg: #000;
}

.modal-backdrop.show {
    opacity: .55;
}

[data-theme="dark"] .modal-backdrop.show {
    opacity: .72;
}


/* ---------------------------------------------------------
   FORM VALIDATION
--------------------------------------------------------- */

[data-theme="dark"] .input-adaptive.is-invalid {
    background: var(--surface-2) !important;
    color: var(--text) !important;
}


/* ---------------------------------------------------------
   BUTTONS
--------------------------------------------------------- */

.modal-adaptive .btn-outline-secondary {
    color: var(--muted);
    border-color: var(--border);
}

.modal-adaptive .btn-outline-secondary:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--border);
}


/* ---------------------------------------------------------
   DATABASE COUNT BADGE
--------------------------------------------------------- */

.badge.bg-light {
    background: var(--surface-2) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
}


/* ---------------------------------------------------------
   PAGINATION
--------------------------------------------------------- */

.pagination .page-link {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.pagination .page-link:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border);
}

.pagination .page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    background: var(--surface-2);
    color: var(--muted);
    border-color: var(--border);
}


/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */

@media (max-width: 768px) {

    .table-adaptive {
        font-size: 0.8rem;
    }

    .table-adaptive tbody td {
        padding: 0.4rem 0.5rem;
    }

    .table-adaptive thead th {
        padding: 0.4rem 0.5rem;
        font-size: 0.65rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }
}

 /* Notification Badge */
    .notification-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background-color: #dc3545;
        color: white;
        font-size: 9px;
        font-weight: 700;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        border: 2px solid var(--bs-body-bg);
        animation: pulse-badge 2s ease-in-out infinite;
        line-height: 1;
        box-shadow: 0 2px 6px rgba(220, 53, 69, 0.4);
    }
    
    @keyframes pulse-badge {
        0%, 100% { 
            transform: scale(1);
            opacity: 1;
        }
        50% { 
            transform: scale(1.1);
            opacity: 0.8;
        }
    }
    
    /* For larger numbers (more than 99) */
    .notification-badge.large {
        min-width: 22px;
        font-size: 8px;
        padding: 0 5px;
    }

/* ========================================
   INPUT GROUP - DARK MODE FIX
   ======================================== */

.input-group .form-control,
.input-group .form-select {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.input-group .form-control:focus,
.input-group .form-select:focus {
    border-color: var(--brand) !important;
}

.input-group-text {
    background-color: var(--surface-2) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* ========================================
   FORM FLOW - DARK MODE
   ======================================== */

.form-floating > .form-control,
.form-floating > .form-select {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.form-floating > label {
    color: var(--muted) !important;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    color: var(--brand) !important;
}

/* ========================================
   DROPDOWN MENU ITEMS - DARK MODE
   ======================================== */

.dropdown-menu {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 10px;
    box-shadow: var(--shadow);
    font-size: 12px;
}

.dropdown-item {
    color: var(--text);
    padding: 9px 13px;
}

.dropdown-item:hover {
    color: var(--text);
    background: var(--surface-2);
}

.dropdown-divider {
    border-color: var(--border);
}

/* ========================================
   MODAL SELECT OPTIONS - DARK MODE
   ======================================== */

.modal select option,
.modal .form-select option {
    background-color: var(--surface) !important;
    color: var(--text) !important;
}

.modal select option:hover,
.modal .form-select option:hover,
.modal select option:checked,
.modal .form-select option:checked {
    background-color: var(--brand) !important;
    color: #fff !important;
}

/* ========================================
   TABLE RESPONSIVE DARK MODE
   ======================================== */

@media (max-width: 767.98px) {
    .table-responsive tr {
        background: var(--surface) !important;
        border-color: var(--border) !important;
    }
    
    .table-responsive td {
        border-bottom-color: var(--border) !important;
        color: var(--text) !important;
    }
    
    .table-responsive td::before {
        color: var(--muted) !important;
    }
}

/* ========================================
   BADGE LIGHT - DARK MODE OVERRIDE
   ======================================== */

.badge.bg-light {
    background: var(--surface-2) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
}

/* ========================================
   TEXT MUTED - DARK MODE
   ======================================== */

.text-muted {
    color: var(--muted) !important;
}

/* ========================================
   BTN OUTLINE SECONDARY - DARK MODE
   ======================================== */

.btn-outline-secondary {
    color: var(--muted);
    border-color: var(--border);
}

.btn-outline-secondary:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--border);
}