/* =====================================================================
   TEMA SBK - warna dari logo: biru navy (atap & tulisan), emas (lingkaran & buku), hijau daun (tunas).
   Hanya untuk layar; cetakan (invoice, DO, laporan) tidak berubah.
   Untuk kembali ke tampilan lama: hapus baris tema.css di includes/header.php & login.php.
   ===================================================================== */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/poppins-latin-400.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/poppins-latin-500.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/poppins-latin-600.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/poppins-latin-700.woff2') format('woff2'); }

@media screen {
    :root {
        --navy-900: #0f1f4d;
        --navy-800: #142a63;
        --navy: #1f3a8a;
        --navy-soft: #e9eefb;
        --gold: #d4a017;
        --gold-dark: #9a6b00;
        --gold-soft: #fdf5e1;
        --leaf: #2f8f4e;
        --leaf-soft: #e6f4ea;
        --bg: #f4f5f9;
        --border: #e4e8f0;
        --text: #24304d;
        --muted: #7c859a;
        --primary: #1f3a8a;
        --primary-dark: #172e6e;
        --primary-soft: #e9eefb;
        --radius: 16px;
        --shadow: 0 1px 2px rgba(15, 31, 77, .05), 0 10px 30px rgba(15, 31, 77, .06);
        --tint-1: #e9eefb; --ink-1: #1f3a8a;
        --tint-2: #e6f4ea; --ink-2: #2f7d45;
        --tint-3: #fdf3dc; --ink-3: #9a6b00;
        --tint-4: #fde8e8; --ink-4: #b42318;
        --tint-5: #efeafd; --ink-5: #5b3fc4;
        --tint-6: #e2f4f6; --ink-6: #0e7490;
    }
    body { font-family: 'Poppins', "Segoe UI", system-ui, Arial, sans-serif; font-size: 13.5px; background: var(--bg); }
    .code, .badge-unit { font-family: Consolas, "Courier New", monospace; }
    a { color: var(--navy); }

    /* ---------- Sidebar navy ---------- */
    .sidebar { background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%); color: #c5cee6; }
    .brand { padding: 22px 18px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: 8px; color: #fff; }
    .brand strong { color: #fff; font-size: 11.5px; font-weight: 700; }
    .brand small { color: #f2c94c; font-weight: 600; letter-spacing: .14em; }
    .brand-logo img { box-shadow: 0 0 0 3px rgba(212, 160, 23, .55); }
    .sidebar nav { padding: 10px 14px 28px; }
    .sidebar nav a, .nav-group-toggle { color: #c5cee6; border-radius: 12px; padding: 10px 14px; }
    .sidebar nav a .ico, .nav-group-toggle .ico { color: #8d9cc6; }
    .sidebar nav a:hover, .nav-group-toggle:hover { background: rgba(255, 255, 255, .07); color: #fff; }
    .sidebar nav a.active, .sidebar nav .nav-sub a.active { position: relative; background: #fff; color: var(--navy); font-weight: 600; box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
    .sidebar nav a.active .ico { color: var(--navy); }
    .sidebar nav a.active::after { content: ''; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--gold); }
    .sidebar nav .nav-sub a.active::after { content: none; }
    .nav-group.has-active .nav-group-toggle { color: #fff; font-weight: 600; }
    .nav-group.has-active .nav-group-toggle .ico { color: #f2c94c; }
    .sidebar nav .nav-sub a { padding: 8px 12px 8px 44px; color: #aeb9d8; }
    .sidebar nav .nav-sub a::before { opacity: .4; }
    .sidebar nav .nav-sub a.active::before { opacity: 1; background: var(--gold); }

    /* ---------- Bar atas: judul tegas dengan aksen emas ---------- */
    .topbar { background: rgba(255, 255, 255, .94); border-bottom: 1px solid #eceff5; padding: 14px 30px; }
    .topbar h1 { flex: 1; }
    .judul-chip { display: inline-flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 700; color: var(--navy-900); white-space: nowrap; }
    .judul-chip::before { content: ''; width: 6px; height: 24px; border-radius: 6px; background: linear-gradient(180deg, var(--gold) 0%, #f2c94c 100%); }
    .user-chip:hover, .user-menu.open .user-chip { background: #f4f6fb; border-color: transparent; }
    .avatar { background: var(--gold-soft); color: var(--gold-dark); box-shadow: inset 0 0 0 1.5px #f0d48a; }
    .user-dropdown { border: 0; border-radius: 16px; box-shadow: 0 18px 44px rgba(15, 31, 77, .18); }
    .content { padding: 28px 32px; }

    /* ---------- Kartu ---------- */
    .card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
    .card-head { padding: 20px 24px; border-bottom: 1px solid #eef1f6; }
    .card-head h2 { font-size: 16px; font-weight: 600; color: var(--navy-900); }
    .card-head p { color: var(--muted); }
    .card-body { padding: 24px; }

    /* ---------- Tombol ---------- */
    .btn { border-radius: 12px; padding: 10px 18px; font-weight: 500; border: 1px solid #dde2ee; transition: background .15s, box-shadow .15s, transform .15s, border-color .15s; }
    .btn:hover { background: #f5f7fc; border-color: #c9d1e3; }
    .btn-primary { background: linear-gradient(135deg, #1f3a8a 0%, #2d52b8 100%); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(31, 58, 138, .28); }
    .btn-primary:hover { background: linear-gradient(135deg, #172e6e 0%, #26479f 100%); border-color: transparent; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(31, 58, 138, .32); }
    .btn-icon { border-radius: 10px; border-color: #e1e6f0; width: 30px; height: 30px; }
    .btn-icon:hover { color: var(--navy); border-color: var(--navy); background: var(--navy-soft); }
    .actions { gap: 4px; }

    /* ---------- Isian ---------- */
    input[type=text], input[type=password], input[type=number], input[type=search], input[type=date], select, textarea {
        border: 1.5px solid #dfe3ec; border-radius: 12px; background: #fff; padding: 11px 14px; color: var(--text);
        transition: border-color .15s, box-shadow .15s;
    }
    input::placeholder, textarea::placeholder { color: #a6aec0; }
    input:hover, select:hover, textarea:hover { border-color: #c9d0df; }
    input:focus, select:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(31, 58, 138, .12); }
    input:disabled { background: #f4f6fa; color: #7c859a; border-style: dashed; }
    .input-group input { border-radius: 12px 0 0 12px; }
    .input-group .addon { border: 1.5px solid #dfe3ec; border-left: 0; border-radius: 0 12px 12px 0; background: #f6f7fb; color: #6b7590; font-weight: 500; }
    .input-group .addon.pre { border-left: 1.5px solid #dfe3ec; border-right: 0; border-radius: 12px 0 0 12px; }
    .alert { border-radius: 14px; }

    /* ---------- Form: lapang, bertahap (1, 2, 3), nyaman diisi ---------- */
    .form-grid { counter-reset: langkah; gap: 0 32px; }
    .form-section {
        counter-increment: langkah; display: flex; align-items: center; gap: 12px;
        margin: 14px 0 18px; padding: 0; border: 0;
        font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--navy-900);
    }
    .form-section:first-child { margin-top: 0; }
    .form-section::before {
        content: counter(langkah); flex: none; width: 32px; height: 32px; border-radius: 50%;
        display: inline-flex; align-items: center; justify-content: center;
        background: var(--gold-soft); color: var(--gold-dark); font-size: 14px; font-weight: 700; box-shadow: inset 0 0 0 1.5px #f0d48a;
    }
    .form-section::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, #e3e7f0 0%, rgba(227, 231, 240, 0) 100%); }
    .field { margin-bottom: 24px; }
    .field > span { margin-bottom: 8px; font-size: 13.5px; font-weight: 600; color: #2b3553; }
    .field .req { color: #e05252; margin-left: 2px; }
    .field small { margin-top: 7px; color: #8a93a8; font-size: 12px; line-height: 1.5; }
    .preview { border-radius: 14px; background: var(--leaf-soft); color: #1f6b38; padding: 14px 16px; margin: 0 0 24px; font-weight: 500; }
    .preview::before { content: '\21C4'; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: var(--leaf); font-weight: 700; }
    .form-actions { gap: 10px; margin-top: 6px; padding-top: 20px; border-top: 1px dashed #e1e5ee; }
    .form-actions .btn { padding: 11px 22px; }
    .form-actions .btn-primary { min-width: 150px; font-weight: 600; }

    /* ---------- Tabel ---------- */
    table { font-size: 13px; }
    th, td { padding: 10px 11px; }
    th { background: #f6f8fc; color: #6b7590; font-weight: 600; font-size: 11.5px; letter-spacing: .05em; border-bottom-color: #e9edf4; line-height: 1.35; }
    td { border-bottom-color: #f0f2f7; }
    tbody tr:hover { background: #f8faff; }
    .badge { padding: 3px 11px; }
    .pager-links a { border-radius: 10px; }
    .pager-links a.current { background: var(--navy); border-color: var(--navy); }


    /* ---------- Daftar transaksi: rapi, satu baris per data, aksi ringkas ---------- */
    th { white-space: nowrap; }
    .card-head .toolbar input[type=search] { width: auto; flex: 1 1 240px; }
    .card-head .toolbar input[type=date] { width: 168px; }
    .table-wrap { position: relative; }
    .sr-only { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    table.daftar td { padding-top: 14px; padding-bottom: 14px; vertical-align: middle; }
    table.daftar tbody tr { transition: background .12s; }
    table.daftar tbody tr:hover { background: #f7f9ff; }
    .kolom-no { white-space: nowrap; }
    .no-trx { font-family: Consolas, "Courier New", monospace; font-size: 13.5px; font-weight: 700; color: var(--navy); letter-spacing: .01em; }
    .no-trx:hover { text-decoration: underline; }
    .tag-inv { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-dark); font-family: Consolas, monospace; font-size: 11px; font-weight: 700; vertical-align: 1px; }
    .kolom-no .sub, .kolom-pihak .sub { margin-top: 3px; }
    .kolom-pihak { max-width: 0; width: 38%; }
    .satu-baris { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .kolom-pihak strong { color: var(--text); font-weight: 600; }
    .jumlah-barang { font-weight: 600; font-size: 14px; color: var(--text); }
    table.daftar td.num .sub { margin-top: 1px; }
    .nilai { font-size: 14px; font-weight: 600; color: var(--navy-900); }
    .kolom-aksi { width: 1%; white-space: nowrap; text-align: right; }
    .aksi-baris { display: inline-flex; align-items: center; gap: 6px; }
    .btn-lihat { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--navy-soft); color: var(--navy); font-weight: 600; font-size: 12.5px; }
    .btn-lihat .ico { width: 15px; height: 15px; }
    .btn-lihat:hover { background: var(--navy); color: #fff; }
    .menu-aksi { position: relative; }
    .menu-aksi > summary { list-style: none; cursor: pointer; }
    .menu-aksi > summary::-webkit-details-marker { display: none; }
    .menu-aksi[open] > summary { background: var(--navy-soft); border-color: var(--navy); color: var(--navy); }
    .menu-aksi-isi { position: fixed; z-index: 60; min-width: 210px; padding: 6px; background: #fff; border-radius: 14px; box-shadow: 0 16px 40px rgba(15, 31, 77, .2); text-align: left; }
    .menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-align: left; white-space: nowrap; }
    .menu-item .ico { width: 16px; height: 16px; color: var(--muted); }
    .menu-item:hover { background: var(--navy-soft); color: var(--navy); }
    .menu-item:hover .ico { color: var(--navy); }
    .menu-item.danger { color: #c0392b; }
    .menu-item.danger .ico { color: #c0392b; }
    .menu-item.danger:hover { background: #fdecec; color: #a42a1f; }
    .menu-aksi-isi form.inline { display: block; }
    .vendor-compare th { white-space: normal; }
    .vendor-compare td.num .sub { white-space: normal; }

    /* ---------- Kotak ringkasan berwarna (dashboard) ---------- */
    .stat { border: 0; box-shadow: none; transition: transform .15s, box-shadow .15s; }
    .stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border: 0; }
    .stat span { color: inherit; opacity: .8; }
    .stats.ops .stat strong { font-size: 21px; font-weight: 600; }
    .stats .stat .stat-ico { background: rgba(255, 255, 255, .8) !important; }
    .stats .stat:nth-child(6n+1) { background: var(--tint-1); color: var(--ink-1); }
    .stats .stat:nth-child(6n+2) { background: var(--tint-2); color: var(--ink-2); }
    .stats .stat:nth-child(6n+3) { background: var(--tint-3); color: var(--ink-3); }
    .stats .stat:nth-child(6n+4) { background: var(--tint-4); color: var(--ink-4); }
    .stats .stat:nth-child(6n+5) { background: var(--tint-5); color: var(--ink-5); }
    .stats .stat:nth-child(6n+6) { background: var(--tint-6); color: var(--ink-6); }
    .stats .stat:nth-child(6n+1) .stat-ico { color: var(--ink-1) !important; }
    .stats .stat:nth-child(6n+2) .stat-ico { color: var(--ink-2) !important; }
    .stats .stat:nth-child(6n+3) .stat-ico { color: var(--ink-3) !important; }
    .stats .stat:nth-child(6n+4) .stat-ico { color: var(--ink-4) !important; }
    .stats .stat:nth-child(6n+5) .stat-ico { color: var(--ink-5) !important; }
    .stats .stat:nth-child(6n+6) .stat-ico { color: var(--ink-6) !important; }
    .kpi { position: relative; overflow: hidden; border: 0; box-shadow: var(--shadow); padding: 18px 20px 18px 24px; background: #fff; }
    .kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
    .kpi-grid .kpi:nth-child(4n+1)::before { background: var(--navy); }
    .kpi-grid .kpi:nth-child(4n+2)::before { background: var(--leaf); }
    .kpi-grid .kpi:nth-child(4n+3)::before { background: var(--gold); }
    .kpi-grid .kpi:nth-child(4n+4)::before { background: #e05252; }
    .kpi-label { color: var(--muted); }
    .kpi-value { font-weight: 600; color: var(--navy-900); }
    .kpi-hero .kpi-value { color: var(--navy); }
    .mini-stats { border-bottom-color: #eef1f6; }
    .section-title h2 { font-weight: 600; color: var(--navy-900); }
    .rank-bar { background: #eef1f8; }
    .rank-bar i { background: linear-gradient(90deg, var(--navy) 0%, #4c6fd1 100%); }
    .chart-bar { background: #c9d3ef; }
    .chart-slot.kini .chart-bar { background: linear-gradient(180deg, #2d52b8 0%, var(--navy) 100%); }
    .doc-switch a.active { background: var(--navy); color: #fff; }
    .tabs a.active { color: var(--navy); border-bottom-color: var(--gold); }

    /* ---------- Login ---------- */
    .login-page { background: radial-gradient(1200px 600px at 85% 10%, rgba(212, 160, 23, .22) 0%, rgba(212, 160, 23, 0) 60%), linear-gradient(160deg, var(--navy-800) 0%, var(--navy-900) 100%); }
    .login-card { border-radius: 22px; box-shadow: 0 30px 70px rgba(5, 12, 35, .45); }
    .login-logo img { mix-blend-mode: multiply; border-radius: 50%; }
    .login-app { color: var(--gold-dark) !important; }
}

/* HP & tablet: jarak tepi kecil */
@media screen and (max-width: 900px) {
    .topbar, .content, .footer { padding-left: 16px; padding-right: 16px; }
    .content { padding-top: 20px; }
    .topbar h1 { min-width: 0; }
    .card-head .toolbar, .section-title .toolbar { width: 100%; }
    .toolbar > * { min-width: 0 !important; max-width: 100%; }
    .toolbar select, .toolbar input { flex: 1 1 150px; width: auto !important; }
    .content .card, .invoice { overflow-x: auto; }
    .judul-chip { font-size: 15.5px; white-space: normal; line-height: 1.25; }
    .form-grid { gap: 0; }
    .form-actions { flex-wrap: wrap; }
    .form-actions .btn { flex: 1 1 auto; }
}
