* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, Arial, sans-serif; background: #f0f2f5; height: 100vh; display: flex; flex-direction: column; overflow: hidden; color: #222; }

/* TOP BAR */
.topbar {
  background: #6B1558; color: #fff;
  padding: 0.6rem 1rem; display: flex; align-items: center;
  gap: 0.75rem; flex-shrink: 0; flex-wrap: wrap;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}
.brand { font-size: 14px; font-weight: 700; white-space: nowrap; margin-right: auto; }
.tb-input {
  padding: 6px 10px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.12);
  color: #fff; font-size: 13px; outline: none; width: 200px;
}
.tb-input::placeholder { color: rgba(255,255,255,0.45); }
.tb-input:focus { border-color: rgba(255,255,255,0.65); background: rgba(255,255,255,0.2); }
.tb-btn {
  padding: 6px 13px; border-radius: 7px; border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.15); color: #fff; font-size: 13px; cursor: pointer;
  white-space: nowrap; transition: background 0.15s; font-weight: 600;
}
.tb-btn:hover { background: rgba(255,255,255,0.28); }
.tb-sep { width: 1px; height: 22px; background: rgba(255,255,255,0.2); flex-shrink: 0; }
.settings-group { display: flex; align-items: center; gap: 6px; font-size: 12px; color: rgba(255,255,255,0.85); }
.settings-group input[type=number] {
  width: 46px; text-align: center; padding: 5px;
  border-radius: 6px; border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.12); color: #fff; font-size: 13px; outline: none;
}
.toggle-btn {
  padding: 5px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.1);
  color: #fff; transition: background 0.15s;
}
.toggle-btn.on { background: rgba(80,220,120,0.3); border-color: rgba(80,220,120,0.5); }
.served-badge { font-size: 12px; color: rgba(255,255,255,0.75); white-space: nowrap; }
.served-badge b { color: #fff; }
.open-display {
  text-decoration: none; padding: 6px 13px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.1);
  color: #fff; font-size: 13px; white-space: nowrap; transition: background 0.15s;
}
.open-display:hover { background: rgba(255,255,255,0.22); }

/* BOARD */
.board {
  display: flex; gap: 10px; padding: 10px;
  overflow-x: auto; overflow-y: hidden; flex: 1;
  align-items: flex-start;
}

