/* ===== Resto Hijau - style.css ===== */
:root {
  --g900: #14532d;
  --g700: #15803d;
  --g500: #22c55e;
  --g100: #dcfce7;
  --g50: #f0fdf4;
  --ink: #1f2937;
  --mute: #6b7280;
  --line: #e5e7eb;
  --wa: #25d366;
  --bs-primary: #15803d;
  --bs-primary-rgb: 21, 128, 61;
  --bs-link-color: #15803d;
  --bs-link-hover-color: #14532d;
  --bs-body-font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--bs-body-font-family);
  color: var(--ink);
  background: #fff;
}

/* ---------- Buttons ---------- */
.btn-green { background: var(--g700); border-color: var(--g700); color: #fff; }
.btn-green:hover, .btn-green:focus { background: var(--g900); border-color: var(--g900); color: #fff; }
.btn-outline-green { border-color: var(--g700); color: var(--g700); }
.btn-outline-green:hover, .btn-outline-green.active { background: var(--g700); border-color: var(--g700); color: #fff; }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; font-weight: 600; }
.btn-wa:hover, .btn-wa:focus { background: #1ebe5b; border-color: #1ebe5b; color: #fff; }
.form-control:focus, .form-select:focus {
  border-color: var(--g500);
  box-shadow: 0 0 0 .2rem rgba(34, 197, 94, .2);
}
.text-green { color: var(--g700) !important; }
.price { color: var(--g700); font-weight: 700; }

/* ---------- Public navbar & footer ---------- */
.navbar-site { background: var(--g700); box-shadow: 0 2px 10px rgba(20, 83, 45, .25); }
.navbar-site .nav-link { color: #fff; opacity: .85; font-weight: 500; border-bottom: 2px solid transparent; padding: .35rem .1rem; }
.navbar-site .nav-link:hover { opacity: 1; }
.navbar-site .nav-link.active { opacity: 1; font-weight: 600; border-bottom-color: #fff; }
.brand { font-weight: 700; display: inline-flex; align-items: center; gap: .6rem; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; color: var(--g700);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.footer-site { background: var(--g900); color: #d1fae5; }
.footer-site a { color: #d1fae5; text-decoration: none; }
.footer-site a:hover { color: #fff; text-decoration: underline; }
.footer-site .small-line { border-top: 1px solid rgba(255, 255, 255, .15); }

/* ---------- Hero & headings ---------- */
.hero {
  background: linear-gradient(135deg, var(--g900) 0%, var(--g700) 100%);
  color: #fff; position: relative; overflow: hidden;
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { width: 420px; height: 420px; background: rgba(255, 255, 255, .06); right: -120px; top: -160px; }
.hero::after { width: 220px; height: 220px; background: rgba(34, 197, 94, .35); right: 8%; bottom: -90px; }
.badge-soft {
  display: inline-block; background: rgba(255, 255, 255, .15); color: #fff;
  border: 1px solid rgba(255, 255, 255, .3); padding: .3rem .8rem; border-radius: 999px; font-size: .85rem;
}
.hero-art { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; position: relative; z-index: 1; }
.hero-tile {
  background: #fff; border-radius: 18px; aspect-ratio: 1 / 1; padding: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
}
.hero-tile:nth-child(even) { transform: translateY(14px); }
.hero-tile svg { width: 100%; height: 100%; }
.page-head {
  background: linear-gradient(135deg, var(--g900), var(--g700)); color: #fff; padding: 2.6rem 0;
}
.page-head h1 { font-weight: 700; margin-bottom: .25rem; }
.page-head p { opacity: .85; margin: 0; }
.section-title { font-weight: 700; color: var(--g900); }
.section-sub { color: var(--mute); }
.bg-soft { background: var(--g50); }

/* ---------- Cards ---------- */
.feature-card, .testi-card, .info-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 1.4rem; height: 100%;
}
.feature-card .ico, .info-card .ico {
  width: 48px; height: 48px; border-radius: 14px; background: var(--g100); color: var(--g700);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: .8rem;
}
.hours-strip { background: var(--g100); border: 1px solid #bbf7d0; border-radius: 16px; }

.food-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  height: 100%; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s;
}
.food-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(20, 83, 45, .13); }
.food-thumb {
  background: var(--g100); aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; padding: 12px;
}
.food-thumb svg { width: 100%; height: 100%; }
.food-thumb.has-photo { padding: 0; }
.food-thumb img { width: 100%; height: 100%; object-fit: cover; }
.food-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; flex: 1; }
.food-body .desc {
  color: var(--mute); font-size: .82rem; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em;
}
.cat-badge { background: var(--g100); color: var(--g700); font-weight: 500; font-size: .72rem; }

/* ---------- Menu page & cart ---------- */
.cat-pill { border-radius: 999px; }
.cart-card {
  position: sticky; top: 68px; border: 2px solid var(--g700); border-radius: 16px; background: #fff;
  overflow-x: hidden; overflow-y: auto; max-height: calc(100vh - 84px);
}
.cart-head { background: var(--g700); color: #fff; }
.cart-row { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.qty { display: inline-flex; align-items: center; gap: .35rem; }
.qty span { min-width: 1.4rem; text-align: center; font-weight: 600; }
.qty .btn { width: 26px; height: 26px; padding: 0; line-height: 1; }
.fab-cart { position: fixed; right: 16px; bottom: 16px; z-index: 1030; }

/* ---------- Admin ---------- */
.admin-body { background: var(--g50); }
.admin-topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px; background: var(--g900); color: #fff;
  z-index: 1040; display: flex; align-items: center; padding: 0 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}
.admin-topbar .brand { color: #fff; text-decoration: none; }
.admin-sidebar {
  position: fixed; top: 56px; bottom: 0; left: 0; width: 230px; background: var(--g100);
  padding: 16px 12px; overflow-y: auto; z-index: 1035; transition: transform .25s ease;
}
.admin-sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--g900);
  text-decoration: none; font-weight: 500; margin-bottom: 4px; font-size: .92rem;
}
.admin-sidebar a:hover { background: #bbf7d0; }
.admin-sidebar a.active { background: var(--g700); color: #fff; }
.admin-sidebar .side-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--g700); margin: 8px 12px 6px; }
.admin-main { margin-left: 230px; padding: 80px 24px 32px; min-height: 100vh; }
.side-overlay { display: none; position: fixed; inset: 56px 0 0 0; background: rgba(0, 0, 0, .35); z-index: 1034; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; height: 100%; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; height: 100%; }
.stat-card .label { color: var(--mute); font-size: .8rem; }
.stat-card .value { font-size: 1.5rem; font-weight: 700; color: var(--g700); }
.stat-card .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--g100); color: var(--g700); display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; }
thead.table-green th { background: var(--g700); color: #fff; font-weight: 600; font-size: .85rem; border: 0; white-space: nowrap; }
.table > :not(caption) > * > * { padding-top: .6rem; padding-bottom: .6rem; }
.thumb-sm { width: 56px; height: 42px; border-radius: 8px; background: var(--g100); display: flex; align-items: center; justify-content: center; padding: 3px; overflow: hidden; }
.thumb-sm svg { width: 100%; height: 100%; }
.thumb-sm.has-photo { padding: 0; }
.thumb-sm img { width: 100%; height: 100%; object-fit: cover; }
.preview-box { width: 120px; height: 90px; border-radius: 12px; background: var(--g100); display: flex; align-items: center; justify-content: center; padding: 6px; overflow: hidden; flex-shrink: 0; }
.preview-box svg { width: 100%; height: 100%; }
.preview-box.has-photo { padding: 0; }
.preview-box img { width: 100%; height: 100%; object-fit: cover; }

.bars { display: flex; align-items: flex-end; gap: 12px; height: 210px; padding-top: 10px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.bar { width: 100%; max-width: 46px; border-radius: 8px 8px 0 0; background: linear-gradient(var(--g500), var(--g700)); min-height: 3px; transition: height .4s; }
.bar-val { font-size: .68rem; color: var(--mute); margin-bottom: 3px; white-space: nowrap; }
.bar-lbl { font-size: .72rem; color: var(--mute); margin-top: 6px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; }
.login-left {
  background: linear-gradient(135deg, var(--g900), var(--g700)); color: #fff; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 2rem;
}
.login-left::before { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; background: rgba(255, 255, 255, .07); right: -90px; top: -90px; }
.login-left::after { content: ""; position: absolute; width: 170px; height: 170px; border-radius: 50%; background: rgba(34, 197, 94, .35); left: -50px; bottom: -50px; }
.login-left > * { position: relative; z-index: 1; }
.login-box { width: 100%; max-width: 380px; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); box-shadow: 4px 0 18px rgba(0, 0, 0, .2); }
  .side-overlay.show { display: block; }
  .admin-main { margin-left: 0; padding: 76px 14px 28px; }
  .hero-art { margin-top: 1rem; }
}

/* ---------- Print (laporan) ---------- */
.print-only { display: none; }
@media print {
  .admin-topbar, .admin-sidebar, .side-overlay, .no-print { display: none !important; }
  .admin-main { margin: 0; padding: 0; }
  .print-only { display: block; }
  .panel { border: 0; padding: 0; }
  body { background: #fff; }
  thead.table-green th { background: #e5e7eb !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- DataTables (tema hijau) ---------- */
.dataTables_wrapper { font-size: .88rem; }
.dataTables_wrapper .form-select, .dataTables_wrapper .form-control { font-size: .85rem; }
.dataTables_wrapper .page-link { color: var(--g700); }
.dataTables_wrapper .page-item.active .page-link { background: var(--g700); border-color: var(--g700); color: #fff; }
.dataTables_wrapper .page-item.disabled .page-link { color: #9ca3af; }
table.dataTable.table-hover > tbody > tr:hover > * { box-shadow: inset 0 0 0 9999px rgba(34, 197, 94, .08); }
@media print { .dataTables_wrapper .no-print { display: none !important; } }

/* Navbar publik: sticky dipasang pada pembungkusnya (#site-nav) agar benar-benar menempel saat scroll */
#site-nav { position: sticky; top: 0; z-index: 1030; }

/* Baris detail transaksi (transaksi_detail) */
.detail-box { background: var(--g50); border: 1px dashed #86efac; border-radius: 10px; padding: 10px 14px; margin: 4px 0 8px; }
table.dataTable > tbody > tr.child-row-open > * { background: var(--g50); }


/* ---------- Role, avatar, logo, SweetAlert ---------- */
.brand-mark { overflow: hidden; flex-shrink: 0; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--g700); color: #fff; font-weight: 600; flex-shrink: 0; }
.avatar-xs { width: 24px; height: 24px; font-size: .65rem; background: #fff; color: var(--g700); }
.avatar-sm { width: 36px; height: 36px; font-size: .8rem; }
.avatar-lg { width: 84px; height: 84px; font-size: 1.8rem; }
.admin-sidebar .side-role { margin: 14px 12px 0; }
.role-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; }
.logo-preview { width: 120px; height: 120px; border-radius: 18px; border: 2px dashed var(--g500); background: var(--g50); display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--g700); overflow: hidden; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.brand-preview { background: var(--g700); color: #fff; padding: .6rem .9rem; border-radius: 10px; }
.demo-box { background: var(--g50); border: 1px solid var(--g100); border-radius: 12px; padding: .75rem; }
.swal2-container { z-index: 3000 !important; }
.swal2-popup { font-family: 'Poppins', system-ui, sans-serif; }
.swal2-container.swal2-top-end, .swal2-container.swal2-top-right { padding-top: 66px !important; }
