/* ==========================================================================
   HFT.vn — Unified Design System (Minimalist Luxury Azure Sky & Porcelain)
   Pure CSS3 (No build tool required)
   ========================================================================== */

:root {
  --primary: #2b7de9;
  --primary-hover: #1e6ad4;
  --primary-dark: #164e9e;
  --primary-accent: #5fa4f4;
  --primary-light: #eef5fe;
  --primary-soft: #eef5fe;
  --primary-border: #c5ddfb;
  --brand-navy: #14253d;

  --slate-900: #14253d;
  --slate-800: #1e334f;
  --slate-700: #334a66;
  --slate-600: #4b627d;
  --slate-500: #647b96;
  --slate-400: #93a7be;
  --slate-300: #c8d7e8;
  --slate-200: #e2ecf7;
  --slate-100: #f0f5fb;
  --slate-50: #f8fbff;

  --success: #1f8a5b;
  --success-bg: #ecfdf5;
  --success-soft: #ecfdf5;
  --warning: #c07a1c;
  --warning-bg: #fef9ec;
  --warning-soft: #fef9ec;
  --danger: #d14343;
  --danger-bg: #fef2f2;
  --danger-soft: #fef2f2;
  --info: #2b7de9;
  --info-bg: #eef5fe;
  --info-soft: #eef5fe;
  --accent-teal: #0f766e;
  --accent-teal-bg: #f0fdfa;
  --accent-teal-border: #5eead4;
  --accent-orange: #c2410c;
  --accent-orange-bg: #fff7ed;
  --accent-orange-border: #fed7aa;

  --bg: #f5f9fe;
  --bg-page: #f5f9fe;
  --surface: #ffffff;
  --text: #14253d;
  --text-muted: #5f738c;
  --border: #e2ecf7;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(20, 37, 61, 0.04);
  --shadow-md: 0 6px 20px rgba(20, 37, 61, 0.06);
  --shadow-lg: 0 16px 40px rgba(20, 37, 61, 0.11);

  --sidebar-width: 260px;
  --topbar-height: 62px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.3;
}

/* ---------- Utilities ---------- */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 18px; }
.w-full { width: 100%; }

/* ---------- Buttons ---------- */
button, .btn, a, input, select, textarea {
  touch-action: manipulation;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--slate-800);
  color: #ffffff;
}
.btn-secondary:hover:not(:disabled) {
  background: var(--slate-900);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}
.btn-success:hover:not(:disabled) {
  background: #17724b;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.btn-danger:hover:not(:disabled) {
  background: #b83232;
}

.btn-warning {
  background: var(--warning);
  color: #ffffff;
}
.btn-warning:hover:not(:disabled) {
  background: #a36514;
}

.btn-outline {
  background: var(--surface);
  color: var(--slate-700);
  border-color: var(--slate-300);
}
.btn-outline:hover:not(:disabled) {
  background: var(--slate-50);
  border-color: var(--primary-border);
  color: var(--primary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--slate-600);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--slate-100);
  color: var(--slate-900);
}

.btn-sidebar-logout {
  background: var(--slate-50);
  color: var(--slate-700);
  border-color: var(--border);
}
.btn-sidebar-logout:hover:not(:disabled) {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f7d4d4;
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.auth-label-row .form-label {
  margin-bottom: 0;
}
.auth-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-hover);
  cursor: pointer;
}
.auth-link-btn:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.account-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  margin-bottom: 16px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
}
.account-chip-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-navy);
}
.account-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Auth Mode Switcher & Staff Restaurant Banner ---------- */
.auth-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 18px;
  background: var(--slate-100);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.auth-mode-tab {
  border: none;
  background: transparent;
  color: var(--slate-600);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 10px;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.auth-mode-tab:hover {
  color: var(--slate-900);
}
.auth-mode-tab.active {
  background: #ffffff;
  color: var(--primary-dark);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.staff-rest-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px;
  margin-bottom: 16px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
}
.staff-rest-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.staff-rest-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 20px;
}
.staff-rest-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.staff-rest-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-hover);
}
.staff-rest-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--brand-navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Image Uploader Widget (Cloudinary) ---------- */
.img-uploader {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--slate-50);
  border: 1.5px dashed var(--slate-300);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.img-uploader:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.img-uploader-preview {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  color: var(--slate-400);
  font-size: 24px;
}
.img-uploader-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.img-uploader-preview.is-contain img {
  object-fit: contain;
  padding: 4px;
}
.img-uploader-actions {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.img-uploader-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.img-uploader-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-block {
  display: flex;
  width: 100%;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.modal-body .btn {
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
}

.btn-ack-fading {
  opacity: 0 !important;
  transform: scale(0.92);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 15px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--slate-700);
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-control, .form-select {
  width: 100%;
  padding: 10px 13px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--slate-900);
  background: var(--surface);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(43, 125, 233, 0.16);
}

.form-control.is-invalid {
  border-color: var(--danger);
}
.form-control.is-invalid:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(209, 67, 67, 0.14);
}

.form-control.is-valid {
  border-color: var(--success);
}
.form-control.is-valid:focus {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(31, 138, 91, 0.14);
}

.form-control:disabled {
  background: var(--slate-100);
  color: var(--slate-500);
}

.form-hint {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.form-error {
  margin-top: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--danger);
}

.pwd-rules-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.pwd-rule-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.pwd-rule-item.is-ok {
  color: var(--success);
}

.pwd-rule-item.is-miss {
  color: var(--danger);
}

.pwd-realtime-error {
  flex-basis: 100%;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
  line-height: 1.4;
}

.input-with-action {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-action .form-control {
  padding-right: 44px;
}
.input-action-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--slate-500);
  cursor: pointer;
  padding: 6px;
  font-size: 13px;
  font-weight: 600;
}
.input-action-btn:hover {
  color: var(--slate-800);
}

.form-grid-2,
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.form-grid-2 > *,
.form-row > * {
  min-width: 0;
}
@media (min-width: 580px) {
  .form-grid-2,
  .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--slate-900);
}

.card-body {
  padding: 18px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-full);
  line-height: 1.4;
}

