/* Kababchi.az — shared styles beyond Tailwind utilities */

.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.material-symbols-outlined.fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.pb-safe { padding-bottom: env(safe-area-inset-bottom, 16px); }

.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card-shadow { box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.05); }
.card-shadow-hover:hover { box-shadow: 0px 8px 30px rgba(0, 0, 0, 0.08); }

/* Pulsing dot for "in progress" states (tracking, KDS, live orders) */
.pulse-ring { animation: kbb-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes kbb-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.5); }
}

/* Radio / checkbox selection cards (product customization) */
input[type="radio"].opt:checked + div,
input[type="checkbox"].opt:checked + div {
  border-color: #d71920;
  background-color: rgba(215, 25, 32, 0.05);
}
input[type="radio"].opt:checked + div .radio-inner {
  background-color: #d71920; border-color: #d71920;
}
input[type="checkbox"].opt:checked + div .checkbox-inner {
  background-color: #d71920; border-color: #d71920;
}
input[type="checkbox"].opt:checked + div .checkbox-inner span { opacity: 1; }

/* Toggle switch (admin) */
.kbb-toggle { display: inline-block; vertical-align: middle; position: relative; width: 44px; height: 24px; border-radius: 9999px; background: #e5e2e1; transition: background .2s; cursor: pointer; flex: none; }
.kbb-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 9999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .2s; }
input:checked + .kbb-toggle { background: #d71920; }
input:checked + .kbb-toggle::after { left: 22px; }

/* Toast */
#kbb-toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px);
  background: #303030; color: #f3f0ef; padding: 12px 20px; border-radius: 12px;
  font-family: Manrope, sans-serif; font-size: 14px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 90vw; text-align: center;
}
#kbb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Simple bar chart bars (reports) */
.kbb-bar { border-radius: 6px 6px 0 0; background: #d71920; opacity: .85; transition: opacity .2s; }
.kbb-bar:hover { opacity: 1; }
.kbb-bar.muted { background: #e6bdb8; }

/* Skeleton shimmer */
.skeleton { background: linear-gradient(90deg, #f0eded 25%, #e5e2e1 50%, #f0eded 75%); background-size: 200% 100%; animation: kbb-shimmer 1.4s infinite; }
@keyframes kbb-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Print-friendly-ish tables on small screens: allow horizontal scroll inside container */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
.table-scroll table { min-width: 720px; }

/* ---------- Admin modal / form toolkit ----------
   Layout-critical rules live here (local CSS), NOT in Tailwind utility classes,
   so the dialog renders correctly even if the Tailwind CDN is slow or blocked. */
.kbb-modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-start; justify-content: center;
  background: rgba(27, 28, 28, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  padding: 16px; overflow-y: auto; overscroll-behavior: contain;
  animation: kbb-fade .15s ease;
}
.kbb-modal {
  box-sizing: border-box;
  background: #fff; border-radius: 16px; width: 100%; max-width: 560px;
  margin: auto;                       /* centers when it fits, scrolls when it does not */
  box-shadow: 0 24px 60px rgba(0,0,0,.28); animation: kbb-pop .18s cubic-bezier(.2,.9,.3,1.2);
  display: flex; flex-direction: column; overflow: hidden;
  font-family: Manrope, -apple-system, "Segoe UI", sans-serif; color: #1b1c1c;
}
.kbb-modal.kbb-modal-sm { max-width: 400px; }
.kbb-modal.kbb-modal-wide { max-width: 768px; }
.kbb-modal * { box-sizing: border-box; }
.kbb-modal h2, .kbb-modal p { overflow-wrap: anywhere; }

/* Sections — self-sufficient padding/borders (Tailwind classes only add polish) */
.kbb-modal-head { padding: 20px 24px 16px; border-bottom: 1px solid #e5e2e1; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.kbb-modal-head h2 { margin: 0; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 20px; line-height: 28px; }
.kbb-modal-head p { margin: 2px 0 0; font-size: 12px; line-height: 16px; color: #5d3f3c; }
.kbb-modal-body { padding: 20px 24px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.kbb-modal-body.kbb-center { text-align: center; padding: 24px 24px 16px; }
.kbb-modal-body.kbb-center h2 { margin: 0 0 4px; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 20px; }
.kbb-modal-body.kbb-center p { margin: 0; font-size: 14px; line-height: 21px; color: #5d3f3c; }
.kbb-modal-foot { padding: 16px 24px; border-top: 1px solid #e5e2e1; background: #f6f3f2; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.kbb-modal-foot.kbb-split > button { flex: 1 1 0; min-width: 120px; }
.kbb-modal-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .kbb-modal-grid { grid-template-columns: 1fr 1fr; } .kbb-modal-grid .kbb-full { grid-column: 1 / -1; } }
.kbb-modal-icon { width: 48px; height: 48px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }

/* Buttons — local fallbacks so labels never collapse without Tailwind */
.kbb-btn { border: 0; border-radius: 12px; padding: 10px 18px; font-weight: 700; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: background .15s, opacity .15s; white-space: nowrap; }
.kbb-btn:disabled { opacity: .6; cursor: default; }
.kbb-btn-primary { background: #d71920; color: #fff; }
.kbb-btn-primary:hover:not(:disabled) { background: #ae0011; }
.kbb-btn-danger { background: #ba1a1a; color: #fff; }
.kbb-btn-danger:hover:not(:disabled) { background: #93000a; }
.kbb-btn-ghost { background: #fff; color: #1b1c1c; border: 1px solid #e5e2e1; }
.kbb-btn-ghost:hover:not(:disabled) { background: #f0eded; }
.kbb-modal-close { background: none; border: 0; cursor: pointer; padding: 6px; margin: -6px -6px 0 0; border-radius: 8px; color: #5d3f3c; line-height: 0; }
.kbb-modal-close:hover { background: #f0eded; }

@keyframes kbb-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes kbb-pop { from { opacity: 0; transform: translateY(12px) scale(.97) } to { opacity: 1; transform: none } }
.kbb-input {
  box-sizing: border-box;
  width: 100%; background: #f6f3f2; border: 1px solid #e6bdb8; border-radius: 12px;
  padding: 11px 14px; font-family: Manrope, sans-serif; font-size: 15px; color: #1b1c1c;
  transition: border-color .15s, box-shadow .15s;
}
.kbb-input:focus { outline: none; border-color: #d71920; box-shadow: 0 0 0 3px rgba(215,25,32,.12); }
.kbb-input::placeholder { color: #926f6b; }
select.kbb-input { appearance: auto; cursor: pointer; }
.kbb-field-label { display: block; font-weight: 700; font-size: 13px; color: #5d3f3c; margin-bottom: 6px; }
.kbb-field-hint { display: block; font-size: 12px; color: #5d3f3c; margin-top: 4px; }
.kbb-modal-error { display: none; background: rgba(255,218,214,.6); color: #93000a; font-weight: 700; font-size: 13px; border-radius: 10px; padding: 10px 12px; }
.kbb-modal-error.show { display: block; }

@media (max-height: 520px) { .kbb-modal { margin: 0 auto; } }

/* Empty-state row inside admin tables */
.kbb-empty { text-align: center; padding: 48px 16px; color: #5d3f3c; font-weight: 700; }
