/* Buyzo Admin Panel — design system matched to reference screenshots */

:root {
    --sp-yellow: #ffd92e;
    --sp-yellow-dark: #f5c400;
    --sp-navy: #0e1a3a;
    --sp-navy-2: #16224c;
    --sp-navy-3: #1d2b5c;
    --sp-blue: #2563eb;
    --sp-blue-dark: #1d4ed8;
    --sp-green: #16a34a;
    --sp-red: #ef4444;
    --sp-orange: #f97316;
    --sp-purple: #8b5cf6;
    --sp-teal: #14b8a6;
    --sp-gray: #6b7280;
    --sp-bg: #f4f6fa;
    --sp-card-border: #e7ebf2;
    --sp-text: #1f2937;
    --sp-text-soft: #6b7280;
    --sp-radius: 14px;
    --sp-sidebar-w: 260px;
    --sp-header-h: 64px;
    --sp-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
    font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--sp-bg);
    color: var(--sp-text);
    min-height: 100vh;
}

a { color: var(--sp-blue); text-decoration: none; }
a:hover { text-decoration: none; }

/* ---------- Header ---------- */
.sp-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--sp-header-h);
    background: var(--sp-yellow);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px;
    z-index: 1030;
    box-shadow: 0 2px 8px rgba(16, 24, 40, .08);
}

.sp-hamburger {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--sp-navy);
    cursor: pointer;
    padding: 6px;
    line-height: 1;
    display: inline-flex;
    border-radius: 8px;
}
.sp-hamburger:hover { background: rgba(255, 255, 255, .4); }

.sp-brand { display: flex; align-items: center; gap: 8px; color: var(--sp-navy); font-weight: 800; font-size: 22px; white-space: nowrap; }
.sp-brand .brand-cart { color: var(--sp-red); font-size: 26px; }
.sp-brand .brand-pro { color: var(--sp-red); }
.sp-brand-divider { color: var(--sp-navy); font-weight: 600; font-size: 15px; opacity: .75; white-space: nowrap; }
.sp-brand-title { color: var(--sp-navy); font-weight: 700; font-size: 17px; white-space: nowrap; }

.sp-header-search {
    margin-left: auto;
    position: relative;
    width: 320px;
    max-width: 38vw;
}
.sp-header-search input {
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 9px 16px 9px 40px;
    font-size: 13.5px;
    background: #fff;
    outline: none;
    font-family: inherit;
    color: var(--sp-text);
}
.sp-header-search .bi-search { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #9aa3b2; font-size: 14px; }

.sp-header-actions { display: flex; align-items: center; gap: 14px; }

.sp-bell { position: relative; background: none; border: none; font-size: 22px; color: var(--sp-navy); cursor: pointer; padding: 4px; display: inline-flex; }
.sp-bell .badge-count {
    position: absolute; top: -4px; right: -6px;
    background: var(--sp-red); color: #fff;
    font-size: 10.5px; font-weight: 700;
    min-width: 18px; height: 18px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 4px;
}

.sp-profile { display: flex; align-items: center; gap: 10px; cursor: pointer; background: none; border: none; font-family: inherit; color: var(--sp-navy); }
.sp-profile .avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--sp-blue);
    color: #fff; font-weight: 700; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
    overflow: hidden;
}
.sp-profile .avatar img { width: 100%; height: 100%; object-fit: cover; }
.sp-profile .p-name { font-weight: 700; font-size: 14px; line-height: 1.1; text-align: left; }
.sp-profile .p-role { font-size: 11.5px; opacity: .75; text-align: left; }

