/* ============================================================
   GUDANG SEWA PRO — DESIGN SYSTEM
   Palet: Navy (utama) · Hijau Zamrud (sukses) · Amber (peringatan)
   Font: Poppins (judul) · Inter (isi)
   ============================================================ */

:root {
    --navy-900: #14283F;
    --navy-800: #1E3A5F;
    --navy-700: #2A4E7C;
    --navy-100: #E7EDF5;

    --green-700: #23724A;
    --green-600: #2E8B57;
    --green-100: #E4F5EC;

    --amber-600: #D98C1F;
    --amber-500: #F2A93B;
    --amber-100: #FCF0DC;

    --red-600: #C0392B;
    --red-100: #FBE9E7;

    --wa-green: #25D366;
    --wa-green-dark: #1DA851;

    --ink-900: #1A1F26;
    --ink-600: #4A5568;
    --ink-400: #8792A2;

    --bg-canvas: #F5F6F8;
    --bg-card: #FFFFFF;
    --border-soft: #E3E7ED;

    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;

    --shadow-card: 0 10px 30px rgba(20, 40, 63, 0.08);
    --shadow-pop: 0 16px 40px rgba(20, 40, 63, 0.14);

    --font-head: 'Poppins', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-canvas);
    color: var(--ink-900);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    color: var(--navy-900);
    margin: 0 0 8px;
    line-height: 1.3;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

:focus-visible {
    outline: 2px solid var(--navy-700);
    outline-offset: 2px;
}

/* ---------------- App Shell ---------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 264px;
    background: var(--navy-900);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .25s ease;
}

.sidebar.is-open { transform: translateX(0); }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 22px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(145deg, var(--amber-500), var(--amber-600));
    color: var(--navy-900);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-name {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 15px;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: #C5CFDD;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}

.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }

.nav-link.is-active {
    background: rgba(242, 169, 59, .16);
    color: var(--amber-500);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    opacity: .9;
}

/* Ikon sederhana berbasis SVG data-uri agar tanpa dependensi eksternal */
.nav-icon[data-icon="grid"]        { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="home"]        { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3l9 8h-3v9h-5v-6h-2v6H6v-9H3z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3l9 8h-3v9h-5v-6h-2v6H6v-9H3z'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="user"]        { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="calendar"]    { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="receipt"]     { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h12v20l-3-2-3 2-3-2-3 2z'/%3E%3Cpath d='M8 8h8M8 12h8'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h12v20l-3-2-3 2-3-2-3 2z'/%3E%3Cpath d='M8 8h8M8 12h8'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="wrench"]      { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.7 6.3a4 4 0 00-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 005.4-5.4l-2.3 2.3-2-2z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.7 6.3a4 4 0 00-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 005.4-5.4l-2.3 2.3-2-2z'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="file"]        { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h9l5 5v15H6z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h9l5 5v15H6z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="chart"]       { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20V10M12 20V4M20 20v-7'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20V10M12 20V4M20 20v-7'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="gear"]        { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19 12a7 7 0 00-.1-1.2l2-1.6-2-3.4-2.4 1a7 7 0 00-2-1.2L14 3h-4l-.5 2.6a7 7 0 00-2 1.2l-2.4-1-2 3.4 2 1.6A7 7 0 005 12a7 7 0 00.1 1.2l-2 1.6 2 3.4 2.4-1a7 7 0 002 1.2L10 21h4l.5-2.6a7 7 0 002-1.2l2.4 1 2-3.4-2-1.6c.067-.395.1-.795.1-1.2z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19 12a7 7 0 00-.1-1.2l2-1.6-2-3.4-2.4 1a7 7 0 00-2-1.2L14 3h-4l-.5 2.6a7 7 0 00-2 1.2l-2.4-1-2 3.4 2 1.6A7 7 0 005 12a7 7 0 00.1 1.2l-2 1.6 2 3.4 2.4-1a7 7 0 002 1.2L10 21h4l.5-2.6a7 7 0 002-1.2l2.4 1 2-3.4-2-1.6c.067-.395.1-.795.1-1.2z'/%3E%3C/svg%3E"); }
.nav-icon[data-icon="logout"]      { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4M16 17l5-5-5-5M21 12H9'/%3E%3C/svg%3E"); }

.sidebar-footer { padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.nav-link--logout:hover { background: rgba(192,57,43,.18); color: #FF8A7A; }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,16,26,.5);
    z-index: 35;
}
.sidebar-overlay.is-open { display: block; }

.main-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-title {
    font-size: 17px;
    margin: 0;
}

.topbar-spacer { flex: 1; }

.hamburger {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    flex-shrink: 0;
}
.hamburger span { width: 18px; height: 2px; background: var(--navy-900); border-radius: 2px; }

.content {
    padding: 20px 16px 32px;
    max-width: 1180px;
    width: 100%;
    margin: 0 auto;
}

.app-footer {
    text-align: center;
    padding: 18px;
    color: var(--ink-400);
    font-size: 12px;
}

/* ---------------- Page Header ---------------- */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.page-head p { color: var(--ink-600); margin: 0; font-size: 14px; }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .1s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }

.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-700); }

