:root {
  --bg-page: #f8f6f5;
  --bg-sidebar: #ffffff;
  --card: #ffffff;
  --primary: #ff6a3d;
  --primary-hover: #fa5a2a;
  --primary2: #ff4d6d;
  --text: #0f172a;
  --text-secondary: #475569;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --input-bg: #f1f5f9;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 28px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06);
  --shadow: 0 4px 12px rgba(0, 0, 0, .07);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, .12);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body.admin {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-page);
}

.hidden {
  display: none !important
}

/* ===================== */
/* Login                 */
/* ===================== */
.login-screen {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background: linear-gradient(135deg, #fdf8f6 0%, #f0ebe8 50%, #e8e4f0 100%);
}

.login-card {
  width: min(440px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
}

.login-title {
  font-size: 28px;
  font-weight: 900;
  margin: 0 0 6px
}

.login-subtitle {
  color: var(--text-secondary);
  margin: 0 0 14px;
  font-size: 14px
}

.login-row {
  display: flex;
  gap: 12px;
  align-items: center
}

.login-row input {
  flex: 1;
  height: 48px;
  border: none;
  border-radius: var(--radius);
  padding: 0 16px;
  outline: none;
  background: var(--input-bg);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  transition: box-shadow .2s;
}

.login-row input:focus {
  box-shadow: 0 0 0 3px rgba(255, 106, 61, .15)
}

.login-error {
  margin-top: 10px;
  color: #dc2626;
  font-weight: 600;
  font-size: 13px
}

/* Shake animation */
@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-10px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(10px);
  }
}

.shake {
  animation: shake 0.5s;
}

/* ===================== */
/* App layout            */
/* ===================== */
.app-shell {
  min-height: 100%;
}

/* ===================== */
/* Sidebar (Light theme) */
/* ===================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 40;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 8px;
  margin-bottom: 10px
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--primary), var(--primary2))
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0
}

.brand-name {
  font-weight: 900;
  color: var(--text);
  font-size: 16px;
  letter-spacing: .5px
}

.brand-ver {
  font-size: 11px;
  color: var(--muted)
}

/* Plan pill */
.plan {
  margin-bottom: 4px;
  padding: 0 4px
}

.plan-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: rgba(34, 197, 94, .08);
  border: 1px solid rgba(34, 197, 94, .18);
  color: #16a34a;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  outline: none;
  transition: opacity .2s;
  font-size: 13px;
}

.plan-pill:hover {
  opacity: .85
}

.plan-pill .plan-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 8px
}

.plan-pill .plan-text {
  font-size: 13px
}

.plan-pill .plan-days {
  opacity: .75;
  font-weight: 500
}

/* Navigation — Light sidebar */
.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1
}

.nav-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 500;
  font-family: var(--font);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all .15s ease;
  border-left: 3px solid transparent;
  margin-left: 0;
}

.nav-item:hover {
  background: rgba(0, 0, 0, .03);
  color: var(--text);
}

.nav-item.active {
  background: rgba(255, 106, 61, .06);
  color: var(--primary);
  font-weight: 700;
  border-left-color: var(--primary);
}

.nav-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-item.disabled {
  opacity: .3;
  cursor: not-allowed;
  filter: grayscale(1);
}

.nav-item--locked {
  opacity: 0.45;
  /* intentionally clickable — navigates to lock message inside the tab */
}

.sidebar-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Sidebar overlay backdrop for mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  backdrop-filter: blur(4px);
  z-index: 39;
}

.sidebar-backdrop.active {
  display: block
}

/* ===================== */
/* Main area             */
/* ===================== */
.main {
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 24px;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
}

/* Topbar */
.topbar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 16px;
  z-index: 30;
}

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

.topbar-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--text)
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap
}

/* Hamburger - hidden on desktop */
.menu-toggle {
  display: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background .2s;
}

.menu-toggle:hover {
  background: rgba(0, 0, 0, .05)
}

.menu-toggle .material-symbols-rounded {
  font-size: 24px
}

/* Search input */
.search {
  height: 42px;
  width: min(360px, 60vw);
  border-radius: var(--radius);
  border: none;
  padding: 0 14px;
  outline: none;
  background: var(--input-bg);
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  transition: box-shadow .2s;
}

