/* Sistem Informasi Manajemen Catering Multi-Sekolah */
:root { --brand: #0d6efd; --brand-dark: #0a58ca; --brand-rgb: 13,110,253; --sidebar-w: 240px; }
body { background: #f4f6f9; font-size: .95rem; }
.btn-primary { background: var(--brand) !important; border-color: var(--brand) !important; background-image: none !important; color: #fff !important; }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-dark) !important; border-color: var(--brand-dark) !important; }
.btn-outline-primary { color: var(--brand) !important; border-color: var(--brand) !important; }
.btn-outline-primary:hover, .btn-check:checked + .btn-outline-primary { background: var(--brand) !important; color: #fff !important; }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; color: #fff; }
a { color: var(--brand); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); }

h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6 { color: #1f2937; }
.public-header h1, .public-header .h5 { color: #fff; }

/* Admin layout */
.sidebar .offcanvas-body { display: block !important; width: 100%; }
.topbar { background: var(--brand); background-image: linear-gradient(90deg, var(--brand), var(--brand-dark)); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.topbar .navbar-brand { font-weight: 600; max-width: 45vw; }
.brand-logo { height: 30px; width: 30px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }
.school-switch select { max-width: 200px; }
.sidebar { width: var(--sidebar-w); background: #fff; border-right: 1px solid #e5e7eb; min-height: calc(100vh - 56px); }
@media (min-width: 992px) { .sidebar { position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; flex-shrink: 0; } }
.sidebar .nav-link { color: #374151; padding: .45rem 1rem; border-left: 3px solid transparent; display: flex; gap: .6rem; align-items: center; }
.sidebar .nav-link:hover { background: rgba(var(--brand-rgb), .06); }
.sidebar .nav-link.active { background: rgba(var(--brand-rgb), .1); border-left-color: var(--brand); color: var(--brand); font-weight: 600; }
.sidebar .ico { width: 1.4rem; text-align: center; }
.sidebar .nav-header { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #9ca3af; padding: .9rem 1rem .3rem; }
.content { min-width: 0; }
.card { border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04); border-radius: .75rem; }
.card-header { background: #fff; font-weight: 600; border-bottom: 1px solid #eef0f3; border-radius: .75rem .75rem 0 0 !important; }
.stat { border-radius: .75rem; padding: 1rem; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.06); height: 100%; }
.stat .label { color: #6b7280; font-size: .8rem; }
.stat .value { font-size: 1.45rem; font-weight: 700; }
.stat.accent { border-left: 4px solid var(--brand); }
.table { background: #fff; }
.table td, .table th { vertical-align: middle; }
.table-actions { white-space: nowrap; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: .5rem; background: #eef0f3; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 130px; }
.badge { font-weight: 600; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.text-pre { white-space: pre-wrap; }

/* Public ordering page */
.public { background: #f6f7fb; }
.public-header { background: var(--brand); background-image: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; padding: 1rem 0 2.5rem; }
.public-header .logo { height: 56px; width: 56px; object-fit: contain; background: #fff; border-radius: 12px; padding: 4px; }
.public-main { margin-top: -1.8rem; padding-bottom: 7rem; }
.step-card { border-radius: 1rem; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; margin-right: .5rem; }
.menu-card { border: 1px solid #e5e7eb; border-radius: .9rem; overflow: hidden; background: #fff; height: 100%; display: flex; flex-direction: column; }
.menu-card img, .menu-card .noimg { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #f1f3f6; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.menu-card .body { padding: .6rem .75rem; flex: 1; display: flex; flex-direction: column; }
.menu-card .price { color: var(--brand); font-weight: 700; }
.menu-card.selected { outline: 3px solid var(--brand); }
.recipient-box { border: 1px solid #e5e7eb; border-radius: .9rem; background: #fff; }
.recipient-box .rhead { background: rgba(var(--brand-rgb), .07); border-radius: .9rem .9rem 0 0; padding: .6rem .9rem; }
.item-row { border-top: 1px dashed #e5e7eb; padding: .6rem .9rem; }
.mod-chip .btn { font-size: .8rem; padding: .2rem .55rem; border-radius: 2rem; }
.sticky-total { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; box-shadow: 0 -4px 14px rgba(0,0,0,.1); padding: .7rem 0; z-index: 1030; }
.sticky-total .total { font-size: 1.25rem; font-weight: 700; color: var(--brand); }
.btn-pesan { font-size: 1.1rem; font-weight: 700; padding: .65rem 1.6rem; border-radius: 2rem; }
.qty-group { width: 120px; }
.qty-group input { text-align: center; }
.success-icon { font-size: 4rem; }

/* menu harian langsung di bawah penerima (mode satu minggu) */
.menu-strip { display: flex; gap: .5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.menu-chip { position: relative; flex: 0 0 116px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: stretch; text-align: left;
  border: 1px solid #e5e7eb; border-radius: .75rem; background: #fff; padding: 0; overflow: hidden; font-size: .78rem; line-height: 1.2; }
.menu-chip img, .menu-chip .noimg { width: 100%; height: 70px; object-fit: cover; background: #f1f3f6; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.menu-chip .nm { padding: .3rem .45rem 0; font-weight: 600; color: #1f2937; }
.menu-chip .pr { padding: 0 .45rem .4rem; color: var(--brand); font-weight: 700; }
.menu-chip.on { border: 2px solid var(--brand); box-shadow: 0 0 0 2px rgba(var(--brand-rgb), .15); }
.menu-chip .qb { position: absolute; top: 4px; right: 4px; background: var(--brand); color: #fff; border-radius: 1rem; min-width: 22px; padding: 0 6px; text-align: center; font-weight: 700; }
.day-block .item-row { padding-top: .4rem; }
.item-row.compact { padding-top: .35rem; padding-bottom: .35rem; }

/* input tanggal dd/mm/yyyy */
.date-dmy { position: relative; display: block; }
.date-dmy > input[type=text] { padding-right: 2.2rem; }
.date-dmy-btn { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; padding: 0 .25rem; line-height: 1; font-size: 1rem; cursor: pointer; }
.date-dmy-native { position: absolute !important; left: 0; bottom: 0; width: 100% !important; height: 100%; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* potong foto */
.crop-overlay { position: fixed; inset: 0; z-index: 2000; background: #0f172a; display: flex; flex-direction: column; color: #fff; }
.crop-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .6rem .9rem; }
.crop-hint { font-size: .8rem; opacity: .7; }
.crop-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0 1rem; }
.crop-stage canvas { max-width: 100%; max-height: 100%; touch-action: none; border-radius: 4px; }
.crop-actions { justify-content: center; padding-bottom: max(.8rem, env(safe-area-inset-bottom)); }
.crop-info { font-size: .8rem; opacity: .7; min-width: 90px; text-align: center; }

.day-chip { min-width: 58px; line-height: 1.15; }

/* Cetak */
.print-page { background: #fff; font-size: 12px; }
.print-page .table { font-size: 12px; }
@media print {
  body { background: #fff !important; }
  .sidebar, .topbar, .d-print-none, .btn { display: none !important; }
  .content .container-fluid { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  a[href]:after { content: none !important; }
  .page-break { page-break-after: always; }
  table { page-break-inside: auto; } tr { page-break-inside: avoid; }
}
@media (max-width: 575.98px) {
  .stat .value { font-size: 1.15rem; }
  h1.h4 { font-size: 1.1rem; }
  .table { font-size: .85rem; }
}

/* tombol kirim pesanan publik: teks panjang tetap rapi di HP */
.btn-pesan { white-space: nowrap; }
@media (max-width: 420px) { .btn-pesan { font-size: .85rem; padding-left: .9rem; padding-right: .9rem; } }
/* tanggal yang ditutup operator (stok habis) */
.day-chip[data-chip-closed], .day-chip[data-chip-closed]:disabled { opacity: 1; color: #b02a37; border-color: #f1aeb5; background: #fff5f5; cursor: not-allowed; }

/* tampilan di dalam aplikasi Android operator (WebView): tanpa navigasi web */
body.in-app .topbar, body.in-app .sidebar { display: none !important; }
body.in-app .content { margin-left: 0 !important; }
