@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
    --bg:            #f4f6fa;
    --surface:       #ffffff;
    --surface-2:     #f8fafc;
    --border:        #e2e8f0;
    --border-strong: #cbd5e1;

    --text:          #0f172a;
    --text-muted:    #64748b;
    --text-soft:     #94a3b8;

    --primary:       #1e40af;
    --primary-600:   #1d4ed8;
    --primary-50:    #eff6ff;
    --accent:        #0ea5e9;

    --success:       #16a34a;
    --warning:       #d97706;
    --danger:        #dc2626;
    --purple:        #7c3aed;
    --indigo:        #4f46e5;
    --pink:          #db2777;

    --sidebar-bg:    #0f172a;
    --sidebar-item:  #94a3b8;
    --sidebar-hover: #1e293b;
    --sidebar-active:#1e40af;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, .06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .08);

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;

    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    padding: 4px;
}
.sidebar .brand .brand-logo {
    width: 38px;
    height: 38px;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    background: var(--bg);
}
.login-hero {
    background:
        radial-gradient(1200px 500px at -10% 100%, #1e40af22, transparent 60%),
        radial-gradient(900px 400px at 100% 0%, #0ea5e922, transparent 55%),
        #0f172a;
    color: white;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.login-hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}
.login-brand {
    display: flex; align-items: center; gap: 12px;
    font-weight: 700; font-size: 18px; letter-spacing: .3px;
    position: relative;
}
.login-brand .badge {
    width: 42px; height: 42px; display: grid; place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e40af, #0ea5e9);
    box-shadow: 0 6px 24px #1e40afaa;
}
.login-hero-title {
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.15;
    font-weight: 800;
    max-width: 520px;
    position: relative;
}
.login-hero-title span { color: #7dd3fc; }
.login-hero-sub {
    color: #cbd5e1; max-width: 480px;
    margin-top: 14px; position: relative;
}
.login-hero-foot {
    display: flex; gap: 28px; color: #94a3b8; font-size: 13px;
    position: relative;
}
.login-hero-foot b { color: #e2e8f0; }

.login-panel {
    display: grid; place-items: center;
    padding: 48px 40px;
}
.login-card {
    width: 100%; max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-lg);
}
.login-card h1 { margin: 0 0 6px; font-size: 24px; font-weight: 700; }
.login-card .muted { color: var(--text-muted); margin-bottom: 26px; font-size: 14px; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 11px 13px;
    background: var(--surface);
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    transition: border-color .18s, box-shadow .18s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px #1e40af1a;
}
.form-textarea { min-height: 90px; resize: vertical; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px;
    font: inherit; font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform .12s, background .18s, box-shadow .18s, border-color .18s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-600); box-shadow: 0 6px 18px #1e40af55; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

.default-creds {
    margin-top: 22px; padding: 14px 16px;
    background: #f1f5f9; border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.default-creds b { color: var(--primary); }

.app-shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}
.sidebar {
    background: var(--sidebar-bg);
    color: #e2e8f0;
    padding: 22px 16px;
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
}
.sidebar .brand {
    display: flex; align-items: center; gap: 12px;
    padding: 4px 8px 22px;
    border-bottom: 1px solid #1e293b;
    margin-bottom: 20px;
}
.sidebar .brand .badge {
    width: 38px; height: 38px; display: grid; place-items: center;
    background: linear-gradient(135deg, #1e40af, #0ea5e9);
    border-radius: 10px; font-weight: 800; color: white;
}
.sidebar .brand-title { font-weight: 700; font-size: 15px; }
.sidebar .brand-sub   { font-size: 11px; color: #94a3b8; letter-spacing: .5px; text-transform: uppercase; }

.sidebar nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px;
    color: var(--sidebar-item);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    transition: background .15s, color .15s;
}
.sidebar nav a:hover { background: var(--sidebar-hover); color: white; }
.sidebar nav a.active {
    background: linear-gradient(90deg, #1e40afcc, #1e40af00);
    color: white;
    border-left: 3px solid var(--accent);
    padding-left: 9px;
}
.sidebar nav a i { width: 20px; text-align: center; }
.sidebar-section { text-transform: uppercase; font-size: 10.5px; color: #64748b; padding: 12px 12px 6px; letter-spacing: 1.2px; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid #1e293b; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; background: #1e293b; }
.user-chip .avatar {
    width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    background: linear-gradient(135deg, #4f46e5, #db2777);
    color: white; font-weight: 700;
}
.user-chip .name { font-size: 13px; font-weight: 600; color: white; }
.user-chip .role { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .8px; }

.main-content { padding: 26px 34px; overflow-x: hidden; }
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 26px;
}
.page-title {
    font-size: 22px; font-weight: 700; margin: 0;
}
.page-subtitle { color: var(--text-muted); font-size: 13.5px; margin-top: 4px; }

.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 999px;
    background: var(--primary-50); color: var(--primary);
    font-size: 12px; font-weight: 600;
    border: 1px solid #dbeafe;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}
.card-header h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-body { padding: 20px; }

.dashboard-hero {
    text-align: center;
    padding: 22px 0 8px;
    margin-bottom: 20px;
}
.dashboard-hero h1 {
    font-size: clamp(24px, 3.2vw, 34px);
    font-weight: 800;
    letter-spacing: -.5px;
    margin: 0 0 8px;
    background: linear-gradient(90deg, #0f172a, #1e40af 65%, #0ea5e9);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dashboard-hero p { color: var(--text-muted); margin: 0; font-size: 14px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex; align-items: center; gap: 14px;
    transition: transform .18s, box-shadow .18s, border-color .18s;
    position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.stat-icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: grid; place-items: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}
.stat-label { color: var(--text-muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 2px; font-family: var(--font-mono); }

.stat-card.blue    .stat-icon { background: linear-gradient(135deg, #1e40af, #3b82f6); }
.stat-card.green   .stat-icon { background: linear-gradient(135deg, #059669, #34d399); }
.stat-card.amber   .stat-icon { background: linear-gradient(135deg, #d97706, #fbbf24); }
.stat-card.purple  .stat-icon { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.stat-card.pink    .stat-icon { background: linear-gradient(135deg, #db2777, #f472b6); }
.stat-card.teal    .stat-icon { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.stat-card.slate   .stat-icon { background: linear-gradient(135deg, #475569, #94a3b8); }
.stat-card.indigo  .stat-icon { background: linear-gradient(135deg, #4f46e5, #818cf8); }
.stat-card.red     .stat-icon { background: linear-gradient(135deg, #dc2626, #f87171); }
.stat-card.cyan    .stat-icon { background: linear-gradient(135deg, #0284c7, #38bdf8); }

.stat-card.highlight { border: 1.5px solid #dbeafe; background: linear-gradient(180deg, #eff6ff 0%, #ffffff 60%); }

.search-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 24px;
}
.search-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.search-row {
    display: grid; grid-template-columns: 1fr auto;
    gap: 12px;
}
.search-input-wrap { position: relative; }
.search-input-wrap i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-soft);
}
.search-input-wrap input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.search-input-wrap input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px #1e40af1a; }

.table-wrap { overflow-x: auto; }
table.data-table {
    width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.data-table th, .data-table td {
    padding: 12px 16px; text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table th {
    background: var(--surface-2);
    font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; font-size: 11.5px; letter-spacing: .5px;
    position: sticky; top: 0;
}
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table td.mono { font-family: var(--font-mono); font-weight: 600; }

.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .3px;
    border: 1px solid transparent;
}
.badge-ITC       { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.badge-VENDOR    { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-RENTAL    { background: #fce7f3; color: #9d174d; border-color: #fbcfe8; }
.badge-EMPLOYEE  { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.badge-COURTESY  { background: #ccfbf1; color: #115e59; border-color: #99f6e4; }
.badge-PIO       { background: #fef3c7; color: #a16207; border-color: #fde68a; }
.badge-MARKETING { background: #fde68a; color: #713f12; border-color: #fbbf24; }
.badge-SCBD      { background: #ddd6fe; color: #5b21b6; border-color: #c4b5fd; }
.badge-SOLD      { background: #f1f5f9; color: #334155; border-color: #cbd5e1; text-decoration: line-through; }
.badge-YARD      { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.badge-WISMUL    { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.badge-TestDrive { background: #cffafe; color: #155e75; border-color: #a5f3fc; }

.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center; justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal-backdrop.show { display: flex; animation: fadeIn .18s ease; }
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 680px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 24px 48px rgba(0,0,0,.24);
    animation: pop .22s ease;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close {
    background: none; border: 0; cursor: pointer;
    font-size: 20px; color: var(--text-muted);
    width: 34px; height: 34px; border-radius: 8px;
    display: grid; place-items: center;
    transition: background .15s;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 22px; }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 10px;
    padding: 16px 22px; border-top: 1px solid var(--border);
    background: var(--surface-2);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop    { from { opacity: 0; transform: translateY(8px) scale(.98) } to { opacity: 1; transform: none } }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 22px;
}
.detail-item .k { font-size: 11.5px; text-transform: uppercase; color: var(--text-muted); letter-spacing: .5px; font-weight: 600; }
.detail-item .v { font-size: 14.5px; font-weight: 600; margin-top: 2px; color: var(--text); word-break: break-word; }
.detail-item .v.mono { font-family: var(--font-mono); }

.section-divider {
    margin: 22px 0 14px; padding-top: 14px;
    border-top: 1px dashed var(--border);
    font-size: 12.5px; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .8px;
}

.toast-stack {
    position: fixed; top: 20px; right: 20px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 999;
}
.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    padding: 12px 16px;
    min-width: 280px;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    animation: slideIn .22s ease;
    font-size: 13.5px;
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger);  }
.toast.warning { border-left-color: var(--warning); }
.toast .t { font-weight: 700; margin-bottom: 2px; }
.toast .m { color: var(--text-muted); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0 } to { transform: none; opacity: 1 } }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 20px;
}
.form-grid .col-2 { grid-column: span 2; }

.confirm-list {
    background: var(--surface-2);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-top: 8px;
}
.confirm-list .row {
    display: flex; justify-content: space-between; gap: 10px;
    padding: 4px 0; font-size: 13.5px;
    border-bottom: 1px dotted var(--border);
}
.confirm-list .row:last-child { border: 0; }
.confirm-list .row .k { color: var(--text-muted); font-weight: 500; }
.confirm-list .row .v { font-weight: 600; text-align: right; }

.empty-state {
    padding: 40px 20px; text-align: center; color: var(--text-muted);
}
.empty-state i { font-size: 34px; margin-bottom: 12px; opacity: .5; }
.empty-state h4 { margin: 0 0 4px; color: var(--text); }

@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-hero { padding: 32px; min-height: 240px; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; z-index: 200; left: -260px; width: 250px;
        transition: left .22s ease;
    }
    .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .main-content { padding: 18px; }
    .mobile-toggle { display: inline-flex !important; }
}
@media (max-width: 720px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .form-grid, .detail-grid { grid-template-columns: 1fr; }
    .form-grid .col-2 { grid-column: span 1; }
    .search-row { grid-template-columns: 1fr; }
    .login-hero { display: none; }
}
.mobile-toggle {
    display: none;
    background: var(--surface); border: 1px solid var(--border);
    width: 40px; height: 40px; border-radius: 10px;
    align-items: center; justify-content: center; cursor: pointer;
}

.notif-bell { position:relative; }
.notif-badge { position:absolute; top:-6px; right:-6px; background:var(--danger,#dc2626); color:#fff; font-size:10px; font-weight:700; min-width:16px; height:16px; line-height:16px; text-align:center; border-radius:8px; padding:0 4px; }
.notif-panel { position:absolute; bottom:64px; left:12px; right:12px; max-height:60vh; overflow:auto; background:var(--card,#fff); border:1px solid var(--border,#e2e8f0); border-radius:12px; box-shadow:0 10px 30px rgba(0,0,0,.12); z-index:60; }
.notif-panel-head { display:flex; justify-content:space-between; align-items:center; padding:10px 12px; border-bottom:1px solid var(--border,#e2e8f0); position:sticky; top:0; background:inherit; }
.notif-panel-body { padding:6px; }
.notif-item { padding:8px 10px; border-bottom:1px solid var(--border,#f1f5f9); display:flex; flex-direction:column; gap:4px; }
.ni-plat { font-weight:700; }
.ni-meta { font-size:11.5px; color:var(--text-muted,#64748b); }
.plat-lock-status { min-height:16px; }
@media (min-width:900px){ .notif-panel { left:200px; right:auto; width:340px; } }