.search:focus {
  box-shadow: 0 0 0 3px rgba(255, 106, 61, .15)
}

/* Branch selector */
.branch-selector {
  height: 36px;
  max-width: 200px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  padding: 0 10px;
  background: var(--input-bg);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color .2s;
}

.branch-selector:focus {
  border-color: var(--primary);
  outline: none
}

/* Branch rows in config */
.branch-row {
  padding: 14px;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.branch-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.branch-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1
}

.branch-info strong {
  font-size: 14px;
  color: var(--text)
}

.branch-info small {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.branch-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0
}

.branch-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600
}

.branch-status.active {
  background: #dcfce7;
  color: #166534
}

.branch-status.inactive {
  background: #fee2e2;
  color: #991b1b
}

/* Branch link + QR section */
.branch-link-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.branch-link-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.branch-link-input {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
  min-width: 0;
}

.branch-qr-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.branch-qr-wrap canvas {
  border-radius: 6px;
  border: 1px solid var(--line);
}

.branch-qr-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Branch inventory toggles */
.branch-toggle {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background .2s;
  background: var(--muted);
  flex-shrink: 0;
}

.branch-toggle.on {
  background: var(--success)
}

.branch-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}

.branch-toggle.on::after {
  transform: translateX(18px)
}

/* Branch filter pills (orders) */
.branch-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px
}

.branch-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all .2s;
}

.branch-pill.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff
}

.branch-pill .pill-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, .12);
  margin-left: 6px;
  padding: 0 4px;
}

.branch-pill.active .pill-badge {
  background: rgba(255, 255, 255, .25)
}

/* Order branch badge */
.order-branch-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--text-secondary);
  margin-left: 6px;
}

/* ===================== */
/* Cards                 */
/* ===================== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.card-title {
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 18px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tabs */
.tab {
  display: none
}

.tab.active {
  display: block
}

/* ===================== */
/* Forms — Modern Style  */
/* ===================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px
}

.field span {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.field input,
.field select {
  width: 100%;
  height: 46px;
  border-radius: var(--radius);
  border: none;
  padding: 0 14px;
  outline: none;
  background: var(--input-bg);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  transition: box-shadow .2s;
}

.field input:focus,
.field select:focus {
  box-shadow: 0 0 0 3px rgba(255, 106, 61, .15);
}

.field select {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.field-full {
  grid-column: 1/-1
}

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start
}

/* Config section separator */
.config-separator {
  border: none;
  border-top: 1px solid var(--line);
  margin: 22px 0 18px
}

.config-subtitle {
  font-weight: 800;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: .6px;
}

/* ===================== */
/* Buttons               */
/* ===================== */
.btn {
  border: none;
  border-radius: var(--radius);
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 13px;
  transition: all .2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 106, 61, .2);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(255, 106, 61, .3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--text);
  color: #fff;
}

.btn-secondary:hover {
  background: #1e293b;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--input-bg);
  border-color: #cbd5e1;
}

.btn-danger {
  background: rgba(239, 68, 68, .06);
  border: 1px solid rgba(239, 68, 68, .15);
  color: #dc2626;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, .12);
}

.btn:focus {
  outline: 3px solid rgba(255, 106, 61, .25);
  outline-offset: 2px
}

/* ===================== */
/* Categories + products */
/* ===================== */
.categories {
  display: flex;
  flex-direction: column;
  gap: 14px
}

.category {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 18px;
  background: var(--card);
}

.category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.category-name {
  font-weight: 900;
  font-size: 18px;
  color: var(--text)
}

.category-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.pgrid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.pcard {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--card);
  transition: box-shadow .2s, transform .2s;
  max-width: 400px;
}

.pcard:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.pimg {
  width: 100%;
  height: 180px;
  max-height: 180px;
  background: var(--input-bg);
  object-fit: cover;
  display: block;
}

.pbody {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.ptitle {
  font-weight: 800;
  color: var(--text)
}

.pprice {
  font-weight: 800;
  color: var(--text)
}

.pdesc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  min-height: 34px
}

.pbadges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap
}

.badge {
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 700;
  font-size: 12px;
  border: none;
  background: var(--input-bg);
  color: var(--text-secondary)
}

