:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --dark: #111214;
  --muted: #6e6e73;
  --accent: #059669;
  --accent-hover: #047857;
  --accent-soft: rgba(5, 150, 105, 0.12);
  --warn-bg: #fef9c3;
  --warn-text: #854d0e;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --border: rgba(17, 18, 20, 0.09);
  --radius: 16px;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--dark);
  line-height: 1.45;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Auth Screen */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 20px 44px -12px rgba(17, 18, 20, 0.08);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.auth-logo strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
}

.auth-logo span {
  font-size: 12px;
  color: var(--muted);
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

.alert-box {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  margin-bottom: 14px;
}

.error-text {
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

/* App Shell (mobile-first) */
.app-shell {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 84px;
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 250, 248, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

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

.brand-mini strong {
  display: block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-mini span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.sub-badge.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sub-badge.expiring {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.sub-badge.expired {
  background: var(--danger-bg);
  color: var(--danger);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.super-rest-bar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.super-rest-bar select {
  flex: 1;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
}

.main-content {
  padding: 14px 16px;
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
}

/* iiko banner */
.iiko-banner {
  background: var(--dark);
  color: #ffffff;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 13px;
}

.iiko-banner strong {
  display: block;
  color: #34d399;
}

.iiko-banner span {
  font-size: 12px;
  color: #d4d4d8;
}

/* Menu Toolbar & Filters */
.menu-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--muted);
}

.search-wrap input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  padding: 10px 0;
  font-size: 14px;
  font-family: inherit;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.cat-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.cat-pills::-webkit-scrollbar {
  display: none;
}

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--dark);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
}

.chip.active {
  background: var(--dark);
  color: #ffffff;
  border-color: var(--dark);
}

.chip-stop.active {
  background: var(--danger);
  border-color: var(--danger);
}

/* Dish List & 1-Tap Stop Switch */
.dish-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dish-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dish-card.is-stopped {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.25);
}

.dish-thumb {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f1f5f9;
}

.dish-main {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.dish-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dish-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.dish-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 3px;
}

/* Large 1-tap toggle */
.stop-toggle {
  border: none;
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 96px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.stop-toggle.in-stock {
  background: var(--accent-soft);
  color: var(--accent);
}

.stop-toggle.out-stock {
  background: var(--danger);
  color: #ffffff;
}

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

/* Panel Cards */
.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}

.panel-card h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
}

.panel-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}

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

.sub-hero h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.sub-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 14px;
}

.sub-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.sub-meta-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}

.sub-meta-box span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.sub-meta-box strong {
  font-size: 14px;
}

.plan-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 12px;
  font-size: 13px;
}

.plan-row strong {
  display: block;
}

.plan-row span {
  font-size: 11px;
  color: var(--muted);
}

/* Superadmin list */
.sa-restaurants-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sa-rest-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.sa-rest-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.sa-rest-top strong {
  display: block;
  font-size: 15px;
}

.sa-rest-top small {
  font-size: 12px;
  color: var(--muted);
}

.sa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* Forms & Buttons */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.field label {
  font-size: 12px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: inherit;
  font-size: 14px;
}

.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
}

.btn-xs {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 9px;
}

.btn-full {
  width: 100%;
}

.flex-1 {
  flex: 1;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--dark);
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 35;
}

.nav-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.nav-btn.active {
  color: var(--accent);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 18, 20, 0.55);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop.active {
  display: flex;
}

.modal-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 18px 18px 24px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-head h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  font-size: 20px;
  cursor: pointer;
}

.photo-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.upload-preview {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.cat-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.cat-add-row input {
  flex: 1;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 13px;
}

.cats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cat-manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  z-index: 90;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.empty-box {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 14px;
}
