/* ===== Variasi EF 18 Project - tema simpel profesional ===== */
:root {
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f4f6f9;
    --brand: #1f3fd1;
    --brand-dark: #15289b;
    --side: #0a1240;
    --accent: #e11d2a;
    --radius: 10px;
}
html, body { background: var(--bg); }
body { font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .875rem; color: var(--ink); -webkit-font-smoothing: antialiased; }
h1,h2,h3,h4,h5,h6 { font-weight: 600; }
a { color: var(--brand); }

/* ---------- sidebar ---------- */
.sb { position: fixed; inset: 0 auto 0 0; width: 244px; background: var(--side); color: #cbd5e1; z-index: 1040; overflow-y: auto; transition: transform .25s ease; }
.sb-brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.2rem; color: #fff; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.07); }
.sb-user { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.2rem; margin: .6rem .8rem; background: rgba(255,255,255,.05); border-radius: 10px; }
.sb-user .av { width: 40px; height: 40px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; flex: 0 0 40px; }
.sb-user .role { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; order: 2; }
.sb-user .nm { font-weight: 500; font-size: .85rem; color: #fff; line-height: 1.2; }
.sb-user > div:last-child { display: flex; flex-direction: column; }
.sb-nav { padding: .4rem .8rem 1.5rem; }
.sb-nav a.item, .sb-nav .grp-btn { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; margin-bottom: 2px; color: #cbd5e1; text-decoration: none; font-weight: 400; font-size: .85rem; width: 100%; background: transparent; border: 0; border-radius: 8px; text-align: left; }
.sb-nav a.item i, .sb-nav .grp-btn i.ic { width: 1.2rem; text-align: center; font-size: 1.05rem; opacity: .85; }
.sb-nav a.item:hover, .sb-nav .grp-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.sb-nav a.item.active, .sb-nav .grp-btn.active { background: var(--brand); color: #fff; }
.sb-nav .grp-btn.active { background: rgba(31,63,209,.38); color: #fff; }
.sb-nav .grp-btn .chev { margin-left: auto; font-size: .65rem; transition: transform .2s; }
.sb-nav .grp-btn:not(.collapsed) .chev { transform: rotate(180deg); }
.sb-sub { margin: 2px 0 4px 1.55rem; border-left: 1px solid rgba(255,255,255,.12); }
.sb-sub a { display: block; padding: .45rem .9rem; color: #94a3b8; text-decoration: none; font-size: .82rem; border-radius: 6px; }
.sb-sub a:hover { color: #fff; }
.sb-sub a.active { color: #fff; font-weight: 500; }

.sb-brand { justify-content: center; padding: 1.1rem 1rem; }
.sb-brand img { width: 100%; max-width: 200px; height: auto; display: block; }
.sb-nav a.item.active { box-shadow: inset 3px 0 0 var(--accent); }
.sb-sub a.active { box-shadow: inset 2px 0 0 var(--accent); margin-left: -1px; }
.sb-user .av { background: var(--accent); }
.panel-head > span:first-child { padding-bottom: .35rem; border-bottom: 3px solid var(--accent); }
.topbar { border-bottom: 2px solid var(--brand); }
.btn-danger, .btn-outline-danger:hover { background: var(--accent); border-color: var(--accent); }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }
.table thead th { border-bottom: 2px solid var(--brand); }
.login-hero { background: linear-gradient(160deg, #0a1240 0%, #11217c 60%, #1f3fd1 100%); border-right: 5px solid var(--accent); }
.login-hero .logo-img { width: 100%; max-width: 420px; margin-bottom: 1.6rem; filter: drop-shadow(0 6px 18px rgba(0,0,0,.35)); }
.login-card .logo-mobile { display: none; width: 220px; margin: 0 auto 1.2rem; }
@media (max-width: 860px) { .login-card .logo-mobile { display: block; } }

.bell { position: relative; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); display: grid; place-items: center; font-size: 1.1rem; }
.bell:hover { background: #f3f4f6; }
.bell .dot { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 600; display: grid; place-items: center; }

/* ---------- area utama ---------- */
.wrap { margin-left: 244px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: .65rem 1.25rem; display: flex; align-items: center; gap: .9rem; position: sticky; top: 0; z-index: 1030; }
.topbar .tgl { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); display: none; place-items: center; font-size: 1.2rem; }
.topbar .ttl { font-weight: 600; color: var(--ink); }
.topbar .ttl small { font-weight: 400; color: var(--muted); }
.topbar .jump { max-width: 220px; font-size: .8rem; }
.topbar .user { display: flex; align-items: center; gap: .55rem; cursor: pointer; }
.topbar .user .av { width: 34px; height: 34px; border-radius: 50%; background: #e0e7ff; color: var(--brand-dark); display: grid; place-items: center; font-weight: 600; }
.content { padding: 1.4rem 1.5rem; flex: 1; }
.panel { background: transparent; border: 0; box-shadow: none; }
.panel-head { background: transparent; color: var(--ink); padding: 0 0 1rem; font-weight: 600; font-size: 1.25rem; display: flex; align-items: center; justify-content: space-between; }
.panel-head .act { display: none; }
.panel-body { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.footer { text-align: center; padding: 1rem; font-size: .75rem; color: var(--muted); }

@media (max-width: 991.98px) {
    .sb { transform: translateX(-100%); }
    body.sb-open .sb { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.45); z-index: 1045; }
    body.sb-open::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035; }
    .wrap { margin-left: 0; }
    .topbar .tgl { display: grid; }
    .topbar .jump { display: none; }
    .content { padding: 1rem; }
}

/* ---------- kartu statistik ---------- */
.sc { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.1rem; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); height: 100%; transition: box-shadow .2s, transform .2s; }
.sc:hover { box-shadow: 0 6px 16px rgba(16,24,40,.08); transform: translateY(-2px); }
.sc .ic { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 10px; display: grid; place-items: center; font-size: 1.35rem; background: #e9edfd; color: var(--brand); }
.sc .tx { display: flex; flex-direction: column-reverse; min-width: 0; }
.sc .nm { font-size: 1.25rem; font-weight: 600; line-height: 1.2; color: var(--ink); white-space: nowrap; }
.sc .lb { font-size: .76rem; color: var(--muted); }
.sc-gray .ic { background: #f3f4f6; color: #4b5563; }
.sc-green .ic { background: #ecfdf3; color: #15803d; }
.sc-yellow .ic { background: #fffbeb; color: #b45309; }
.sc-red .ic { background: #fdecee; color: var(--accent); }
.sc-red .nm { color: var(--accent); }
.sc-blue .ic, .sc-navy .ic { background: #e9edfd; color: var(--brand); }
.sc-teal .ic { background: #ecfeff; color: #0e7490; }

.sec-title { font-size: .95rem; color: var(--ink); margin: 1.4rem 0 .7rem; font-weight: 600; }

/* ---------- tabel & komponen ---------- */
.table { margin-bottom: 0; --bs-table-border-color: var(--line); }
.table thead th, .table-light, .table > thead.table-light > tr > th { background: #f9fafb !important; color: #4b5563 !important; font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table > :not(caption) > * > * { padding: .7rem .8rem; }
.table-bordered > :not(caption) > * { border-width: 0 0 1px; }
.table-bordered > :not(caption) > * > * { border-width: 0 0 1px; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f8fafc; }
.table-striped-soft tbody tr:nth-child(odd) > * { background: transparent; }
.table-responsive { border: 1px solid var(--line); border-radius: 8px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.card-header { background: #fff !important; font-weight: 600; border-bottom: 1px solid var(--line); }
.btn { border-radius: 8px; font-weight: 500; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.form-control, .form-select { border-radius: 8px; border-color: #d1d5db; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(31,63,209,.18); }
.form-label { font-weight: 500; font-size: .82rem; color: #374151; }
.alert { border-radius: 8px; border: 0; }
.badge { font-weight: 500; }

.rank { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 600; background: #f3f4f6; }
.rank.r1 { background: #fef3c7; color: #92400e; } .rank.r2 { background: #e5e7eb; color: #374151; } .rank.r3 { background: #ffedd5; color: #9a3412; }
.stok-bar { height: 6px; border-radius: 6px; background: #eef0f3; overflow: hidden; min-width: 80px; }
.stok-bar > span { display: block; height: 100%; border-radius: 6px; }
.avatar-produk { width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; color: #fff; font-weight: 600; font-size: .8rem; }
.g-blue { background: #3b82f6; } .g-green { background: #16a34a; } .g-amber { background: #d97706; } .g-purple { background: #7c3aed; } .g-teal { background: #0891b2; }

/* ---------- transaksi kasir ---------- */
.pos-list { max-height: 62vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.pos-list table thead th { position: sticky; top: 0; z-index: 1; }
.cart-box { background: #f9fafb; border: 1px solid var(--line); border-radius: var(--radius); }
.cart-total { background: var(--side); color: #fff; border-radius: 8px; padding: .9rem 1rem; }
.cart-total .nominal { font-size: 1.6rem; font-weight: 600; }
.qty-btn { width: 26px; height: 26px; padding: 0; line-height: 1; }

/* ---------- nota & cetak ---------- */
.nota { max-width: 340px; margin: 0 auto; background: #fff; border: 1px dashed #9ca3af; padding: 1.1rem 1.2rem; font-family: 'Courier New', monospace; font-size: .8rem; color: #111; }
.nota h6 { text-align: center; margin-bottom: 0; font-weight: 700; font-family: inherit; }
.nota .garis { border-top: 1px dashed #555; margin: .5rem 0; }
.nota table { width: 100%; font-size: .78rem; }
.nota td { padding: 1px 0; vertical-align: top; border: 0; }
@media print {
    .sb, .topbar, .panel-head, .no-print, .footer, .alert { display: none !important; }
    .wrap { margin: 0 !important; }
    html, body { background: #fff !important; }
    .content { padding: 0 !important; }
    .panel-body { border: 0 !important; padding: 0 !important; box-shadow: none !important; }
    .nota { border: 0; }
    .sc { break-inside: avoid; }
}

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.login-hero { background: var(--side); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.login-hero .orb { display: none; }
.login-hero .logo-lg { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; background: var(--brand); margin-bottom: 1.4rem; }
.login-hero h1 { font-weight: 600; font-size: 1.7rem; }
.login-hero .fitur { display: flex; gap: .8rem; align-items: flex-start; margin-top: 1.2rem; color: #cbd5e1; }
.login-hero .fitur i { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.08); }
.login-hero .fitur b { color: #fff; font-weight: 500; }
.login-form { display: grid; place-items: center; padding: 2rem; background: #fff; }
.login-card { width: 100%; max-width: 380px; }
.input-icon { position: relative; }
.input-icon > i.lead { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #9ca3af; }
.input-icon .form-control { padding-left: 42px; padding-top: .65rem; padding-bottom: .65rem; }
.input-icon .toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #9ca3af; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-hero { display: none; } }