.badge-ok {
  background: rgba(34, 197, 94, .08);
  color: #16a34a
}

.badge-off {
  background: var(--input-bg);
  color: var(--muted)
}

.badge-warn {
  background: rgba(239, 68, 68, .06);
  color: #dc2626
}

.badge-pill {
  background: rgba(255, 106, 61, .08);
  color: var(--primary)
}

.pactions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px
}

.btn-outline-orange {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font)
}

.btn-outline-orange:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 106, 61, .2)
}

.btn-outline-red {
  background: transparent;
  border: 1.5px solid #dc2626;
  color: #dc2626;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font)
}

.btn-outline-red:hover {
  background: #dc2626;
  color: #fff
}

.btn-outline-gray {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--text-secondary);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font)
}

.btn-outline-gray:hover {
  background: var(--input-bg);
  color: var(--text)
}

/* ===================== */
/* Modal — Premium Style */
/* ===================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .35);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal {
  width: min(760px, 100%);
  max-height: min(86vh, 860px);
  overflow: auto;
  background: var(--card);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  position: sticky;
  top: 0;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}

.modal-title {
  font-weight: 900;
  font-size: 18px;
  color: var(--text)
}

.modal-close {
  border: none;
  background: var(--input-bg);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
  background: #e2e8f0
}

.modal-body {
  padding: 24px
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: rgba(248, 250, 252, .8);
  backdrop-filter: blur(8px);
  position: sticky;
  bottom: 0;
}

/* Modal section headers (for product editor) */
.modal-body .config-subtitle {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin: 20px 0 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.modal-body .config-subtitle:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* ===================== */
/* Hint text             */
/* ===================== */
.hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

/* ===================== */
/* Banner upload         */
/* ===================== */
.banner-upload-preview {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--input-bg);
  margin-bottom: 8px;
}

.btn-remove-banner {
  background: transparent;
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, .2);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  cursor: pointer;
  font-size: 13px;
  margin-top: 6px;
  font-family: var(--font);
  transition: all .2s;
}

.btn-remove-banner:hover {
  background: #dc2626;
  color: #fff;
}

/* ===================== */
/* Textarea              */
/* ===================== */
textarea {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius);
  outline: none;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  resize: vertical;
  background: var(--input-bg);
  transition: box-shadow .2s;
}

textarea:focus {
  box-shadow: 0 0 0 3px rgba(255, 106, 61, .15);
}

/* ===================== */
/* Product image uploader*/
/* ===================== */
.uploader {
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(241, 245, 249, .5);
  transition: border-color .2s;
}

.uploader:hover {
  border-color: var(--primary)
}

.uploader-preview {
  width: 86px;
  height: 86px;
  border-radius: var(--radius);
  background: var(--input-bg);
  overflow: hidden;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uploader-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.uploader-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

/* ===================== */
/* Toast                 */
/* ===================== */
.toast-wrap {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 14px;
  max-width: 340px;
  font-family: var(--font);
}

.toast.ok {
  background: var(--text)
}

.toast.err {
  background: #991b1b
}

/* ===================== */
/* Delivery zones        */
/* ===================== */
.zones-table {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.zones-row {
  display: grid;
  grid-template-columns: 1fr 1fr 140px 44px;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.zones-row:first-child {
  border-top: none
}

.zones-row input {
  width: 100%
}

.zone-del {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
}

/* ===================== */
/* Share link & QR       */
/* ===================== */
.share-link-box {
  display: flex;
  gap: 6px;
  align-items: center
}

.share-link-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: none;
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}

.qr-section {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  margin-top: 8px
}

.qr-section canvas {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff
}

.qr-actions {
  display: flex;
  flex-direction: column;
  gap: 8px
}

/* ===================== */
/* Sound toggle          */
/* ===================== */
.sound-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--input-bg);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

.sound-toggle:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 106, 61, .1);
}

.sound-toggle.active {
  border-color: var(--primary);
  background: rgba(255, 106, 61, .06);
}

@keyframes sound-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 106, 61, .5)
  }

  70% {
    box-shadow: 0 0 0 12px rgba(255, 106, 61, 0)
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 106, 61, 0)
  }
}

.sound-toggle.pulse {
  animation: sound-pulse .8s ease-out;
}

