/* ISB Manajemen Toko — tema di atas SB Admin 2 (navy + emas, mengikuti logo) */
:root {
  --navy: #0f3a6d; --navy-dark: #0a2646; --navy-soft: #e8eef7;
  --gold: #d6a516; --gold-soft: #fbf3d9;
  --ink: #1f2a44; --muted: #7a869a; --line: #e6ebf2; --bg: #f4f6fb;
  --radius: 14px; --shadow: 0 2px 12px rgba(15, 58, 109, .07);
}
body, #content-wrapper { font-family: 'Inter', 'Nunito', system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: .9rem; }
a { color: var(--navy); } a:hover { color: var(--gold); }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.01em; }

/* ---------- Sidebar ---------- */
.sidebar { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-dark) 100%) !important; width: 15.5rem; }
.sidebar.toggled { width: 6.5rem !important; }
.sidebar .sidebar-brand { height: 4.6rem; justify-content: flex-start; padding: 0 1.1rem; gap: .7rem; }
.sidebar .brand-logo { width: 42px; height: 42px; border-radius: 12px; background: #fff; object-fit: contain; flex: none; }
.sidebar .brand-text { text-align: left; line-height: 1.15; font-weight: 700; font-size: .95rem; }
.sidebar .brand-text small { display: block; font-weight: 500; color: var(--gold); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.sidebar.toggled .brand-text { display: none; }
.sidebar .sidebar-heading { color: rgba(255, 255, 255, .45); font-size: .65rem; letter-spacing: .1em; padding: 0 1.25rem; margin-top: .4rem; }
.sidebar .nav-item .nav-link { padding: .7rem 1.1rem; margin: 2px .7rem; border-radius: 10px; width: auto; color: rgba(255, 255, 255, .78); font-weight: 500; transition: .15s; }
.sidebar .nav-item .nav-link { display: flex; align-items: center; text-align: left; white-space: nowrap; }
.sidebar .nav-item .nav-link span { font-size: .88rem; display: inline; }
.sidebar .nav-item .nav-link[data-toggle=collapse]::after { margin-left: auto; }
.sidebar .nav-item .nav-link i { width: 1.5rem; text-align: center; flex: none; font-size: .9rem; margin-right: .35rem; color: rgba(255, 255, 255, .55); }
.sidebar .nav-item .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar .nav-item.active .nav-link { background: var(--gold); color: var(--navy-dark); font-weight: 700; }
.sidebar .nav-item.active .nav-link i { color: var(--navy-dark); }
.sidebar .collapse-inner { border-radius: 12px; margin: 0 .9rem; padding: .4rem; }
.sidebar .collapse-item { border-radius: 8px; padding: .5rem .8rem; font-size: .84rem; }
.sidebar .collapse-item.active { background: var(--gold-soft); color: var(--navy-dark); font-weight: 700; }
/* sidebar dikecilkan: hanya ikon, rapi & di tengah */
@media (min-width: 768px) {
  .sidebar.toggled { width: 4.9rem !important; overflow: visible; }
  .sidebar.toggled .sidebar-brand { justify-content: center; padding: 0; }
  .sidebar.toggled .sidebar-heading { font-size: 0; height: 1px; margin: .6rem 1rem; background: rgba(255, 255, 255, .12); padding: 0; }
  .sidebar.toggled .nav-item .nav-link { width: auto; margin: 3px .6rem; padding: .8rem 0; justify-content: center; }
  .sidebar.toggled .nav-item .nav-link span { display: none; }
  .sidebar.toggled .nav-item .nav-link i { margin: 0; font-size: 1.05rem; width: auto; }
  .sidebar.toggled .nav-item .collapse { position: absolute; left: 4.9rem; top: 0; z-index: 1100; min-width: 11rem; }
  .sidebar.toggled .nav-item .collapse .collapse-inner { margin: 0; box-shadow: 0 8px 30px rgba(15, 58, 109, .2); }
  .sidebar.toggled .nav-item .nav-link[data-toggle=collapse]::after { display: none; }
}
.sidebar-divider { border-color: rgba(255, 255, 255, .1); margin: .7rem 1rem; }

/* ---------- Topbar ---------- */
.topbar { height: 4.2rem; box-shadow: 0 1px 0 var(--line) !important; background: #fff; }
.topbar .user-chip { display: flex; align-items: center; gap: .6rem; }
.topbar .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; object-fit: cover; }
.topbar .dropdown-menu { border: 0; border-radius: 12px; box-shadow: 0 8px 30px rgba(15, 58, 109, .15); }
.topbar-date { color: var(--muted); font-size: .8rem; }

/* ---------- Page ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.4rem; margin: 0; display: flex; align-items: center; gap: .6rem; }
.page-head h1 .ico { width: 38px; height: 38px; border-radius: 11px; background: var(--navy-soft); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; }
.page-head .sub { color: var(--muted); font-size: .82rem; margin: .15rem 0 0; }
.card { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0 !important; padding: 1rem 1.25rem; font-weight: 700; }
.card-body { padding: 1.25rem; }
.text-navy { color: var(--navy) !important; } .text-gold { color: var(--gold) !important; }

/* ---------- Buttons & badges ---------- */
.btn { border-radius: 10px; font-weight: 600; padding: .5rem 1rem; }
.btn-primary { background: var(--navy); border-color: var(--navy); }
.btn-primary:hover, .btn-primary:focus { background: var(--navy-dark); border-color: var(--navy-dark); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--navy-dark); }
.btn-gold:hover { background: #bf9211; border-color: #bf9211; color: var(--navy-dark); }
.btn-sm { padding: .3rem .6rem; border-radius: 8px; }
.btn-soft-primary { background: var(--navy-soft); color: var(--navy); } .btn-soft-primary:hover { background: var(--navy); color: #fff; }
.btn-soft-danger { background: #fdeaea; color: #d33; } .btn-soft-danger:hover { background: #d33; color: #fff; }
.btn-soft-warning { background: var(--gold-soft); color: #9a7408; } .btn-soft-warning:hover { background: var(--gold); color: #fff; }
.badge { border-radius: 8px; font-weight: 600; padding: .4em .7em; }
.badge-soft-success { background: #e2f6ea; color: #1b8a4b; } .badge-soft-warning { background: var(--gold-soft); color: #9a7408; }
.badge-soft-info { background: #e1f2fb; color: #1479a8; } .badge-soft-primary { background: var(--navy-soft); color: var(--navy); }
.badge-soft-secondary { background: #eceff4; color: #5b667a; } .badge-soft-danger { background: #fdeaea; color: #d33; }

/* ---------- Forms ---------- */
.form-control, .custom-select, .select2-container--bootstrap4 .select2-selection { border-radius: 10px; border-color: #dbe2ec; min-height: calc(1.5em + .9rem); }
.form-control:focus, .custom-select:focus { border-color: var(--navy); box-shadow: 0 0 0 .2rem rgba(15, 58, 109, .12); }
label { font-weight: 600; font-size: .8rem; color: #4a566d; margin-bottom: .3rem; }
.select2-container--bootstrap4 .select2-selection--single { height: calc(1.5em + .9rem) !important; }
.select2-container { width: 100% !important; }
.modal-content { border: 0; border-radius: 16px; overflow: hidden; }
.modal-header { background: var(--navy); color: #fff; border: 0; padding: 1rem 1.25rem; }
.modal-header .close { color: #fff; opacity: .8; text-shadow: none; }
.modal-footer { border-top: 1px solid var(--line); }

/* ---------- Tables / DataTables ---------- */
.table thead th { background: #f7f9fc; color: #5b667a; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line) !important; border-top: 0; white-space: nowrap; }
.table td { vertical-align: middle; border-color: var(--line); }
.table-hover tbody tr:hover { background: #f8fafd; }
div.dataTables_wrapper div.dataTables_filter input { border-radius: 10px; border: 1px solid #dbe2ec; padding: .4rem .8rem; }
div.dataTables_wrapper div.dataTables_length select { border-radius: 8px; }
.page-item.active .page-link { background: var(--navy); border-color: var(--navy); }
.page-link { color: var(--navy); border-radius: 8px; margin: 0 2px; border: 0; }
.dataTables_info, .dataTables_length label, .dataTables_filter label { font-size: .8rem; color: var(--muted); font-weight: 500; }
td.text-nowrap-actions, td.aksi { white-space: nowrap; }

/* ---------- Filter periode ---------- */
.filter-periode { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.filter-periode .custom-select { width: auto; min-width: 8.5rem; font-weight: 600; }

/* ---------- Stat cards ---------- */
.stat-card { position: relative; overflow: hidden; height: 100%; }
.stat-card .card-body { display: flex; align-items: center; gap: 1rem; }
.stat-card .stat-ico { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; flex: none; }
.stat-card .stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.stat-card .stat-value { font-size: 1.3rem; font-weight: 800; line-height: 1.2; word-break: break-word; }
.stat-card .stat-sub { font-size: .72rem; color: var(--muted); }
.ico-navy { background: var(--navy-soft); color: var(--navy); } .ico-gold { background: var(--gold-soft); color: #9a7408; }
.ico-green { background: #e2f6ea; color: #1b8a4b; } .ico-red { background: #fdeaea; color: #d33; }
.ico-blue { background: #e1f2fb; color: #1479a8; } .ico-purple { background: #efe9fb; color: #6b44c2; }
.chart-box { position: relative; height: 300px; } .chart-box.sm { height: 260px; }
.empty-note { color: var(--muted); text-align: center; padding: 2.5rem 0; }

/* ---------- Form transaksi multi-baris ---------- */
.item-row { background: #fafbfe; border: 1px solid var(--line); border-radius: 12px; padding: .9rem .9rem .3rem; margin-bottom: .75rem; position: relative; }
.item-row .btn-remove { position: absolute; top: .5rem; right: .5rem; }
.item-row .row-sub { font-weight: 700; color: var(--navy); }
.row-label { display: none; }
.total-box { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.total-box .amount { font-size: 1.6rem; font-weight: 800; color: var(--gold); }
.jenis-tabs .btn { border-radius: 999px; }
.sticky-total { position: sticky; top: 1rem; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; background: #fff; }
.auth-side { flex: 1.1; background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-side::after { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: var(--gold); opacity: .12; right: -120px; bottom: -120px; }
.auth-side h2 { font-size: 2rem; } .auth-side .tag { color: var(--gold); letter-spacing: .12em; text-transform: uppercase; font-size: .75rem; font-weight: 700; }
.auth-form { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box .logo { width: 150px; margin-bottom: 1rem; }

/* ---------- Invoice ---------- */
.invoice { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; max-width: 900px; margin: 0 auto; }
.invoice .inv-title { font-size: 1.8rem; font-weight: 800; color: var(--navy); letter-spacing: .05em; }
.invoice .inv-logo { height: 70px; }

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
  .row-label { display: block; }
  .page-head h1 { font-size: 1.15rem; }
  .card-body { padding: 1rem; }
  .auth-side { display: none; }
  .topbar-date { display: none; }
  .invoice { padding: 1.1rem; }
  .filter-periode .custom-select { flex: 1; min-width: 7rem; }
  .sticky-total { position: static; }
}
@media print {
  .sidebar, .topbar, .no-print, footer.sticky-footer { display: none !important; }
  #content-wrapper, body { background: #fff !important; }
  .invoice { box-shadow: none; padding: 0; max-width: 100%; }
  .container-fluid { padding: 0 !important; }
}

/* ---------- Sidebar mobile: drawer (tersembunyi default, tombol hamburger membuka) ---------- */
.btn { white-space: nowrap; }
@media (max-width: 767.98px) {
  .sidebar, .sidebar.toggled { position: fixed; top: 0; bottom: 0; left: 0; width: 15.5rem !important; z-index: 1200; overflow-y: auto !important; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.toggled { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .sidebar.toggled .brand-text { display: block; }
  .sidebar.toggled .sidebar-heading { font-size: .65rem; height: auto; background: none; padding: 0 1.25rem; margin: .4rem 0 0; }
  .sidebar .nav-item .nav-link span, .sidebar.toggled .nav-item .nav-link span { display: inline; }
  .sidebar.toggled .nav-item .nav-link { justify-content: flex-start; margin: 2px .7rem; padding: .7rem 1.1rem; }
  body.sidebar-toggled::after { content: ''; position: fixed; inset: 0; background: rgba(10, 38, 70, .5); z-index: 1100; }
}

/* tombol tutup drawer (mobile) */
.drawer-close { position: absolute; top: .9rem; right: .8rem; z-index: 2; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; }
/* datatables responsive */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control::before, table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control::before { background-color: var(--navy, #0f3a6d); box-shadow: none; }
table.dataTable > tbody > tr.child ul.dtr-details { display: block; }
table.dataTable > tbody > tr.child span.dtr-title { min-width: 7rem; color: var(--muted); font-weight: 600; }
table.dataTable > tbody > tr.child td.child { white-space: normal; }
@media (max-width: 575.98px) { div.dataTables_wrapper div.dataTables_filter, div.dataTables_wrapper div.dataTables_length, div.dataTables_wrapper div.dataTables_info, div.dataTables_wrapper div.dataTables_paginate { text-align: center !important; float: none; } div.dataTables_wrapper div.dataTables_filter input { width: 100%; margin: 0; } }