.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: var(--success-bg); color: #166534; }
.badge-warning { background: var(--warning-bg); color: #925610; }
.badge-danger { background: var(--danger-bg); color: #b83232; }
.badge-info { background: var(--primary-light); color: var(--primary-dark); }
.badge-neutral { background: var(--slate-100); color: var(--slate-600); }

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 14px;
  border: 1px solid transparent;
  display: block;
}
.alert.flex {
  display: flex;
}
.alert-danger { background: var(--danger-bg); border-color: #f7d4d4; color: #992626; }
.alert-warning { background: var(--warning-bg); border-color: #f3dea2; color: #854d0e; }
.alert-success { background: var(--success-bg); border-color: #bbf7d0; color: #166534; }
.alert-info { background: var(--primary-light); border-color: var(--primary-border); color: var(--primary-dark); }

/* ---------- Tables ---------- */
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--slate-500);
  background: var(--slate-50);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--slate-50);
}

.data-table .badge {
  white-space: nowrap;
}

/* ---------- KPI Grid ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--slate-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ---------- Desktop Dashboard Shell (Porcelain White & Azure Sky Sidebar) ---------- */
.app-shell,
.dashboard-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  color: var(--slate-700);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.2s ease;
}

.sidebar-brand {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-mark img,
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--slate-600);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-item:hover {
  background: var(--slate-50);
  color: var(--slate-900);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-color: var(--primary-border);
  font-weight: 700;
}

.sidebar-footer {
  padding: 14px;
  border-top: 1px solid var(--border);
  background: var(--slate-50);
}

.main-area {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: calc(100% - var(--sidebar-width));
}

.topbar {
  min-height: 58px;
  height: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: max(10px, env(safe-area-inset-top, 0px)) 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.owner-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-title {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--slate-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-refresh-btn {
  flex-shrink: 0;
}

.page-content {
  padding: 18px 20px max(48px, calc(28px + env(safe-area-inset-bottom, 0px)));
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 18px;
  line-height: 1;
  color: var(--slate-700);
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 37, 61, 0.45);
  z-index: 50;
}

@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 55;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .main-area {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .page-content {
    padding: 14px 12px max(56px, calc(32px + env(safe-area-inset-bottom, 0px)));
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: max(9px, env(safe-area-inset-top, 0px)) 12px 9px;
    gap: 8px;
  }
  .topbar-title {
    font-size: 15.5px;
  }
  .topbar-refresh-btn .refresh-label {
    display: none;
  }
  .topbar-refresh-btn {
    padding: 6px 9px;
  }
  .data-table th,
  .data-table td {
    padding: 9px 10px;
    font-size: 13px;
  }
}

/* ---------- Mobile-First Container (Guest & Staff) ---------- */
.mobile-shell {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.mobile-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ---------- WS Connection Status Pill ---------- */
.ws-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--slate-100);
  color: var(--slate-600);
}
.ws-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--slate-400);
}
.ws-pill.connected { background: var(--success-bg); color: #166534; }
.ws-pill.connected .ws-dot { background: var(--success); }
.ws-pill.reconnecting { background: var(--warning-bg); color: #92400e; }
.ws-pill.reconnecting .ws-dot { background: var(--warning); }

/* ---------- Auth Pages (Login / Register — Flat Calm Sky Mist) ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px 28px;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 14px;
}

.auth-brand-img {
  max-width: 245px;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.auth-logo {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: var(--primary);
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(43, 125, 233, 0.22);
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--slate-900);
}

.auth-subtitle {
  margin-top: 5px;
  font-size: 14px;
  color: var(--text-muted);
}

/* Step indicator */
.step-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 700;
  background: var(--slate-100);
  color: var(--slate-500);
}

.step-pill.active {
  background: var(--primary-light);
  color: var(--primary-hover);
  border: 1px solid var(--primary-border);
}

.step-pill.done {
  background: var(--success-bg);
  color: #166534;
}

/* 5-Digit OTP Boxes */
.otp-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
}

.otp-digit {
  width: 54px;
  height: 62px;
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--slate-900);
  background: var(--slate-50);
  border: 2px solid var(--slate-300);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.otp-digit:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(43, 125, 233, 0.16);
}

.otp-digit.filled {
  border-color: var(--primary);
  background: var(--primary-light);
}

@media (max-width: 420px) {
  .auth-card {
    padding: 22px 16px;
  }
  .otp-inputs {
    gap: 6px;
  }
  .otp-digit {
    width: 44px;
    height: 52px;
    font-size: 21px;
  }
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 37, 61, 0.52);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.16s ease;
}

.modal-dialog {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  max-height: 90dvh;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popIn 0.18s ease;
}

.modal-dialog.modal-sm { max-width: 400px; }
.modal-dialog.modal-lg { max-width: 780px; }
.modal-dialog.modal-xl { max-width: 980px; }

.modal-header {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-title {
  font-size: 16.5px;
  font-weight: 700;
  min-width: 0;
  line-height: 1.35;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--slate-500);
  cursor: pointer;
  min-width: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 8px;
  flex-shrink: 0;
}
.modal-close:hover {
  background: var(--slate-100);
  color: var(--slate-800);
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.modal-footer {
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  background: var(--slate-50);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-footer .btn {
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
}

@media (max-width: 640px) {
  .form-control, .form-select {
    font-size: 16px;
  }
}

@media (max-width: 560px) {
  .modal-backdrop {
    padding: 10px;
  }
  .modal-header {
    padding: 13px 14px;
  }
  .modal-body {
    padding: 14px;
  }
  .modal-footer {
    padding: 11px 14px;
  }
  .card-header,
  .card-body {
    padding: 13px 14px;
  }
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 32px);
  width: 360px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--slate-900);
  color: #ffffff;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-left: 4px solid var(--primary);
  animation: slideIn 0.2s ease;
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--info); }

.toast-close {
  background: none;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex-shrink: 0;
}
.toast-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* ---------- Spinner & Empty State ---------- */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-dark {
  border-color: rgba(15, 23, 42, 0.16);
  border-top-color: var(--primary);
}

/* ---------- Branded HFT Rotating-Ring Logo Loader (Global, Inline & Image Upload) ---------- */
.hft-logo-spinner {
  position: relative;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hft-logo-spinner.is-sm {
  width: 40px;
  height: 40px;
}

.hft-logo-spinner.is-lg {
  width: 68px;
  height: 68px;
}

.hft-logo-spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3.5px solid rgba(43, 125, 233, 0.14);
  border-top-color: #20b4ec;
  border-right-color: #2b7de9;
  animation: spin 0.85s cubic-bezier(0.5, 0.18, 0.5, 0.82) infinite;
}

.hft-logo-spinner.is-sm .hft-logo-spinner-ring {
  border-width: 3px;
}