/* Dropdown menus */
.sp-dropdown { position: relative; }
.sp-dropdown-menu {
    display: none;
    position: absolute; right: 0; top: calc(100% + 8px);
    background: #fff; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .15);
    min-width: 200px; padding: 8px; z-index: 1050;
    border: 1px solid var(--sp-card-border);
}
.sp-dropdown.open .sp-dropdown-menu { display: block; }
.sp-dropdown-menu a, .sp-dropdown-menu button {
    display: flex; align-items: center; gap: 10px;
    width: 100%; text-align: left;
    padding: 9px 12px; border-radius: 8px;
    color: var(--sp-text); font-size: 13.5px;
    background: none; border: none; cursor: pointer; font-family: inherit;
}
.sp-dropdown-menu a:hover, .sp-dropdown-menu button:hover { background: #f1f5fd; color: var(--sp-blue); }
.sp-dropdown-menu .divider { height: 1px; background: var(--sp-card-border); margin: 6px 0; }

/* ---------- Sidebar ---------- */
.sp-sidebar {
    position: fixed;
    top: var(--sp-header-h); left: 0; bottom: 0;
    width: var(--sp-sidebar-w);
    background: var(--sp-navy);
    overflow-y: auto;
    padding: 16px 12px 24px;
    z-index: 1020;
    transition: transform .25s ease;
    scrollbar-width: thin;
    scrollbar-color: #2a3a6b transparent;
}
.sp-sidebar::-webkit-scrollbar { width: 5px; }
.sp-sidebar::-webkit-scrollbar-thumb { background: #2a3a6b; border-radius: 3px; }

.sp-nav { list-style: none; }
.sp-nav > li { margin-bottom: 4px; }

.sp-nav-link, .sp-nav-parent {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    color: #cdd5e8;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    background: none; border: none; cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.sp-nav-link:hover, .sp-nav-parent:hover { background: var(--sp-navy-3); color: #fff; }
.sp-nav-link.active { background: var(--sp-blue); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(37, 99, 235, .4); }
.sp-nav-link .bi, .sp-nav-parent .bi { font-size: 17px; width: 22px; text-align: center; flex-shrink: 0; }
.sp-nav-parent .chevron { margin-left: auto; font-size: 13px; transition: transform .2s; }
.sp-nav-group.open > .sp-nav-parent .chevron { transform: rotate(180deg); }

.sp-nav-sub { list-style: none; display: none; padding: 2px 0 6px 0; }
.sp-nav-group.open .sp-nav-sub { display: block; }
.sp-nav-sub a {
    display: block;
    padding: 8px 14px 8px 48px;
    color: #9fabc9;
    font-size: 13px;
    border-radius: 8px;
}
.sp-nav-sub a:hover { color: #fff; background: var(--sp-navy-3); }
.sp-nav-sub a.active { color: #fff; background: var(--sp-navy-3); font-weight: 600; }

.sp-sidebar-promo {
    margin-top: 22px;
    background: linear-gradient(180deg, var(--sp-navy-2), #121f45);
    border: 1px solid #24345f;
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    color: #fff;
}
.sp-sidebar-promo .promo-crown { font-size: 30px; color: var(--sp-yellow); }
.sp-sidebar-promo h5 { font-weight: 800; font-size: 19px; margin: 6px 0 2px; }
.sp-sidebar-promo h5 span { color: var(--sp-yellow); }
.sp-sidebar-promo p { font-size: 12px; color: #aeb9d6; margin-bottom: 14px; line-height: 1.5; }
.sp-sidebar-promo .btn-promo {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--sp-yellow); color: var(--sp-navy);
    font-weight: 700; font-size: 13px;
    padding: 9px 18px; border-radius: 999px;
}
.sp-sidebar-promo .btn-promo:hover { background: var(--sp-yellow-dark); }

/* ---------- Main ---------- */
.sp-main {
    margin-left: var(--sp-sidebar-w);
    padding: calc(var(--sp-header-h) + 20px) 24px 24px;
    transition: margin-left .25s ease;
}
body.sidebar-collapsed .sp-sidebar { transform: translateX(-100%); }
body.sidebar-collapsed .sp-main { margin-left: 0; }

/* ---------- Cards ---------- */
.sp-card {
    background: #fff;
    border: 1px solid var(--sp-card-border);
    border-radius: var(--sp-radius);
    box-shadow: var(--sp-shadow);
    margin-bottom: 20px;
}
.sp-card-head {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--sp-card-border);
}
.sp-card-head .head-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: #e8f0ff; color: var(--sp-blue);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 17px; flex-shrink: 0;
}
.sp-card-head h6 { font-size: 15.5px; font-weight: 700; margin: 0; }
.sp-card-head .head-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.sp-card-head .view-all { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.sp-card-body { padding: 18px 20px; }
.sp-card-body.no-pad { padding: 0; }

/* ---------- Summary stat cards ---------- */
.sp-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.sp-stat {
    border-radius: var(--sp-radius);
    border: 1px solid var(--sp-card-border);
    padding: 18px;
    display: flex; align-items: center; gap: 14px;
    position: relative;
    box-shadow: var(--sp-shadow);
}
.sp-stat .stat-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff; flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .15);
}
.sp-stat .stat-body { min-width: 0; }
.sp-stat .stat-label { font-size: 13px; color: var(--sp-text-soft); font-weight: 500; }
.sp-stat .stat-value { font-size: 22px; font-weight: 800; line-height: 1.15; white-space: nowrap; }
.sp-stat .stat-trend { font-size: 11.5px; color: var(--sp-green); font-weight: 600; white-space: nowrap; }
.sp-stat .stat-link { position: absolute; top: 14px; right: 14px; color: #b6c0d4; font-size: 15px; }
.sp-stat.blue   { background: #eef4ff; } .sp-stat.blue .stat-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.sp-stat.green  { background: #eafaf0; } .sp-stat.green .stat-icon { background: linear-gradient(135deg, #22c55e, #16a34a); }
.sp-stat.red    { background: #fdefef; } .sp-stat.red .stat-icon { background: linear-gradient(135deg, #f87171, #ef4444); }
.sp-stat.purple { background: #f4efff; } .sp-stat.purple .stat-icon { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.sp-stat.orange { background: #fff6e8; } .sp-stat.orange .stat-icon { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.sp-stat.teal   { background: #e8faf7; } .sp-stat.teal .stat-icon { background: linear-gradient(135deg, #2dd4bf, #0d9488); }

/* ---------- Welcome bar ---------- */
.sp-welcome {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 20px; flex-wrap: wrap;
}
.sp-welcome .w-icon {
    width: 46px; height: 46px; border-radius: 12px;
    background: #e8f0ff; color: var(--sp-blue);
    display: flex; align-items: center; justify-content: center; font-size: 21px;
}
.sp-welcome h4 { font-size: 19px; font-weight: 700; margin: 0; }
.sp-welcome p { font-size: 13px; color: var(--sp-text-soft); margin: 2px 0 0; }
.sp-welcome .w-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sp-date-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--sp-text); }
.sp-status-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #eafaf0; color: var(--sp-green);
    font-size: 12.5px; font-weight: 700;
    border: 1px solid #c9ecd6;
    padding: 6px 12px; border-radius: 999px;
}

/* ---------- Tables ---------- */
.sp-table-wrap { overflow-x: auto; }
table.sp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.sp-table thead th {
    background: #f7f9fc;
    color: #5b6472;
    font-weight: 600;
    font-size: 12.5px;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--sp-card-border);
    white-space: nowrap;
}
table.sp-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #eef1f6;
    vertical-align: middle;
}
table.sp-table tbody tr:last-child td { border-bottom: none; }
table.sp-table tbody tr:hover { background: #fafbfe; }
table.sp-table .t-product { display: flex; align-items: center; gap: 10px; }
table.sp-table .t-thumb {
    width: 40px; height: 40px; border-radius: 9px;
    object-fit: cover; background: #eef1f6; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    color: #9aa3b2; font-size: 17px; overflow: hidden;
}
.t-rank {
    width: 26px; height: 26px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
    background: #eef1f6; color: var(--sp-text-soft);
}
.t-rank.r1 { background: #ffd92e; color: #7a5c00; }
.t-rank.r2 { background: #e2e8f0; color: #475569; }
.t-rank.r3 { background: #ffe3c2; color: #b45309; }

/* ---------- Badges ---------- */
.sp-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 700;
    padding: 4px 11px; border-radius: 999px;
    white-space: nowrap;
}
.sp-badge.green  { background: #e5f7eb; color: #15803d; }
.sp-badge.blue   { background: #e5edfd; color: #1d4ed8; }
.sp-badge.orange { background: #fff1dd; color: #b45309; }
.sp-badge.red    { background: #fde5e5; color: #b91c1c; }
.sp-badge.purple { background: #f0e9fe; color: #6d28d9; }
.sp-badge.gray   { background: #eef1f5; color: #4b5563; }
.sp-badge.teal   { background: #e0f5f2; color: #0f766e; }

/* ---------- Buttons ---------- */
.btn-sp {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 10px;
    font-size: 13.5px; font-weight: 600;
    padding: 9px 16px;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.3;
    transition: all .15s;
    white-space: nowrap;
}
.btn-sp-primary { background: var(--sp-blue); color: #fff; }
.btn-sp-primary:hover { background: var(--sp-blue-dark); color: #fff; }
.btn-sp-success { background: var(--sp-green); color: #fff; }
.btn-sp-success:hover { background: #15803d; color: #fff; }
.btn-sp-danger { background: var(--sp-red); color: #fff; }
.btn-sp-danger:hover { background: #b91c1c; color: #fff; }
.btn-sp-warning { background: var(--sp-orange); color: #fff; }
.btn-sp-warning:hover { background: #c2540a; color: #fff; }
.btn-sp-purple { background: var(--sp-purple); color: #fff; }
.btn-sp-purple:hover { background: #6d28d9; color: #fff; }
.btn-sp-teal { background: var(--sp-teal); color: #fff; }
.btn-sp-teal:hover { background: #0f766e; color: #fff; }
.btn-sp-gray { background: #64748b; color: #fff; }
.btn-sp-gray:hover { background: #475569; color: #fff; }
.btn-sp-yellow { background: var(--sp-yellow); color: var(--sp-navy); }
.btn-sp-yellow:hover { background: var(--sp-yellow-dark); color: var(--sp-navy); }
.btn-sp-outline { background: #fff; color: var(--sp-text); border-color: var(--sp-card-border); }
.btn-sp-outline:hover { background: #f6f8fb; color: var(--sp-text); }
.btn-sp-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-sp-lg { padding: 12px 22px; font-size: 15px; }
.btn-sp-block { width: 100%; }
.btn-sp:disabled, .btn-sp[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }

.icon-btn {
    width: 32px; height: 32px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--sp-card-border);
    background: #fff; color: var(--sp-text-soft);
    cursor: pointer; font-size: 14px;
}
.icon-btn:hover { background: #f1f5fd; color: var(--sp-blue); }
.icon-btn.danger:hover { background: #fdeaea; color: var(--sp-red); border-color: #f5c6c6; }

/* ---------- Forms ---------- */
.sp-form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.sp-form-row.three { grid-template-columns: repeat(3, 1fr); }
.sp-field { margin-bottom: 16px; }
.sp-field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #374151; }
.sp-field label .req { color: var(--sp-red); }
.sp-input, .sp-select, .sp-textarea {
    width: 100%;
    border: 1px solid #d9dfe8;
    border-radius: 10px;
    padding: 10px 13px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--sp-text);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.sp-input:focus, .sp-select:focus, .sp-textarea:focus {
    border-color: var(--sp-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.sp-textarea { min-height: 110px; resize: vertical; }
.sp-field .help { font-size: 12px; color: var(--sp-text-soft); margin-top: 5px; }
.sp-field .error { font-size: 12px; color: var(--sp-red); margin-top: 5px; }
.sp-input.is-invalid, .sp-select.is-invalid, .sp-textarea.is-invalid { border-color: var(--sp-red); }
.sp-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.sp-check input { width: 16px; height: 16px; accent-color: var(--sp-blue); }
.file-drop {
    border: 2px dashed #d9dfe8; border-radius: 12px;
    padding: 22px; text-align: center; color: var(--sp-text-soft);
    font-size: 13px; cursor: pointer; background: #fafbfd;
}
.file-drop:hover { border-color: var(--sp-blue); color: var(--sp-blue); }
.img-preview { width: 80px; height: 80px; object-fit: cover; border-radius: 10px; border: 1px solid var(--sp-card-border); }

/* ---------- Toolbar (search / filters) ---------- */
.sp-toolbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 14px 20px;
    border-bottom: 1px solid var(--sp-card-border);
}
.sp-toolbar .search-box { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.sp-toolbar .search-box input { padding-left: 36px; }
.sp-toolbar .search-box .bi { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9aa3b2; font-size: 14px; }
.sp-toolbar .spacer { margin-left: auto; }

/* ---------- Pagination ---------- */
.sp-pagination { display: flex; align-items: center; gap: 6px; padding: 14px 20px; flex-wrap: wrap; }
.sp-pagination .page-info { font-size: 12.5px; color: var(--sp-text-soft); margin-right: auto; }
.sp-pagination a, .sp-pagination span.page-num {
    min-width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--sp-card-border); border-radius: 8px;
    background: #fff; color: var(--sp-text); font-size: 13px; padding: 0 8px;
}
.sp-pagination a:hover { border-color: var(--sp-blue); color: var(--sp-blue); }
.sp-pagination span.page-num.current { background: var(--sp-blue); border-color: var(--sp-blue); color: #fff; font-weight: 600; }
.sp-pagination span.page-num.disabled { opacity: .45; }

/* ---------- Alerts ---------- */
.sp-alert {
    display: flex; align-items: center; gap: 10px;
    border-radius: 12px; padding: 12px 16px;
    font-size: 13.5px; font-weight: 500;
    margin-bottom: 16px;
}
.sp-alert.success { background: #e5f7eb; color: #15803d; border: 1px solid #c9ecd6; }
.sp-alert.error { background: #fde5e5; color: #b91c1c; border: 1px solid #f5c6c6; }
.sp-alert.info { background: #e5edfd; color: #1d4ed8; border: 1px solid #c9daf7; }
.sp-alert.warning { background: #fff1dd; color: #b45309; border: 1px solid #f7dfbb; }

/* ---------- Page head ---------- */
.sp-page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.sp-page-head h4 { font-size: 19px; font-weight: 700; margin: 0; }
.sp-page-head .sub { font-size: 12.5px; color: var(--sp-text-soft); margin-top: 2px; }
.sp-page-head .head-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.sp-breadcrumb { font-size: 12.5px; color: var(--sp-text-soft); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.sp-breadcrumb a { color: var(--sp-text-soft); }
.sp-breadcrumb a:hover { color: var(--sp-blue); }

/* ---------- Grids ---------- */
.sp-grid { display: grid; gap: 20px; }
.sp-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.sp-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.sp-grid.g-16 { gap: 16px; }
.dash-main { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; margin-bottom: 20px; }
.dash-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.dash-row3 .sp-card { margin-bottom: 0; }

/* ---------- Quick actions ---------- */
.sp-quick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.sp-quick a {
    border-radius: 12px; padding: 18px 10px;
    color: #fff; text-align: center;
    font-size: 13px; font-weight: 600;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    box-shadow: var(--sp-shadow);
}
.sp-quick a .bi { font-size: 22px; }
.sp-quick a:hover { color: #fff; filter: brightness(1.08); }
.qa-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.qa-green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.qa-purple { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.qa-orange { background: linear-gradient(135deg, #fb923c, #f97316); }
.qa-teal { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.qa-gray { background: linear-gradient(135deg, #94a3b8, #64748b); }

/* ---------- Misc ---------- */
.sp-empty { text-align: center; color: var(--sp-text-soft); padding: 34px 16px; font-size: 13.5px; }
.sp-empty .bi { font-size: 34px; display: block; margin-bottom: 8px; color: #c6cede; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.text-soft { color: var(--sp-text-soft); }
.text-xs { font-size: 12px; }
.fw-700 { font-weight: 700; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 14px; } .mt-3 { margin-top: 14px; }
.d-flex { display: flex; } .items-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.ml-auto { margin-left: auto; }

.notif-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #eef1f6; }
.notif-item:last-child { border-bottom: none; }
.notif-item .n-icon {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.notif-item .n-title { font-size: 13px; font-weight: 600; }
.notif-item .n-time { font-size: 11.5px; color: var(--sp-text-soft); }
.notif-item.unread { background: #f6f9ff; }

.detail-list { list-style: none; }
.detail-list li { display: flex; padding: 9px 0; border-bottom: 1px dashed #e7ebf2; font-size: 13.5px; }
.detail-list li:last-child { border-bottom: none; }
.detail-list .dl-label { width: 42%; color: var(--sp-text-soft); flex-shrink: 0; }
.detail-list .dl-value { font-weight: 600; word-break: break-word; }

.timeline { list-style: none; position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: #e7ebf2; }
.timeline li { position: relative; padding: 0 0 16px 8px; font-size: 13px; }
.timeline li::before {
    content: ''; position: absolute; left: -21px; top: 4px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--sp-blue); border: 2px solid #fff; box-shadow: 0 0 0 2px #dbe4f5;
}
.timeline .t-time { color: var(--sp-text-soft); font-size: 11.5px; }

/* ---------- Modal ---------- */
.sp-modal-backdrop {
    position: fixed; inset: 0; background: rgba(14, 26, 58, .55);
    display: none; align-items: flex-start; justify-content: center;
    z-index: 1060; padding: 60px 16px;
    overflow-y: auto;
}
.sp-modal-backdrop.open { display: flex; }
.sp-modal {
    background: #fff; border-radius: 16px; width: 100%; max-width: 520px;
    box-shadow: 0 20px 50px rgba(16, 24, 40, .3);
}
.sp-modal .m-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--sp-card-border); }
.sp-modal .m-head h6 { font-size: 15px; font-weight: 700; margin: 0; }
.sp-modal .m-close { margin-left: auto; background: none; border: none; font-size: 18px; color: var(--sp-text-soft); cursor: pointer; }
.sp-modal .m-body { padding: 20px; }
.sp-modal .m-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--sp-card-border); }

/* ---------- Footer ---------- */
.sp-footer {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 16px 4px 6px;
    font-size: 12.5px; color: var(--sp-text-soft);
}
.sp-footer .links { margin-left: auto; display: flex; gap: 14px; }

/* ---------- Auth pages ---------- */
.sp-auth {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--sp-navy) 0%, #1a2a5e 55%, #24356e 100%);
    padding: 24px;
}
.sp-auth-card {
    background: #fff; border-radius: 20px; width: 100%; max-width: 420px;
    padding: 36px 34px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.sp-auth-card .brand { text-align: center; margin-bottom: 26px; }
.sp-auth-card .brand .bi { font-size: 38px; color: var(--sp-red); }
.sp-auth-card .brand h1 { font-size: 24px; font-weight: 800; color: var(--sp-navy); display: inline-block; margin-left: 6px; }
.sp-auth-card .brand h1 span { color: var(--sp-red); }
.sp-auth-card .brand p { font-size: 13px; color: var(--sp-text-soft); margin-top: 4px; }
.sp-auth-divider { text-align: center; font-size: 12px; color: #9aa3b2; margin: 18px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1900px) {
    .sp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sp-quick { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1200px) {
    .dash-main, .dash-row3 { grid-template-columns: 1fr; }
    .sp-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 991px) {
    .sp-sidebar { transform: translateX(-100%); }
    body.sidebar-open .sp-sidebar { transform: translateX(0); box-shadow: 8px 0 30px rgba(0, 0, 0, .3); }
    .sp-main { margin-left: 0; }
    .sp-header-search { display: none; }
    .sp-grid.cols-2 { grid-template-columns: 1fr; }
    .sp-form-row, .sp-form-row.three { grid-template-columns: 1fr; }
    .sp-profile .p-meta { display: none; }
    .sp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    html { font-size: 14px; }
    .sp-stats { grid-template-columns: 1fr; }
    .sp-quick { grid-template-columns: repeat(2, 1fr); }
    .sp-grid.cols-3 { grid-template-columns: 1fr; }
    .sp-main { padding: calc(var(--sp-header-h) + 14px) 12px 14px; }
    .sp-brand-title, .sp-brand-divider { display: none; }
    .sp-header { padding: 0 12px; gap: 10px; }
    .sp-welcome .w-right { width: 100%; }
}

.sidebar-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(14, 26, 58, .45); z-index: 1015;
}
body.sidebar-open .sidebar-backdrop { display: block; }

@media print {
    .sp-header, .sp-sidebar, .sp-footer, .sp-toolbar, .sp-pagination, .btn-sp, .head-actions { display: none !important; }
    .sp-main { margin: 0; padding: 0; }
    body { background: #fff; }
    .sp-card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
