/* ===== CAFE SYSTEM — SHARED STYLES ===== */
/* Palette: Warm Coffee Tones */

:root {
  --espresso:    #2C1810;
  --dark-roast:  #3E2723;
  --medium-roast:#5D4037;
  --latte:       #795548;
  --cream:       #D7CCC8;
  --milk:        #EFEBE9;
  --foam:        #FFF8E1;
  --accent:      #FF6F00;
  --accent-light:#FFB300;
  --green:       #2E7D32;
  --green-light: #43A047;
  --red:         #C62828;
  --red-light:   #E53935;
  --blue:        #1565C0;
  --white:       #FFFFFF;
  --shadow:      rgba(44,24,16,0.18);
  --radius:      12px;
  --radius-sm:   8px;
  --font-main:   'Georgia', 'Times New Roman', serif;
  --font-ui:     'Trebuchet MS', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  background: var(--foam);
  color: var(--dark-roast);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 { font-family: var(--font-main); }
h1 { font-size: clamp(1.4rem, 4vw, 2rem); color: var(--espresso); }
h2 { font-size: clamp(1.1rem, 3vw, 1.5rem); }
h3 { font-size: 1rem; }

/* ===== HEADER ===== */
.header {
  background: var(--dark-roast);
  color: var(--foam);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px var(--shadow);
}
.header-logo { font-family: var(--font-main); font-size: 1.2rem; flex: 1; }
.header-badge {
  background: var(--accent);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
}
.header-role { font-size: 0.8rem; opacity: 0.7; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s, opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--dark-roast); color: var(--foam); }
.btn-primary:hover { background: var(--espresso); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-light); }
.btn-green { background: var(--green); color: white; }
.btn-green:hover { background: var(--green-light); }
.btn-red { background: var(--red); color: white; }
.btn-red:hover { background: var(--red-light); }
.btn-outline {
  background: transparent;
  border: 2px solid var(--latte);
  color: var(--latte);
}
.btn-outline:hover { background: var(--milk); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px var(--shadow);
  overflow: hidden;
}
.card-header {
  background: var(--dark-roast);
  color: var(--foam);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 14px 16px; }

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-waiting   { background: #FFF3E0; color: #E65100; border: 1px solid #FFB300; }
.badge-confirmed { background: #E3F2FD; color: #1565C0; border: 1px solid #42A5F5; }
.badge-cooking   { background: #FFF8E1; color: #F57F17; border: 1px solid #FFD54F; }
.badge-ready     { background: #E8F5E9; color: #2E7D32; border: 1px solid #66BB6A; }
.badge-delivering{ background: #EDE7F6; color: #4527A0; border: 1px solid #9575CD; }
.badge-done      { background: var(--milk); color: var(--latte); border: 1px solid var(--cream); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--medium-roast); margin-bottom: 5px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--cream);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  color: var(--dark-roast);
  background: white;
  transition: border-color 0.2s;
  -webkit-appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--latte);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* ===== NOTIFICATION TOAST ===== */
#toast-container {
  position: fixed;
  top: 70px;
  right: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--dark-roast);
  color: var(--foam);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  max-width: 280px;
  box-shadow: 0 4px 16px var(--shadow);
  animation: toastIn 0.3s ease;
  border-left: 4px solid var(--accent);
  pointer-events: auto;
}
.toast.toast-success { border-left-color: var(--green); }
.toast.toast-error   { border-left-color: var(--red); }
.toast.toast-info    { border-left-color: var(--blue); }
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(44,24,16,0.6);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; }
.modal {
  background: white;
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header {
  background: var(--dark-roast);
  color: var(--foam);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
}
.modal-close {
  background: none;
  border: none;
  color: var(--foam);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.modal-body { padding: 18px; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
  background: var(--cream);
  border-radius: 10px;
  height: 10px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--latte), var(--accent));
  border-radius: 10px;
  transition: width 0.8s ease;
}

/* ===== ICON SVG ===== */
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ===== STATUS INDICATOR ===== */
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}
.dot-orange { background: var(--accent); animation: pulse 1.5s infinite; }
.dot-green  { background: var(--green); }
.dot-blue   { background: var(--blue); }
.dot-gray   { background: var(--cream); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== LOADING ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  flex-direction: column;
  gap: 12px;
  color: var(--latte);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--cream);
  border-top-color: var(--latte);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== EMPTY STATE ===== */
.empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--latte);
}
.empty svg { opacity: 0.3; margin-bottom: 12px; }
.empty p { font-size: 1rem; }

/* ===== DIVIDER ===== */
.divider { border: none; border-top: 1px solid var(--cream); margin: 12px 0; }

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ===== UTILITIES ===== */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.text-center { text-align: center; }
.text-sm { font-size: 0.82rem; }
.text-muted { color: var(--latte); }
.text-bold { font-weight: 700; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ===== LIVE TIMER ===== */
.order-timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Courier New', monospace;
  font-size: .85rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: .5px;
  transition: background .5s, color .5s;
}
.timer-ok     { background: transparent; color: inherit; }
.timer-warn   { background: transparent; color: inherit; }
.timer-urgent { background: transparent; color: inherit; }
@keyframes timer-pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

.order-created-time {
  font-size: .78rem;
  color: var(--latte, #9E8070);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.order-created-time strong {
  color: var(--espresso, #3E2723);
  font-size: .82rem;
}