.hft-logo-spinner.is-lg .hft-logo-spinner-ring {
  border-width: 4px;
}

.hft-logo-spinner-img {
  width: 58%;
  height: 58%;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(43, 125, 233, 0.14));
}

.hft-global-loader {
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 249, 254, 0.58);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, visibility 0.16s ease;
}

.hft-global-loader.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hft-global-loader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 176px;
  max-width: 280px;
  padding: 20px 26px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(43, 125, 233, 0.18);
  box-shadow: 0 18px 44px rgba(20, 37, 61, 0.14);
  text-align: center;
}

.hft-global-loader-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--slate-800);
  line-height: 1.35;
}

.hft-loader-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 20px;
  text-align: center;
  color: var(--slate-700);
}

.hft-loader-inline.is-compact {
  padding: 20px 14px;
  gap: 8px;
}

.hft-loader-inline .hft-loader-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-800);
}

.hft-loader-inline .hft-loader-subtext {
  font-size: 12.5px;
  color: var(--text-muted);
}

.hft-loader-inline.is-dark .hft-logo-spinner-ring {
  border-color: rgba(56, 189, 248, 0.22);
  border-top-color: #38bdf8;
  border-right-color: #60a5fa;
}

.hft-loader-inline.is-dark .hft-loader-text {
  color: #f1f5f9;
}

.hft-loader-inline.is-dark .hft-loader-subtext {
  color: #94a3b8;
}

.hft-upload-spinner-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(2px);
}

@media print {
  .hft-global-loader {
    display: none !important;
  }
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ==========================================================================
   Thermal Receipt Styles (Shared by Screen Preview & 80mm / 58mm Print)
   ========================================================================== */
.receipt-preview-paper {
  background: #ffffff;
  border: 1px dashed var(--slate-400);
  border-radius: 8px;
  padding: 14px 12px;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.38;
  color: #0f172a;
}

.receipt-vendor-banner {
  text-align: center;
  border: 1px dashed #1e293b;
  border-radius: 4px;
  padding: 4px 6px;
  margin-bottom: 8px;
  font-size: 9.5px;
  line-height: 1.3;
  color: #0f172a;
}

.receipt-vendor-name {
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.receipt-vendor-contact {
  font-weight: 600;
}

.receipt-center { text-align: center; }
.receipt-bold { font-weight: 700; }

.receipt-rest-name {
  font-size: 13.5px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 1px;
}

.receipt-rest-sub {
  font-size: 10.5px;
  color: #334155;
}

.receipt-doc-title {
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 6px 0 4px;
}

.receipt-divider {
  border: none;
  border-top: 1px dashed #000000;
  margin: 6px 0;
}

.receipt-meta-grid {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 6px;
  font-size: 11px;
}

.receipt-meta-grid td {
  padding: 1.5px 2px;
  vertical-align: top;
}

.receipt-meta-right {
  text-align: right;
  white-space: nowrap;
}

.receipt-grid-table {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 6px;
  font-size: 11px;
}

.receipt-grid-table th,
.receipt-grid-table td {
  border: 1px solid #000000;
  padding: 3.5px 4px;
  vertical-align: top;
}

.receipt-grid-table th {
  font-weight: 700;
  text-align: center;
  background: #f8fafc;
  white-space: nowrap;
}

.receipt-grid-table .col-stt { width: 8%; text-align: center; }
.receipt-grid-table .col-name { text-align: left; word-break: break-word; }
.receipt-grid-table .col-qty { width: 10%; text-align: center; white-space: nowrap; }
.receipt-grid-table .col-price { width: 21%; text-align: right; white-space: nowrap; }
.receipt-grid-table .col-amt { width: 24%; text-align: right; white-space: nowrap; }

.receipt-sub-line {
  font-size: 9.5px;
  color: #334155;
  margin-top: 1px;
}

.receipt-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  margin: 2px 0;
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
  font-weight: 800;
  margin: 4px 0;
}

.receipt-qr-box {
  text-align: center;
  margin: 8px 0 4px;
  font-size: 11px;
}

.receipt-qr-box img {
  width: 150px;
  max-width: 100%;
  height: auto;
  margin: 5px auto;
  display: block;
}

.receipt-footer {
  text-align: center;
  font-size: 11px;
  margin-top: 6px;
}

/* ==========================================================================
   Full-Screen Image Lightbox Viewer (Bottom Close X + Click-Outside Dismiss)
   ========================================================================== */
.zoomable-img,
.img-uploader-preview.has-image {
  cursor: zoom-in;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.zoomable-img:hover,
.img-uploader-preview.has-image:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 14px rgba(43, 125, 233, 0.18);
}

.img-lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2600;
  background: rgba(15, 28, 46, 0.9);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px 16px;
  animation: fadeIn 0.16s ease;
  cursor: zoom-out;
}

.img-lightbox-stage {
  max-width: min(94vw, 960px);
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: default;
}

.img-lightbox-img {
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  animation: popIn 0.18s ease;
}

.img-lightbox-caption {
  color: #e2e8f0;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  max-width: 90vw;
}

.img-lightbox-close-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(15, 28, 46, 0.78);
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.img-lightbox-close-btn:hover {
  background: rgba(209, 67, 67, 0.9);
  border-color: #ffffff;
  transform: scale(1.08);
}

/* ==========================================================================
   Daily Check-In Gate Overlay (Mandatory for MONTHLY Staff & Kitchen)
   ========================================================================== */
.checkin-gate-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(20, 37, 61, 0.74);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.checkin-gate-card {
  width: 100%;
  max-width: 460px;
  margin: auto;
  background: #ffffff;
  border-radius: 20px;
  padding: 26px 22px;
  box-shadow: 0 24px 60px rgba(20, 37, 61, 0.36);
  color: var(--slate-900);
  text-align: center;
  animation: popIn 0.22s ease;
}

/* ==========================================================================
   Shared Layout & Simplification Primitives (v91)
   ========================================================================== */
.kpi-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1120px) {
  .kpi-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .kpi-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpi-grid-4 .kpi-card {
    padding: 12px 13px;
  }
  .kpi-grid-4 .kpi-label {
    font-size: 10.5px;
    line-height: 1.3;
  }
  .kpi-grid-4 .kpi-value {
    font-size: 18px;
    margin-top: 4px;
  }
}