/* Volume slider */
.volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 10px 4px 8px;
  height: 36px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 60px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--primary) var(--vol-pct, 0%), var(--line) var(--vol-pct, 0%));
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
  cursor: pointer;
}

.volume-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 28px;
  white-space: nowrap;
}

/* ===================== */
/* Payment methods       */
/* ===================== */
.payment-methods-wrap {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.payment-row {
  display: grid;
  grid-template-columns: 1fr 1fr 44px;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.payment-row:first-child {
  border-top: none
}

.payment-row input {
  width: 100%
}

.payment-del {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
}

/* ===================== */
/* PIN Screen            */
/* ===================== */
.pin-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #fdf8f6 0%, #f0ebe8 50%, #e8e4f0 100%);
}

.pin-card {
  width: min(400px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
  text-align: center;
}

.pin-card h2 {
  font-size: 22px;
  font-weight: 900;
  margin: 0 0 6px;
  color: var(--text);
}

.pin-card .pin-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.pin-inputs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.pin-digit {
  width: 56px;
  height: 64px;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  border: none;
  border-radius: var(--radius);
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  caret-color: var(--primary);
  font-family: var(--font);
  transition: box-shadow .2s;
}

.pin-digit:focus {
  box-shadow: 0 0 0 3px rgba(255, 106, 61, .2);
}

.pin-digit.error {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .15);
  background: #fef2f2;
}

.pin-error {
  color: #dc2626;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 12px;
  min-height: 20px;
}

.pin-forgot {
  color: var(--primary);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-weight: 600;
  margin-top: 10px;
  font-family: var(--font);
}

.pin-forgot:hover {
  text-decoration: underline;
}

@keyframes pin-shake {

  0%,
  100% {
    transform: translateX(0);
  }

  15%,
  45%,
  75% {
    transform: translateX(-8px);
  }

  30%,
  60%,
  90% {
    transform: translateX(8px);
  }
}

.pin-inputs.shake {
  animation: pin-shake 0.4s;
}

/* ===================== */
/* Users Table           */
/* ===================== */
.users-table {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.user-row {
  display: grid;
  grid-template-columns: 1fr 1fr 90px auto 44px;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  align-items: center;
}

.user-row:first-child {
  border-top: none
}

.user-row.owner {
  background: rgba(255, 106, 61, .03);
  border-left: 3px solid var(--primary);
}

.user-row input[type="text"],
.user-row input[type="text"].user-field {
  width: 100%;
  height: 42px;
  border-radius: var(--radius);
  border: none;
  padding: 0 12px;
  outline: none;
  background: var(--input-bg);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  transition: box-shadow .2s;
}

.user-row input:focus {
  box-shadow: 0 0 0 3px rgba(255, 106, 61, .12);
}

.user-perms {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.user-del {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
}

/* Owner badge */
.owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 106, 61, .06);
  color: var(--primary);
  border: none;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Permission toggle */
.perm-toggle-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.perm-toggle-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}

.perm-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.perm-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.perm-toggle-slider {
  position: absolute;
  inset: 0;
  background: #ef4444;
  border-radius: 24px;
  transition: background .25s;
}

.perm-toggle input:checked+.perm-toggle-slider {
  background: #22c55e;
}

.perm-toggle-dot {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .25s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.perm-toggle input:checked+.perm-toggle-slider .perm-toggle-dot {
  transform: translateX(20px);
}

.perm-toggle input:disabled+.perm-toggle-slider {
  opacity: .6;
  cursor: not-allowed;
}

/* ===================== */
/* Plans Tab             */
/* ===================== */
.plans-current-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plans-current-card .pcc-left {
  flex: 1;
  min-width: 200px
}

.plans-current-card .pcc-plan-name {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  margin: 0 0 4px
}

.plans-current-card .pcc-dates {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px
}

.plans-current-card .pcc-details {
  font-size: 13px;
  color: var(--muted);
  margin: 0
}

.plans-current-card .pcc-right {
  display: flex;
  align-items: center;
  gap: 12px
}

.plans-current-card .btn-renew {
  padding: 8px 18px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 13px;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: all .2s;
  box-shadow: 0 2px 8px rgba(255, 106, 61, .2);
}

.plans-current-card .btn-renew:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(255, 106, 61, .3)
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.plan-badge-active {
  background: rgba(34, 197, 94, .08);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, .15)
}

.plan-badge-warning {
  background: rgba(245, 158, 11, .08);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, .15)
}

