/* =========================================================
   GALATAMA & WARUNG — UI Stylesheet
   Mobile-first, tanpa framework
   ========================================================= */
:root {
  --green: #0b8a5a; --green-600: #087049; --green-50: #e7f5ee; --green-100: #c9ead9;
  --orange: #e8890c; --orange-600: #c87204; --orange-50: #fdf3e2; --orange-100: #fbe2b8;
  --ink: #0f1a17; --ink-2: #33403c; --muted: #6b7a75; --line: #e6ebe9; --line-2: #f0f3f2;
  --bg: #f4f6f5; --card: #ffffff;
  --danger: #e5484d; --danger-50: #fdecec; --info: #2f7fe0; --info-50: #e8f1fd;
  --warning: #d98a00; --warning-50: #fff5df; --purple: #7c5cdb; --purple-50: #f1edfc;
  --radius: 16px; --radius-sm: 10px; --radius-xs: 8px;
  --shadow: 0 1px 2px rgba(16,24,20,.04), 0 4px 16px rgba(16,24,20,.05);
  --shadow-lg: 0 12px 40px rgba(16,24,20,.16);
  --sidebar-w: 284px; --topbar-h: 64px; --bottom-h: 68px;
  --accent: var(--green); --accent-600: var(--green-600); --accent-50: var(--green-50); --accent-100: var(--green-100);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
.theme-warung { --accent: var(--orange); --accent-600: var(--orange-600); --accent-50: var(--orange-50); --accent-100: var(--orange-100); }

*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif; font-size: 14.5px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-600); text-decoration: none; }
h1,h2,h3,h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
img { max-width: 100%; }
.ti { font-size: 1.15em; line-height: 1; vertical-align: -.12em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.text-right { text-align: right !important; }
.text-center, .center { text-align: center; }
.text-success { color: var(--green) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.fw-bold { font-weight: 700; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.mt-0{margin-top:0}.mt-1{margin-top:6px}.mt-2{margin-top:12px}.mt-3{margin-top:20px}.mb-2{margin-bottom:12px}.mb-3{margin-bottom:20px}
.inline { display: inline; }
.hidden { display: none !important; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ================= LAYOUT ================= */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 16px 14px calc(var(--bottom-h) + 24px + var(--safe-b)); flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; }
.foot { padding: 18px 28px; color: var(--muted); font-size: 12.5px; }

/* Sidebar */
.sidebar { position: fixed; inset: 0 auto 0 0; width: min(86vw, var(--sidebar-w)); background: #fbfcfb; border-right: 1px solid var(--line); z-index: 60; transform: translateX(-102%); transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.sidebar-scroll { height: 100%; overflow-y: auto; padding: 14px 14px 30px; }
body.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(10,20,16,.42); backdrop-filter: blur(2px); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .25s; }
body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
body.sidebar-open { overflow: hidden; }

.side-user { display: flex; align-items: center; gap: 10px; padding: 8px 6px 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.side-user-info { flex: 1; min-width: 0; }
.side-user-info strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-info small { color: var(--muted); font-size: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--green), #11a36c); flex-shrink: 0; }
.avatar-sm { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }

.nav-group { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 10px 10px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.brand strong { display: block; font-size: 13.5px; font-weight: 800; letter-spacing: .01em; }
.brand small { display: block; font-size: 12px; color: var(--muted); }
.brand-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 22px; flex-shrink: 0; }
.nav-galatama .brand-icon, .brand-icon.g { background: var(--green); }
.nav-warung .brand-icon, .brand-icon.w { background: var(--orange); }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; font-size: 14.5px; transition: background .15s, color .15s; }
.nav-link .ti { font-size: 20px; color: var(--muted); transition: color .15s; }
.nav-link:hover { background: var(--line-2); color: var(--ink); }
.nav-galatama .nav-link.active { background: var(--green-50); color: var(--green-600); font-weight: 700; }
.nav-galatama .nav-link.active .ti { color: var(--green); }
.nav-warung .nav-link.active { background: var(--orange-50); color: var(--orange-600); font-weight: 700; }
.nav-warung .nav-link.active .ti { color: var(--orange); }
.nav-divider { height: 1px; background: var(--line); margin: 8px 6px; }
.nav-logout { color: var(--danger); margin-top: 4px; }
.nav-logout .ti { color: var(--danger); }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 12px; background: rgba(255,255,255,.88); backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--line); }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title .crumb { display: block; font-size: 11.5px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.topbar-title strong { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.today { color: var(--muted); font-size: 13px; margin-right: 6px; }

/* Bottom nav */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(var(--bottom-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(16,24,20,.06); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; }
.bottom-nav a .ti { font-size: 23px; }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav .bn-main { position: relative; }
.bn-fab { width: 54px; height: 54px; margin-top: -26px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(140deg, var(--orange), #f2a53a); color: #fff; box-shadow: 0 8px 18px rgba(232,137,12,.4); border: 4px solid #fff; }
.bn-fab .ti { font-size: 24px !important; }

.only-desktop { display: none !important; }

/* ================= PAGE HEAD ================= */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h1 { font-size: 21px; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 3px; font-size: 13.5px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ================= CARDS / GRID ================= */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head h3 { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ti { color: var(--accent); }
.card-body { padding: 16px; }
.card-body.p0 { padding: 0; }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--line-2); background: #fcfdfc; border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 14px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 12px; grid-template-columns: 1fr; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }

/* Stat tile */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; gap: 12px; align-items: flex-start; box-shadow: var(--shadow); min-width: 0; }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; background: var(--accent-50); color: var(--accent); }
.stat-body { min-width: 0; }
.stat-label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-value { display: block; font-size: 17px; font-weight: 800; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat-hint { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tone-green .stat-icon { background: var(--green-50); color: var(--green); }
.tone-orange .stat-icon { background: var(--orange-50); color: var(--orange); }
.tone-info .stat-icon { background: var(--info-50); color: var(--info); }
.tone-danger .stat-icon { background: var(--danger-50); color: var(--danger); }
.tone-purple .stat-icon { background: var(--purple-50); color: var(--purple); }
.tone-warning .stat-icon { background: var(--warning-50); color: var(--warning); }

/* Hero banner (dashboard) */
.hero { border-radius: 20px; padding: 18px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #18b07a 0%, var(--green) 45%, #06573a 100%); position: relative; overflow: hidden; margin-bottom: 16px; }
.hero::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero h2 { font-size: 20px; font-weight: 800; }
.hero p { opacity: .88; margin-top: 4px; font-size: 13.5px; }
.hero .hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; position: relative; z-index: 1; }
.hero .btn { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.22); }
.hero .btn:hover { background: rgba(255,255,255,.26); }
.hero .btn.btn-white { background: #fff; color: var(--green-600); }

/* ================= BUTTONS ================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 15px; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; color: var(--ink); background: #fff; transition: background .15s, transform .08s, box-shadow .15s, color .15s; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-primary:hover { background: var(--accent-600); }
.btn-galatama { background: var(--green); color: #fff; } .btn-galatama:hover { background: var(--green-600); }
.btn-warung { background: var(--orange); color: #fff; } .btn-warung:hover { background: var(--orange-600); }
.btn-soft { background: var(--accent-50); color: var(--accent-600); }
.btn-soft:hover { background: var(--accent-100); }
.btn-light { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-light:hover { background: var(--line-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--line-2); }
.btn-ghost-danger { background: transparent; color: var(--danger); }
.btn-ghost-danger:hover { background: var(--danger-50); }
.btn-icon { width: 38px; height: 38px; padding: 0; }
.btn-icon .ti { font-size: 19px; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 50px; font-size: 15.5px; border-radius: 13px; }
.btn-block { width: 100%; }

/* ================= FORMS ================= */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.field .help { font-size: 12px; color: var(--muted); }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=password], input[type=search], input[type=tel], input:not([type]), select, textarea {
  width: 100%; height: 44px; padding: 0 13px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; font: inherit; font-size: 15px; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none; }
textarea { height: auto; min-height: 84px; padding: 11px 13px; resize: vertical; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7a75' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
input[readonly] { background: var(--line-2); }
.input-icon { position: relative; }
.input-icon > .ti { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 18px; pointer-events: none; }
.input-icon input { padding-left: 40px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 8px; cursor: pointer; }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; background: var(--line-2); border: 1.5px solid var(--line); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--muted); font-weight: 600; font-size: 13.5px; }
.input-group input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .addon-r { border-right: 1.5px solid var(--line); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .addon-r ~ input, .input-group input:has(+ .addon-r) { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.form-row { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 16px; box-shadow: var(--shadow); }
.filter-bar .field { margin: 0; flex: 1 1 140px; }
.filter-bar .btn { flex: 1 1 100%; }
.quick-range { display: flex; gap: 6px; flex-wrap: wrap; width: 100%; }
.search-box { position: relative; flex: 1; min-width: 180px; }
.search-box .ti { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 38px; }

/* ================= CHIPS / BADGES / TABS ================= */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; font-family: inherit; }
.chip:hover { border-color: var(--accent-100); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge-success { background: var(--green-50); color: var(--green-600); }
.badge-warning { background: var(--warning-50); color: #a96a00; }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-info { background: var(--info-50); color: var(--info); }
.badge-primary { background: var(--accent-50); color: var(--accent-600); }
.badge-muted { background: var(--line-2); color: var(--muted); }
.tabs { display: flex; gap: 4px; padding: 4px; background: #e9eeec; border-radius: 12px; overflow-x: auto; margin-bottom: 16px; scrollbar-width: none; }
.tabs a, .tabs button { flex: 1; text-align: center; padding: 9px 12px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); white-space: nowrap; border: 0; background: none; font-family: inherit; cursor: pointer; }
.tabs .active { background: #fff; color: var(--accent-600); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* ================= TABLE ================= */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 11px 14px; background: #fafbfb; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover { background: #fbfcfc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 800; background: #fafbfb; border-top: 1px solid var(--line); }
.table .actions { white-space: nowrap; text-align: right; }
.table .actions > * { vertical-align: middle; }
.td-title { font-weight: 700; }
.td-sub { font-size: 12.5px; color: var(--muted); }
tr.row-muted td { opacity: .5; }

/* Mobile: tabel jadi kartu */
@media (max-width: 767px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tbody tr { padding: 12px 14px; border-bottom: 1px solid var(--line); position: relative; }
  .table-cards td { padding: 3px 0; border: 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table-cards td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; flex-shrink: 0; }
  .table-cards td.td-main { display: block; text-align: left; padding-bottom: 6px; padding-right: 90px; }
  .table-cards td.td-main::before { display: none; }
  .table-cards td.actions { position: absolute; top: 8px; right: 8px; width: auto; padding: 0; }
  .table-cards td.actions::before { display: none; }
  .table-cards td:empty { display: none; }
  .table-cards tfoot { display: block; }
  .table-cards tfoot tr { display: flex; justify-content: space-between; padding: 12px 14px; background: #fafbfb; }
  .table-cards tfoot td { padding: 0; border: 0; background: none; }
  .table-cards tfoot td:empty { display: none; }
}

/* ================= MODAL ================= */
dialog.modal { border: 0; padding: 0; border-radius: 20px 20px 0 0; width: 100%; max-width: 100%; max-height: 92vh; margin: auto auto 0; box-shadow: var(--shadow-lg); color: var(--ink); overflow: hidden; display: none; flex-direction: column; }
dialog.modal[open] { display: flex; animation: sheetUp .26s cubic-bezier(.2,.8,.2,1); }
dialog.modal::backdrop { background: rgba(10,20,16,.48); backdrop-filter: blur(2px); }
.modal > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { font-size: 17px; font-weight: 800; }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px calc(14px + var(--safe-b)); border-top: 1px solid var(--line-2); background: #fcfdfc; }
.modal-foot .btn { flex: 1; }
.confirm-icon { width: 60px; height: 60px; border-radius: 50%; margin: 6px auto 14px; display: grid; place-items: center; background: var(--danger-50); color: var(--danger); font-size: 28px; }
#confirmText { font-size: 17px; margin-bottom: 4px; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ================= TOAST / ALERT / EMPTY ================= */
.toasts { position: fixed; top: 74px; left: 12px; right: 12px; z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 13px; background: #fff; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; border-left: 4px solid var(--info); animation: toastIn .3s ease; }
.toast .ti { font-size: 21px; }
.toast span { flex: 1; }
.toast-success { border-color: var(--green); } .toast-success .ti { color: var(--green); }
.toast-error { border-color: var(--danger); } .toast-error .ti { color: var(--danger); }
.toast-info .ti { color: var(--info); }
.toast-x { border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; }
.toast.hide { opacity: 0; transform: translateY(-10px); transition: .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; margin-bottom: 14px; font-weight: 500; }
.alert .ti { font-size: 19px; flex-shrink: 0; }
.alert-danger { background: var(--danger-50); color: #b42318; }
.alert-warning { background: var(--warning-50); color: #8a5800; }
.alert-info { background: var(--info-50); color: #1d5fb0; }
.alert-success { background: var(--green-50); color: var(--green-600); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ti { font-size: 46px; color: #c5d0cc; display: block; margin-bottom: 10px; }
.empty h4 { color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }
.empty p { font-size: 13px; }

/* ================= PROGRESS / LIST ================= */
.progress { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.list li:last-child { border-bottom: 0; }
.list .li-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-50); color: var(--accent); flex-shrink: 0; font-size: 18px; }
.list .li-body { flex: 1; min-width: 0; }
.list .li-body strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .li-body small { color: var(--muted); font-size: 12.5px; }
.list .li-end { text-align: right; font-weight: 700; white-space: nowrap; }

/* ================= SESI CARDS ================= */
.sesi-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.sesi-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; position: relative; box-shadow: var(--shadow); overflow: hidden; }
.sesi-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--green); }
.sesi-card.s-2::before { background: var(--orange); } .sesi-card.s-3::before { background: #3c4fd6; }
.sesi-card .sesi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.sesi-card .sesi-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--green-50); color: var(--green); }
.sesi-card.s-2 .sesi-icon { background: var(--orange-50); color: var(--orange); }
.sesi-card.s-3 .sesi-icon { background: #ebedfb; color: #3c4fd6; }
.sesi-card h4 { font-size: 16px; font-weight: 800; margin-top: 10px; }
.sesi-card .time { color: var(--muted); font-size: 13px; font-weight: 600; }
.sesi-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 10px; }
.sesi-meta div { background: var(--line-2); border-radius: 10px; padding: 8px; text-align: center; }
.sesi-meta small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.sesi-meta b { font-size: 13.5px; }
.sesi-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.sesi-actions .btn { flex: 1; }

/* ================= LAPAK GRID ================= */
.lapak-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.lapak-legend span::before { content: ''; display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.lg-free::before { background: #fff; border: 1.5px solid var(--green-100); }
.lg-used::before { background: var(--green); }
.lg-off::before { background: #e3e7e5; }
.lg-sel::before { background: var(--orange); }
.lapak-area { margin-bottom: 16px; }
.lapak-area h5 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.lapak-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.lapak { position: relative; aspect-ratio: 1; border-radius: 12px; border: 1.5px solid var(--green-100); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; color: var(--green-600); cursor: pointer; transition: .15s; font-family: inherit; padding: 2px; }
.lapak small { font-size: 9.5px; font-weight: 600; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 3px; }
.lapak:hover { border-color: var(--green); transform: translateY(-1px); }
.lapak.used { background: var(--green); color: #fff; border-color: var(--green); cursor: default; }
.lapak.off { background: #eef1f0; color: #a7b3ae; border-color: #e3e7e5; cursor: not-allowed; }
.lapak.selected, .lapak input:checked + span { background: var(--orange); border-color: var(--orange); color: #fff; }
label.lapak { padding: 0; overflow: hidden; }
label.lapak input { position: absolute; opacity: 0; pointer-events: none; }
label.lapak span { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 10px; }
label.lapak.used span, label.lapak.off span { cursor: not-allowed; }

/* ================= LEADERBOARD ================= */
.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; align-items: end; gap: 8px; padding: 18px 12px 0; }
.podium-item { text-align: center; }
.podium-item .medal { width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center; font-size: 24px; color: #fff; font-weight: 800; }
.podium-item strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium-item .w { font-size: 15px; font-weight: 800; color: var(--green-600); }
.podium-item .base { margin-top: 8px; border-radius: 12px 12px 0 0; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 20px; }
.p1 .medal { background: linear-gradient(135deg, #f7c948, #e0a100); width: 62px; height: 62px; } .p1 .base { height: 84px; background: linear-gradient(180deg, #f2b705, #d69a00); }
.p2 .medal { background: linear-gradient(135deg, #cfd6dc, #94a1ab); } .p2 .base { height: 62px; background: linear-gradient(180deg, #aab5bd, #8a98a3); }
.p3 .medal { background: linear-gradient(135deg, #e3a47a, #b8693c); } .p3 .base { height: 46px; background: linear-gradient(180deg, #d08a5a, #b06a3d); }
.rank-no { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--line-2); color: var(--ink-2); }
.rank-1 { background: #fdf0c4; color: #a37500; } .rank-2 { background: #e9edf0; color: #5b6872; } .rank-3 { background: #f6e1d3; color: #9a542a; }
.hasil-input { width: 92px !important; height: 38px !important; text-align: right; padding: 0 10px !important; font-weight: 700; }

/* ================= POS / KASIR ================= */
.pos { display: grid; grid-template-columns: 1fr; gap: 16px; }
.pos-toolbar { display: flex; gap: 10px; margin-bottom: 12px; }
.product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.product { position: relative; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; text-align: left; cursor: pointer; font-family: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 6px; min-height: 118px; transition: .15s; -webkit-tap-highlight-color: transparent; }
.product:hover { border-color: var(--orange-100); box-shadow: var(--shadow); }
.product:active { transform: scale(.97); }
.product .p-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--orange-50); color: var(--orange); font-size: 19px; }
.product .p-name { font-weight: 700; font-size: 13.5px; line-height: 1.3; flex: 1; }
.product .p-price { font-weight: 800; color: var(--orange-600); font-size: 14px; }
.product .p-stock { font-size: 11.5px; color: var(--muted); }
.product.low .p-stock { color: var(--danger); font-weight: 700; }
.product.out { opacity: .45; pointer-events: none; }
.product .p-qty { position: absolute; top: 8px; right: 8px; min-width: 24px; height: 24px; border-radius: 99px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 800; display: none; place-items: center; padding: 0 6px; }
.product.in-cart { border-color: var(--orange); background: #fffaf2; }
.product.in-cart .p-qty { display: grid; }

.cart { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.cart-head { padding: 14px 16px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; }
.cart-head h3 { font-size: 16px; font-weight: 800; display: flex; gap: 8px; align-items: center; }
.cart-items { flex: 1; overflow-y: auto; padding: 4px 0; min-height: 120px; }
.cart-item { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px dashed var(--line); }
.cart-item .ci-body { flex: 1; min-width: 0; }
.cart-item .ci-body strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item .ci-body small { color: var(--muted); font-size: 12px; }
.cart-item .ci-total { font-weight: 800; font-size: 13.5px; min-width: 74px; text-align: right; }
.qty { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 30px; height: 30px; border: 0; background: var(--line-2); font-size: 16px; cursor: pointer; color: var(--ink-2); font-weight: 700; }
.qty input { width: 38px !important; height: 30px !important; border: 0 !important; text-align: center; padding: 0 !important; font-weight: 700; border-radius: 0 !important; box-shadow: none !important; font-size: 14px !important; }
.cart-sum { padding: 14px 16px; border-top: 1px solid var(--line-2); background: #fcfdfc; }
.sum-row { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; color: var(--ink-2); }
.sum-total { font-size: 20px; font-weight: 800; color: var(--ink); margin: 8px 0 12px; }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.pay-methods label { cursor: pointer; }
.pay-methods input { display: none; }
.pay-methods span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.pay-methods span .ti { font-size: 20px; }
.pay-methods input:checked + span { border-color: var(--orange); background: var(--orange-50); color: var(--orange-600); }
.quick-cash { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.quick-cash .chip { height: 30px; font-size: 12.5px; }
.change-box { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 10px; background: var(--green-50); color: var(--green-600); font-weight: 800; margin-bottom: 10px; }
.change-box.minus { background: var(--danger-50); color: var(--danger); }
.cart-fab { position: fixed; left: 12px; right: 12px; bottom: calc(var(--bottom-h) + 10px + var(--safe-b)); z-index: 44; display: none; align-items: center; justify-content: space-between; gap: 10px; height: 56px; padding: 0 16px; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 700; border: 0; font-family: inherit; font-size: 15px; box-shadow: var(--shadow-lg); cursor: pointer; }
.cart-fab .cnt { background: var(--orange); border-radius: 99px; padding: 2px 9px; font-size: 13px; margin-right: 8px; }

/* Line items (pembelian) */
.line-items .li-row { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; position: relative; background: #fcfdfc; }
.line-items .li-row .field { margin: 0; }
.line-items .li-remove { position: absolute; top: 6px; right: 6px; }
.grand-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px; background: var(--accent-50); color: var(--accent-600); font-weight: 800; font-size: 18px; }

/* Chart */
.chart-box { position: relative; height: 240px; }
.kpi-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi-split > div { padding: 12px; border-radius: 12px; background: var(--line-2); }
.kpi-split small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi-split b { font-size: 16px; }

/* Summary rows (laporan harian) */
.sum-table { width: 100%; border-collapse: collapse; }
.sum-table td { padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.sum-table td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.sum-table tr.sub td { padding-left: 32px; color: var(--ink-2); font-size: 13.5px; }
.sum-table tr.sub td:last-child { font-weight: 600; }
.sum-table tr.total td { font-weight: 800; font-size: 15.5px; background: #fafbfb; }
.sum-table tr.grand td { font-weight: 800; font-size: 17px; background: var(--accent-50); color: var(--accent-600); }

/* ================= LOGIN ================= */
.login-page { min-height: 100vh; background: radial-gradient(1200px 600px at 0% 0%, #d8f1e5 0%, transparent 60%), radial-gradient(900px 500px at 100% 100%, #fde9c8 0%, transparent 60%), var(--bg); }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; align-items: center; max-width: 1080px; margin: 0 auto; padding: 24px 16px; gap: 24px; }
.login-hero h1 { font-size: 26px; font-weight: 800; margin: 14px 0 8px; }
.login-hero p { color: var(--ink-2); max-width: 440px; }
.hero-badges { display: flex; gap: 8px; }
.hero-list { list-style: none; padding: 0; margin: 18px 0 0; display: none; gap: 10px; }
.hero-list li { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink-2); }
.hero-list .ti { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #fff; color: var(--green); box-shadow: var(--shadow); }
.login-card { background: #fff; border-radius: 22px; padding: 26px 22px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.login-card h2 { font-size: 22px; font-weight: 800; }
.login-card > .muted { margin: 4px 0 20px; }
.login-hint { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 16px; }


/* ================= PENDAFTARAN ONLINE (admin) ================= */
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--warning); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; }
.card-pending { border-color: #f3d48a; box-shadow: 0 0 0 3px var(--warning-50), var(--shadow); }
.link-box { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--green-50); border: 1px dashed var(--green-100); font-family: ui-monospace, monospace; font-size: 13.5px; word-break: break-all; }
.link-box span { flex: 1; }

/* ================= HAK AKSES ================= */
.nav-sistem { padding: 6px 10px; }
.role-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.role-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.role-card h4 { font-size: 16px; font-weight: 800; margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.role-meta { display: flex; gap: 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-top: 4px; }
.role-meta .ti { color: var(--muted); }
.role-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.matrix th, .matrix td { white-space: nowrap; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 190px; box-shadow: 1px 0 0 var(--line-2); }
.matrix thead th:first-child { background: #fafbfb; }
.matrix th.text-center { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--ink-2); min-width: 120px; }
.matrix tr.mx-group td { background: #f6f8f7; font-weight: 800; font-size: 13px; }
.matrix tr.mx-group td:first-child { background: #f6f8f7; }
.matrix .chip { height: 26px; font-size: 11.5px; padding: 0 10px; }
.mx-role { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; margin: 0 auto 5px; font-size: 17px; background: var(--info-50); color: var(--info); }
.mx-role.tone-green { background: var(--green-50); color: var(--green); }
.mx-role.tone-orange { background: var(--orange-50); color: var(--orange); }
.mx-role.tone-purple { background: var(--purple-50); color: var(--purple); }
.mx-lock { color: var(--green); font-size: 22px; opacity: .55; }
.mx-check { display: inline-grid; cursor: pointer; }
.mx-check input { position: absolute; opacity: 0; pointer-events: none; }
.mx-check span { width: 26px; height: 26px; border-radius: 8px; border: 2px solid #cfd8d4; background: #fff; display: grid; place-items: center; transition: .15s; }
.mx-check span::after { content: ''; width: 7px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); opacity: 0; }
.mx-check input:checked + span { background: var(--accent); border-color: var(--accent); }
.mx-check input:checked + span::after { opacity: 1; }
.mx-check input:focus-visible + span { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.role-pick { display: grid; gap: 8px; grid-template-columns: 1fr; }
.role-pick label { cursor: pointer; }
.role-pick input { display: none; }
.role-pick label > span { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; transition: .15s; }
.role-pick .stat-icon { grid-row: span 2; width: 36px; height: 36px; font-size: 18px; }
.role-pick b { font-size: 14px; }
.role-pick small { color: var(--muted); font-size: 12px; }
.role-pick input:checked + span { border-color: var(--accent); background: var(--accent-50); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
.btn.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
@media (min-width: 560px) { .role-pick { grid-template-columns: 1fr 1fr; } }
@media (min-width: 768px) { .role-grid { grid-template-columns: repeat(3, 1fr); } }

/* ================= RESPONSIVE ================= */
@media (min-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .form-row { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .line-items .li-row { grid-template-columns: 2fr 1fr 1.3fr 1.2fr; align-items: end; padding-right: 48px; }
  .toasts { left: auto; width: 380px; }
  .filter-bar .btn { flex: 0 0 auto; }
  .quick-range { width: auto; }
}
@media (min-width: 768px) {
  .content { padding: 22px 22px 40px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .stat { padding: 16px; }
  .stat-value { font-size: 19px; }
  .sesi-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .page-head h1 { font-size: 24px; }
  dialog.modal { border-radius: 20px; width: 560px; max-width: calc(100vw - 32px); margin: auto; max-height: 88vh; }
  dialog.modal.modal-sm { width: 400px; }
  dialog.modal.modal-lg { width: 820px; }
  .modal-foot .btn { flex: 0 0 auto; min-width: 110px; }
  .hero { padding: 24px 26px; }
  .hero h2 { font-size: 24px; }
  .chart-box { height: 290px; }
}
@media (min-width: 992px) {
  .sidebar { transform: none; position: sticky; top: 0; height: 100vh; flex-shrink: 0; width: var(--sidebar-w); }
  .sidebar-backdrop, .bottom-nav, .only-mobile, .cart-fab { display: none !important; }
  .only-desktop { display: initial !important; }
  .btn.only-desktop { display: inline-flex !important; }
  .topbar { padding: 0 26px; height: 70px; }
  .topbar-title strong { font-size: 18px; }
  .content { padding: 26px 28px 30px; }
  .toasts { top: 84px; right: 24px; }
  .grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
  .grid-main > * { min-width: 0; }
  .pos { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
  .pos .cart { position: sticky; top: 90px; max-height: calc(100vh - 110px); }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .login-wrap { grid-template-columns: 1.1fr 1fr; gap: 60px; padding: 40px; }
  .login-hero h1 { font-size: 36px; }
  .hero-list { display: grid; }
  .login-card { padding: 34px 32px; }
}
@media (min-width: 1200px) {
  .form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* POS mobile: cart sebagai bottom sheet */
@media (max-width: 991px) {
  .page-kasir .content { padding-bottom: calc(var(--bottom-h) + 90px + var(--safe-b)); }
  .page-kasir .cart-fab.show { display: flex; }
  .page-kasir .cart { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; max-height: 88vh; border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1); padding-bottom: var(--safe-b); }
  .page-kasir.cart-open .cart { transform: none; box-shadow: var(--shadow-lg); }
  .page-kasir.cart-open .sidebar-backdrop { opacity: 1; pointer-events: auto; z-index: 65; }
  .cart-head::before { content: ''; position: absolute; left: 50%; top: 7px; width: 42px; height: 5px; border-radius: 9px; background: #d6ddda; transform: translateX(-50%); }
  .cart-head { position: relative; padding-top: 20px; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .page-actions, .filter-bar, .btn, .toasts, .foot { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}
