/* =========================================================================
   Ruang Kopi — Panel Admin & Kasir (sesuai desain Figma)
   Sidebar krem, aksen cokelat tua & emas, kartu membulat. Responsif.
   ========================================================================= */
:root {
  --rk-bg: #F4FAF4; --rk-side: #F7FCF7; --rk-surface: #FFFFFF; --rk-tint: #E8F5E9; --rk-tint-2: #D3EBD5; --rk-line: #D5EAD6;
  --rk-ink: #12301A; --rk-brown: #1B5E20; --rk-brown-2: #2E7D32; --rk-muted: #5E7A61; --rk-gold: #2E7D32;
  --rk-amber: #66BB6A; --rk-amber-soft: #DCEFDD; --rk-red: #D23C3C; --rk-green: #2E7D32;
  --rk-shadow: 0 16px 36px -26px rgba(27, 94, 32, .5); --rk-shadow-sm: 0 6px 18px -14px rgba(27, 94, 32, .45);
  --rk-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-font-family: var(--rk-font); --bs-body-color: var(--rk-ink); --bs-body-bg: var(--rk-bg); --bs-border-color: var(--rk-line);
  --bs-link-color-rgb: 140, 94, 6; --bs-link-hover-color-rgb: 58, 35, 22; --bs-focus-ring-color: rgba(102, 187, 106, .35);
  --ad-side-w: 272px;
}
body { background: var(--rk-bg); font-size: .92rem; font-family: var(--rk-font); color: var(--rk-ink); }
h1, h2, h3, h4, h5, h6, .rk-num { font-family: var(--rk-font); font-weight: 700; letter-spacing: -.015em; color: var(--rk-ink); }
.text-forest, .text-gold { color: var(--rk-gold) !important; }
.text-muted-rk { color: var(--rk-muted) !important; }
.bg-sage, .bg-tint { background: var(--rk-tint) !important; }
[hidden] { display: none !important; }
a { color: var(--rk-gold); }

/* ---------- Sidebar ---------- */
.ad-sidebar { width: var(--ad-side-w); background: var(--rk-side); border-right: 1px solid var(--rk-line); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; padding: 20px 16px; z-index: 1040; overflow-y: auto; }
.ad-main { margin-left: var(--ad-side-w); min-height: 100vh; }
.ad-brand { display: flex; align-items: center; gap: 12px; color: var(--rk-ink); text-decoration: none; padding: 4px 6px 18px; border-bottom: 1px solid var(--rk-line); margin-bottom: 10px; }
.ad-brand .logo { width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 1px solid var(--rk-line); color: var(--rk-brown); display: grid; place-items: center; overflow: hidden; font-weight: 800; flex-shrink: 0; }
.ad-brand .logo img { width: 100%; height: 100%; object-fit: cover; }
.ad-brand strong { display: block; line-height: 1.1; font-size: 1.12rem; }
.ad-brand small { color: var(--rk-muted); font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ad-nav-label { font-size: .66rem; color: #8BA98E; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 14px 12px 6px; }
.ad-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; color: #2F4A32; text-decoration: none; margin-bottom: 3px; font-weight: 600; font-size: .9rem; }
.ad-nav a i { font-size: 1.08rem; width: 20px; text-align: center; }
.ad-nav a:hover { background: var(--rk-tint); color: var(--rk-brown); }
.ad-nav a.active { background: var(--rk-brown); color: #fff; box-shadow: var(--rk-shadow-sm); }
.ad-user { margin-top: auto; background: #fff; border: 1px solid var(--rk-line); border-radius: 18px; padding: 14px; box-shadow: var(--rk-shadow); font-size: .82rem; }
.ad-user .ad-live { display: inline-flex; align-items: center; gap: 6px; font-size: .64rem; font-weight: 800; letter-spacing: .08em; color: var(--rk-gold); text-transform: uppercase; }
.ad-user .ad-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--rk-gold); }
.ad-user strong { display: block; font-size: 1.05rem; margin-top: 4px; }

/* ---------- Topbar ---------- */
.ad-topbar { min-height: 72px; display: flex; align-items: center; gap: 10px; padding: 12px 28px; background: rgba(244, 250, 244, .92); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 1030; border-bottom: 1px solid rgba(213, 234, 214, .7); }
.ad-search { position: relative; flex: 1; max-width: 300px; }
.ad-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--rk-muted); }
.ad-search input { border-radius: 999px; background: #fff; border: 1px solid var(--rk-line); padding: .55rem .9rem .55rem 2.4rem; width: 100%; font-size: .85rem; }
.ad-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--rk-line); font-size: .78rem; font-weight: 600; color: #2F4A32; white-space: nowrap; text-decoration: none; }
.ad-chip.live { background: var(--rk-amber-soft); border-color: transparent; color: var(--rk-brown); }
.ad-chip.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--rk-gold); }
.ad-chip.amber { background: var(--rk-tint); border-color: transparent; color: var(--rk-brown); }
.ad-bell { position: relative; width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 1px solid var(--rk-line); display: grid; place-items: center; color: var(--rk-brown); text-decoration: none; flex-shrink: 0; }
.ad-bell span { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 999px; background: var(--rk-red); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
.ad-me { display: flex; align-items: center; gap: 10px; text-align: right; line-height: 1.15; }
.ad-me small { color: var(--rk-gold); font-weight: 600; font-size: .74rem; display: block; }
.ad-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--rk-brown); color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.ad-content { padding: 22px 28px 48px; }