.btn-guide-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark, #1d4ed8);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-guide-toggle:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.guide-collapsible-box {
  background: #f8fbff;
  border: 1px solid #bfdbfe;
  border-left: 3.5px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--slate-700);
}
.guide-collapsible-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.settings-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
@media (min-width: 1024px) {
  .settings-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.payment-mode-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.quick-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.quick-filter-pill {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--slate-700);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.quick-filter-pill:hover {
  border-color: var(--primary-border);
  color: var(--primary-dark);
  background: var(--primary-light);
}
.quick-filter-pill.is-active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

@media (max-width: 768px) {
  .table-wrap {
    background-image:
      linear-gradient(to right, #ffffff, #ffffff),
      linear-gradient(to right, #ffffff, #ffffff),
      linear-gradient(to right, rgba(20, 37, 61, 0.08), rgba(255, 255, 255, 0)),
      linear-gradient(to left, rgba(20, 37, 61, 0.08), rgba(255, 255, 255, 0));
    background-position: left center, right center, left center, right center;
    background-repeat: no-repeat;
    background-size: 18px 100%, 18px 100%, 12px 100%, 12px 100%;
    background-attachment: local, local, scroll, scroll;
  }
}

.checkin-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid var(--primary-border);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 12px;
}

.checkin-gate-date-box {
  background: var(--slate-50);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 16px 0;
  text-align: left;
  display: grid;
  gap: 6px;
  font-size: 13.5px;
}

.checkin-gate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.pwa-ctrl-btn.pwa-push-on {
  background: var(--success-bg) !important;
  color: #166534 !important;
  border-color: #bbf7d0 !important;
}

.pwa-install-btn {
  background: var(--primary-light) !important;
  color: var(--primary-dark) !important;
  border-color: var(--primary-border) !important;
}

/* ---------- Active Login Sessions & Remote Sign-Out ---------- */
.login-sessions-list {
  display: grid;
  gap: 10px;
}

.login-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.login-session-item.is-current {
  background: var(--primary-light);
  border-color: var(--primary-border);
}

.login-session-left {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
  flex: 1 1 auto;
}

.login-session-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--slate-100);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.login-session-item.is-current .login-session-icon {
  background: #ffffff;
  border-color: var(--primary-border);
}

.login-session-info {
  min-width: 0;
  flex: 1 1 auto;
}

.login-session-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-900);
}

.login-session-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.45;
  word-break: break-word;
}

.login-session-actions {
  flex-shrink: 0;
}

.btn-remote-logout {
  background: #ffffff;
  color: var(--danger);
  border: 1px solid #f4c7c9;
}

.btn-remote-logout:hover:not(:disabled) {
  background: var(--danger-bg);
  border-color: var(--danger);
}

@media (max-width: 560px) {
  .login-session-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .login-session-actions {
    display: flex;
    justify-content: flex-end;
  }
  .login-session-actions .btn {
    width: 100%;
  }
}

.kds-hr-hero {
  background: var(--primary);
  color: #ffffff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.kds-hr-amount {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0 4px;
}

.kds-hr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 12.5px;
}

/* ==========================================================================
   Thermal Receipt Print Area (#print-bill-area) — 80mm / 58mm Standard
   Hidden on screen, ONLY element visible during window.print()
   ========================================================================== */
#print-bill-area {
  display: none;
}

@media print {
  @page {
    size: 80mm auto;
    margin: 0;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    width: 80mm !important;
  }

  body > *:not(#print-bill-area) {
    display: none !important;
  }

  #print-bill-area {
    display: block !important;
    width: 74mm;
    margin: 0 auto;
    padding: 3mm 2mm 8mm;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 11.5px;
    line-height: 1.35;
    color: #000000;
  }

  #print-bill-area .receipt-vendor-banner {
    border-color: #000000;
    color: #000000;
  }

  #print-bill-area .receipt-rest-sub,
  #print-bill-area .receipt-sub-line {
    color: #000000;
  }

  #print-bill-area .receipt-grid-table th {
    background: transparent !important;
  }

  #print-bill-area .receipt-qr-box img {
    width: 46mm;
  }

  /* Compact 58mm thermal paper layout */
  #print-bill-area.print-58mm {
    width: 52mm;
    padding: 2mm 1mm 6mm;
    font-size: 9.5px;
  }

  #print-bill-area.print-58mm .receipt-vendor-banner {
    font-size: 8px;
    padding: 3px 4px;
  }

  #print-bill-area.print-58mm .receipt-doc-title {
    font-size: 13px;
  }

  #print-bill-area.print-58mm .receipt-meta-grid {
    font-size: 9px;
  }

  #print-bill-area.print-58mm .receipt-grid-table {
    font-size: 8.8px;
  }

  #print-bill-area.print-58mm .receipt-grid-table th,
  #print-bill-area.print-58mm .receipt-grid-table td {
    padding: 2px 2px;
  }

  #print-bill-area.print-58mm .receipt-total-row {
    font-size: 12.5px;
  }

  #print-bill-area.print-58mm .receipt-qr-box img {
    width: 36mm;
  }
}

/* ==========================================================================
   Modern Ops v93: Voice Toggle, Busy/Idle Chip, Assist Order, Takeaway,
   Visual 7-Day Work Schedule, Coverage Lanes & Two-Way Salary Negotiation
   ========================================================================== */