.plan-badge-expired {
  background: rgba(239, 68, 68, .08);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, .15)
}

.plan-badge-free {
  background: rgba(99, 102, 241, .08);
  color: #4f46e5;
  border: 1px solid rgba(99, 102, 241, .15)
}

/* Toggle billing */
.plan-toggle-billing {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  justify-content: center;
}

.plan-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted)
}

.plan-toggle-label .plan-toggle-save {
  display: inline-block;
  background: rgba(34, 197, 94, .08);
  color: #16a34a;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}

.plan-toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.plan-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0
}

.plan-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #cbd5e1;
  border-radius: 26px;
  transition: .3s;
}

.plan-toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: .3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.plan-toggle-switch input:checked+.plan-toggle-slider {
  background: var(--primary)
}

.plan-toggle-switch input:checked+.plan-toggle-slider::before {
  transform: translateX(22px)
}

/* Plans grid */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.plan-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}

.plan-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow)
}

.plan-card-header {
  padding: 18px 20px 12px;
  background: var(--input-bg);
}

.plan-card.popular .plan-card-header {
  background: linear-gradient(135deg, rgba(255, 106, 61, .06), rgba(255, 106, 61, .02));
}

.plan-card.popular {
  border-color: rgba(255, 106, 61, .25)
}

.plan-card-popular-tag {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.plan-card-name {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  margin: 0 0 2px
}

.plan-card-desc {
  font-size: 12px;
  color: var(--muted);
  margin: 0
}

.plan-card-body {
  padding: 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column
}

.plan-price {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  margin: 0 0 4px
}

.plan-price small {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted)
}

.plan-price-annual {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 2px
}

.plan-price-savings {
  font-size: 12px;
  font-weight: 700;
  color: #16a34a;
  margin: 0 0 12px
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  flex: 1
}

.plan-features li {
  font-size: 13px;
  color: var(--text);
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.plan-features li::before {
  content: '✓';
  color: #16a34a;
  font-weight: 700;
  font-size: 14px
}

.plan-card-footer {
  padding: 0 20px 18px
}

.plan-card-footer .btn {
  width: 100%;
  padding: 10px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 14px
}

.plan-card-footer .btn-current {
  background: rgba(34, 197, 94, .06);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, .15);
  cursor: default;
}

/* Addon cards */
.addon-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s;
}

.addon-card:hover {
  transform: translateY(-2px)
}

.addon-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0
}

.addon-card-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  flex: 1
}

.addon-card-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--text)
}

.addon-card-price small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500
}

.addon-card .addon-active-badge {
  display: inline-block;
  background: rgba(34, 197, 94, .06);
  color: #16a34a;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
}

.addon-card .btn {
  margin-top: 4px;
  padding: 8px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 13px
}

/* Plan request modal */
.plan-request-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, .35);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.plan-request-modal.hidden {
  display: none
}

.plan-request-content {
  background: var(--card);
  border-radius: var(--radius-2xl);
  max-width: 440px;
  width: 100%;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.plan-request-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.plan-request-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: var(--text)
}

.plan-request-body {
  padding: 20px 22px
}

.plan-request-body .prb-price {
  font-size: 24px;
  font-weight: 900;
  color: var(--primary);
  margin: 8px 0 16px
}

.plan-request-body .prb-payment-info {
  background: var(--input-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
  border: none;
}

.plan-request-body .prb-payment-info p {
  margin: 4px 0;
  font-size: 14px;
  color: var(--text)
}

.plan-request-body .prb-payment-info strong {
  color: var(--primary)
}

.plan-request-footer {
  padding: 12px 22px 20px
}

/* ===================== */
/* Orders System         */
/* ===================== */

/* Filter pills */
.order-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px
}

.order-filter-pills .pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font);
}

.order-filter-pills .pill:hover {
  border-color: var(--primary);
  color: var(--primary)
}

.order-filter-pills .pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(255, 106, 61, .2)
}

