/* ===================================
   WARKOP APP — PESANTREN THEME
   Mobile-First Responsive Design
   =================================== */

/* ===== RESET & FONT ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* Pesantren Color Palette */
  --hijau-tua:   #0d3320;
  --hijau:       #1a5c38;
  --hijau-md:    #2d7a50;
  --hijau-muda:  #4caf78;
  --emas:        #c9a84c;
  --emas-md:     #d4b96a;
  --emas-muda:   #f0dfa0;
  --krim:        #fdf9f2;
  --krim-2:      #f5ede0;
  --krim-3:      #ede0cc;
  --putih:       #ffffff;
  --teks:        #1a0f06;
  --teks-sub:    #5a4030;
  --batas:       #d9c8aa;
  --shadow:      rgba(13,51,32,0.14);

  /* Semantic */
  --success:    #1b5e35;
  --danger:     #b71c1c;
  --warning:    #e65100;
  --info:       #0d47a1;

  --radius:     14px;
  --radius-sm:  8px;
  --font:       'Outfit', sans-serif;

  /* Bottom nav height */
  --bnav-h:     62px;
}
body {
  font-family: var(--font);
  color: var(--teks);
  background: var(--krim);
  min-height: 100vh;
  padding-bottom: var(--bnav-h); /* space for bottom nav */
}
a { text-decoration: none; color: inherit; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--krim-3); border-radius:10px; }

/* ===== TOP NAVBAR (Desktop only) ===== */
.navbar {
  display: none; /* hidden on mobile, shown on desktop */
  align-items: center; justify-content: space-between;
  padding: 0.7rem 1.5rem;
  background: var(--hijau-tua);
  color: #fff;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 12px var(--shadow);
}
.navbar-brand { display: flex; align-items: center; gap: 0.6rem; font-size: 1.1rem; font-weight: 700; }
.navbar-brand span { font-size: 1.5rem; }
.navbar-logo-img {
  width: 32px; height: 32px; border-radius: 50%;
  object-fit: cover; border: 1.5px solid var(--emas);
  flex-shrink: 0;
}
.navbar-links { display: flex; gap: 0.3rem; }
.navbar-links a {
  padding: 0.4rem 0.8rem; border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 500; color: rgba(255,255,255,0.75);
  transition: all 0.2s;
}
.navbar-links a:hover, .navbar-links a.active {
  background: rgba(255,255,255,0.15); color: #fff;
}

/* ===== MOBILE TOP BAR ===== */
.mobile-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--hijau-tua);
  color: #fff;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 12px var(--shadow);
}
.mobile-topbar .brand { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; font-size: 1.05rem; }
.mobile-logo-img {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover; border: 1.5px solid var(--emas);
  flex-shrink: 0;
}
.mobile-topbar .page-badge {
  font-size: 0.75rem; font-weight: 600; opacity: 0.9;
  background: rgba(255,255,255,0.12); padding: 0.2rem 0.6rem; border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.1);
}
.home-logo-img {
  width: 64px; height: 64px; border-radius: 50%;
  object-fit: cover; border: 2.5px solid var(--emas);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3); flex-shrink: 0;
}
.login-logo-img {
  width: 96px; height: 96px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--emas);
  box-shadow: 0 6px 24px rgba(0,0,0,0.35); margin: 0 auto 0.8rem;
  display: block;
}
.mobile-topbar .user-info { text-align: right; font-size: 0.72rem; opacity: 0.85; }