.voice-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--slate-700);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.voice-toggle-btn.is-voice-on {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}
.voice-toggle-btn.is-voice-off {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

.staff-busy-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid #86efac;
  background: #ecfdf5;
  color: #166534;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.staff-busy-chip.is-busy {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.assist-order-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.assist-cat-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.assist-cat-chips .area-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--slate-700);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.assist-cat-chips .area-filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}
.assist-cat-chips .area-filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.assist-dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
  padding: 2px;
}
.assist-dish-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
}
.assist-dish-card.is-selected {
  border-color: #2b7de9;
  background: #f0f7ff;
}
.assist-cart-panel {
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.schedule-kpi-hero {
  background: linear-gradient(135deg, #1d4ed8 0%, #0ea5e9 100%);
  color: #ffffff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.18);
}
.schedule-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.schedule-kpi-box {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 8px 10px;
}
.schedule-kpi-box .kpi-lbl {
  font-size: 11px;
  opacity: 0.9;
}
.schedule-kpi-box .kpi-val {
  font-size: 15px;
  font-weight: 800;
  margin-top: 2px;
}
.schedule-kpi-box .kpi-sub {
  font-size: 11px;
  opacity: 0.85;
}

.emp-week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(84px, 1fr));
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.emp-day-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #ffffff;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.emp-day-card.is-today {
  border-color: #93c5fd;
  background: #eff6ff;
}
.emp-day-card.is-selected {
  border-color: #2563eb;
  background: #dbeafe;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}
.emp-day-card.is-disabled {
  opacity: 0.65;
}
.emp-day-dow {
  font-size: 11px;
  font-weight: 700;
  color: var(--slate-600);
}
.emp-day-num {
  font-size: 14px;
  font-weight: 800;
  color: var(--slate-900);
}
.emp-day-slot {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
}
.emp-day-slot.is-open { background: #dcfce7; color: #166534; }
.emp-day-slot.is-full { background: #fee2e2; color: #b91c1c; }
.emp-day-slot.is-past { background: #e2e8f0; color: #475569; }
.emp-day-peers {
  font-size: 10px;
  color: var(--text-muted);
}

.schedule-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.schedule-history-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 4px solid #cbd5e1;
  background: #ffffff;
}
.schedule-history-row.is-approved {
  border-left-color: #16a34a;
  background: #f0fdf4;
}
.schedule-history-row.is-pending {
  border-left-color: #f97316;
  background: #fff7ed;
}
.schedule-history-row.is-rejected {
  border-left-color: #dc2626;
  background: #fef2f2;
}
.schedule-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}
.schedule-status-pill.is-approved { background: #dcfce7; color: #15803d; }
.schedule-status-pill.is-pending { background: #ffedd5; color: #c2410c; }
.schedule-status-pill.is-cancelled { background: #e2e8f0; color: #475569; }
.schedule-status-pill.is-rejected { background: #fee2e2; color: #b91c1c; }

.salary-proposal-banner {
  border-radius: 12px;
  padding: 14px;
  border: 1.5px solid #fdba74;
  background: #fff7ed;
}
.salary-proposal-banner.is-action-needed {
  border-color: #ef4444;
  background: #fef2f2;
}

.owner-two-lanes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.owner-role-lane {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8fafc;
}
.owner-role-lane.is-kitchen {
  border-color: #fed7aa;
  background: #fffaf5;
}
.coverage-bar-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.coverage-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.25s ease;
}
.coverage-bar-fill.is-ok { background: #16a34a; }
.coverage-bar-fill.is-mid { background: #f59e0b; }
.coverage-bar-fill.is-low { background: #ef4444; }

.owner-shift-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 4px solid #cbd5e1;
}
.owner-shift-pill.is-approved { border-left-color: #16a34a; }
.owner-shift-pill.is-pending { border-left-color: #f97316; }
.owner-shift-pill.is-rejected { border-left-color: #dc2626; }

.takeaway-live-card {
  border: 1.5px solid #5eead4;
  background: #f0fdfa;
  border-radius: 12px;
  padding: 12px;
}
.takeaway-live-card.has-pending {
  border-color: #f97316;
  background: #fff7ed;
}

.kds-confirm-armed {
  background: #f59e0b !important;
  border-color: #d97706 !important;
  color: #111827 !important;
  font-weight: 900 !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35) !important;
}

@media (max-width: 760px) {
  .owner-two-lanes-grid {
    grid-template-columns: 1fr;
  }
  .schedule-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Theme Toggle Pill & Role-First Login Picker + Advance Reservation Portal
   ========================================================================== */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--slate-700);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.theme-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}
.theme-toggle-btn.is-dark {
  background: #1e293b;
  border-color: #334155;
  color: #fde68a;
}
.theme-toggle-btn.is-compact {
  padding: 5px 8px;
  min-width: 34px;
}

.auth-theme-corner {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 6px;
}

/* 3-Role Welcome Picker on login.html */
.role-picker-title {
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  color: var(--slate-900);
  margin: 0 0 14px;
}
.role-picker-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.role-choice-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--slate-900);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease, background 0.16s ease;
}
.role-choice-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 6px 18px rgba(43, 125, 233, 0.12);
  transform: translateY(-1px);
}
.role-choice-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--primary-light);
  flex-shrink: 0;
}
.role-choice-btn.is-guest .role-choice-icon { background: #ecfdf5; }
.role-choice-btn.is-owner .role-choice-icon { background: #eef5fe; }
.role-choice-btn.is-staff .role-choice-icon { background: #fff7ed; }
.role-choice-name {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--slate-900);
}
.role-choice-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}
.role-choice-arrow {
  margin-left: auto;
  color: var(--slate-400);
  font-size: 18px;
  font-weight: 700;
}
.role-back-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

/* Public Advance Reservation Portal (/reserve.html) */
.reserve-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 14px 48px;
  min-height: 100vh;
}
.reserve-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.reserve-rest-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.reserve-rest-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--primary-light);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.reserve-rest-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.reserve-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.reserve-tab-btn {
  padding: 11px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--slate-700);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}
.reserve-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(43, 125, 233, 0.22);
}
.reserve-date-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
}
.reserve-date-chip {
  min-width: 78px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--slate-800);
  text-align: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.reserve-date-chip:hover {
  border-color: var(--primary);
}
.reserve-date-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
.reserve-date-chip .rd-dow {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
}
.reserve-date-chip .rd-num {
  font-size: 14.5px;
  font-weight: 800;
  margin-top: 2px;
}
.reserve-floor-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}
.reserve-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.reserve-table-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 10px;
  border-radius: 12px;
  border: 1.5px solid #86efac;
  background: #ecfdf5;
  color: #065f46;
  cursor: pointer;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.reserve-table-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #16a34a;
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.16);
}
.reserve-table-card.is-booked {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
  cursor: not-allowed;
  opacity: 0.78;
}
.reserve-table-num {
  font-size: 16px;
  font-weight: 900;
}
.reserve-table-state {
  font-size: 11.5px;
  font-weight: 700;
}
.reserve-dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.reserve-dish-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  align-items: center;
}
.reserve-dish-card.is-oos {
  opacity: 0.65;
}
.reserve-dish-thumb {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--slate-100);
  flex-shrink: 0;
}
.reserve-dish-thumb-placeholder {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  background: var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

/* ==========================================================================
   GLOBAL DARK MODE ([data-theme="dark"]) — Crisp Slate & Electric Azure
   ========================================================================== */
[data-theme="dark"] {
  --primary: #4f9cf9;
  --primary-hover: #3b82f6;
  --primary-dark: #93c5fd;
  --primary-accent: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-soft: rgba(59, 130, 246, 0.15);
  --primary-border: #1e3a5f;
  --brand-navy: #e2e8f0;

  --slate-900: #f1f5f9;
  --slate-800: #e2e8f0;
  --slate-700: #cbd5e1;
  --slate-600: #94a3b8;
  --slate-500: #94a3b8;
  --slate-400: #64748b;
  --slate-300: #334155;
  --slate-200: #263348;
  --slate-100: #1b2537;
  --slate-50: #141d2e;

  --success: #34d399;
  --success-bg: rgba(16, 185, 129, 0.16);
  --success-soft: rgba(16, 185, 129, 0.16);
  --warning: #fbbf24;
  --warning-bg: rgba(245, 158, 11, 0.16);
  --warning-soft: rgba(245, 158, 11, 0.16);
  --danger: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.18);
  --danger-soft: rgba(239, 68, 68, 0.18);
  --info: #60a5fa;
  --info-bg: rgba(59, 130, 246, 0.16);
  --info-soft: rgba(59, 130, 246, 0.16);
  --accent-teal: #2dd4bf;
  --accent-teal-bg: rgba(20, 184, 166, 0.14);
  --accent-teal-border: rgba(45, 212, 191, 0.42);
  --accent-orange: #fb923c;
  --accent-orange-bg: rgba(249, 115, 22, 0.15);
  --accent-orange-border: rgba(251, 146, 60, 0.42);

  --bg: #0b1220;
  --bg-page: #0b1220;
  --surface: #111b2e;
  --text: #e6eef8;
  --text-muted: #94a3b8;
  --border: #23324a;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] body,
[data-theme="dark"] .auth-page {
  background: var(--bg);
  color: var(--text);
}

[data-theme="dark"] .toast {
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  border-left: 4px solid var(--primary);
}
[data-theme="dark"] .btn-secondary {
  background: #334155;
  color: #f8fafc;
}
[data-theme="dark"] .btn-secondary:hover:not(:disabled) {
  background: #475569;
}
[data-theme="dark"] .btn-success {
  background: #059669;
  color: #ffffff;
}
[data-theme="dark"] .btn-success:hover:not(:disabled) {
  background: #047857;
}
[data-theme="dark"] .btn-danger {
  background: #dc2626;
  color: #ffffff;
}
[data-theme="dark"] .btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}
[data-theme="dark"] .header-call-btn,
[data-theme="dark"] .fab-call-staff {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid rgba(147, 197, 253, 0.35);
}
[data-theme="dark"] .header-call-btn:active,
[data-theme="dark"] .fab-call-staff:hover {
  background: var(--primary-hover);
}