/* ---------- Kepala halaman ---------- */
.ad-crumb { font-size: .78rem; font-weight: 600; color: var(--rk-muted); margin-bottom: 4px; }
.ad-crumb b { color: var(--rk-gold); }
.ad-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 20px; }
.ad-head h1 { font-size: 1.9rem; margin: 0; line-height: 1.15; }
.ad-head p { color: var(--rk-muted); margin: 6px 0 0; max-width: 62ch; }
.ad-head .ad-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ad-eyebrow { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--rk-amber-soft); color: var(--rk-gold); font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 6px; }

/* ---------- Kartu ---------- */
.ad-card { background: var(--rk-surface); border: 1px solid rgba(213, 234, 214, .8); border-radius: 22px; padding: 20px; box-shadow: var(--rk-shadow-sm); }
.ad-card.tint { background: var(--rk-tint); border: 0; box-shadow: none; }
.ad-card-title { margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ad-card-title h2, .ad-card-title h3, .ad-card-title .h6, .ad-card-title .h5 { margin: 0; font-size: 1.12rem; }
.ad-card-title small { color: var(--rk-muted); }
.ad-stat { background: var(--rk-surface); border: 1px solid rgba(213, 234, 214, .8); border-radius: 22px; padding: 18px 20px; height: 100%; position: relative; box-shadow: var(--rk-shadow-sm); overflow: hidden; }
.ad-stat .ico { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; background: var(--rk-tint); color: var(--rk-brown); display: grid; place-items: center; font-size: 1.15rem; }
.ad-stat small { color: var(--rk-muted); display: block; }
.ad-stat .ad-stat-label { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #4C6A4F; padding-right: 50px; }
.ad-stat .rk-num { font-size: 2rem; line-height: 1.15; margin: 10px 0 6px; font-weight: 800; word-break: break-word; }
.ad-stat .ad-stat-hint { font-size: .78rem; color: var(--rk-gold); font-weight: 600; }
.ad-stat.dark { background: var(--rk-brown); border-color: var(--rk-brown); color: #fff; }
.ad-stat.dark .rk-num { color: #fff; }
.ad-stat.dark .ad-stat-label, .ad-stat.dark small { color: #CFE6D0; }
.ad-stat.dark .ad-stat-hint { color: var(--rk-amber); }
.ad-stat.dark .ico { background: rgba(255, 255, 255, .12); color: var(--rk-amber); }
.ad-stat.amber { background: linear-gradient(160deg, #EEF8EE, #C8E6C9); }
.ad-stat.amber .rk-num { color: var(--rk-gold); }

/* ---------- Tombol & form ---------- */
.btn { border-radius: 999px; font-weight: 600; font-family: var(--rk-font); }
.btn-forest { background: var(--rk-brown); color: #fff; border: 0; box-shadow: var(--rk-shadow-sm); }
.btn-forest:hover, .btn-forest:focus { background: #144A18; color: #fff; }
.btn-forest:disabled { background: #9DB8A0; color: #fff; }
.btn-sage { background: var(--rk-tint); color: var(--rk-brown); border: 0; }
.btn-sage:hover { background: var(--rk-tint-2); color: var(--rk-brown); }
.btn-outline-forest { border: 1.5px solid var(--rk-brown); color: var(--rk-brown); background: #fff; }
.btn-outline-forest:hover { background: var(--rk-brown); color: #fff; }
.btn-check:checked + .btn-outline-forest { background: var(--rk-brown); color: #fff; }
.btn-light-rk { background: #fff; border: 1px solid var(--rk-line); color: var(--rk-brown); }
.btn-light-rk:hover { background: var(--rk-tint); color: var(--rk-brown); }
.form-control, .form-select { border-radius: 12px; border-color: var(--rk-line); padding: .6rem .85rem; background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--rk-amber); box-shadow: 0 0 0 .2rem rgba(102, 187, 106, .3); }
.form-check-input:checked { background-color: var(--rk-brown); border-color: var(--rk-brown); }
.form-check-input:focus { border-color: var(--rk-amber); box-shadow: 0 0 0 .2rem rgba(102, 187, 106, .3); }
.form-label { font-weight: 600; font-size: .84rem; }

/* ---------- Pill status ---------- */
.rk-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--rk-tint); color: var(--rk-brown); white-space: nowrap; }
.rk-pill-dark { background: var(--rk-brown); color: #fff; }
.rk-pill-amber { background: var(--rk-amber); color: var(--rk-brown); }
.rk-pill-green { background: #E3F2E8; color: var(--rk-green); }
.rk-pill-sage { background: var(--rk-amber-soft); color: var(--rk-gold); }
.rk-pill-red { background: #FBE3E1; color: var(--rk-red); }
.rk-num { font-variant-numeric: tabular-nums; }

/* ---------- Tabel ---------- */
.ad-table { margin: 0; }
.ad-table thead th { font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #4C6A4F; background: var(--rk-tint); border-bottom: 0; padding: 12px; white-space: nowrap; }
.ad-table thead th:first-child { border-radius: 14px 0 0 14px; }
.ad-table thead th:last-child { border-radius: 0 14px 14px 0; }
.ad-table td { padding: 14px 12px; vertical-align: middle; border-color: var(--rk-line); }
.ad-table tbody tr:hover td { background: #F7FCF7; }
.ad-thumb { width: 48px; height: 48px; border-radius: 14px; object-fit: cover; background: var(--rk-tint); display: inline-flex; align-items: center; justify-content: center; color: #7FA982; flex-shrink: 0; overflow: hidden; }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-bar { height: 7px; border-radius: 6px; background: var(--rk-tint); overflow: hidden; min-width: 80px; }
.ad-bar > div { height: 100%; background: var(--rk-brown); border-radius: 6px; }
.ad-top5 td { background: #F1F8F1; }
.ad-top5 .rk-pill-dark { background: var(--rk-amber); color: var(--rk-brown); }

/* ---------- SMART ---------- */
.ad-formula { background: radial-gradient(130% 120% at 100% 0%, #2E7D32, #1B5E20 55%, #0E3B13); color: #E8F5E9; border-radius: 22px; padding: 22px; box-shadow: var(--rk-shadow); }
.ad-formula h2, .ad-formula h3, .ad-formula .h6 { color: #fff; }
.ad-formula code { color: var(--rk-amber); background: rgba(255, 255, 255, .08); padding: 2px 8px; border-radius: 6px; font-size: .88rem; }
.ad-formula li { margin-bottom: 8px; }

/* ---------- Pesanan (kanban) ---------- */
.ad-kanban { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.ad-col { background: var(--rk-tint); border-radius: 22px; padding: 14px; min-height: 240px; }
.ad-col h3 { font-size: .92rem; display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ad-order { background: #fff; border: 1px solid var(--rk-line); border-radius: 18px; padding: 14px; margin-bottom: 10px; box-shadow: var(--rk-shadow-sm); }
.ad-order ul { padding-left: 16px; margin: 8px 0; font-size: .82rem; }

/* ---------- Grid status meja ---------- */
.ad-zone { font-size: .72rem; font-weight: 800; letter-spacing: .06em; color: var(--rk-gold); text-transform: uppercase; display: flex; justify-content: space-between; margin: 14px 0 8px; }
.ad-zone span { color: var(--rk-muted); text-transform: none; letter-spacing: 0; font-weight: 600; }
.ad-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ad-tile { border-radius: 16px; padding: 12px 14px; background: #fff; border: 1px solid var(--rk-line); text-decoration: none; color: var(--rk-ink); display: block; min-height: 92px; border-left: 4px solid transparent; }
.ad-tile strong { font-size: 1.25rem; display: block; }
.ad-tile small { color: var(--rk-muted); display: block; font-size: .74rem; }
.ad-tile .amt { font-weight: 700; font-size: .82rem; margin-top: 6px; color: var(--rk-ink); }
.ad-tile.busy { background: #E8F5E9; border-left-color: var(--rk-brown); }
.ad-tile.brew { background: #F1F8E9; border-left-color: var(--rk-amber); }
.ad-tile.free .amt { color: var(--rk-gold); }
.ad-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; font-weight: 600; color: #4C6A4F; }
.ad-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ---------- POS ---------- */
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.pos-item { background: #fff; border: 1px solid var(--rk-line); border-radius: 18px; padding: 8px 8px 10px; text-align: left; transition: border-color .15s, transform .15s; box-shadow: var(--rk-shadow-sm); }
.pos-item:hover { border-color: var(--rk-brown); transform: translateY(-1px); }
.pos-item:disabled { opacity: .45; }
.pos-item .ad-thumb { width: 100%; height: 92px; border-radius: 14px; margin-bottom: 8px; font-size: 1.6rem; }
.pos-panel { position: sticky; top: 90px; }
.pos-line { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--rk-line); font-size: .85rem; }

/* ---------- Login ---------- */
.ad-login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--rk-bg); }
.ad-login-art { background: radial-gradient(90% 70% at 20% 10%, rgba(46, 125, 50, .6), transparent 60%), linear-gradient(180deg, #1B5E20, #0A2C0D); color: #D8ECD9; padding: 48px; display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden; }
.ad-login-art::before { content: ''; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(102, 187, 106, .25), transparent 70%); }
.ad-login-art > * { position: relative; }
.ad-login-art i { color: var(--rk-amber); }
.ad-login-art h2 { color: #fff; font-size: 2.6rem; max-width: 14ch; line-height: 1.08; }
.ad-login-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }

/* ---------- Toast ---------- */
.ad-toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 1090; width: min(380px, calc(100% - 32px)); }
.ad-toast { background: var(--rk-brown); color: #fff; border-radius: 16px; padding: 12px 16px; margin-bottom: 8px; display: flex; gap: 10px; align-items: flex-start; box-shadow: var(--rk-shadow); }
.ad-toast i { color: var(--rk-amber); }
.ad-toast.error { background: var(--rk-red); }
.ad-toast.error i { color: #fff; }

/* ---------- Responsif ---------- */
@media (max-width: 1199.98px) { .ad-topbar .hide-lg { display: none !important; } }
@media (max-width: 991.98px) {
  .ad-sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--rk-shadow); }
  .ad-sidebar.show { transform: none; }
  .ad-main { margin-left: 0; }
  .ad-topbar, .ad-content { padding-left: 16px; padding-right: 16px; }
  .ad-backdrop.show { position: fixed; inset: 0; background: rgba(12, 40, 16, .45); z-index: 1035; }
  .ad-head h1 { font-size: 1.5rem; }
  .ad-search { max-width: none; }
  .ad-topbar .ad-chip, .ad-me .ad-me-text { display: none; }
}
@media (max-width: 767.98px) {
  .ad-login { grid-template-columns: 1fr; }
  .ad-login-art { display: none; }
  .ad-stat .rk-num { font-size: 1.6rem; }
  .ad-card { padding: 16px; border-radius: 18px; }
  .ad-content { padding-top: 16px; }
  .ad-topbar .ad-search { display: none; }
  .ad-kanban { grid-template-columns: repeat(4, minmax(240px, 82vw)); }
}
@media print {
  .ad-sidebar, .ad-topbar, .no-print, .ad-toast-wrap { display: none !important; }
  .ad-main { margin: 0; }
  .ad-content { padding: 0; }
  .ad-card, .ad-stat { border: 1px solid #ccc; box-shadow: none; }
  body { background: #fff; }
}

/* ---------- Penyesuaian hasil uji pratinjau ---------- */
.ad-stat .rk-num { font-size: clamp(1.35rem, 1.55vw, 1.9rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-nav a { font-size: .86rem; padding: 10px 12px; gap: 10px; line-height: 1.25; }
@media (max-width: 767.98px) { .ad-stat .rk-num { font-size: 1.6rem; } }

/* ---------- Palet hijau: penyesuaian kontras ---------- */
:root { --rk-leaf: #A5D6A7; }
.rk-pill-amber, .ad-top5 .rk-pill-dark { background: var(--rk-leaf); color: var(--rk-brown); }
.ad-stat.dark .ico, .ad-stat.dark .ad-stat-hint, .ad-toast i, .ad-login-art i, .ad-formula code { color: var(--rk-leaf); }
.ad-tile.brew { border-left-color: #66BB6A; }