.order-filter-pills .pill .pill-count {
  background: rgba(0, 0, 0, .06);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  min-width: 20px;
  text-align: center;
}

.order-filter-pills .pill.active .pill-count {
  background: rgba(255, 255, 255, .25)
}

/* Pending orders card */
#orders-pending-card {
  border: 2px solid var(--warning);
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  animation: pulse-border 2.5s ease-in-out infinite;
}

#orders-pending-card .card-title {
  color: #92400e
}

@keyframes pulse-border {

  0%,
  100% {
    border-color: #f59e0b
  }

  50% {
    border-color: #ef4444
  }
}

/* Pending order card highlight */
.order-card.order-card-pending {
  border: 1.5px solid #fbbf24;
  background: #fffef5;
}

/* Status badge */
.order-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}

.order-status-badge.st-nuevo {
  background: #fef3c7;
  color: #92400e
}

.order-status-badge.st-confirmado {
  background: #dbeafe;
  color: #1e40af
}

.order-status-badge.st-preparacion {
  background: #fce7f3;
  color: #9d174d
}

.order-status-badge.st-listo {
  background: #d1fae5;
  color: #065f46
}

.order-status-badge.st-en_camino {
  background: #e0e7ff;
  color: #3730a3
}

.order-status-badge.st-entregado {
  background: #f0fdf4;
  color: #166534
}

.order-status-badge.st-cancelado {
  background: #fee2e2;
  color: #991b1b
}

/* Order card */
.order-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 0;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  transition: box-shadow .2s;
  overflow: hidden;
}

.order-card:hover {
  box-shadow: var(--shadow)
}

.order-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--input-bg);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.order-card-number {
  font-weight: 800;
  font-size: 16px;
  flex: 1
}

.order-card-total {
  font-weight: 800;
  font-size: 16px;
  color: var(--primary)
}

.order-card-info {
  padding: 12px 18px 0
}

.order-card .order-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px
}

.order-card .order-customer {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px
}

.order-card .order-time-ago {
  font-size: 12px;
  color: var(--muted);
  font-style: italic
}

.order-card .order-cancel-reason {
  margin: 8px 18px 0;
  padding: 8px 12px;
  background: #fef2f2;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #991b1b;
  border-left: 3px solid #ef4444;
}

.order-card .order-items-section {
  margin: 10px 18px 0
}

.order-card .order-action-btns {
  padding: 12px 18px 16px
}

/* Order legacy selectors */
.orders {
  display: flex;
  flex-direction: column;
  gap: 12px
}

.order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px
}

.order-id {
  font-weight: 800
}

.order-meta {
  color: var(--muted);
  font-size: 13px
}

.order-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.order-items {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px
}

.order-total {
  font-weight: 800
}

/* Action buttons */
.order-action-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px
}

.order-action-btn {
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all .2s;
  font-family: var(--font);
}

.order-action-btn:hover {
  opacity: .85;
  transform: translateY(-1px)
}

.order-action-btn.act-confirmar {
  background: #3b82f6;
  color: #fff
}

.order-action-btn.act-preparar {
  background: #ec4899;
  color: #fff
}

.order-action-btn.act-listo {
  background: #10b981;
  color: #fff
}

.order-action-btn.act-enviar {
  background: #6366f1;
  color: #fff
}

.order-action-btn.act-entregar {
  background: #22c55e;
  color: #fff
}

.order-action-btn.act-cancelar {
  background: #fee2e2;
  color: #991b1b
}

.order-action-btn.act-print {
  background: #2ecc71;
  color: #fff
}

.order-action-btn.act-delete {
  background: #fef2f2;
  color: #b91c1c
}

/* Orders grid */
.orders-grid {
  display: grid;
  gap: 12px
}

/* Items section in card */
.order-items-section {
  margin-top: 10px;
  padding: 12px;
  background: var(--input-bg);
  border-radius: var(--radius)
}

.order-items-section .order-item-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 14px
}

.order-items-section .order-item-detail {
  display: flex;
  justify-content: space-between;
  padding: 1px 0 1px 16px;
  font-size: 12px;
  color: #666;
}

.order-items-section .order-item-detail .detail-label {
  font-weight: 600;
  color: var(--text-secondary)
}

.order-items-section .order-totals {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line)
}

