﻿/* ======================================================
   ASTRA ISUZU — ADMIN INTELLIGENCE SYSTEM
====================================================== */

:root {
    --sidebar-w:     260px;
    --topbar-h:      64px;
    color-scheme:    light;

    /* ---- LIGHT THEME — key visual Astra Isuzu (merah korporat + putih) ---- */
    --dark:          #FFFFFF;                 /* sidebar & topbar */
    --darker:        #FFFFFF;                 /* page background */
    --card:          #FFFFFF;
    --card-border:   #C8D2DE;                 /* garis tegas, tidak samar */
    --surface:       #F5F7F9;                 /* hover / raised surface */
    --surface-2:     #EEF1F5;

    --red:           #DA291C;                 /* Isuzu Red — Pantone 485 C */
    --red-dark:      #B32116;
    --red-soft:      #FBE6E4;
    --cyan:          #145298;                 /* Astra Blue (biru tua korporat) */
    --astra-blue:    #145298;
    --astra-blue-fill: #599AD7;             /* bidang saja, bukan teks */
    --text:          #16202E;
    --muted:         #41505F;
    --success:       #145298;
    --warning:       #B32116;
    --danger:        #DA291C;
    --info:          #145298;
    --cold:          #0E3A6B;
    --warm:          #2166A8;
    --hot:           #DA291C;
    --negotiating:   #16202E;
    --waiting:       #4A5A6E;
    --closing:       #9B1B12;
}

* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { font-family:'Plus Jakarta Sans','Inter',system-ui,sans-serif; background:var(--darker); color:var(--text); overflow-x:hidden; }
a { text-decoration:none; color:inherit; }
img { max-width:100%; display:block; }

/* ======================================================
   LAYOUT
====================================================== */

.admin-wrapper { display:flex; min-height:100vh; }

/* ======================================================
   SIDEBAR
====================================================== */

.admin-sidebar {
    width: var(--sidebar-w);
    background: var(--dark);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    overflow-y: auto;
    transition: transform .3s ease;
}