/* UNASSIGNED COLUMN */
.column {
  flex-shrink: 0; width: 210px; background: #e6e9ef;
  border-radius: 12px; display: flex; flex-direction: column;
  max-height: calc(100vh - 62px);
}
.column.drag-over { background: #d8dce6; outline: 2px dashed #8B1F6B; outline-offset: -2px; }
.col-header {
  padding: 9px 12px; display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.col-title { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: #666; flex: 1; }
.col-badge { background: #6B1558; color: #fff; font-size: 10px; border-radius: 12px; padding: 1px 8px; font-weight: 700; }
.unassigned-scroll { overflow-y: auto; flex: 1; padding: 4px 8px 8px; }

/* STATION COLUMN */
.station-col {
  flex-shrink: 0; width: 230px; background: #fff;
  border: 1px solid #e0e0e0; border-radius: 12px;
  display: flex; flex-direction: column; max-height: calc(100vh - 62px);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: border-color 0.15s, opacity 0.15s;
}
.station-col.drag-over { background: #fdf0f9; border-color: #8B1F6B; }
.station-col.col-dragging { opacity: 0.45; }
.station-col.col-drop-left  { border-left:  3px solid #e040a0; }
.station-col.col-drop-right { border-right: 3px solid #e040a0; }

.station-header {
  background: #6B1558; border-radius: 11px 11px 0 0;
  padding: 8px 10px; display: flex; align-items: center; gap: 5px; flex-shrink: 0;
}
.col-drag-handle {
  cursor: grab; color: rgba(255,255,255,0.5); font-size: 15px; line-height: 1;
  padding: 2px 3px; border-radius: 4px; flex-shrink: 0; user-select: none;
  transition: color 0.15s;
}
.col-drag-handle:hover { color: #fff; }
.col-drag-handle:active { cursor: grabbing; }
.name-stack { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.station-name-input {
  background: transparent; border: none; color: #fff;
  font-size: 13px; font-weight: 700; outline: none; width: 100%; cursor: text;
}
.station-name-input:focus { background: rgba(255,255,255,0.15); border-radius: 4px; padding: 1px 4px; }
.station-name-ar {
  background: transparent; border: none; color: rgba(255,255,255,0.7);
  font-size: 11px; outline: none; width: 100%; cursor: text; direction: rtl;
}
.station-name-ar::placeholder { color: rgba(255,255,255,0.3); }
.station-name-ar:focus { background: rgba(255,255,255,0.12); border-radius: 4px; padding: 1px 4px; color: #fff; }
.icon-btn {
  background: none; border: none; color: rgba(255,255,255,0.65);
  cursor: pointer; font-size: 13px; padding: 2px 5px; border-radius: 4px;
  transition: color 0.15s, background 0.15s; flex-shrink: 0; line-height: 1;
}
.icon-btn:hover { color: #fff; background: rgba(255,255,255,0.2); }
.icon-btn.del:hover { color: #ff8a80; }

/* NOW SERVING ZONE */
.serving-zone {
  padding: 8px 8px 6px; background: #fdf5fb;
  border-bottom: 1px solid #edd5e8; flex-shrink: 0; min-height: 78px;
}
.serving-zone.drop-active { background: #f5e0ef; }
.zone-label { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: #9B4080; margin-bottom: 5px; }

.serving-card {
  background: #6B1558; color: #fff; border-radius: 8px;
  padding: 6px 9px; display: flex; align-items: center; gap: 7px;
  cursor: grab; user-select: none;
}
.serving-card:active { cursor: grabbing; }
.serving-num { font-size: 22px; font-weight: 900; flex: 1; }
.done-btn {
  background: rgba(255,255,255,0.2); border: none; color: #fff;
  cursor: pointer; border-radius: 5px; padding: 3px 8px; font-size: 11px;
  white-space: nowrap; transition: background 0.15s;
}
.done-btn:hover { background: rgba(255,255,255,0.35); }
.empty-serving { font-size: 11px; color: #c0a0bb; text-align: center; padding: 12px 0; font-style: italic; }

/* CALL NEXT */
.call-next-btn {
  margin: 6px 8px 3px; border: none;
  background: #8B1F6B; color: #fff; border-radius: 7px;
  padding: 6px; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background 0.15s; flex-shrink: 0;
}
.call-next-btn:hover { background: #6B1558; }
.call-next-btn:disabled { background: #ccc; cursor: default; }

/* QUEUE */
.queue-scroll { overflow-y: auto; flex: 1; padding: 4px 8px 8px; }
.section-label { font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: #bbb; margin-bottom: 6px; }

/* CARDS */
.c-card {
  background: #fff; border: 1px solid #e8e8e8; border-radius: 8px;
  padding: 7px 9px; display: flex; align-items: center; gap: 7px;
  margin-bottom: 5px; cursor: grab; user-select: none;
  transition: box-shadow 0.12s, opacity 0.15s; position: relative;
}
.c-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.c-card.dragging { opacity: 0.35; }
.c-card.drop-before::before {
  content: ''; position: absolute; top: -3px; left: 0; right: 0;
  height: 3px; background: #6B1558; border-radius: 2px;
}
.c-card.drop-after::after {
  content: ''; position: absolute; bottom: -3px; left: 0; right: 0;
  height: 3px; background: #6B1558; border-radius: 2px;
}
.q-order { font-size: 10px; color: #ccc; font-weight: 700; min-width: 16px; }
.c-num { font-size: 18px; font-weight: 900; color: #222; flex: 1; }
.remove-btn {
  background: none; border: none; color: #ddd; cursor: pointer;
  font-size: 13px; padding: 2px 4px; border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.remove-btn:hover { color: #e24b4a; background: #fff0f0; }
.empty-msg { font-size: 11px; color: #bbb; text-align: center; padding: 14px 0; font-style: italic; }

/* ADD STATION BTN */
.add-col-btn { flex-shrink: 0; width: 44px; margin-top: 4px; }
.add-station-btn {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(107,21,88,0.07); border: 2px dashed rgba(107,21,88,0.25);
  color: #8B1F6B; font-size: 26px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.add-station-btn:hover { background: rgba(107,21,88,0.14); }

/* ── NEW ELEMENTS ──────────────────────── */

/* Undo button — disabled state */
#undo-btn:disabled { opacity: 0.4; cursor: default; }
#undo-btn:disabled:hover { background: rgba(255,255,255,0.15); }

/* Recall button inside serving card */
.recall-btn {
  background: rgba(255,255,255,0.12); border: none; color: #fff;
  cursor: pointer; border-radius: 5px; padding: 3px 8px; font-size: 13px;
  white-space: nowrap; transition: background 0.15s; flex-shrink: 0;
}
.recall-btn:hover { background: rgba(100,200,255,0.28); }

/* Ghost button inside serving card */
.ghost-btn {
  background: rgba(255,255,255,0.12); border: none; color: #fff;
  cursor: pointer; border-radius: 5px; padding: 3px 8px; font-size: 13px;
  white-space: nowrap; transition: background 0.15s; flex-shrink: 0;
}
.ghost-btn:hover { background: rgba(255,210,0,0.28); }

/* Ghosted section inside unassigned column */
.ghost-section-label {
  font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase;
  color: #9B4080; padding: 10px 4px 4px; opacity: 0.75;
}
.ghost-card {
  background: #fdf5fb; border-color: #e2c4da;
  opacity: 0.88;
}
.ghost-badge { font-size: 14px; flex-shrink: 0; line-height: 1; }
.requeue-btn { color: #9B4080 !important; font-size: 15px !important; }
.requeue-btn:hover { color: #6B1558 !important; background: #f5e0ef !important; }

/* On-break station column */
.col-on-break { opacity: 0.72; }
.col-on-break .station-header { background: #888; }
.col-on-break .station-header .col-drag-handle,
.col-on-break .station-header .icon-btn { opacity: 0.7; }
.break-banner {
  padding: 22px 12px; text-align: center;
  font-size: 13px; color: #aaa; font-style: italic; letter-spacing: 1px;
}

/* Break toggle button */
.break-toggle { font-size: 14px; }
.break-toggle.is-break { color: #4CAF50 !important; }
.break-toggle.is-break:hover { color: #388E3C !important; background: rgba(76,175,80,0.15) !important; }

/* Keyboard shortcut hint badge inside Call Next button */
.kbd-hint {
  font-size: 9px; font-weight: 400; letter-spacing: 0;
  background: rgba(255,255,255,0.18); border-radius: 3px;
  padding: 1px 5px; margin-left: 5px; opacity: 0.75;
}

/* Reset topbar button */
.reset-btn { opacity: 0.85; }
.reset-btn:hover { opacity: 1; }

/* Hide toggle button */
.hide-toggle { font-size: 13px; color: rgba(255,255,255,0.5) !important; }
.hide-toggle:hover { color: rgba(255,255,255,0.9) !important; }
.hide-toggle.is-hidden { color: rgba(255,100,100,0.75) !important; }
.hide-toggle.is-hidden:hover { color: rgba(255,120,120,1) !important; }

/* Hidden station column */
.col-hidden { opacity: 0.6; }
.col-hidden .station-header { background: #555; }
.hidden-banner {
  background: repeating-linear-gradient(
    45deg, rgba(0,0,0,0.04), rgba(0,0,0,0.04) 4px, transparent 4px, transparent 10px
  );
  border-bottom: 1px solid #e0e0e0;
  padding: 5px 10px;
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  color: #999; text-align: center;
}

/* Station served count — dim label under name inputs */
.station-served-count {
  font-size: 9px; color: rgba(255,255,255,0.45);
  letter-spacing: 0.5px; line-height: 1;
}

/* Estimated wait time — below queue list in control panel */
.est-wait {
  font-size: 10px; color: #9B4080; opacity: 0.65;
  text-align: center; padding: 5px 0 2px;
  letter-spacing: 0.5px; font-style: italic;
}

/* Dismiss undo toast — appears in serving zone after ✓ Done */
.dismiss-undo-toast {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: rgba(107,21,88,0.09); border: 1px solid rgba(107,21,88,0.2);
  border-radius: 6px; padding: 4px 8px; margin-top: 5px;
  font-size: 11px; color: #6B1558;
}
.undo-dismiss-btn {
  background: #6B1558; border: none; color: #fff;
  cursor: pointer; border-radius: 5px; padding: 3px 10px;
  font-size: 11px; font-weight: 600; transition: background 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.undo-dismiss-btn:hover { background: #8B1F6B; }

/* ── Session Summary Modal ───────────────── */
.modal-box--wide { width: min(580px, 94vw); }

.sum-totals {
  display: flex; gap: 24px; font-size: 13px; color: #666;
  padding-bottom: 12px; border-bottom: 1px solid #eee; flex-wrap: wrap;
}
.sum-totals b { color: #6B1558; font-size: 17px; }

.sum-table {
  width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px;
}
.sum-table th {
  text-align: left; font-size: 10px; letter-spacing: 1.5px;
  text-transform: uppercase; color: #aaa; padding: 6px 8px;
  border-bottom: 2px solid #eee;
}
.sum-table th:not(:first-child) { text-align: center; }
.sum-table td { padding: 8px 8px; border-bottom: 1px solid #f2f2f2; color: #333; }
.sum-table tr:last-child td { border-bottom: none; }
.sum-table tr:hover td { background: #faf7fc; }
.sum-num { text-align: center; font-weight: 600; }
.sum-ghost { color: #9B2D8A; }
.sum-empty { text-align: center; color: #bbb; font-style: italic; padding: 20px 0; }

.sum-export-btn {
  display: block; width: 100%; margin-top: 14px; padding: 9px;
  background: #6B1558; color: #fff; border: none;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.sum-export-btn:hover { background: #8B1F6B; }

/* ── Reset Modal ─────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.45);
  align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: #fff; border-radius: 16px;
  width: min(520px, 92vw);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
  animation: modal-in 0.18s ease;
}
@keyframes modal-in {
  from { transform: scale(0.94); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.modal-header {
  background: #6B1558; color: #fff;
  padding: 14px 18px; display: flex; align-items: center;
}
.modal-title { font-size: 15px; font-weight: 700; flex: 1; }
.modal-close {
  background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: 4px;
  transition: color 0.15s, background 0.15s; line-height: 1;
}
.modal-close:hover { color: #fff; background: rgba(255,255,255,0.15); }

.modal-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; overflow-y: auto; }

.reset-group { display: flex; flex-direction: column; gap: 6px; }
.reset-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: #999; padding: 0 2px 2px;
}
.reset-group-label--danger { color: #c0392b; }

.reset-opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left; cursor: pointer;
  background: #f8f8f8; border: 1px solid #eee; border-radius: 10px;
  padding: 10px 14px; transition: background 0.15s, border-color 0.15s;
}
.reset-opt:hover { background: #f0e8f0; border-color: #c8a0c0; }

.reset-opt--danger { background: #fff5f5; border-color: #ffd0d0; }
.reset-opt--danger:hover { background: #ffe8e8; border-color: #f0a0a0; }

.reset-opt--full { background: #fff0f0; border-color: #ffb0b0; }
.reset-opt--full:hover { background: #ffd8d8; border-color: #e06060; }

.ro-icon { font-size: 20px; flex-shrink: 0; width: 28px; text-align: center; line-height: 1; }
.ro-text { display: flex; flex-direction: column; gap: 2px; }
.ro-title { font-size: 13px; font-weight: 700; color: #222; }
.ro-desc  { font-size: 11px; color: #888; line-height: 1.4; }