[data-theme="dark"] .card,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .topbar,
[data-theme="dark"] .staff-header,
[data-theme="dark"] .staff-bottom-nav,
[data-theme="dark"] .guest-header,
[data-theme="dark"] .guest-cart-bar,
[data-theme="dark"] .modal-dialog,
[data-theme="dark"] .assist-dish-card,
[data-theme="dark"] .emp-day-card,
[data-theme="dark"] .owner-shift-pill,
[data-theme="dark"] .owner-role-lane,
[data-theme="dark"] .owner-role-lane.is-kitchen,
[data-theme="dark"] .owner-role-lane.is-staff,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .table-card,
[data-theme="dark"] .dish-card,
[data-theme="dark"] .order-card,
[data-theme="dark"] .sheet-panel,
[data-theme="dark"] .guest-sheet,
[data-theme="dark"] .drawer-panel,
[data-theme="dark"] .subtabs {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .emp-day-card.is-today {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(96, 165, 250, 0.45);
}

[data-theme="dark"] .card-header,
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer,
[data-theme="dark"] .data-table thead th,
[data-theme="dark"] .auth-mode-tabs {
  background: #162238 !important;
  border-color: var(--border) !important;
  color: var(--slate-800);
}

[data-theme="dark"] .data-table tbody tr {
  background: var(--surface);
  border-color: var(--border);
}
[data-theme="dark"] .data-table tbody tr:hover {
  background: #182640;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="month"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #0d1626 !important;
  border-color: #2b3d59 !important;
  color: #f1f5f9 !important;
}
[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #64748b;
}

[data-theme="dark"] .btn-outline,
[data-theme="dark"] .icon-pill-btn,
[data-theme="dark"] .subtab-btn,
[data-theme="dark"] .assist-cat-chips .area-filter-chip,
[data-theme="dark"] .cat-chip {
  background: #162238;
  border-color: #2b3d59;
  color: #cbd5e1;
}
[data-theme="dark"] .btn-outline:hover,
[data-theme="dark"] .subtab-btn:hover {
  background: #1e3050;
  color: #ffffff;
}
[data-theme="dark"] .subtab-btn.active,
[data-theme="dark"] .assist-cat-chips .area-filter-chip.active,
[data-theme="dark"] .auth-mode-tab.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .nav-item {
  color: #cbd5e1;
}
[data-theme="dark"] .nav-item:hover {
  background: #182640;
  color: #ffffff;
}
[data-theme="dark"] .nav-item.active {
  background: rgba(79, 156, 249, 0.18);
  color: #93c5fd;
}

[data-theme="dark"] .alert-info {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #bfdbfe;
}
[data-theme="dark"] .alert-success {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}
[data-theme="dark"] .alert-warning {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde68a;
}
[data-theme="dark"] .alert-danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.38);
  color: #fecaca;
}

[data-theme="dark"] .badge-neutral {
  background: #1e293b;
  color: #cbd5e1;
}
[data-theme="dark"] .badge-success {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}
[data-theme="dark"] .badge-warning {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
}
[data-theme="dark"] .badge-danger {
  background: rgba(239, 68, 68, 0.24);
  color: #fca5a5;
}
[data-theme="dark"] .badge-info,
[data-theme="dark"] .badge-primary {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}

[data-theme="dark"] .voice-toggle-btn.is-voice-on {
  background: rgba(22, 163, 74, 0.2);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}