.order-items-section .order-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px
}

.order-items-section .order-grand-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
  margin-top: 4px
}

/* ===================== */
/* Support Tab           */
/* ===================== */
.support-search {
  position: relative;
  margin-bottom: 24px;
}

.support-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 20px;
  pointer-events: none;
}

.support-search-input {
  width: 100%;
  height: 48px;
  padding-left: 44px !important;
  border-radius: var(--radius-xl) !important;
  font-size: 15px !important;
  background: var(--input-bg);
  border: none;
  outline: none;
  font-family: var(--font);
  color: var(--text);
  transition: box-shadow .2s;
}

.support-search-input:focus {
  box-shadow: 0 0 0 3px rgba(255, 106, 61, .12);
}

.support-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.support-card {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  text-align: center;
  transition: all .2s;
}

.support-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.support-card-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.support-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px;
}

.support-card-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.4;
}

.support-card-btn {
  width: 100%;
  padding: 10px;
  font-size: 13px;
}

.support-card-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.support-articles {
  margin-top: 8px;
}

.support-articles-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 12px;
}

.support-article {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}

.support-article:hover {
  background: var(--input-bg);
  border-color: #cbd5e1;
}

.support-article .material-symbols-rounded {
  color: var(--primary);
  font-size: 20px;
  flex-shrink: 0;
}

.support-article span:nth-child(2) {
  flex: 1;
}

.support-article-arrow {
  color: var(--muted) !important;
  font-size: 18px !important;
}

/* ===================== */
/* Responsive            */
/* ===================== */
@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    box-shadow: none;
    border-right: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, .1);
  }

  .main {
    margin-left: 0;
    padding: 12px 14px;
  }

  .menu-toggle {
    display: flex;
  }

  .topbar {
    border-radius: var(--radius-lg);
    top: 12px;
  }

  .card {
    border-radius: var(--radius-lg);
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .zones-row {
    grid-template-columns: 1fr 1fr
  }

  .zones-row .zone-fee {
    grid-column: 1 / -1
  }

  .zones-row .zone-del {
    grid-column: 1 / -1
  }

  .payment-row {
    grid-template-columns: 1fr
  }
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr
  }

  .plans-grid {
    grid-template-columns: 1fr
  }

  .plans-current-card {
    flex-direction: column;
    align-items: flex-start
  }

  .order-filter-pills {
    gap: 4px
  }

  .order-filter-pills .pill {
    padding: 5px 10px;
    font-size: 12px
  }

  .toggle-row {
    padding: 12px
  }

  .uploader {
    flex-direction: column
  }

  .order-action-btn {
    padding: 5px 10px;
    font-size: 12px
  }

  .support-cards {
    grid-template-columns: 1fr
  }

  .topbar {
    padding: 10px 12px;
    top: 0;
    border-radius: 0;
    margin: -12px -14px 0;
    width: calc(100% + 28px);
  }

  .topbar-title {
    font-size: 16px
  }

  .search {
    width: 100%
  }

  .topbar-right {
    width: 100%
  }

  .share-link-box {
    flex-wrap: wrap
  }
}

@media (max-width: 960px) {
  .user-row {
    grid-template-columns: 1fr 1fr
  }

  .user-row .user-pin-field {
    grid-column: 1 / -1
  }

  .user-perms {
    grid-column: 1 / -1
  }

  .user-del {
    grid-column: 1 / -1;
    width: 100%
  }
}

@media (max-width: 500px) {
  .user-row {
    grid-template-columns: 1fr
  }

  .pin-digit {
    width: 48px;
    height: 56px;
    font-size: 24px
  }
}

@media (max-width: 480px) {
  .support-card {
    padding: 18px 14px
  }

  .support-card-icon {
    width: 52px;
    height: 52px
  }
}

/* ===================== */
/* Theme toggle button   */
/* ===================== */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--input-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  color: var(--text-secondary);
}

.theme-toggle:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 106, 61, .1);
}

.theme-toggle .material-symbols-rounded {
  font-size: 20px
}

/* ===================== */
/* Toggle row (switches) */
/* ===================== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--input-bg);
  border-radius: var(--radius);
  gap: 12px;
}

.toggle-row-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text)
}

.toggle-row-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px
}

/* ===================== */
/* Uploader redesigned   */
/* ===================== */
.uploader-preview {
  position: relative;
}