.admin-sidebar::-webkit-scrollbar { width:4px; }
.admin-sidebar::-webkit-scrollbar-track { background:transparent; }
.admin-sidebar::-webkit-scrollbar-thumb { background:#E3E8EF; border-radius:6px; }

.sidebar-logo {
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.sidebar-logo-brand {
    font-size: 20px;
    font-weight:700;
    letter-spacing: .5px;
    line-height: 1;
}

.sidebar-logo-brand span { color: var(--red); }

.sidebar-logo-sub {
    font-size:12px;
    font-weight:600;
    letter-spacing: 2px;
    color: var(--muted);
    text-transform: uppercase;
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-section-label {
    font-size:12px;
    font-weight:700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--muted);
    padding: 14px 24px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #41505F;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    border-radius: 0;
}

.nav-item:hover { color: var(--text); background: #F5F7F9; }

.nav-item.active {
    color: var(--red);
    background: var(--red-soft);
    font-weight:600;
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 3px;
    background: var(--red);
    border-radius: 0 3px 3px 0;
}

.nav-item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item-text { flex: 1; }

.nav-item-arrow {
    font-size:12px;
    transition: transform .25s;
    color: var(--muted);
}

.nav-item.open .nav-item-arrow { transform: rotate(90deg); }

.nav-submenu {
    display: none;
    background: #F5F7F9;
}

.nav-submenu.open { display: block; }

.nav-subitem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 24px 9px 52px;
    font-size: 13px;
    color: #41505F;
    transition: color .2s;
}

.nav-subitem:hover { color: #334155; }
.nav-subitem.active { color: #9B1B12; font-weight:500; }
.nav-subitem::before { content:"·"; margin-right:4px; }

.sidebar-help {
    margin: 16px;
    border-radius: 16px;
    background: #FBE6E4;
    border: 1px solid #DA291C;
    padding: 18px;
    flex-shrink: 0;
}

.sidebar-help p {
    font-size: 12px;
    color: #41505F;
    line-height: 1.6;
    margin-bottom: 12px;
}

.sidebar-help-btn {
    display: block;
    text-align: center;
    padding: 9px;
    background: var(--red);
    color: white;
    border-radius:8px;
    font-size: 13px;
    font-weight:600;
    transition: .25s;
}

.sidebar-help-btn:hover { background: #B32116; }

/* ======================================================
   TOPBAR
====================================================== */

.admin-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: var(--topbar-h);
    background: #FFFFFF;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--card-border);
    z-index: 90;
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 20px;
}

.topbar-hamburger {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: .2s;
    display: flex;
    align-items: center;
}

.topbar-hamburger:hover { background: #EEF1F5; color: var(--text); }

.topbar-title {
    font-size: 16px;
    font-weight:600;
    flex-shrink: 0;
}

.topbar-spacer { flex: 1; }

.topbar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #F5F7F9;
    border: 1px solid var(--card-border);
    border-radius:8px;
    padding: 0 14px;
    height: 38px;
    width: 260px;
}

.topbar-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    width: 100%;
}

.topbar-search input::placeholder { color: var(--muted); }

.topbar-icon-btn {
    position: relative;
    width: 38px; height: 38px;
    background: #F5F7F9;
    border: 1px solid var(--card-border);
    border-radius:8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    transition: .2s;
    flex-shrink: 0;
}

.topbar-icon-btn:hover { background: #EEF1F5; color: var(--text); }

.topbar-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--red);
    color: white;
    font-size:12px;
    font-weight:700;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: #F5F7F9;
    border: 1px solid var(--card-border);
    border-radius:8px;
    cursor: pointer;
    transition: .2s;
}

.topbar-user:hover { background: #EEF1F5; }

.topbar-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight:700;
    color: white;
    flex-shrink: 0;
}

.topbar-user-info { line-height: 1.2; }
.topbar-user-name { font-size: 13px; font-weight:600; }
.topbar-user-role { font-size:12px; color: var(--muted); }

/* ======================================================
   MAIN CONTENT
====================================================== */

.admin-main {
    margin-left: var(--sidebar-w);
    margin-top: var(--topbar-h);
    padding: 24px 28px;
    min-height: calc(100vh - var(--topbar-h));
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
}

/* ======================================================
   CARDS
====================================================== */

.admin-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius:16px;
    padding: 24px;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.admin-card-title {
    font-size: 15px;
    font-weight:600;
}

/* ======================================================
   KPI STATS
====================================================== */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius:16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color .3s;
}

.kpi-card:hover { border-color: #C8D2DE; }

.kpi-icon {
    width: 48px; height: 48px;
    border-radius:12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.kpi-data { flex: 1; min-width: 0; }

.kpi-value {
    font-size: 26px;
    font-weight:700;
    line-height: 1;
    margin-bottom: 4px;
}

.kpi-label {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.kpi-pct {
    font-size:12px;
    color: var(--muted);
    margin-top: 3px;
}

.kpi-cold    .kpi-icon { background: #E7EFF7; color: var(--cold); }
.kpi-warm    .kpi-icon { background: #E7EFF7; color: var(--warm); }
.kpi-hot     .kpi-icon { background: #FBE6E4; color: var(--hot); }
.kpi-neg     .kpi-icon { background: #E3E8EF; color: var(--negotiating); }
.kpi-wait    .kpi-icon { background: #E3E8EF; color: var(--waiting); }
.kpi-close   .kpi-icon { background: #FBE6E4;  color: var(--closing); }
.kpi-total   .kpi-icon { background: var(--red-soft); color: var(--red); }

/* ======================================================
   DASHBOARD GRID
====================================================== */

.dash-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dash-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dash-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dash-grid-6-4 {
    display: grid;
    grid-template-columns: 6fr 4fr;
    gap: 20px;
    margin-bottom: 20px;
}

.dash-grid-4-6 {
    display: grid;
    grid-template-columns: 4fr 6fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* ======================================================
   STATUS BADGE
====================================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight:600;
}

.badge-cold       { background: var(--cold);        color: #FFFFFF; }
.badge-warm       { background: var(--warm);        color: #FFFFFF; }
.badge-hot        { background: var(--hot);         color: #FFFFFF; }
.badge-negotiating{ background: var(--negotiating); color: #FFFFFF; }
.badge-waiting    { background: var(--waiting);     color: #FFFFFF; }
.badge-closing    { background: var(--closing);     color: #FFFFFF; }
.badge-active     { background: var(--astra-blue);  color: #FFFFFF; }
.badge-inactive   { background: #FFFFFF; color: #41505F; border: 1px solid #C8D2DE; }

/* ======================================================
   TABLES
====================================================== */

.admin-table-wrap {
    overflow-x: auto;
    border-radius: 16px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    text-align: left;
    padding: 12px 16px;
    font-size:12px;
    font-weight:600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #C8D2DE;
    vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table tr:hover td { background: #F5F7F9; }

/* ======================================================
   FORMS
====================================================== */

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group.full { grid-column: 1 / -1; }

.form-label {
    font-size: 12px;
    font-weight:600;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #41505F;
}

.form-input,
.form-select,
.form-textarea {
    background: #F5F7F9;
    border: 1px solid #C8D2DE;
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .25s;
    width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--red); }

.form-input::placeholder,
.form-textarea::placeholder { color: #41505F; }

.form-select option { background: #FFFFFF; }

.form-textarea { resize: vertical; min-height: 100px; }

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

/* IMAGE UPLOAD */

.upload-zone {
    border: 2px dashed #C8D2DE;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: border-color .25s, background .25s;
    position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--red);
    background: var(--red-soft);
}

.upload-zone input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.upload-icon { font-size: 40px; margin-bottom: 12px; }
.upload-text { font-size: 14px; color: #41505F; }
.upload-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color .25s;
}

.image-preview-item.is-main { border-color: var(--red); }

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-actions {
    position: absolute;
    inset: 0;
    background: #C8D2DE;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity .25s;
}

.image-preview-item:hover .image-preview-actions { opacity: 1; }

.img-action-btn {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 13px;
    transition: .2s;
}

/* ======================================================
   BUTTONS
====================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    border-radius:8px;
    font-size: 13px;
    font-weight:600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all .25s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-red     { background: var(--red); color: white; }
.btn-red:hover { background: #B32116; transform: translateY(-2px); }

.btn-ghost   { background: #FFFFFF; border:1px solid var(--card-border); color: var(--text); }
.btn-ghost:hover { background: var(--surface); border-color: #C8D2DE; }

.btn-danger  { background: #FFFFFF; color: #9B1B12; border:1px solid #9B1B12; }
.btn-danger:hover { background: #9B1B12; color: #FFFFFF; }

.btn-success { background: #FFFFFF; color: var(--success); border:1px solid var(--success); }

.btn-sm { height: 32px; padding: 0 14px; font-size: 12px; border-radius: 8px; }

.btn-icon {
    width: 36px; height: 36px;
    padding: 0;
    border-radius:8px;
}

/* ======================================================
   PAGE HEADER
====================================================== */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header-left h1 {
    font-size: 22px;
    font-weight:700;
    margin-bottom: 4px;
}

.page-header-left p {
    font-size: 13px;
    color: var(--muted);
}

/* ======================================================
   ALERT / TOAST
====================================================== */

.alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: #E7EFF7; border:1px solid #2166A8; color: var(--success); }
.alert-error   { background: #FBE6E4;  border:1px solid #DA291C; color: var(--danger); }

/* ======================================================
   CHART CONTAINER
====================================================== */

.chart-container {
    position: relative;
    height: 240px;
}

.chart-container-sm { height: 180px; }
.chart-container-lg { height: 320px; }

/* ======================================================
   PROSPECT MAP
====================================================== */

#prospectMap, #adminDealerMap {
    width: 100%;
    height: 480px;
    border-radius: 16px;
    overflow: hidden;
}

/* ======================================================
   TOGGLE
====================================================== */

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
}

.toggle-input { display: none; }

.toggle-track {
    width: 44px; height: 24px;
    background: #EEF1F5;
    border-radius: 12px;
    position: relative;
    transition: background .25s;
    flex-shrink: 0;
}

.toggle-thumb {
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform .25s;
}

.toggle-input:checked + .toggle-track { background: var(--red); }
.toggle-input:checked + .toggle-track .toggle-thumb { transform: translateX(20px); }

/* ======================================================
   PAGINATION
====================================================== */

.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 20px;
}

.page-btn {
    width: 34px; height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight:500;
    background: #F5F7F9;
    border: 1px solid var(--card-border);
    color: var(--muted);
    cursor: pointer;
    transition: .2s;
}

.page-btn:hover { background: #EEF1F5; color: var(--text); }
.page-btn.active { background: var(--red); border-color: var(--red); color: white; }

/* ======================================================
   NEON KPI ROW
====================================================== */

.neon-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr)) repeat(2, minmax(0,1fr)) minmax(0,1.4fr);
    gap: 12px;
    margin-bottom: 16px;
}

.neon-kpi-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius:12px;
    padding: 14px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: border-color .3s, box-shadow .3s;
    min-width: 0;
}

.neon-kpi-card:hover {
    border-color: #C8D2DE;
}

.neon-kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.neon-kpi-body { flex: 1; min-width: 0; }

.neon-kpi-label {
    font-size:12px;
    color: var(--muted);
    font-weight:600;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.neon-kpi-val {
    font-size: 24px;
    font-weight:700;
    line-height: 1;
    margin-bottom: 2px;
}

.neon-kpi-pct {
    font-size:12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.neon-kpi-total {
    background: #FBE6E4;
    border-color: #DA291C;
    flex-direction: row;
    gap: 10px;
}

.neon-kpi-total-val {
    font-size: 30px;
    font-weight:700;
    color: var(--text);
    text-shadow: none;
}

/* ======================================================
   NEON SELECT / SEARCH
====================================================== */

.neon-select {
    background: #F5F7F9;
    border: 1px solid #C8D2DE;
    border-radius: 8px;
    padding: 6px 12px;
    color: var(--text);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.neon-select option { background: #FFFFFF; }

.neon-search {
    background: #F5F7F9;
    border: 1px solid #C8D2DE;
    border-radius: 8px;
    padding: 6px 12px;
    color: var(--text);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    width: 180px;
}

.neon-search::placeholder { color: #41505F; }
.neon-search:focus { border-color: var(--red); }

/* ======================================================
   NEON ACTION BUTTONS
====================================================== */

.neon-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: .2s;
}

.neon-view { background: #E7EFF7; }
.neon-view:hover { background: #D5E0EC; }

.neon-edit { background: #EEF1F5; }
.neon-edit:hover { background: #D5E0EC; }

.neon-del { background: #FBE6E4; }
.neon-del:hover { background: #F8D4D2; }

/* ======================================================
   NEON MINI STAT (master data quick links)
====================================================== */

.neon-mini-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: 12px;
    background: #F5F7F9;
    border: 1px solid #C8D2DE;
    text-decoration: none;
    transition: .25s;
}

.neon-mini-stat:hover {
    background: #EEF1F5;
    border-color: var(--clr, #DA291C);
    box-shadow: 0 2px 10px #E3E8EF;
}

.neon-mini-val {
    font-size: 22px;
    font-weight:700;
    color: var(--clr, #DA291C);
    text-shadow: none;
    line-height: 1;
    margin-bottom: 4px;
}

.neon-mini-lbl {
    font-size:12px;
    color: var(--muted);
    font-weight:600;
    text-transform: uppercase;
    letter-spacing: .8px;
}

/* ======================================================
   VEHICLE GALLERY PREVIEW (mirrors truck detail page)
====================================================== */

/* Main image container */
.admin-main-img-wrap {
    position: relative;
    height: 480px;
    border-radius:16px;
    overflow: hidden;
    background: #FFFFFF;
    border: 1px solid #C8D2DE;
    box-shadow: 0 24px 80px #E3E8EF;
    margin-bottom: 16px;
    cursor: pointer;
}

.admin-main-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
    display: block;
}

.admin-main-img-wrap:hover img {
    transform: scale(1.02);
}

.admin-main-img-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #41505F;
}

.admin-main-img-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 24px;
    background: rgba(0,0,0,.55);
    pointer-events: none;
}

.admin-main-img-overlay span {
    font-size: 12px;
    font-weight:700;
    letter-spacing: 2px;
    color: #FFFFFF;
}

/* Thumbnail grid — exactly 6 columns like truck detail */
.admin-thumb-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.admin-thumb-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius:12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    background: #EEF1F5;
    transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}

.admin-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.admin-thumb-item:hover {
    transform: translateY(-4px);
    border-color: #DA291C;
    box-shadow: 0 12px 30px #FBE6E4;
}

.admin-thumb-item:hover img {
    transform: scale(1.06);
}

.admin-thumb-item.active-thumb {
    border-color: #DA291C;
    box-shadow: 0 8px 24px #F8D4D2;
}

.admin-thumb-item.is-main {
    border-color: var(--red);
}

/* Delete button on thumbnail */
.admin-thumb-del {
    position: absolute;
    top: 0; right: 0;
    padding: 4px;
    opacity: 0;
    transition: opacity .25s;
    z-index: 2;
}

.admin-thumb-item:hover .admin-thumb-del {
    opacity: 1;
}

.admin-thumb-del-btn {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #DA291C;
    border: none;
    color: white;
    font-size:12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.admin-thumb-del-btn:hover { background: #9B1B12; }

/* "UTAMA" badge on thumbnail */
.admin-thumb-main-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    font-size:12px;
    font-weight:700;
    letter-spacing: .8px;
    background: var(--red);
    color: white;
    padding: 2px 6px;
    border-radius:6px;
}

/* Add photo button */
.admin-thumb-add {
    aspect-ratio: 4/3;
    border-radius:12px;
    border: 2px dashed #C8D2DE;
    background: #F5F7F9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .25s, background .25s;
    color: var(--muted);
}

.admin-thumb-add:hover {
    border-color: var(--red);
    background: var(--red-soft);
    color: var(--red);
}

/* ======================================================
   PIPELINE INTELLIGENCE STRIP
====================================================== */

.pipeline-strip {
    /* layout handled inline per row */
}

.pipeline-card {
    background: var(--card);
    border: 1px solid #C8D2DE;
    border-radius: 16px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: border-color .25s, transform .2s;
}

.pipeline-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--pc, #145298);
    opacity: .6;
}

.pipeline-card:hover {
    border-color: var(--pc, #145298);
    transform: translateY(-1px);
}

/* ======================================================
   DASHBOARD — 3-COLUMN MAIN GRID
====================================================== */

.dash-3col {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,360px) minmax(0,260px);
    gap: 16px;
}

/* ======================================================
   DASHBOARD KPI STRIP — clean, minimal
====================================================== */

.dash-kpi-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0,1fr)) minmax(0,1.6fr);
    gap: 8px;
    margin-bottom: 14px;
}

.dash-kpi-chip {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-top: 3px solid var(--kc, #145298);
    border-radius:8px;
    padding: 8px 10px 6px;
    display: flex;
    flex-direction: column;
    gap: 1px;
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
    min-width: 0;
}

.dash-kpi-chip:hover {
    background: color-mix(in srgb, var(--kc, #145298) 8%, #FFFFFF);
    box-shadow: inset 0 0 0 1px var(--kc, #145298);
}

.dash-kpi-num {
    font-size: 20px;
    font-weight:700;
    line-height: 1;
    letter-spacing: -.5px;
}

.dash-kpi-lbl {
    font-size:12px;
    font-weight:500;
    color: #41505F;
    text-transform: uppercase;
    letter-spacing: .6px;
    white-space: normal;
    line-height: 1.3;
}

.dash-kpi-pct {
    font-size:12px;
    color: #41505F;
    font-weight: 500;
}

.dash-kpi-total {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-top: 3px solid var(--red);
    border-radius:8px;
    padding: 8px 12px 6px;
    display: flex;
    align-items: stretch;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
}

#miniLineChart {
    display: block;
    width: 72px !important;
    height: 44px !important;
    flex-shrink: 0;
    align-self: center;
}

/* ── Follow-Up widget ── */

.followup-card { padding: 16px 20px; }

.followup-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    transition: background .15s;
}

.followup-row:hover { background: #F5F7F9; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .6; transform: scale(1.3); }
}

/* ── Map dot: Ping Ripple — solid core + crisp border ring (no blur/fill) ── */
@keyframes map-ping {
    0%   { transform: scale(1); opacity: .85; }
    100% { transform: scale(4.5); opacity: 0; }
}

.neon-map-dot {
    position: relative;
    width: 8px; height: 8px;
}

.map-dot-core {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

/* Ring = border outline only — no fill, no blur */
.map-dot-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid;
    animation: map-ping var(--ping-dur, 2s) cubic-bezier(0, 0, .2, 1) infinite;
}

/* Second ring — fires at half-duration offset */
.map-dot-ring2 {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid;
    animation: map-ping var(--ping-dur, 2s) cubic-bezier(0, 0, .2, 1) infinite;
    animation-delay: calc(var(--ping-dur, 2s) / 2);
}

/* ── Hide hamburger on desktop (sidebar always visible ≥ 901px) ── */
@media(min-width:901px) {
    .topbar-hamburger { display: none !important; }
}

/* ======================================================
   PROSPECT KPI STRIP
====================================================== */

.prospect-kpi-strip {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.prospect-kpi-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 18px;
    border-radius: 12px;
    background: #F5F7F9;
    border: 1px solid #C8D2DE;
    text-decoration: none;
    transition: .2s;
    min-width: 90px;
    flex: 1;
}

.prospect-kpi-chip:hover {
    background: color-mix(in srgb, var(--chip-clr, #41505F) 8%, #FFFFFF);
    border-color: var(--chip-clr, #41505F);
}

.prospect-kpi-chip.active {
    background: color-mix(in srgb, var(--chip-clr, #DA291C) 12%, #FFFFFF);
    border-color: var(--chip-clr, #DA291C);
}

/* ======================================================
   RESPONSIVE — Full breakpoint system
====================================================== */

/* ── 1400px — Wide desktop ── */
@media(max-width:1400px) {
    .dash-kpi-strip { grid-template-columns: repeat(4, minmax(0,1fr)) repeat(2, minmax(0,1fr)) minmax(0,1.5fr); }
}
@media(max-width:1400px) {
    .neon-kpi-row {
        grid-template-columns: repeat(4, minmax(0,1fr)) repeat(3, minmax(0,1fr));
    }
    .dash-3col {
        grid-template-columns: minmax(0,1fr) minmax(0,310px) minmax(0,240px);
    }
}

/* ── 1200px — Standard desktop ── */
@media(max-width:1200px) {
    :root { --sidebar-w: 220px; }
    /* pipeline rows handled inline */
    .dash-grid-4 { grid-template-columns: 1fr 1fr; }
    .neon-kpi-row {
        grid-template-columns: repeat(4, minmax(0,1fr)) repeat(3, minmax(0,1fr));
    }
    .dash-3col {
        grid-template-columns: minmax(0,1fr) minmax(0,290px) minmax(0,210px);
        gap: 14px;
    }
}

/* ── 1100px — Narrow desktop / large tablet landscape ── */
@media(max-width:1100px) {
    .neon-kpi-row {
        grid-template-columns: repeat(4, minmax(0,1fr));
    }
    .dash-3col {
        grid-template-columns: minmax(0,1fr) minmax(0,270px);
    }
    .dash-3col > *:last-child {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
}

/* ── 1024px — Tablet landscape ── */
@media(max-width:1024px) {
    .topbar-search { display: none; }
    .admin-card { padding: 18px; }
    .neon-kpi-row {
        grid-template-columns: repeat(4, minmax(0,1fr));
        gap: 10px;
    }
    .dash-3col {
        grid-template-columns: minmax(0,1fr) minmax(0,260px);
        gap: 12px;
    }
    .dash-3col > *:last-child {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
}

/* ── 1024px — dash-kpi-strip ── */
@media(max-width:1024px) {
    .dash-kpi-strip { grid-template-columns: repeat(3, minmax(0,1fr)) repeat(3, minmax(0,1fr)) minmax(0,1.3fr); gap: 8px; }
}

/* ── 900px — Tablet portrait (sidebar hides) ── */
@media(max-width:900px) {
    .admin-sidebar { transform: translateX(-100%); z-index: 20000; }
    .admin-sidebar.open { transform: translateX(0); box-shadow: 4px 0 32px #E3E8EF; }
    .admin-topbar { left: 0; margin-left: 0; }
    .admin-main   { margin-left: 0; padding: 16px; }

    .page-header  { flex-wrap: wrap; gap: 12px; }
    .page-header > *:last-child { width: 100%; display: flex; gap: 8px; flex-wrap: wrap; }

    .dash-grid-2, .dash-grid-3, .dash-grid-6-4, .dash-grid-4-6 { grid-template-columns: 1fr; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }

    .neon-kpi-row { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }

    .dash-3col { grid-template-columns: 1fr; gap: 14px; }
    .dash-3col > *:last-child {
        grid-column: auto;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .prospect-kpi-chip { min-width: 70px; padding: 10px 12px; }
    .dash-kpi-strip { grid-template-columns: repeat(3, minmax(0,1fr)) minmax(0,1.3fr); gap: 8px; }
    .dash-kpi-num { font-size: 22px; }

    .admin-table { font-size: 13px; }
    .admin-table th, .admin-table td { padding: 10px 12px; }
}

/* ── 768px — Tablet portrait small ── */
@media(max-width:768px) {
    /* pipeline rows responsive handled inline */
    .admin-main { padding: 14px; }
    .admin-card { padding: 16px; border-radius: 16px; }

    .neon-kpi-row { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
    .neon-kpi-val { font-size: 20px; }
    .neon-kpi-icon { width: 36px; height: 36px; font-size: 16px; border-radius:8px; }
    .dash-kpi-strip { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
    .dash-kpi-num { font-size: 20px; }

    .dash-3col { grid-template-columns: 1fr; }
    .dash-3col > *:last-child {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .prospect-kpi-strip { gap: 8px; }
    .prospect-kpi-strip .prospect-kpi-chip { min-width: 60px; flex: 1; padding: 8px 10px; }

    .page-header-left h1 { font-size: 18px; }
    .admin-card-title { font-size: 14px; }

    /* Filter bars: stack */
    .admin-card form[method="GET"] { flex-direction: column; align-items: stretch !important; }
    .neon-search, .neon-select { width: 100% !important; }

    /* Analytics: tighten KPI row */
    .neon-kpi-total-val { font-size: 22px; }

    /* Collapse 3-col+ inline grids → 2 col on tablet */
    [style*="grid-template-columns:1fr 1fr 1fr"],
    [style*="grid-template-columns:repeat(3,1fr)"],
    [style*="grid-template-columns:1fr 360px"],
    [style*="grid-template-columns:1fr 460px"],
    [style*="grid-template-columns:minmax(0,1fr) minmax(0,360px)"],
    [style*="grid-template-columns:minmax(0,1fr) minmax(0,340px)"] {
        grid-template-columns: 1fr 1fr !important;
    }
    /* Pure sidebar layouts → single col on tablet */
    [style*="grid-template-columns:6fr 4fr"],
    [style*="grid-template-columns:4fr 6fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* ── 480px — Mobile ── */
@media(max-width:480px) {
    :root { --topbar-h: 56px; }
    .admin-main { padding: 10px; }
    .admin-card { padding: 14px; border-radius:12px; }

    .topbar-user-info  { display: none; }
    .topbar-user       { padding: 5px 8px; }
    .topbar-icon-btn   { width: 34px; height: 34px; }

    .neon-kpi-row { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
    .neon-kpi-val { font-size: 18px; }
    .neon-kpi-icon { width: 32px; height: 32px; font-size: 14px; border-radius: 8px; }
    .neon-kpi-label { font-size:12px; }
    .neon-kpi-card { padding: 10px; gap: 8px; border-radius: 12px; }
    .neon-kpi-total .neon-kpi-total-val { font-size: 20px; }

    .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .page-header > *:last-child { width: 100%; }
    .page-header-left h1 { font-size: 17px; }

    .admin-card-header  { flex-wrap: wrap; gap: 8px; }
    .admin-card-title   { font-size: 13px; }

    .btn { height: 36px; padding: 0 14px; font-size: 12px; }
    .btn-sm { height: 30px; padding: 0 10px; font-size:12px; }

    .dash-3col > *:last-child {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .prospect-kpi-strip { gap: 6px; }
    .prospect-kpi-chip { min-width: 50px; padding: 8px 6px; }
    .prospect-kpi-chip > span:first-child { font-size: 16px; }
    .prospect-kpi-chip > span:last-child  { font-size:12px; }

    /* Tables: tighten */
    .admin-table { font-size: 12px; }
    .admin-table th, .admin-table td { padding: 8px 10px; }

    /* Forms: full width */
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
    .form-input, .form-select, .form-textarea { font-size: 13px; padding: 10px 13px; }

/* ======================================================
   PAGINATION — admin dark theme override
====================================================== */

.neon-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-wrap: wrap;
}

.neon-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight:500;
    text-decoration: none;
    border: 1px solid #C8D2DE;
    background: #F5F7F9;
    color: #41505F;
    transition: all .2s;
    cursor: pointer;
    line-height: 1;
}

.neon-page-btn:hover  { background: #E7EFF7; border-color: #145298; color: #145298; }
.neon-page-btn.active { background: #D5E0EC; border-color: #145298;  color: #145298; font-weight:700; }
.neon-page-btn:disabled,
.neon-page-btn[aria-disabled="true"] {
    opacity: .35;
    cursor: default;
    pointer-events: none;
}
.neon-page-btn svg { width: 14px; height: 14px; display: block; }
.neon-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 32px;
    color: #41505F;
    font-size: 12px;
}

    /* Collapse ALL inline multi-column grids → 1 col on mobile */
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns:1fr 1fr 1fr"],
    [style*="grid-template-columns:1fr 2fr"],
    [style*="grid-template-columns:2fr 1fr"],
    [style*="grid-template-columns:160px 1fr"],
    [style*="grid-template-columns:repeat(2"],
    [style*="grid-template-columns:repeat(3"],
    [style*="grid-template-columns:1fr 360px"],
    [style*="grid-template-columns:1fr 460px"],
    [style*="grid-template-columns:minmax(0,1fr) minmax(0,1.6fr)"],
    [style*="grid-template-columns:minmax(0,1fr) minmax(0,360px)"],
    [style*="grid-template-columns:minmax(0,1fr) minmax(0,340px)"],
    [style*="grid-template-columns:6fr 4fr"],
    [style*="grid-template-columns:4fr 6fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* ══════════════════════════════════════════════════════
   DASHBOARD VISUAL UPGRADE — Aesthetic 100/100
══════════════════════════════════════════════════════ */

/* 1 — Page background dot texture */
.admin-main {
    background-image: none;
    background-size: 28px 28px;
    background-attachment: local;
}

/* 2 — Card entrance animation + depth */
.admin-card {
    position: relative;
    overflow: hidden;
    animation: cardIn .42s cubic-bezier(.22,.68,0,1.15) both;
    transition: box-shadow .25s ease, transform .25s ease;
}
/* Shimmer highlight line at card top */
.admin-card::after {
    content: '';
    position: absolute;
    top: 0; left: 15%; right: 15%;
    height: 1px;
    background: #EEF1F5;
    pointer-events: none;
    z-index: 1;
}
.admin-card:hover {
    box-shadow: 0 8px 40px #EEF1F5, 0 0 0 1px #F5F7F9;
    transform: translateY(-2px);
}
.admin-card.no-lift:hover {
    transform: none;
    box-shadow: none;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 3 — Pipeline card hover neon lift */
.pipeline-card {
    transition: transform .22s ease, box-shadow .22s ease;
}
.pipeline-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px #E3E8EF;
                
}

/* 4 — KPI chip hover */
.dash-kpi-chip {
    transition: background .2s, box-shadow .2s, transform .2s;
}
.dash-kpi-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px #EEF1F5;
                
}

/* 5 — Section dividers */
.dash-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 12px;
}
.dash-section-label {
    font-size:12px;
    font-weight:700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #41505F;
    white-space: nowrap;
}
.dash-section-line {
    flex: 1;
    height: 1px;
    background: #F5F7F9;
}

/* 6 — Gradient number text utilities */
.num-grad-orange {
    background: #DA291C;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.num-grad-purple {
    background: #16202E;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.num-grad-green {
    background: #2166A8;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 7 — Count-up number pop */
@keyframes numPop {
    0%   { transform: scale(.85); opacity: 0; }
    60%  { transform: scale(1.06); }
    100% { transform: scale(1);   opacity: 1; }
}
.kpi-num-animate {
    animation: numPop .5s cubic-bezier(.22,.68,0,1.4) both;
}

/* 8 — Stronger glow on overdue alert */
.dash-alert-pulse {
    animation: alertGlow 2.5s ease-in-out infinite;
}
@keyframes alertGlow {
    0%, 100% { box-shadow: 0 0 0 0 #FFFFFF; }
    50%       { box-shadow: 0 0 0 4px #FBE6E4; }
}

/* ======================================================
   LIGHT THEME — penyesuaian akhir
   Di latar terang, garis saja kurang memisahkan bidang;
   bayangan sangat halus mengembalikan hierarki kartu.
====================================================== */
:root { color-scheme: light; }

.admin-card,
.kpi-card,
.neon-kpi-card,
.dash-card {
    box-shadow: 0 1px 2px #F5F7F9, 0 1px 12px #F5F7F9;
}

.admin-topbar { box-shadow: 0 1px 3px #F5F7F9; }

/* ======================================================
   PETA (Leaflet) — tema terang
====================================================== */
.leaflet-control-attribution { display: none !important; }

.leaflet-container {
    background: #EEF1F5;
    font-family: 'Plus Jakarta Sans','Inter',system-ui,sans-serif;
}

.leaflet-control-zoom a {
    background: #FFFFFF;
    color: var(--text);
    border-color: var(--card-border);
}
.leaflet-control-zoom a:hover { background: var(--surface); }

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #FFFFFF;
    color: var(--text);
    box-shadow: 0 6px 24px #E3E8EF;
}

/* ======================================================
   MOBILE — grid yang ditulis inline di blade
   Inline style menang atas media query biasa, sehingga
   kolom tetap berdampingan di layar kecil dan kartu
   saling menimpa. Aturan di bawah memaksanya menumpuk.
====================================================== */
@media (max-width: 900px) {
    .dash-analytics-row,
    .dash-analytics-left,
    .admin-main [style*="display:grid"][style*="1fr 1fr"],
    .admin-main [style*="display:grid"][style*="minmax(0,1fr) minmax(0,"],
    .admin-main [style*="display:grid"][style*="1fr 400px"],
    .admin-main [style*="display:grid"][style*="1fr 360px"],
    .admin-main [style*="display:grid"][style*="1fr 340px"],
    .admin-main [style*="display:grid"][style*="1fr 280px"] {
        grid-template-columns: 1fr !important;
    }

    /* apa pun yang lebih lebar dari layar tidak boleh mendorong halaman */
    .admin-main { overflow-x: hidden; }
    .admin-main img,
    .admin-main canvas { max-width: 100%; }
}

@media (max-width: 600px) {
    .admin-main [style*="display:grid"][style*="repeat(3,1fr)"],
    .admin-main [style*="display:grid"][style*="repeat(3,minmax(0,1fr))"],
    .admin-main [style*="display:grid"][style*="repeat(4,1fr)"],
    .admin-main [style*="display:grid"][style*="repeat(4,minmax(0,1fr))"] {
        grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    }
}

/* ======================================================
   IKON MONOKROM — pengganti emoji berwarna
   Mewarisi warna teks (currentColor), jadi selalu ikut
   palet korporat dan tidak pernah menambah warna baru.
====================================================== */
.ico {
    width: 1.05em;
    height: 1.05em;
    flex-shrink: 0;
    vertical-align: -.15em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.ico-lg { width: 1.5em; height: 1.5em; }

/* ======================================================
   TOPBAR di layar kecil
   Search + profil + tombol Keluar tidak muat di <600px,
   sehingga tombol Keluar terpotong di tepi layar.
====================================================== */
@media (max-width: 700px) {
    .admin-topbar { padding: 0 12px; gap: 10px; overflow: hidden; }
    .topbar-search { display: none; }
    .topbar-user { gap: 6px; flex-shrink: 0; }
    .admin-topbar form { flex-shrink: 0; }
    .topbar-title { font-size: 15px; }
}

@media (max-width: 480px) {
    /* tombol Keluar jadi ikon saja — teksnya tidak muat */
    .topbar-user form button { padding: 7px 9px !important; font-size: 0 !important; gap: 0 !important; }
    .topbar-user form button svg { width: 16px; height: 16px; }
}

/* ======================================================
   AKSESIBILITAS & STANDAR UI
   WCAG 2.1 AA: fokus keyboard terlihat, target sentuh
   memadai, state disabled jelas, hormati reduced-motion.
====================================================== */

/* 1 — Fokus keyboard (WCAG 2.4.7). Sebelumnya tidak ada
      indikator sama sekali: mustahil dinavigasi tanpa mouse. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.nav-item:focus-visible,
.btn:focus-visible {
    outline: 3px solid var(--astra-blue);
    outline-offset: 2px;
    border-radius: 8px;
}
/* jangan tampilkan ring saat diklik mouse */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) { outline: none; }

/* 2 — State disabled yang terbaca */
.btn:disabled,
.btn[aria-disabled="true"],
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none !important;
}

/* 3 — Target sentuh di perangkat sentuh (WCAG 2.5.5) */
@media (max-width: 900px) {
    .btn      { height: 44px; font-size: 14px; }
    .btn-sm   { height: 38px; font-size: 13px; }
    .btn-icon { width: 44px; height: 44px; }
    .neon-action-btn { min-width: 40px; min-height: 40px; }
    .nav-item { padding-top: 13px; padding-bottom: 13px; }
}

/* 4 — Hormati preferensi kurangi gerakan */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
    .btn-red:hover, .kpi-card:hover, .pipeline-card:hover { transform: none !important; }
}

/* 5 — Lewati navigasi (skip link) untuk pengguna keyboard */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 30000;
    background: var(--red);
    color: #FFFFFF;
    padding: 12px 20px;
    border-radius: 0 0 10px 0;
    font-weight:600;
    font-size: 14px;
}
.skip-link:focus {
    left: 0;
}

/* 6 — Tabel lebar harus bisa digulir, bukan mendorong layout */
.admin-table-wrap,
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ======================================================
   KPI STRIP — proporsi kartu
   Semua kartu status dibuat setinggi dan sepadat sama;
   kartu TOTAL PROSPEK melebar penuh di layar kecil agar
   tidak menggantung sendirian di satu kolom.
====================================================== */
.dash-kpi-chip,
.dash-kpi-total {
    min-height: 76px;
    justify-content: center;
}

.dash-kpi-total .dash-kpi-lbl { white-space: normal; }

@media (max-width: 900px) {
    .dash-kpi-strip {
        grid-template-columns: repeat(2, minmax(0,1fr)) !important;
        gap: 10px;
    }
    .dash-kpi-total {
        grid-column: 1 / -1;
        align-items: center;
    }
}

@media (max-width: 400px) {
    .dash-kpi-strip { grid-template-columns: 1fr !important; }
}

/* ======================================================
   PROPORSI KARTU DI LAYAR KECIL
   Grid berisi kartu besar tidak boleh dipaksa 2 kolom —
   sisa kartu ganjil akan menggantung dan terlihat timpang.
   Kartu besar selalu 1 kolom penuh di bawah 900px.
====================================================== */
@media (max-width: 900px) {
    .pipeline-strip,
    .analytics-row-3,
    .admin-main [style*="display:grid"]:has(> .admin-card),
    .admin-main [style*="display:grid"]:has(> .pipeline-card) {
        grid-template-columns: 1fr !important;
    }

    /* kartu dalam satu baris selalu setinggi sama */
    .admin-main [style*="display:grid"] > .admin-card,
    .pipeline-strip > .pipeline-card { height: 100%; }
}

/* ======================================================
   BLOK STATISTIK & LEGEND — lebar seragam
   Sebelumnya memakai flex-wrap sehingga tiap item selebar
   isinya: tombol dan legend jadi tidak rata satu sama lain.
====================================================== */
.activity-stats {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px !important;
    width: 100%;
}
.activity-stats > * {
    width: 100%;
    justify-content: flex-start;
    min-height: 52px;
}

.map-legend {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 8px !important;
    width: 100%;
}
.map-legend > label { min-height: 32px; }

@media (max-width: 900px) {
    .activity-stats,
    .map-legend { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 380px) {
    .activity-stats,
    .map-legend { grid-template-columns: 1fr; }
}

/* ======================================================
   TIPOGRAFI
   Seluruh antarmuka admin memakai Plus Jakarta Sans.
   PENGECUALIAN: wordmark "ASTRA ISUZU" memakai tipografi
   korporat Astra — kalau berkas fontnya (.woff2) dipasang
   dengan nama "Astra", ia otomatis dipakai di sini.
====================================================== */
.sidebar-logo-brand,
.login-logo-brand,
.brand-astra {
    font-family: 'Astra', 'Astra Sans', 'Inter', system-ui, sans-serif;
    letter-spacing: .5px;
}

/* ======================================================
   CHIP STATUS PROSPEK — teks panjang tidak boleh meluber
   "WAITING APPROVAL" lebih lebar dari chip-nya sehingga
   menimpa chip sebelah. Chip dibuat grid berlebar sama
   dan labelnya dibungkus, bukan dipaksa satu baris.
====================================================== */
.prospect-kpi-strip {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0,1fr));
    gap: 10px;
    align-items: stretch;
}

.prospect-kpi-chip {
    min-width: 0 !important;
    padding: 12px 8px;
    text-align: center;
    justify-content: center;
    overflow: hidden;
}

.prospect-kpi-chip > span,
.prospect-kpi-chip > div {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

@media (max-width: 900px) {
    .prospect-kpi-strip { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 420px) {
    .prospect-kpi-strip { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .prospect-kpi-chip > span:last-child { font-size: 12px; letter-spacing: 0; }
}

/* Pengaman umum: isi kartu tidak boleh mendorong/menimpa
   tetangganya. Tanpa min-width:0, item flex/grid menolak
   menyusut dan teks panjang meluber keluar kartu. */
.admin-card,
.kpi-card,
.dash-kpi-chip,
.neon-kpi-card,
.pipeline-card,
.prospect-kpi-chip { min-width: 0; }

.admin-card > *,
.dash-kpi-chip > *,
.neon-kpi-card > *,
.pipeline-card > * { min-width: 0; }

.dash-kpi-lbl,
.neon-kpi-label,
.prospect-kpi-chip > span:last-child { overflow-wrap: anywhere; }

/* ======================================================
   STAT PILL PETA — lebar seragam
   Pill sebelumnya selebar teksnya masing-masing sehingga
   baris terlihat patah-patah (3 / 3 / 1) dan timpang.
====================================================== */
.map-pill-row {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px !important;
    align-items: stretch;
}
.map-pill-row > .map-pill {
    width: 100%;
    justify-content: center;
    min-width: 0;
}
/* ringkasan koordinat bukan pill: beri baris sendiri */
.map-pill-row > span,
.map-pill-row > a { grid-column: 1 / -1; }

@media (max-width: 900px) {
    .map-pill-row { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 420px) {
    .map-pill-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* ======================================================
   KENYAMANAN BACA
   Bobot huruf diturunkan satu tingkat di seluruh panel
   (900/800 -> 700, 700 -> 600, 600 -> 500) dan jarak baris
   dilonggarkan supaya tidak terasa "berat" dibaca lama.
====================================================== */
body { line-height: 1.55; letter-spacing: 0; }

.admin-card-title,
.page-header-left h1 { letter-spacing: -.01em; }

/* label uppercase kecil tidak perlu setebal judul */
.dash-kpi-lbl,
.neon-kpi-label,
.dash-section-label,
.form-label { font-weight: 600; letter-spacing: .3px; }

/* ======================================================
   KETEGASAN — chip & pill juga memakai garis penuh
   Warna korporat Astra tegas, bukan samar: setiap bidang
   berwarna diberi garis warna penuh, bukan garis pudar.
====================================================== */
.dash-kpi-chip,
.prospect-kpi-chip,
.map-pill,
.neon-kpi-card,
.kpi-card,
.pipeline-card { border-width: 1px; border-style: solid; }

.map-pill { border-color: #C8D2DE; background: #FFFFFF; }

.form-input,
.form-select,
.form-textarea,
.neon-select,
.neon-search { border: 1px solid #C8D2DE !important; background: #FFFFFF !important; }

.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--astra-blue) !important; }

.admin-table thead th { border-bottom: 2px solid #C8D2DE; }
.admin-table tbody tr { border-bottom: 1px solid #E3E8EF; }


/* ======================================================
   KATEGORI = teks biasa
   Kategori bukan status; kapsul/pill hanya menambah
   ramai tanpa menambah makna.
====================================================== */
.cell-category {
    color: #16202E;
    font-weight: 600;
    white-space: nowrap;
}

/* ======================================================
   TABEL — ukuran & bobot yang nyaman
   14px + <strong> bawaan browser (700) membuat isi tabel
   terasa besar dan berat, apalagi di kolom sempit.
====================================================== */
.admin-table { font-size: 13px; }
.admin-table strong,
.admin-table b { font-weight: 600; }
.admin-table th { letter-spacing: .5px; font-weight: 600; }
.admin-table td { padding: 12px 14px; }

@media (max-width: 900px) {
    .admin-table { font-size: 12px; }
    .admin-table th,
    .admin-table td { padding: 10px 10px; }
    .admin-table th { letter-spacing: .3px; }
    /* nama panjang: biarkan memotong kata secara wajar, bukan per huruf */
    .admin-table td strong { overflow-wrap: break-word; }
}