.btn-secondary { background: #fff; color: var(--navy-800); border: 1px solid var(--border-soft); }
.btn-secondary:hover { background: var(--navy-100); }

.btn-success { background: var(--green-600); color: #fff; }
.btn-success:hover { background: var(--green-700); }

.btn-danger { background: transparent; color: var(--red-600); border: 1px solid var(--red-100); }
.btn-danger:hover { background: var(--red-100); }

.btn-wa { background: var(--wa-green); color: #fff; }
.btn-wa:hover { background: var(--wa-green-dark); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-icon { width: 18px; height: 18px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- Cards & Stats ---------------- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 20px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--accent, var(--navy-800));
}
.stat-card.accent-green { --accent: var(--green-600); }
.stat-card.accent-amber { --accent: var(--amber-500); }
.stat-card.accent-navy  { --accent: var(--navy-800); }
.stat-card.accent-red   { --accent: var(--red-600); }

.stat-label {
    font-size: 12.5px;
    color: var(--ink-600);
    font-weight: 500;
    margin-bottom: 6px;
}
.stat-value {
    font-family: var(--font-head);
    font-size: 24px;
    font-weight: 700;
    color: var(--navy-900);
}
.stat-sub { font-size: 12px; color: var(--ink-400); margin-top: 4px; }

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 28px 0 12px;
}
.section-title h2 { font-size: 16px; margin: 0; }

/* ---------------- Badges / Pills ---------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-green  { background: var(--green-100); color: var(--green-700); }
.badge-amber  { background: var(--amber-100); color: var(--amber-600); }
.badge-navy   { background: var(--navy-100); color: var(--navy-800); }
.badge-red    { background: var(--red-100); color: var(--red-600); }
.badge-gray   { background: #EEF0F3; color: var(--ink-600); }

/* ---------------- Alerts ---------------- */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 18px;
    font-weight: 500;
}
.alert--success { background: var(--green-100); color: var(--green-700); }
.alert--error   { background: var(--red-100); color: var(--red-600); }
.alert--info    { background: var(--navy-100); color: var(--navy-800); }

/* ---------------- Forms ---------------- */
.panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 22px;
    margin-bottom: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 640px) {
    .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-900);
}
.form-hint { font-size: 12px; color: var(--ink-400); }
.form-error { font-size: 12px; color: var(--red-600); font-weight: 500; }

input[type=text], input[type=tel], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=file], select, textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-soft);
    background: #fff;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--ink-900);
    transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--navy-700);
    box-shadow: 0 0 0 3px rgba(42, 78, 124, .15);
}
input.has-error, select.has-error, textarea.has-error {
    border-color: var(--red-600);
}

/* ---------------- Table (responsif jadi kartu di mobile) ---------------- */
.table-wrap { overflow-x: auto; }
table.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
table.data-table th {
    text-align: left;
    font-size: 12.5px;
    text-transform: none;
    color: var(--ink-600);
    font-weight: 600;
    padding: 14px 16px;
    background: var(--navy-100);
    white-space: nowrap;
}
table.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-top: 1px solid var(--border-soft);
    vertical-align: middle;
}
table.data-table tr:hover td { background: #FAFBFD; }

@media (max-width: 760px) {
    table.data-table thead { display: none; }
    table.data-table, table.data-table tbody, table.data-table tr, table.data-table td {
        display: block;
        width: 100%;
    }
    table.data-table tr {
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-card);
        margin-bottom: 12px;
        padding: 6px 4px;
        background: var(--bg-card);
    }
    table.data-table td {
        border-top: none;
        padding: 8px 14px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        text-align: right;
    }
    table.data-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--ink-600);
        font-size: 12.5px;
        text-align: left;
    }
    table.data-table td.cell-actions { justify-content: flex-end; }
    table.data-table td.cell-actions::before { content: none; }
}

/* ---------------- Empty State ---------------- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}
.empty-state .empty-icon {
    width: 52px; height: 52px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: var(--navy-100);
    display: flex; align-items: center; justify-content: center;
}
.empty-state h3 { font-size: 16px; margin-bottom: 6px; }
.empty-state p { color: var(--ink-600); font-size: 14px; margin: 0 0 18px; }

/* ---------------- Auth (Login) ---------------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(160deg, var(--navy-900), var(--navy-800) 60%, #24507F);
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 34px 28px;
    box-shadow: var(--shadow-pop);
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}
.auth-title { font-size: 20px; margin-bottom: 4px; }
.auth-sub { color: var(--ink-600); font-size: 13.5px; margin-bottom: 24px; }
.auth-hint {
    margin-top: 18px;
    font-size: 12.5px;
    color: var(--ink-400);
    text-align: center;
}

/* ---------------- Utility ---------------- */
.mt-0 { margin-top: 0; }
.text-muted { color: var(--ink-600); }
.text-center { text-align: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.unit-thumb {
    width: 44px; height: 44px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--navy-100);
    flex-shrink: 0;
}
.doc-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--navy-100);
    color: var(--navy-800);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}
.progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--navy-100);
    overflow: hidden;
}
.progress-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--green-600), var(--amber-500));
    border-radius: 999px;
}

/* ---------------- Responsive: Desktop ---------------- */
@media (min-width: 992px) {
    .sidebar { transform: translateX(0); }
    .main-area { margin-left: 264px; }
    .hamburger { display: none; }
    .content { padding: 28px 32px 40px; }
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 991px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
    .content { padding: 16px 12px 28px; }
    .panel, .card { padding: 16px; }
}