/* ===== BOTTOM NAV (Mobile) ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: var(--hijau-tua);
  display: flex; align-items: center; justify-content: space-around;
  height: var(--bnav-h);
  box-shadow: 0 -2px 16px var(--shadow);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  color: rgba(255,255,255,0.5); text-decoration: none;
  font-size: 0.62rem; font-weight: 600; padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm); transition: all 0.2s;
  min-width: 52px;
}
.bnav-item .bnav-icon { font-size: 1.3rem; transition: transform 0.2s; }
.bnav-item.active { color: var(--emas-md); }
.bnav-item.active .bnav-icon { transform: translateY(-2px); }
.bnav-item:active { background: rgba(255,255,255,0.08); }

/* ===== BISMILLAH HEADER (Home) ===== */
.bismillah-bar {
  background: linear-gradient(135deg, var(--hijau-tua), var(--hijau));
  color: var(--emas-muda);
  text-align: center;
  padding: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

/* ===== HOME PAGE ===== */
.home-hero {
  background: linear-gradient(160deg, var(--hijau-tua) 0%, var(--hijau) 60%, var(--hijau-md) 100%);
  padding: 1.5rem 1rem 2rem;
  color: #fff;
  position: relative; overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute; top: -30px; right: -30px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(201,168,76,0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.home-hero::after {
  content: '';
  position: absolute; bottom: -40px; left: -20px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(201,168,76,0.1) 0%, transparent 70%);
  border-radius: 50%;
}
.home-hero-content { position: relative; z-index: 1; }
.home-logo { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.home-logo-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: rgba(255,255,255,0.1); border: 2px solid rgba(201,168,76,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
}
.home-logo-text h1 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.3px; }
.home-logo-text p { font-size: 0.78rem; opacity: 0.75; margin-top: 0.1rem; }
.home-time-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 99px; padding: 0.3rem 0.8rem;
  font-size: 0.75rem; opacity: 0.9;
}

/* ===== HOME STATS ===== */
.home-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem;
  padding: 0 1rem;
  margin-top: -1rem; position: relative; z-index: 10;
  margin-bottom: 1rem;
}
.hstat-card {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.5rem;
  text-align: center;
  box-shadow: 0 4px 16px var(--shadow);
  border-bottom: 3px solid var(--emas);
}
.hstat-icon { font-size: 1.3rem; margin-bottom: 0.2rem; }
.hstat-val { font-size: 1rem; font-weight: 800; color: var(--hijau-tua); line-height: 1.2; }
.hstat-label { font-size: 0.62rem; color: var(--teks-sub); font-weight: 500; }

/* ===== HOME NAV GRID ===== */
.home-nav-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
  padding: 0 1rem 1rem;
}
.hnav-card {
  background: #fff; border-radius: var(--radius);
  padding: 1rem 0.85rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  box-shadow: 0 2px 12px var(--shadow);
  border-left: 4px solid var(--batas);
  transition: all 0.25s;
  cursor: pointer;
}
.hnav-card:active { transform: scale(0.97); }
.hnav-card:hover { box-shadow: 0 6px 20px var(--shadow); }
.hnav-card--kasir   { border-color: var(--emas); }
.hnav-card--menu    { border-color: var(--hijau-md); }
.hnav-card--stok    { border-color: var(--info); }
.hnav-card--laporan { border-color: var(--warning); }
.hnav-card--sync    { border-color: var(--hijau-muda); }
.hnav-card-icon { font-size: 1.8rem; }
.hnav-card-name { font-size: 0.9rem; font-weight: 700; color: var(--hijau-tua); }
.hnav-card-desc { font-size: 0.72rem; color: var(--teks-sub); line-height: 1.4; }

/* ===== USER BADGE ===== */
.user-banner {
  margin: 0 1rem 0.8rem;
  background: linear-gradient(135deg, var(--hijau-tua), var(--hijau));
  color: #fff; border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  display: flex; align-items: center; gap: 0.7rem;
}
.user-banner-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.15); border: 2px solid var(--emas);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
  flex-shrink: 0;
}
.user-banner-name { font-size: 0.88rem; font-weight: 700; }
.user-banner-role { font-size: 0.7rem; opacity: 0.75; }
.user-banner-logout {
  margin-left: auto; background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff; border-radius: var(--radius-sm); padding: 0.3rem 0.7rem;
  font-size: 0.75rem; cursor: pointer; font-family: var(--font);
  transition: all 0.2s;
}
.user-banner-logout:hover { background: rgba(255,255,255,0.2); }

/* ===== PAGE LAYOUT ===== */
.page-content { padding: 1rem 1rem 0.5rem; max-width: 1100px; margin: 0 auto; }
.page-title {
  font-size: 1.1rem; font-weight: 700; color: var(--hijau-tua);
  margin-bottom: 0.9rem; display: flex; align-items: center; gap: 0.4rem;
}

/* ===== CARD ===== */
.card {
  background: #fff; border-radius: var(--radius);
  box-shadow: 0 2px 12px var(--shadow);
  padding: 1rem; margin-bottom: 0.8rem;
}
.card-title {
  font-size: 0.9rem; font-weight: 700; color: var(--hijau-tua);
  margin-bottom: 0.7rem; border-bottom: 1px solid var(--batas);
  padding-bottom: 0.45rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.55rem 1.1rem; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.2s;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.96); }