[data-theme="dark"] .voice-toggle-btn.is-voice-off {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}
[data-theme="dark"] .staff-busy-chip {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}
[data-theme="dark"] .staff-busy-chip.is-busy {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}
[data-theme="dark"] .takeaway-live-card {
  background: rgba(20, 184, 166, 0.12);
  border-color: rgba(45, 212, 191, 0.4);
}
[data-theme="dark"] .takeaway-live-card.has-pending {
  background: rgba(249, 115, 22, 0.14);
  border-color: rgba(251, 146, 60, 0.5);
}
[data-theme="dark"] .salary-proposal-banner.is-action-needed {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.45);
}
[data-theme="dark"] .salary-proposal-banner.is-waiting {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(251, 191, 36, 0.45);
}
[data-theme="dark"] .emp-day-card.is-selected {
  background: rgba(59, 130, 246, 0.22) !important;
  border-color: #60a5fa !important;
}
[data-theme="dark"] .assist-dish-card.is-selected {
  background: rgba(59, 130, 246, 0.18) !important;
  border-color: #60a5fa !important;
}
[data-theme="dark"] .role-choice-btn:hover {
  background: rgba(59, 130, 246, 0.16);
  border-color: #60a5fa;
}
[data-theme="dark"] .role-choice-btn.is-guest .role-choice-icon { background: rgba(16, 185, 129, 0.18); }
[data-theme="dark"] .role-choice-btn.is-owner .role-choice-icon { background: rgba(59, 130, 246, 0.18); }
[data-theme="dark"] .role-choice-btn.is-staff .role-choice-icon { background: rgba(249, 115, 22, 0.18); }
[data-theme="dark"] .reserve-table-card {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
}
[data-theme="dark"] .reserve-table-card.is-booked {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}
[data-theme="dark"] .auth-brand-wrap,
[data-theme="dark"] .brand-logo,
[data-theme="dark"] .staff-avatar,
[data-theme="dark"] .guest-logo,
[data-theme="dark"] .qr-card-img,
[data-theme="dark"] .qr-locked-preview {
  background: #ffffff;
  border-radius: 10px;
}
[data-theme="dark"] code {
  background: #1b2537 !important;
  color: #93c5fd !important;
  border-color: #2b3d59 !important;
}
[data-theme="dark"] .ws-pill {
  background: #162238;
  border-color: #2b3d59;
  color: #cbd5e1;
}
[data-theme="dark"] .staff-rest-banner {
  background: #162238;
  border-color: #2b3d59;
}
[data-theme="dark"] .otp-digit {
  background: #0d1626;
  border-color: #334155;
  color: #f8fafc;
}
[data-theme="dark"] .modal-close {
  color: #cbd5e1;
}
[data-theme="dark"] .modal-close:hover {
  background: #23324a;
  color: #ffffff;
}

/* Complete Dark Mode parity across owner.css, staff.css, kitchen.css, guest.css & admin.css
   Uses natural [data-theme="dark"] specificity (no blanket !important) so active/selected/filled states stay vibrant! */
[data-theme="dark"] .table-live-card,
[data-theme="dark"] .table-live-card.state-AVAILABLE,
[data-theme="dark"] .plan-card,
[data-theme="dark"] .plan-card.is-ultra,
[data-theme="dark"] .plan-card.is-free,
[data-theme="dark"] .filter-bar,
[data-theme="dark"] .owner-onboarding-card,
[data-theme="dark"] .onboarding-step-btn,
[data-theme="dark"] .payment-mode-card,
[data-theme="dark"] .payment-mode-option,
[data-theme="dark"] .payment-mode-strip,
[data-theme="dark"] .guide-collapsible-box,
[data-theme="dark"] .quick-filter-pill,
[data-theme="dark"] .schedule-history-row,
[data-theme="dark"] .img-uploader-preview,
[data-theme="dark"] .btn-remote-logout,
[data-theme="dark"] .urgent-alert-row,
[data-theme="dark"] .handover-review-panel,
[data-theme="dark"] .handover-review-card,
[data-theme="dark"] .tax-pit-card,
[data-theme="dark"] .tax-hero-card,
[data-theme="dark"] .tax-wallet-strip,
[data-theme="dark"] .tax-details-box,
[data-theme="dark"] .tax-choice-card,
[data-theme="dark"] .tax-pay-opt,
[data-theme="dark"] .staff-order-card,
[data-theme="dark"] .call-card,
[data-theme="dark"] .pay-table-card,
[data-theme="dark"] .pay-method-option,
[data-theme="dark"] .handover-qr-card,
[data-theme="dark"] .handover-bank-meta,
[data-theme="dark"] .handover-bill-checklist,
[data-theme="dark"] .handover-req-card,
[data-theme="dark"] .kds-ticket,
[data-theme="dark"] .kds-item-tap-btn,
[data-theme="dark"] .drawer-search-bar,
[data-theme="dark"] .gateway-status-hero,
[data-theme="dark"] .target-radio-card,
[data-theme="dark"] .plan-module-toggle,
[data-theme="dark"] .loyalty-phone-display,
[data-theme="dark"] .pin-dot,
[data-theme="dark"] .ios-key,
[data-theme="dark"] .promo-preview-banner,
[data-theme="dark"] .fav-dish-card,
[data-theme="dark"] .dish-step-btn,
[data-theme="dark"] .host-setting-row,
[data-theme="dark"] .mobile-menu-btn,
[data-theme="dark"] .chip-filter-btn,
[data-theme="dark"] .staff-area-chip {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .table-live-card.state-OCCUPIED,
[data-theme="dark"] .dish-card.in-cart,
[data-theme="dark"] .payment-mode-option.is-active,
[data-theme="dark"] .tax-choice-card:has(input:checked),
[data-theme="dark"] .tax-pay-opt:has(input:checked),
[data-theme="dark"] .urgent-alert-row.is-info,
[data-theme="dark"] .inline-transfer-qr-box,
[data-theme="dark"] .handover-reminder-bar,
[data-theme="dark"] .btn-guide-toggle,
[data-theme="dark"] .plan-mod-chip,
[data-theme="dark"] .pay-method-option.selected,
[data-theme="dark"] .target-radio-card.selected,
[data-theme="dark"] .plan-module-toggle.is-checked,
[data-theme="dark"] .gateway-status-hero.is-payos,
[data-theme="dark"] .drawer-header.is-info {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(96, 165, 250, 0.45);
  color: #dbeafe;
}
[data-theme="dark"] .chip-filter-btn.active,
[data-theme="dark"] .staff-area-chip.active,
[data-theme="dark"] .quick-filter-pill.active,
[data-theme="dark"] .dish-step-btn.is-inc,
[data-theme="dark"] .pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}
[data-theme="dark"] .table-live-card.state-REQUESTING_PAYMENT,
[data-theme="dark"] .kds-ticket.status-CONFIRMED .kds-ticket-head,
[data-theme="dark"] .kds-wait-timer.warn,
[data-theme="dark"] .kds-note-callout,
[data-theme="dark"] .kds-item-tap-btn.is-preparing,
[data-theme="dark"] .call-card.waiting-guest,
[data-theme="dark"] .handover-screenshot-tip,
[data-theme="dark"] .handover-req-card.status-PENDING,
[data-theme="dark"] .schedule-history-row.is-pending,
[data-theme="dark"] .host-header-chip.is-alert {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(251, 191, 36, 0.45);
  color: #fef3c7;
}
[data-theme="dark"] .onboarding-step-btn.is-done,
[data-theme="dark"] .tax-pit-card.is-recommended,
[data-theme="dark"] .payment-mode-option.is-mode2.is-active,
[data-theme="dark"] .kds-item-row.item-DONE,
[data-theme="dark"] .kds-item-tap-btn.is-done,
[data-theme="dark"] .kds-wait-timer.ok,
[data-theme="dark"] .kds-action-btn.done-secondary,
[data-theme="dark"] .call-card.mine,
[data-theme="dark"] .pay-table-card.claimed-me,
[data-theme="dark"] .handover-step.done,
[data-theme="dark"] .handover-req-card.status-APPROVED,
[data-theme="dark"] .plan-module-toggle.is-mandatory,
[data-theme="dark"] .schedule-history-row.is-approved {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
  color: #d1fae5;
}
[data-theme="dark"] .urgent-alerts-bar,
[data-theme="dark"] .holding-card-overdue,
[data-theme="dark"] .call-card.rerequest,
[data-theme="dark"] .call-card.rerequest .call-content-box,
[data-theme="dark"] .drawer-header,
[data-theme="dark"] .handover-req-card.status-REJECTED,
[data-theme="dark"] .schedule-history-row.is-rejected,
[data-theme="dark"] .handover-reject-chip:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}
[data-theme="dark"] .kds-item-row.item-DONE .kds-dish-name,
[data-theme="dark"] .step-pill.done,
[data-theme="dark"] .pwa-ctrl-btn.pwa-push-on {
  color: #6ee7b7 !important;
}
[data-theme="dark"] .schedule-status-pill.is-approved,
[data-theme="dark"] .emp-day-slot.is-open {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
}
[data-theme="dark"] .schedule-status-pill.is-pending {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
}
[data-theme="dark"] .schedule-status-pill.is-rejected,
[data-theme="dark"] .emp-day-slot.is-full {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}
[data-theme="dark"] .schedule-status-pill.is-cancelled,
[data-theme="dark"] .emp-day-slot.is-past {
  background: #1e293b;
  color: #94a3b8;
}
[data-theme="dark"] .coverage-bar-track,
[data-theme="dark"] .ios-keypad {
  background: #1e293b;
  border-color: var(--border);
}
[data-theme="dark"] .ios-key-letters {
  color: #94a3b8;
}
[data-theme="dark"] .ios-key-muted,
[data-theme="dark"] .ios-key-blank {
  background: #0f172a;
  color: #cbd5e1;
}
[data-theme="dark"] .ios-key:active:not(:disabled),
[data-theme="dark"] .ios-key-muted:active:not(:disabled) {
  background: #1e2d47;
}
[data-theme="dark"] .login-session-item.is-current .login-session-icon {
  background: #162238;
  color: #93c5fd;
}
[data-theme="dark"] .table-wrap {
  background-image: none;
}
[data-theme="dark"] .auth-brand-wrap {
  padding: 6px 14px;
  display: inline-flex;
}