.uploader-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}

.uploader-preview:hover .uploader-remove {
  opacity: 1
}

.uploader-dropzone {
  flex: 1;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  min-height: 86px;
  text-align: center;
  transition: border-color .2s;
}

.uploader-dropzone:hover {
  border-color: var(--primary)
}

.uploader-dropzone-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text)
}

.uploader-dropzone-hint {
  font-size: 11px;
  color: var(--muted)
}

/* ===================== */
/* Dark Mode             */
/* ===================== */
body.admin.dark {
  --bg-page: #0f172a;
  --bg-sidebar: #1e293b;
  --card: #1e293b;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --muted: #64748b;
  --line: #334155;
  --input-bg: #334155;
}

body.admin.dark .login-screen,
body.admin.dark .pin-screen {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

body.admin.dark .nav-item.active {
  background: rgba(255, 106, 61, .12);
}

body.admin.dark .modal-footer {
  background: rgba(30, 41, 59, .85);
}

body.admin.dark .btn-secondary {
  background: #475569;
}

body.admin.dark .btn-secondary:hover {
  background: #64748b;
}

body.admin.dark .btn-ghost {
  border-color: var(--line);
  color: var(--text-secondary);
}

body.admin.dark .btn-ghost:hover {
  background: var(--input-bg);
  border-color: #475569;
}

body.admin.dark .btn-danger {
  background: rgba(239, 68, 68, .12);
  border-color: rgba(239, 68, 68, .25);
}

body.admin.dark .toast {
  background: #334155;
}

body.admin.dark .toast.err {
  background: #7f1d1d;
}

body.admin.dark #orders-pending-card {
  background: linear-gradient(135deg, #451a03, #78350f);
  border-color: #b45309;
}

body.admin.dark .order-card.order-card-pending {
  background: #2d2006;
  border-color: #a16207;
}

body.admin.dark .login-card,
body.admin.dark .pin-card {
  background: #1e293b;
  border-color: #334155;
}

body.admin.dark .pin-digit.error {
  background: #450a0a;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .25);
}

body.admin.dark .sound-toggle,
body.admin.dark .theme-toggle {
  border-color: var(--line);
  background: var(--input-bg);
}

body.admin.dark .volume-wrap {
  background: var(--input-bg);
  border-color: var(--line);
}

body.admin.dark .volume-slider {
  background: linear-gradient(to right, var(--primary) var(--vol-pct, 0%), #334155 var(--vol-pct, 0%));
}

body.admin.dark .qr-section canvas {
  border-color: var(--line);
}

/* Login/register inline inputs */
body.admin.dark .login-card input,
body.admin.dark .login-card select {
  background: var(--input-bg) !important;
  color: var(--text) !important;
}

body.admin.dark .login-card input::placeholder {
  color: var(--muted);
}

body.admin.dark .login-card .login-subtitle,
body.admin.dark .pin-card .pin-subtitle {
  color: var(--text-secondary);
}

/* Pending orders in dark mode */
body.admin.dark #orders-pending-card .card-title {
  color: #fbbf24;
}

/* Manual close box */
.manual-close-box {
  background: #fff3cd;
  padding: 15px;
  border-radius: 10px;
  border: 1px solid #ffeeba;
}

.manual-close-hint {
  margin: 5px 0 0 30px;
  font-size: 14px;
  color: #856404;
}

body.admin.dark .manual-close-box {
  background: rgba(245, 158, 11, .12);
  border-color: rgba(245, 158, 11, .25);
}

body.admin.dark .manual-close-box label {
  color: var(--text);
}

body.admin.dark .manual-close-hint {
  color: #fbbf24;
}

/* Schedule table dark compat */
body.admin.dark #schedule-table thead tr {
  color: var(--muted);
}

body.admin.dark #schedule-table input[type="time"],
body.admin.dark #schedule-table input[type="checkbox"] {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--line);
}

body.admin.dark #schedule-table tr {
  color: var(--text);
}

/* Print config dark compat */
body.admin.dark #tab-print .hint {
  color: var(--muted);
}

body.admin.dark #tab-security p {
  color: var(--text-secondary);
}