.btn-primary   { background: var(--hijau); color: #fff; }
.btn-primary:hover { background: var(--hijau-tua); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--hijau-tua); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #7f0000; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-info      { background: var(--info); color: #fff; }
.btn-gold      { background: var(--emas); color: var(--hijau-tua); font-weight: 700; }
.btn-gold:hover { background: var(--emas-md); }
.btn-outline   { background: transparent; color: var(--hijau); border: 2px solid var(--hijau); }
.btn-outline:hover { background: var(--hijau); color: #fff; }
.btn-sm   { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
.btn-lg   { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }

/* ===== FORM ===== */
.form-group { margin-bottom: 0.85rem; }
label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--teks-sub); margin-bottom: 0.3rem; }
input, select, textarea {
  width: 100%; padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--batas); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.9rem; color: var(--teks);
  background: var(--krim); transition: border-color 0.2s; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--hijau); background: #fff; }
textarea { resize: vertical; min-height: 70px; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.84rem; min-width: 480px; }
thead th { background: var(--hijau-tua); color: #fff; padding: 0.6rem 0.8rem; text-align: left; font-weight: 600; font-size: 0.8rem; }
tbody tr { border-bottom: 1px solid var(--batas); transition: background 0.15s; }
tbody tr:hover { background: var(--krim); }
tbody td { padding: 0.55rem 0.8rem; vertical-align: middle; }

/* ===== BADGE ===== */
.badge { display: inline-block; padding: 0.18rem 0.55rem; border-radius: 99px; font-size: 0.7rem; font-weight: 600; }
.badge-hijau  { background: #d4efdf; color: #1a5c38; }
.badge-emas   { background: #fef3cd; color: #7d5a00; }
.badge-biru   { background: #d1e8ff; color: #0d47a1; }
.badge-merah  { background: #fdd9d7; color: #b71c1c; }
.badge-ungu   { background: #e8d5f5; color: #4a148c; }
.badge-abu    { background: #e8eaed; color: #455a64; }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: calc(var(--bnav-h) + 0.8rem); right: 0.8rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.4rem; }
.toast {
  background: var(--hijau-tua); color: #fff;
  padding: 0.65rem 1.1rem; border-radius: var(--radius-sm);
  font-size: 0.85rem; box-shadow: 0 4px 16px var(--shadow);
  animation: toastIn 0.3s ease; max-width: 280px;
  border-left: 4px solid var(--emas);
}
.toast.success { background: var(--hijau-tua); border-color: var(--hijau-muda); }
.toast.error   { background: var(--danger); border-color: #ff8a80; }
@keyframes toastIn { from { opacity:0; transform: translateY(20px); } to { opacity:1; transform: translateY(0); } }

/* ===== MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 500;
  align-items: flex-end; justify-content: center; /* bottom sheet on mobile */
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.2rem 1rem 2rem; /* extra bottom padding for safe area */
  width: 100%; max-width: 520px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.25);
  animation: slideUp 0.28s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-title { font-size: 1rem; font-weight: 700; color: var(--hijau-tua); }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--teks-sub); padding: 0; }
.modal-footer { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }
@keyframes slideUp { from { opacity:0; transform: translateY(40px); } to { opacity:1; transform: translateY(0); } }
/* Drag handle */
.modal::before {
  content: ''; display: block; width: 40px; height: 4px;
  background: var(--batas); border-radius: 99px;
  margin: 0 auto 1rem; flex-shrink: 0;
}

/* ===== KASIR LAYOUT ===== */
.kasir-layout { display: flex; flex-direction: column; gap: 0.8rem; }
.kasir-left { flex: 1; }
.kasir-right { display: none; /* hidden on mobile, shown in modal */ }

/* Menu Search & Filter */
.kasir-search-box {
  margin-bottom: 0.6rem;
  position: relative;
}
.kasir-search-box input {
  padding-left: 2.2rem;
  background: #fff;
  font-size: 0.88rem;
  border-radius: 99px;
  box-shadow: 0 2px 6px var(--shadow);
}
.kasir-search-icon {
  position: absolute; left: 0.8rem; top: 50%;
  transform: translateY(-50%); font-size: 0.95rem; opacity: 0.6;
}

.menu-filter { display: flex; gap: 0.4rem; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.4rem; margin-bottom: 0.8rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.menu-filter::-webkit-scrollbar { display: none; }
.filter-btn {
  padding: 0.45rem 1rem; border-radius: 99px;
  border: 1.5px solid var(--batas); background: #fff;
  cursor: pointer; font-family: var(--font); font-size: 0.8rem; font-weight: 600;
  white-space: nowrap; transition: all 0.2s;
  box-shadow: 0 1px 4px var(--shadow);
}
.filter-btn.active { background: var(--hijau); color: #fff; border-color: var(--hijau); box-shadow: 0 2px 8px rgba(26,92,56,0.3); }

/* Menu Grid — 2 columns on mobile */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
  padding-bottom: 4.5rem; /* space for bottom cart bar */
}
.menu-item-card {
  background: #fff; border-radius: var(--radius);
  padding: 0.85rem 0.65rem; text-align: center;
  border: 1.5px solid var(--batas); cursor: pointer;
  transition: all 0.2s; user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  box-shadow: 0 2px 8px var(--shadow);
  display: flex; flex-direction: column; align-items: center;
}
.menu-item-card:active { transform: scale(0.95); border-color: var(--emas); }
.menu-item-card.has-order { border-color: var(--hijau-md); background: #fbfdfc; }
.mitem-badge-cart {
  position: absolute; top: -6px; right: -6px;
  background: var(--hijau); color: #fff;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  border: 2px solid #fff;
}
.mitem-icon { font-size: 2.2rem; margin-bottom: 0.35rem; line-height: 1; }
.mitem-cat { font-size: 0.62rem; color: var(--teks-sub); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.15rem; }
.mitem-name { font-size: 0.88rem; font-weight: 700; color: var(--hijau-tua); margin-bottom: 0.3rem; line-height: 1.25; }
.mitem-price { font-size: 0.88rem; font-weight: 800; color: var(--emas); margin-top: auto; }
.mitem-stok { font-size: 0.66rem; color: var(--teks-sub); margin-top: 0.25rem; }
.mitem-stok.low { color: var(--danger); font-weight: 600; }
.mitem-variant-tag { font-size: 0.62rem; background: var(--krim); border: 1px solid var(--batas); padding: 0.1rem 0.4rem; border-radius: 99px; color: var(--teks-sub); margin-top: 0.2rem; }

/* Mobile Sticky Bottom Cart Bar */
.mobile-cart-bar {
  position: fixed;
  bottom: var(--bnav-h);
  left: 0; right: 0;
  z-index: 250;
  background: linear-gradient(135deg, var(--hijau-tua), #14472c);
  color: #fff;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
  cursor: pointer;
  transform: translateY(150%);
  transition: transform 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.2);
}
.mobile-cart-bar.visible {
  transform: translateY(0);
}
.mcb-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.mcb-count-badge {
  background: var(--emas);
  color: var(--hijau-tua);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.mcb-total {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--emas-muda);
}
.mcb-btn {
  background: var(--emas);
  color: var(--hijau-tua);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  font-family: var(--font);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Quick Cash Nominal Buttons */
.quick-cash-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.45rem;
}
.qcash-btn {
  flex: 1;
  min-width: 52px;
  padding: 0.4rem 0.3rem;
  background: var(--krim);
  border: 1px solid var(--batas);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--hijau-tua);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.qcash-btn:active {
  background: var(--hijau);
  color: #fff;
  border-color: var(--hijau);
}

/* Order Panel — legacy floating fab fallback */
.order-fab { display: none; }

/* Order Panel Modal */
.order-panel-modal { max-height: 92vh; }
.order-panel-title { font-size: 1rem; font-weight: 700; color: var(--hijau-tua); margin-bottom: 0.7rem; }
.order-items { max-height: 35vh; overflow-y: auto; margin-bottom: 0.7rem; }
.order-item-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0; border-bottom: 1px dashed var(--batas); }
.order-item-row:last-child { border-bottom: none; }
.order-item-name { font-size: 0.85rem; font-weight: 600; flex: 1; }
.order-item-sub { font-size: 0.7rem; color: var(--teks-sub); }
.order-qty-ctrl { display: flex; align-items: center; gap: 0.35rem; }
.qty-btn {
  width: 28px; height: 28px; border-radius: 7px; border: none;
  cursor: pointer; font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; -webkit-tap-highlight-color: transparent;
}
.qty-btn:active { transform: scale(0.88); }
.qty-btn.minus { background: #fdd9d7; color: var(--danger); }
.qty-btn.plus  { background: #d4efdf; color: var(--success); }
.order-item-price { font-size: 0.82rem; font-weight: 700; color: var(--hijau); white-space: nowrap; }
.order-summary { border-top: 2px solid var(--batas); padding-top: 0.7rem; font-size: 0.88rem; }
.order-summary-row { display: flex; justify-content: space-between; margin-bottom: 0.3rem; }
.order-summary-row.total { font-size: 1.05rem; font-weight: 800; color: var(--hijau-tua); }

/* Pelanggan Tabs */
.pelanggan-section { margin-bottom: 0.8rem; }
.pelanggan-tabs { display: flex; gap: 0.35rem; margin-bottom: 0.55rem; }
.ptab {
  flex: 1; padding: 0.45rem 0.4rem;
  border: 1.5px solid var(--batas); background: var(--krim);
  color: var(--teks-sub); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.ptab.active { border-color: var(--hijau); background: var(--hijau); color: #fff; }
.pelanggan-hint { min-height: 1.1rem; margin-top: 0.25rem; }
.pelanggan-selected {
  display: flex; align-items: center;
  background: linear-gradient(135deg, #edf7f1, #d4efdf);
  border: 1.5px solid var(--hijau-muda); border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem; margin-top: 0.35rem;
}

/* Autocomplete */
.autocomplete-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: #fff; border: 1.5px solid var(--batas); border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 4px 16px var(--shadow); max-height: 200px; overflow-y: auto;
}
.ac-item { padding: 0.55rem 0.8rem; cursor: pointer; border-bottom: 1px solid var(--batas); font-size: 0.84rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; transition: background 0.15s; }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item:active { background: var(--krim); }
.ac-item.ac-empty { color: var(--teks-sub); cursor: default; font-style: italic; }
.ac-id { font-size: 0.7rem; color: var(--teks-sub); background: var(--krim-2); padding: 0.1rem 0.4rem; border-radius: 4px; }

/* ===== STATS GRID ===== */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.6rem; margin-bottom: 0.8rem; }
.stats-card { background: #fff; border-radius: var(--radius-sm); padding: 0.85rem 1rem; box-shadow: 0 2px 8px var(--shadow); border-left: 4px solid var(--emas); }
.sc-label { font-size: 0.72rem; color: var(--teks-sub); margin-bottom: 0.25rem; }
.sc-value { font-size: 1.15rem; font-weight: 800; color: var(--hijau-tua); }

/* ===== LOGIN PAGE ===== */
.login-body {
  background: linear-gradient(160deg, var(--hijau-tua) 0%, var(--hijau) 55%, var(--hijau-md) 100%);
  min-height: 100vh; padding: 0; display: flex; flex-direction: column;
}
.login-container { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 1rem 5rem; }
.login-logo { text-align: center; color: #fff; margin-bottom: 2rem; }
.login-logo-circle {
  width: 80px; height: 80px; border-radius: 24px; margin: 0 auto 1rem;
  background: rgba(255,255,255,0.1); border: 2px solid rgba(201,168,76,0.5);
  display: flex; align-items: center; justify-content: center; font-size: 2.5rem;
}
.login-logo h1 { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.2rem; }
.login-logo p { font-size: 0.82rem; opacity: 0.75; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 8px 32px rgba(0,0,0,0.25); }
.login-card-title { font-size: 1rem; font-weight: 700; color: var(--hijau-tua); margin-bottom: 1rem; text-align: center; }
.login-error { background: #fdd9d7; border: 1px solid #e57373; border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; font-size: 0.84rem; color: var(--danger); margin-bottom: 0.8rem; display: none; }
.login-footer { text-align: center; margin-top: 1.5rem; color: rgba(255,255,255,0.55); font-size: 0.75rem; }
.pesantren-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: rgba(201,168,76,0.15); border: 1px solid rgba(201,168,76,0.3);
  border-radius: 99px; padding: 0.3rem 0.8rem;
  color: var(--emas-muda); font-size: 0.75rem; margin-bottom: 1.2rem;
}

/* ===== SYNC PAGE ===== */
.sync-banner {
  display: flex; gap: 0.8rem; align-items: flex-start;
  background: linear-gradient(135deg, #f9f6ee, #fef3cd);
  border: 1.5px solid #f0d080; border-radius: var(--radius);
  padding: 0.9rem 1rem; margin-bottom: 1rem;
}
.sync-banner-icon { font-size: 1.6rem; flex-shrink: 0; }
.sync-banner strong { display: block; color: var(--hijau-tua); margin-bottom: 0.15rem; font-size: 0.9rem; }
.sync-banner p { font-size: 0.8rem; color: var(--teks-sub); }
.sync-card { border-top: 4px solid var(--batas); }
.sync-card-header { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.8rem; }
.sync-card-icon { font-size: 1.8rem; }
.sync-card-title { font-size: 0.95rem; font-weight: 700; color: var(--hijau-tua); }
.sync-status { font-size: 0.8rem; margin-top: 0.1rem; }
.sync-actions { border-top: 1px solid var(--batas); padding-top: 0.7rem; }

/* ===== LAPORAN ===== */
.laporan-filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.8rem; }
.period-tabs { display: flex; gap: 0.3rem; }
.period-tab { padding: 0.35rem 0.75rem; border-radius: 99px; border: 1.5px solid var(--batas); background: #fff; cursor: pointer; font-family: var(--font); font-size: 0.78rem; font-weight: 600; transition: all 0.2s; }
.period-tab.active { background: var(--hijau); color: #fff; border-color: var(--hijau); }

/* ===== PRINT ===== */
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { position: absolute; left: 0; top: 0; width: 300px; font-family: monospace; }
  .bottom-nav, .order-fab, .toast-container { display: none !important; }
}

/* ===== DESKTOP OVERRIDE ===== */
@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .navbar { display: flex; }
  .mobile-topbar { display: none; }
  .bottom-nav { display: none; }
  .order-fab { display: none; }
  .mobile-cart-bar { display: none !important; }
  .modal-overlay { align-items: center; }
  .modal { border-radius: var(--radius); max-width: 480px; width: 90%; }
  .modal::before { display: none; }
  .kasir-layout { flex-direction: row; align-items: flex-start; }
  .kasir-right { display: block; width: 350px; flex-shrink: 0; }
  .order-panel-desktop {
    background: #fff; border-radius: var(--radius);
    box-shadow: 0 2px 12px var(--shadow); padding: 1rem;
    position: sticky; top: 80px;
  }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .home-nav-grid { grid-template-columns: repeat(3, 1fr); }
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding-bottom: 1rem; }
  .toast-container { bottom: 1.2rem; }
}
@media (min-width: 1024px) {
  .page-content { padding: 1.2rem 1.5rem 1rem; }
}

/* Badge compatibility aliases */
.badge-orange { background: #fef3cd; color: #7d5a00; }
.badge-blue   { background: #d1e8ff; color: #0d47a1; }
.badge-gray   { background: #e8eaed; color: #455a64; }
.badge-red    { background: #fdd9d7; color: #b71c1c; }
.badge-green  { background: #d4efdf; color: #1a5c38; }

/* ===== RESPONSIVE MOBILE CARDS & TABLES ===== */
.mobile-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.mobile-card-item {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  border: 1.5px solid var(--batas);
  box-shadow: 0 2px 6px var(--shadow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.mci-icon { font-size: 2rem; flex-shrink: 0; line-height: 1; }
.mci-body { flex: 1; min-width: 0; }
.mci-title { font-weight: 700; font-size: 0.92rem; color: var(--hijau-tua); margin-bottom: 0.2rem; }
.mci-meta { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.25rem; font-size: 0.75rem; color: var(--teks-sub); }
.mci-val { font-weight: 800; font-size: 0.95rem; color: var(--emas); }
.mci-actions { display: flex; gap: 0.35rem; flex-shrink: 0; }

.laporan-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
@media (min-width: 768px) {
  .laporan-charts-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Hide table on mobile if mobile-card-list is present, hide mobile-card-list on desktop */
@media (max-width: 767px) {
  .desktop-table-only { display: none !important; }
}
@media (min-width: 768px) {
  .mobile-card-list { display: none !important; }
}