/* ==========================================================================
   FIXED-SHIFT WORK SCHEDULE MODE (Owner Shift Builder + Employee 1-Tap Cards)
   ========================================================================== */
.sched-mode-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 640px) {
  .sched-mode-picker {
    grid-template-columns: 1fr;
  }
}
.sched-mode-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.sched-mode-opt:hover {
  border-color: var(--primary);
}
.sched-mode-opt.is-active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 4px 14px rgba(43, 125, 233, 0.14);
}
.sched-mode-opt input[type="radio"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.owner-shifts-box {
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--primary);
  background: var(--primary-light);
  margin-bottom: 14px;
}
.owner-shift-builder-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.5fr) minmax(110px, 1fr) minmax(110px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}
@media (max-width: 680px) {
  .owner-shift-builder-row {
    grid-template-columns: 1fr 1fr;
  }
  .owner-shift-builder-row .osb-name-wrap {
    grid-column: 1 / -1;
  }
  .owner-shift-builder-row .osb-dur-badge {
    justify-self: start;
  }
  .owner-shift-builder-row .osb-del-btn {
    justify-self: end;
  }
}
.emp-fixed-shift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.emp-fixed-shift-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--slate-900);
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.emp-fixed-shift-card:hover:not(:disabled) {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(43, 125, 233, 0.14);
}
.emp-fixed-shift-card.is-selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(43, 125, 233, 0.25);
}
.emp-fixed-shift-card.is-mine {
  border-color: #86efac;
  background: #ecfdf5;
  cursor: default;
}
.emp-fixed-shift-card.is-full {
  border-color: #fca5a5;
  background: #fef2f2;
  opacity: 0.78;
  cursor: not-allowed;
}
.emp-fixed-shift-card.is-ended {
  opacity: 0.58;
  cursor: not-allowed;
}
.emp-fixed-shift-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--slate-900);
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.emp-fixed-shift-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
}
.emp-fixed-shift-status {
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 2px;
}

[data-theme="dark"] .sched-mode-opt {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="dark"] .sched-mode-opt.is-active,
[data-theme="dark"] .owner-shifts-box {
  background: rgba(59, 130, 246, 0.14) !important;
  border-color: rgba(96, 165, 250, 0.45) !important;
}
[data-theme="dark"] .owner-shift-builder-row,
[data-theme="dark"] .emp-fixed-shift-card {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
[data-theme="dark"] .emp-fixed-shift-card.is-selected {
  background: rgba(59, 130, 246, 0.22) !important;
  border-color: #60a5fa !important;
}
[data-theme="dark"] .emp-fixed-shift-card.is-mine {
  background: rgba(16, 185, 129, 0.16) !important;
  border-color: rgba(52, 211, 153, 0.45) !important;
}
[data-theme="dark"] .emp-fixed-shift-card.is-full {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: rgba(248, 113, 113, 0.42) !important;
}
