﻿/* ============================================================
   FoodTag365 — Professional UI Design System
   ============================================================ */

:root {
  /* Color palette */
  --ink:          #0f172a;
  --ink-2:        #334155;
  --muted:        #64748b;
  --muted-2:      #94a3b8;
  --line:         #e2e8f0;
  --line-2:       #f1f5f9;
  --panel:        #ffffff;
  --wash:         #f8fafc;
  --wash-2:       #f1f5f9;

  /* Sidebar */
  --nav-bg:       #0c1929;
  --nav-item-hover: rgba(255,255,255,0.07);
  --nav-item-active: rgba(255,255,255,0.11);
  --nav-text:     #94a3b8;
  --nav-text-active: #f8fafc;

  /* Accent - teal */
  --accent:       #0d9488;
  --accent-dark:  #0f766e;
  --accent-light: #ccfbf1;
  --accent-glow:  rgba(13,148,136,0.18);

  /* Status */
  --success:      #059669;
  --success-bg:   #d1fae5;
  --danger:       #dc2626;
  --danger-bg:    #fee2e2;
  --warning:      #d97706;
  --warning-bg:   #fef3c7;

  /* Tokens */
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    14px;
  --radius-xl:    18px;
  --shadow-xs:    0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm:    0 4px 12px rgba(15,23,42,0.08);
  --shadow-md:    0 8px 24px rgba(15,23,42,0.10);
  --shadow-lg:    0 16px 48px rgba(15,23,42,0.14);
  --shadow-xl:    0 28px 72px rgba(15,23,42,0.20);

  --sidebar-w:    268px;
  --topbar-h:     64px;
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

[hidden] { display: none !important; }

html { -webkit-font-smoothing: antialiased; }

body {
  min-height: 100vh;
  font-family: "Roboto Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--wash);
}
.app-shell[hidden], .app-login[hidden] { display: none !important; }
.app-login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at top,#eef9f7,#edf2f3 55%,#e5ecee); }
.app-login-card { width: min(410px,100%); padding: 34px; border: 1px solid #d5e2e1; border-radius: 17px; background: #fff; box-shadow: 0 22px 60px rgba(12,45,50,.15); }
.app-login-card img { display: block; width: 175px; margin: 0 auto; }
.app-login-card > p { margin: 14px 0 28px; color: #09877b; font-size: 12px; font-weight: 900; letter-spacing: .22em; text-align: center; }
.app-login-card h1 { margin: 0 0 24px; text-align: center; }
.app-login-card form, .app-login-card label { display: grid; gap: 7px; }
.app-login-card form { gap: 15px; }
.app-login-card label { color: #50615f; font-size: 12px; font-weight: 800; }
.app-login-card input { height: 43px; border: 1px solid #c9d9d7; border-radius: 8px; padding: 8px 11px; font: inherit; }
.app-login-card form button { height: 44px; border-radius: 8px; background: #0d988b; color: #fff; font-weight: 900; }
.app-login-card #appLoginStatus { min-height: 16px; color: #b63a3a; font-size: 11px; text-align: center; }
.app-login-card > a { display: block; margin-top: 10px; color: #087f74; font-size: 12px; text-align: center; text-decoration: none; }
.topbar-right { position: relative; }
.app-user-menu { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: 220px; overflow: hidden; border: 1px solid #d3e1df; border-radius: 11px; background: #fff; box-shadow: 0 14px 35px rgba(7,30,38,.2); }
.app-user-menu[hidden] { display: none !important; }
.app-user-menu > div { display: grid; gap: 3px; padding: 13px 14px; border-bottom: 1px solid #e7efee; }
.app-user-menu strong { color: var(--ink); font-size: 13px; }
.app-user-menu small { color: var(--muted); font-size: 10px; }
.app-user-menu > button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 14px; color: #b33737; font-size: 12px; font-weight: 800; text-align: left; cursor: pointer; }
.app-user-menu > button:hover { background: #fff1f1; }
.main-nav [hidden] { display: none !important; }
.permission-food-readonly #newFoodButton, .permission-food-readonly .row-action.edit, .permission-food-readonly .row-action.delete, .permission-food-readonly [data-food-delete], .permission-food-readonly [data-food-edit] { display: none !important; }
.permission-menu-readonly [data-restaurant-menu-save], .permission-menu-readonly [data-meal-add], .permission-menu-readonly .meal-add-button { display: none !important; }
.permission-no-food-write .row-action.edit,
.permission-no-food-write #newFoodButton,
.permission-no-food-write [data-food-edit],
.permission-no-menu-write #newFoodMenuButton,
.permission-no-menu-write #newRestaurantButton,
.permission-no-menu-write [data-menu-edit],
.permission-no-menu-write [data-restaurant-edit],
.permission-no-menu-write [data-restaurant-menu-save],
.permission-no-menu-write [data-meal-add],
.permission-no-menu-write [data-meal-remove],
.permission-no-menu-write [data-meal-row-add],
.permission-no-menu-write [data-meal-row-remove],
.permission-no-menu-write #moveFoodRight,
.permission-no-menu-write #moveFoodLeft,
.permission-no-menu-write #mealFoodPickerConfirm,
.permission-no-menu-write .meal-add-button { display: none !important; }
.permission-no-food-delete [data-food-delete],
.permission-no-food-delete [data-all-food-delete],
.permission-no-food-delete [data-allergen-delete],
.permission-no-food-delete [data-ingredient-delete],
.permission-no-menu-delete [data-menu-delete],
.permission-no-menu-delete [data-restaurant-delete] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }

/* ============================================================
   App Shell
   ============================================================ */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--nav-bg);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 30;
  border-right: 1px solid rgba(255,255,255,0.04);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.brand {
  display: grid;
  align-items: center;
  justify-items: center;
  gap: 5px;
  padding: 17px 18px 13px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  width: min(200px, 100%);
  height: auto;
  max-height: 190px;
  aspect-ratio: 1;
  border-radius: 24px;
  object-fit: contain;
}

.brand-product {
  color: rgba(226,232,240,.8);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), #115e59);
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(13,148,136,0.35);
}

.brand-text strong {
  display: block;
  color: #f8fafc;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text span {
  display: block;
  color: var(--nav-text);
  font-size: 11px;
  font-weight: 500;
  margin-top: 1px;
}

.nav-section-label {
  padding: 16px 18px 6px;
  color: rgba(148,163,184,0.55);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
  flex-shrink: 0;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  color: var(--nav-text);
  background: transparent;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}
.main-nav a.nav-item { text-decoration: none; }

.nav-item:hover { background: var(--nav-item-hover); color: #e2e8f0; }

.nav-item.active {
  background: var(--nav-item-active);
  color: var(--nav-text-active);
  font-weight: 600;
}

.nav-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  color: var(--nav-text);
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  background: rgba(13,148,136,0.22);
  color: #5eead4;
}

.nav-label { flex: 1; }

.chevron {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  opacity: 0.6;
  flex-shrink: 0;
}

.nav-item[aria-expanded="true"] .chevron { transform: rotate(45deg); }

.submenu {
  display: none;
  flex-direction: column;
  gap: 1px;
  margin: 2px 10px 2px 24px;
  padding-left: 14px;
  border-left: 1px solid rgba(255,255,255,0.08);
}

.submenu.open { display: flex; }

.submenu button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  color: var(--nav-text);
  font-size: 13px;
  font-weight: 400;
  background: transparent;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

.submenu button:hover:not(:disabled) { background: var(--nav-item-hover); color: #e2e8f0; }
.submenu button.active { color: #5eead4; font-weight: 600; }
.submenu button:disabled { opacity: 0.45; cursor: default; }
.food-menu-tree { display: grid; gap: 2px; }
.food-menu-tree-parent { color: #d6e3e2 !important; font-weight: 700 !important; }
.food-menu-tree-parent .chevron { margin-left: auto; }
.food-menu-tree-parent[aria-expanded="true"] .chevron { transform: rotate(45deg); }
.food-menu-tree-children { display: none; padding-left: 12px; border-left: 1px solid rgba(94,234,212,.24); }
.food-menu-tree.open .food-menu-tree-children { display: grid; gap: 1px; }
.food-menu-tree-children button { min-height: 32px; font-size: 12px; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.db-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(148,163,184,0.7);
  font-size: 11.5px;
  font-weight: 500;
}

.db-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(16,185,129,0.3);
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 2px rgba(16,185,129,0.3); }
  50%       { box-shadow: 0 0 0 5px rgba(16,185,129,0.1); }
}

/* ============================================================
   Content Area
   ============================================================ */

.content { min-width: 0; display: flex; flex-direction: column; }

/* ============================================================
   Topbar
   ============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(248,250,252,0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

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

.menu-button {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--ink-2);
  flex-shrink: 0;
  place-items: center;
  transition: border-color 0.15s, color 0.15s;
}

.menu-button:hover { border-color: var(--accent); color: var(--accent); }

.page-heading { min-width: 0; }

.topbar-eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1px;
}

#pageTitle {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
}

.language-strip { display: flex; gap: 4px; }

.lang-pill {
  min-width: 36px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: all 0.15s;
  cursor: pointer;
  font-family: inherit;
}

.lang-pill:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-dark); }
.lang-pill:disabled { cursor: wait; opacity: 0.65; }

.lang-pill.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #115e59);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(13,148,136,0.3);
  transition: transform 0.15s;
}

.topbar-avatar:hover { transform: scale(1.06); }

/* ============================================================
   Page Content margins
   ============================================================ */

.hero-panel, .metric-grid, .workspace { margin-left: 28px; margin-right: 28px; }

/* ============================================================
   Hero Panel
   ============================================================ */

.hero-panel {
  margin-top: 24px;
  margin-bottom: 20px;
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #ffffff;
  background:
    linear-gradient(125deg, rgba(9,25,45,0.97) 0%, rgba(13,148,136,0.85) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='400' viewBox='0 0 1200 400'%3E%3Crect width='1200' height='400' fill='%230e1b2e'/%3E%3Ccircle cx='900' cy='80' r='180' fill='%230d9488' opacity='.12'/%3E%3Ccircle cx='1100' cy='300' r='100' fill='%23b7791f' opacity='.14'/%3E%3Cpath d='M0 280C200 240 320 310 500 265C680 220 720 150 900 175C1080 200 1100 270 1200 210V400H0Z' fill='%230d9488' opacity='.08'/%3E%3C/svg%3E");
  background-size: cover;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 60%, rgba(13,148,136,0.06));
  pointer-events: none;
}

.hero-content { position: relative; }

.hero-brand-showcase {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero-hotel-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 205px;
  max-height: 92px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 14px;
  background: rgba(255,255,255,.96);
  object-fit: contain;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.18));
}

.hero-panel .eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.65);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52,211,153,0.25);
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero-panel h2 {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #ffffff;
  margin-bottom: 8px;
}

.hero-desc {
  color: rgba(255,255,255,0.62);
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 560px;
}

.status-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

@media (max-width: 1100px) {
  .hero-panel { padding-top: 24px; }
  .hero-brand-showcase { position: relative; inset: auto; display: flex; align-items: center; justify-content: center; gap: 10px; flex: 1; }
  .hero-hotel-logo { position: static; transform: none; }
  .hero-hotel-logo { width: 170px; }
}

.status-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 0 16px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 600;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.status-card--green {
  border-color: rgba(52,211,153,0.35);
  background: rgba(52,211,153,0.14);
  color: #6ee7b7;
}

.status-card--warn {
  border-color: rgba(248,113,113,0.4);
  background: rgba(248,113,113,0.16);
  color: #fca5a5;
}

.topbar-license {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid #d7e8e5;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,250,248,.96));
  box-shadow: 0 5px 18px rgba(15,118,110,.08);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
}

.license-topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 4px 10px;
  border-radius: 9px;
}

.license-topbar-item + .license-topbar-item { border-left: 1px solid #dcebe8; border-radius: 0 9px 9px 0; }
.license-topbar-item > span { display: grid; gap: 1px; }
.license-topbar-item small { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.license-topbar-item strong { color: var(--ink); font-size: 11px; font-weight: 800; }

.license-topbar-item svg { opacity: 0.7; flex-shrink: 0; }

.license-topbar-item.license-ok { color: #0d9488; }
.license-topbar-item.license-warn { color: #dc2626; }
.license-topbar-item.license-ok { background: rgba(13,148,136,.08); }
.license-topbar-item.license-ok strong { color: #0f766e; }

@media (max-width: 900px) {
  .topbar-license { display: none; }
}

/* ============================================================
   Metric Cards
   ============================================================ */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s, transform 0.2s;
}

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

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.metric-icon--teal   { background: #ccfbf1; color: #0f766e; }
.metric-icon--blue   { background: #dbeafe; color: #1d4ed8; }
.metric-icon--amber  { background: #fef3c7; color: #b45309; }
.metric-icon--purple { background: #ede9fe; color: #7c3aed; }

.metric-body { display: flex; flex-direction: column; gap: 3px; }

.metric-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  display: block;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1;
  margin: 4px 0 2px;
}

.metric-sub {
  font-size: 12px;
  color: var(--muted-2);
  font-weight: 400;
}

/* ============================================================
   Workspace & Panel
   ============================================================ */

.workspace { margin-bottom: 28px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line-2);
}

.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

h2 { font-size: 18px; color: var(--ink); }

.primary-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border-radius: var(--radius);
  padding: 0 16px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(13,148,136,0.25);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.primary-action:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 16px rgba(13,148,136,0.35);
  transform: translateY(-1px);
}

.primary-action:active { transform: translateY(0); }

/* ============================================================
   Tables
   ============================================================ */

.table-wrap { width: 100%; overflow-x: auto; }

table { width: 100%; min-width: 680px; border-collapse: collapse; }

thead { background: var(--wash); }

th {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13.5px;
  color: var(--ink-2);
}

tbody tr:last-child td { border-bottom: none; }

tbody tr { transition: background 0.12s; }
tbody tr:hover { background: #f8fffe; }

/* ============================================================
   Badges
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--accent-dark);
  background: var(--accent-light);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

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

/* ============================================================
   Data Grid
   ============================================================ */

.data-grid-screen { overflow-x: auto; background: var(--panel); }

.restaurant-daily-menu { display: grid; gap: 22px; }
.restaurant-menu-heading, .restaurant-menu-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.restaurant-menu-date { display: grid; gap: 5px; margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 800; }
.restaurant-menu-date input { min-height: 40px; border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; background: #fff; color: var(--ink); font: inherit; }
.menu-report-screen { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.menu-report-filters { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfb; position: sticky; top: 16px; }
.menu-report-filters h3 { margin: 0 0 4px; color: var(--ink); }
.menu-report-filters label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.menu-report-filters select, .menu-report-filters input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; background: #fff; color: var(--ink); }
.menu-report-filters button { display: block; width: 100%; min-height: 44px; border: 1px solid #087f74; border-radius: 9px; background: #0f9f91 !important; color: #fff !important; box-shadow: 0 5px 14px rgba(15,159,145,.24); font-weight: 800; opacity: 1; cursor: pointer; }
.menu-report-filters button:hover { background: #0b887d !important; }
.menu-report-results { display: grid; gap: 14px; min-width: 0; }
.menu-report-results > header, .menu-report-card > header { display: flex; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.menu-report-results > header div, .menu-report-card > header div { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 16px; }
.menu-report-results > header span, .menu-report-card > header span { color: var(--muted); font-size: 12px; }
.menu-report-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.menu-report-meals { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; padding: 14px; }
.menu-report-meals section { overflow: hidden; border: 1px solid #e1ecea; border-radius: 9px; }
.menu-report-meals h4 { margin: 0; padding: 10px 12px; background: #eaf7f5; color: #13766b; font-size: 12px; }
.menu-report-meals section div { display: grid; gap: 3px; padding: 10px 12px; border-top: 1px solid #edf2f1; }
.menu-report-meals small { color: var(--muted); }
@media (max-width: 850px) { .menu-report-screen { grid-template-columns: 1fr; } .menu-report-filters { position: static; } }
.restaurant-menu-heading span { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.restaurant-menu-heading p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.restaurant-menu-heading button, .restaurant-menu-footer button { border: 0; border-radius: 10px; background: var(--primary); color: #fff; padding: 12px 20px; font-weight: 800; cursor: pointer; }
.meal-slot-grid { display: grid; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: 14px; align-items: start; }
.meal-slot-card { min-width: 0; overflow: hidden; border: 1px solid #dce9e7; border-radius: 16px; background: #fff; box-shadow: 0 8px 24px rgba(16, 75, 70, .06); }
.meal-slot-card header { display: flex; align-items: center; gap: 11px; padding: 15px; color: #fff; background: linear-gradient(135deg, #167e72, #25a896); }
.meal-slot-card header > span { font-size: 25px; }
.meal-slot-card header small { opacity: .7; font-weight: 800; }
.meal-slot-card h3 { margin: 1px 0 0; font-size: 17px; }
.meal-add-button { margin-left: auto; border: 1px solid rgba(255,255,255,.65); border-radius: 8px; background: rgba(255,255,255,.14); color: #fff; padding: 7px 10px; font-weight: 800; cursor: pointer; }
.meal-add-button:hover { background: #fff; color: #167e72; }
.meal-slot-help { padding: 9px 12px; border-bottom: 1px solid #e5efed; background: #f5fbfa; color: var(--muted); font-size: 10px; }
.meal-slot-help b { color: #167e72; }
.meal-food-list { display: grid; gap: 1px; max-height: 430px; overflow: auto; }
.meal-print-button { width: calc(100% - 24px); margin: 12px; padding: 10px 14px; border: 1px solid #158477; border-radius: 9px; background: #fff; color: #127469; font-weight: 800; cursor: pointer; }
.meal-print-button:hover { background: #eaf7f5; }
.meal-food-list label { display: flex; gap: 9px; align-items: flex-start; padding: 12px; border-bottom: 1px solid #edf3f2; cursor: pointer; }
.meal-food-list label:hover { background: #f4fbfa; }
.meal-food-list input { margin-top: 3px; accent-color: #158477; }
.meal-food-list label > span { display: grid; min-width: 0; }
.meal-food-list strong { font-size: 13px; }
.meal-food-list small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.meal-empty { padding: 18px 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.selected-meal-food { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; border-bottom: 1px solid #edf3f2; }
.selected-meal-food > span { display: grid; min-width: 0; }
.selected-meal-food strong { font-size: 13px; }
.selected-meal-food small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.selected-meal-food > button { flex: 0 0 auto; width: 26px; height: 26px; border: 0; border-radius: 50%; background: #feeceb; color: #b63e38; font-size: 18px; cursor: pointer; }
.ingredient-allergen-field { display: grid !important; gap: 9px; }
.ingredient-allergen-note { color: var(--muted); font-size: 11px; font-weight: 400; }
.choice-grid label.auto-allergen { border-color: #ed9f2f; background: #fff7e8; box-shadow: inset 0 0 0 1px rgba(237,159,47,.18); }

#ingredientAllergenChoices {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 280px;
  padding: 3px 7px 3px 3px;
}

#ingredientAllergenChoices .choice-chip {
  grid-template-columns: 16px 32px minmax(0, 1fr);
  gap: 7px !important;
  min-height: 50px;
  padding: 7px 8px !important;
  font-size: 10.5px !important;
  line-height: 1.15;
}

#ingredientAllergenChoices .choice-chip img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

#ingredientAllergenChoices .choice-chip > span {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

@media (max-width: 380px) {
  #ingredientAllergenChoices { grid-template-columns: 1fr; }
}
.modal-window.meal-picker-window { width: calc(100vw - 12px); max-width: 1600px; max-height: calc(100vh - 12px); overflow-y: auto; }
#mealFoodPicker { padding: 6px; }
.meal-picker-note { margin: 0; padding: 0 22px 12px; color: var(--muted); }
.meal-transfer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); gap: 16px; align-items: stretch; padding: 4px 14px 18px; }
.meal-transfer-panel { overflow: hidden; min-height: 460px; border: 1px solid #d9e7e5; border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(19,78,72,.05); }
.meal-transfer-panel.selected { border-color: #9ed5cd; background: #fbfffe; }
.meal-transfer-panel.selected { height: min(638px, calc(100vh - 210px)); }
.meal-transfer-panel.selected .meal-transfer-table { height: calc(100% - 49px); max-height: none; overflow-y: auto; overscroll-behavior: contain; }
.meal-transfer-panel > header { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-bottom: 1px solid #dfeae8; background: #f3f8f7; }
.meal-transfer-panel.selected > header { background: #eaf8f5; color: #116f65; }
.meal-transfer-panel header span { color: var(--muted); font-size: 11px; }
.meal-transfer-search { display: flex; align-items: center; gap: 8px; margin: 12px 14px; padding: 0 12px; border: 1px solid #cddfdd; border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.meal-transfer-search:focus-within { border-color: #158f80; box-shadow: 0 0 0 3px rgba(21,143,128,.12); }
.meal-transfer-search > span { color: #158f80; font-size: 21px; line-height: 1; transform: rotate(-15deg); }
.meal-transfer-search input { width: 100%; height: 42px; border: 0; outline: 0; background: transparent; color: #17332f; font: inherit; }
.meal-transfer-search input::placeholder { color: #91a7a4; }
.meal-transfer-table { max-height: 520px; overflow: auto; }
.meal-transfer-row { display: flex; align-items: flex-start; gap: 9px; padding: 9px 11px; border-bottom: 1px solid #edf2f1; cursor: pointer; }
.meal-transfer-row:hover, .meal-transfer-row:has(input:checked) { background: #eef9f7; }
.meal-transfer-row input { margin-top: 3px; accent-color: #158477; }
.meal-transfer-row span { display: grid; min-width: 0; flex: 1 1 auto; }
.meal-transfer-row strong { font-size: 11px; line-height: 1.3; overflow-wrap: anywhere; }
.meal-transfer-row small { margin-top: 3px; color: var(--muted); font-size: 9.5px; line-height: 1.25; overflow-wrap: anywhere; }
.meal-row-transfer { flex: 0 0 auto; display: inline-grid; place-items: center; width: 30px; height: 30px; margin-left: auto; border: 1px solid #159486; border-radius: 9px; background: #fff; color: #118476; font-size: 21px; font-weight: 700; line-height: 1; cursor: pointer; transition: background .14s, color .14s, transform .14s; }
.meal-row-transfer:hover { background: #158f80; color: #fff; transform: scale(1.05); }
.meal-row-transfer.remove { border-color: #e3aaa6; color: #b63e38; }
.meal-row-transfer.remove:hover { border-color: #b63e38; background: #b63e38; color: #fff; }
.meal-transfer-empty { padding: 30px 18px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.5; }
.meal-transfer-buttons { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.meal-transfer-buttons button { width: 44px; height: 44px; border: 1px solid #158f80; border-radius: 11px; background: #fff; color: #158f80; font-size: 24px; cursor: pointer; box-shadow: 0 5px 14px rgba(20,112,102,.12); }
.meal-transfer-buttons button:hover { background: #158f80; color: #fff; transform: translateY(-1px); }
.meal-picker-actions { display: flex; justify-content: flex-end; padding: 15px 22px; border-top: 1px solid #e4eceb; }
.meal-picker-actions button { border: 0; border-radius: 9px; background: #158f80; color: #fff; padding: 11px 18px; font-weight: 800; cursor: pointer; }
.restaurant-menu-footer { padding: 15px 18px; border-radius: 12px; background: #eff8f7; color: var(--muted); }
@media (max-width: 1250px) { .meal-slot-grid { grid-template-columns: repeat(2, minmax(240px, 1fr)); } }
@media (max-width: 720px) { .meal-slot-grid { grid-template-columns: 1fr; } .restaurant-menu-heading { align-items: flex-start; flex-direction: column; } }
@media (max-width: 720px) {
  #mealFoodPicker { padding: 0; }
  .meal-picker-window { width: 100vw !important; height: 100dvh; max-height: 100dvh !important; border-radius: 0 !important; overflow: hidden !important; }
  .meal-picker-window .modal-heading { min-height: 56px; padding: 10px 14px; }
  .meal-picker-window .modal-heading h2 { font-size: 16px; }
  .meal-picker-note { padding: 8px 14px; font-size: 11px; line-height: 1.35; }
  .meal-transfer-grid { grid-template-columns: 1fr; gap: 10px; padding: 0 10px 86px; overflow-y: auto; }
  .meal-transfer-buttons { display: none; }
  .meal-transfer-panel { min-height: 0; border-radius: 11px; }
  .meal-transfer-panel > header { padding: 10px 12px; }
  .meal-transfer-search { margin: 8px 10px; }
  .meal-transfer-search input { height: 38px; }
  .meal-transfer-panel:first-child .meal-transfer-table { max-height: 42dvh; }
  .meal-transfer-panel.selected { height: auto; min-height: 260px; background: linear-gradient(180deg, #fbfffe, #f5fcfa); }
  .meal-transfer-panel.selected > header { position: sticky; top: 0; z-index: 2; padding: 12px 13px; box-shadow: 0 3px 10px rgba(20,112,102,.07); }
  .meal-transfer-panel.selected .meal-transfer-table { height: auto; max-height: 48dvh; min-height: 210px; padding: 7px; overflow-y: auto; }
  .meal-transfer-panel.selected .meal-transfer-row { margin-bottom: 7px; border: 1px solid #d7e9e6; border-radius: 11px; background: #fff; box-shadow: 0 3px 10px rgba(20,82,75,.05); }
  .meal-transfer-panel.selected .meal-transfer-row:last-child { margin-bottom: 0; }
  .meal-transfer-panel.selected .meal-transfer-empty { min-height: 210px; display: grid; place-items: center; }
  .meal-transfer-row { align-items: center; min-height: 48px; padding: 7px 9px; }
  .meal-transfer-row input { width: 18px; height: 18px; margin-top: 0; }
  .meal-row-transfer { width: 36px; height: 36px; border-radius: 10px; font-size: 24px; }
  .meal-picker-actions { position: absolute; z-index: 3; right: 0; bottom: 0; left: 0; padding: 10px; background: rgba(255,255,255,.96); box-shadow: 0 -6px 18px rgba(13,43,39,.08); }
  .meal-picker-actions button { width: 100%; min-height: 46px; font-size: 14px; }
}

.grid-toolbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
}

.grid-new-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s;
}

.grid-new-button:hover { background: var(--accent-dark); }

.grid-search { display: flex; align-items: center; gap: 9px; min-width: 340px; color: var(--muted); font-size: 12px; font-weight: 700; }
.grid-search span { white-space: nowrap; }
.grid-search input { width: 100%; min-height: 36px; padding: 7px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; }
.grid-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.grid-note {
  margin-left: auto;
  color: var(--warning);
  font-size: 12px;
  font-weight: 600;
}

.grid-pagination { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.grid-pagination button { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink-2); font-weight: 700; }
.grid-pagination button:disabled { opacity: .45; cursor: default; }

.data-grid-table { width: 100%; border-collapse: collapse; }

.data-grid-table th,
.data-grid-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}

.data-grid-table th {
  background: var(--wash);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
}

.data-grid-table tbody tr:hover { background: #f8fffe; }
.data-grid-table td:first-child { color: var(--muted); font-weight: 500; }

.grid-filter-clear {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
}
.grid-filter-clear:hover { background: var(--accent-light); border-color: var(--accent); }
.grid-filter-clear[hidden] { display: none; }

/* Excel benzeri, aramalı, çoklu seçimli tablo başlığı filtresi */
.th-filter { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.th-filter > span { white-space: nowrap; }
.th-filter-btn {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  cursor: pointer;
  flex: none;
}
.th-filter-btn:hover { border-color: var(--line); background: var(--panel); color: var(--accent-dark); }
.th-filter-btn.active { border-color: var(--accent); background: var(--accent-light); color: var(--accent-dark); }

.th-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  width: 240px;
  max-height: 320px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(15,23,42,.16);
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}
.th-filter-menu[hidden] { display: none !important; }

.th-filter-search {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--wash);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}
.th-filter-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

.th-filter-options { display: grid; gap: 1px; max-height: 220px; overflow-y: auto; }
.th-filter-empty { padding: 8px 6px; color: var(--muted); font-size: 12px; }

.th-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.th-filter-option:hover { background: var(--wash-2); }
.th-filter-option input { flex: none; }
.th-filter-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-filter-all { border-bottom: 1px solid var(--line-2); padding-bottom: 8px; margin-bottom: 2px; font-weight: 700; }

.row-action {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 0 10px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s;
}

.row-action:hover { border-color: var(--muted-2); }

.row-action.edit {
  border-color: rgba(13,148,136,0.3);
  color: var(--accent-dark);
  background: rgba(13,148,136,0.05);
}

.row-action.edit:hover { background: var(--accent-light); border-color: var(--accent); }

.row-action.esl {
  min-width: 104px;
  justify-content: center;
  border-color: #149485;
  color: #ffffff;
  background: linear-gradient(135deg, #16a394, #117c71);
  box-shadow: 0 3px 9px rgba(17,124,113,.18);
  white-space: nowrap;
}

.row-action.esl:hover { border-color: #0f7066; background: linear-gradient(135deg, #138f82, #0d6e64); }
.row-action.esl.sent { border-color: #4fa58b; background: #e8f7f1; color: #167158; box-shadow: none; }
.direct-esl-modal { width: min(520px, calc(100vw - 28px)); }
.direct-esl-help { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.direct-esl-modal .row-action.esl { min-height: 42px; }
.direct-esl-results { display: grid; gap: 7px; max-height: 310px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--wash); }
.direct-esl-results > span { padding: 18px 10px; color: var(--muted); text-align: center; }
.direct-esl-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); text-align: left; cursor: pointer; }
.direct-esl-option span { display: grid; gap: 3px; }
.direct-esl-option small { color: var(--muted); }
.direct-esl-option b { color: var(--accent-dark); font-size: 12px; }
.direct-esl-option:hover, .direct-esl-option.selected { border-color: var(--accent); background: var(--accent-light); }

.row-action.delete {
  border-color: rgba(220,38,38,0.25);
  color: var(--danger);
  background: rgba(220,38,38,0.04);
}

.row-action.delete:hover { background: var(--danger-bg); border-color: var(--danger); }

/* ============================================================
   Images
   ============================================================ */

.allergen-icon {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--wash);
}

.allergen-icon-preview {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--wash);
}

.modal-form-status {
  min-height: 18px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.modal-form-status.error { color: var(--danger); }

.modal-form button[type="submit"]:disabled {
  opacity: .6;
  cursor: wait;
}

.food-list-allergens {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 90px;
}

.food-list-allergen-icon,
.food-list-allergen-fallback {
  width: 28px;
  height: 28px;
  border: 1px solid #d8e4e8;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 2px 5px rgba(16, 44, 56, .08);
}

.food-list-allergen-fallback {
  display: inline-grid;
  place-items: center;
  color: #0b8077;
  font-size: 9px;
  font-weight: 800;
}

.food-list-no-allergen {
  color: var(--muted);
  font-size: 12px;
}

.food-thumb {
  width: 44px;
  height: 34px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--wash);
}

.photo-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(13,148,136,0.2);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* ============================================================
   Menu List
   ============================================================ */

.menu-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  min-width: 620px;
}

.menu-list span {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  background: var(--panel);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

/* ============================================================
   Empty State
   ============================================================ */

.empty-state {
  min-height: 180px;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong { color: var(--ink); font-size: 20px; font-weight: 700; }

/* ============================================================
   Modal
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9,18,35,0.55);
  backdrop-filter: blur(6px);
  z-index: 50;
}

.modal-window {
  width: min(440px, calc(100vw - 32px));
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.food-modal-window {
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: #f8fafc;
  box-shadow: 0 32px 100px rgba(9,18,35,0.38);
}

.food-modal-window .modal-form {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 22px;
}

.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.food-modal-window .modal-heading {
  background: linear-gradient(130deg, #0c1929 0%, #0f766e 70%, #8a6c1a 100%);
  border-bottom: none;
  color: #ffffff;
  min-height: 68px;
}

.food-modal-window .modal-heading h2 { color: #ffffff; font-size: 20px; }

.food-save-notice {
  margin: 12px 18px 0;
  padding: 10px 14px;
  border: 1px solid #ef9b9b;
  border-radius: 9px;
  background: #fff2f2;
  color: #d11f1f;
  font-size: 14px;
  font-weight: 850;
  text-align: center;
}

.food-form-footer button:disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.25);
}

.recipe-name-action .recipe-row-add,
.recipe-name-action .recipe-row-remove {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.food-card-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.food-card-media {
  position: sticky;
  top: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

.food-card-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--accent-dark);
  background: var(--accent-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}

.food-card-media .food-photo-picker {
  min-height: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.food-card-media .food-photo-picker::after,
.food-card-media .food-photo-picker img {
  aspect-ratio: 4 / 3;
  max-height: 175px;
}

.food-card-media .food-photo-picker input { min-height: 40px; font-size: 12px; }

.food-card-note {
  display: grid;
  gap: 4px;
  padding: 11px;
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--wash);
  font-size: 11.5px;
  line-height: 1.45;
}

.food-card-note strong { color: var(--ink-2); font-size: 12px; }
.food-card-content { display: grid; gap: 12px; min-width: 0; }

.food-card-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

.food-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 13px;
}

.food-section-title > span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 7px;
  color: #ffffff;
  background: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.food-card-languages {
  display: inline-flex;
  gap: 3px;
  margin-left: auto;
}

.food-card-languages button {
  width: 34px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.food-card-languages button.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
}

.food-card-languages button:disabled { cursor: wait; opacity: 0.65; }

.food-identity-card .food-form-grid {
  grid-template-columns: 1fr;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.nutrition-card-grid { grid-template-columns: repeat(4, minmax(90px, 1fr)); }

.modal-heading h2 { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }

.modal-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--wash);
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  display: grid;
  place-items: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.modal-close:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }

.food-modal-window .modal-close {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
  color: #ffffff;
}

.food-modal-window .modal-close:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
  color: #ffffff;
}

.modal-form {
  display: grid;
  gap: 14px;
  padding: 18px 22px 22px;
}

.modal-form label {
  display: grid;
  gap: 6px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.modal-form input,
.modal-form select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 13px;
  color: var(--ink);
  background: var(--panel);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.modal-form input:focus,
.modal-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-form button[type="submit"] {
  min-height: 44px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(13,148,136,0.22);
  transition: background 0.15s, box-shadow 0.15s;
}

.modal-form button[type="submit"]:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 16px rgba(13,148,136,0.32);
}

/* ============================================================
   Food Form inside modal
   ============================================================ */

.food-form-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 18px;
  align-items: start;
}

.food-photo-picker {
  position: relative;
  min-height: 400px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.food-photo-picker > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.food-photo-picker input {
  width: 100%;
  min-height: 46px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: var(--wash);
}

.food-photo-picker input::file-selector-button {
  min-height: 32px;
  margin-right: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: #ffffff;
  background: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
}

.food-photo-picker img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.food-photo-picker::after {
  content: "Fotograf onizleme";
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(13,148,136,0.04), rgba(183,121,31,0.04));
}

.food-photo-picker:has(img:not([hidden]))::after { display: none; }

.food-photo-picker small { color: var(--muted-2); font-size: 12px; }

.food-form-main { display: grid; gap: 14px; }

.food-form-main > .food-form-grid,
.food-form-main > .food-tabs,
.food-form-main > .food-tab-panel { box-shadow: var(--shadow-xs); }

.food-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--panel);
}

.nutrition-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.food-form-grid label,
.nutrition-grid label { min-width: 0; }

.food-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--wash);
}

.food-tab {
  min-height: 40px !important;
  border-radius: var(--radius) !important;
  padding: 0 16px !important;
  color: var(--ink-2) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  transition: all 0.15s !important;
}

.food-tab:hover { background: var(--panel) !important; border-color: var(--line) !important; }

.food-tab.active {
  background: var(--accent) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(13,148,136,0.25) !important;
}

.food-tab-panel {
  display: none;
  min-height: 160px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: var(--panel);
}

.food-tab-panel.active { display: block; }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  align-content: flex-start;
  padding: 3px 8px 3px 3px;
}

.choice-chip {
  display: grid !important;
  grid-template-columns: 18px 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px !important;
  min-height: 62px;
  border: 1px solid #d9e5e3 !important;
  border-radius: 13px !important;
  padding: 9px 11px !important;
  color: var(--ink-2) !important;
  background: linear-gradient(180deg, #ffffff, #f9fbfb) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color .14s, background .14s, transform .14s, box-shadow .14s;
}

.choice-chip:hover { border-color: var(--accent) !important; transform: translateY(-1px); box-shadow: 0 5px 14px rgba(16,92,83,.09); }

.choice-chip:has(input:checked) {
  border-color: var(--accent) !important;
  color: var(--accent-dark) !important;
  background: var(--accent-light) !important;
}

.choice-chip input {
  width: 17px;
  height: 17px;
  min-height: 0 !important;
  accent-color: var(--accent);
}

.choice-chip img { width: 38px; height: 38px; object-fit: contain; border-radius: 10px; box-shadow: 0 3px 9px rgba(10,55,49,.13); }
.choice-chip > span { min-width: 0; overflow-wrap: anywhere; }

.choice-empty { color: var(--muted-2); font-size: 13px; }

/* Yemek formundaki 14 AB alerjenini kaydırmadan daha rahat göster. */
#foodAllergenChoices {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  max-height: 285px;
}

#foodAllergenChoices .choice-chip {
  grid-template-columns: 15px 30px minmax(0, 1fr);
  gap: 7px !important;
  min-height: 48px;
  padding: 6px 8px !important;
  border-radius: 11px !important;
  font-size: 10px !important;
  line-height: 1.15;
}

#foodAllergenChoices .choice-chip input {
  width: 15px;
  height: 15px;
}

#foodAllergenChoices .choice-chip img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

@media (max-width: 1100px) {
  #foodAllergenChoices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) { .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { #foodAllergenChoices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .choice-grid { grid-template-columns: 1fr; max-height: 300px; }
  #foodAllergenChoices { grid-template-columns: 1fr; max-height: 300px; }
}

.recipe-summary { display: grid; gap: 10px; }

.food-instructions-field { display: grid !important; gap: 8px; color: var(--ink-2) !important; font-size: 12px !important; font-weight: 700 !important; }
.food-instructions-field textarea { width: 100%; min-height: 210px; resize: vertical; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; background: #fbfdfd; color: var(--ink); font-size: 14px; font-weight: 400; line-height: 1.55; outline: none; }
.food-instructions-field input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; background: #fbfdfd; color: var(--ink); font-size: 14px; font-weight: 400; outline: none; }
.food-instructions-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13,148,136,.12); background: #fff; }
.food-instructions-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13,148,136,.12); background: #fff; }

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

.secondary-action {
  justify-self: start;
  min-height: 40px !important;
  border-radius: var(--radius) !important;
  padding: 0 16px !important;
  border: 1.5px solid var(--accent) !important;
  color: var(--accent-dark) !important;
  background: var(--panel) !important;
  font-weight: 600 !important;
  font-size: 13.5px !important;
  transition: background 0.15s !important;
}

.secondary-action:hover { background: var(--accent-light) !important; }

.recipe-selected-list {
  min-height: 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  color: var(--muted-2);
  background: var(--wash);
}

.recipe-selected-list span {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.food-form-footer {
  position: sticky;
  bottom: -22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px -22px -22px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
}

.food-form-footer span { color: var(--muted); font-size: 13px; font-weight: 500; }
.food-form-footer button { min-width: 170px; min-height: 44px; border-radius: var(--radius); }

/* ============================================================
   Recipe Modal
   ============================================================ */

.recipe-modal-backdrop { z-index: 70; background: rgba(9,18,35,0.55); }

.recipe-modal-window { width: min(1280px, calc(100vw - 24px)); }

.recipe-builder {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) 86px minmax(0, 1.08fr);
  gap: 16px;
  padding: 18px;
}

.recipe-table-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

.recipe-card-title {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--wash);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.recipe-summary-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding-right: 5px !important;
}

.recipe-summary-chip button {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 121, 112, .12);
  color: #087970;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.recipe-summary-chip button:hover {
  background: #d74343;
  color: #fff;
}

.recipe-ingredient-search {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
}

.recipe-ingredient-search input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 11px;
  outline: none;
  color: var(--ink);
  background: var(--wash);
}

.recipe-ingredient-search input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(10, 154, 141, .10);
}

.recipe-table-wrap { height: 390px; overflow-y: auto; overflow-x: hidden; }
.recipe-table-card:first-child .recipe-table-wrap { height: 334px; }

/* Sağdaki yemek içeriği her zaman kendi alanında dikey kaydırılır. */
.recipe-table-card:last-child .recipe-table-wrap {
  height: 390px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.recipe-table-card:last-child .recipe-table {
  table-layout: fixed;
}

.recipe-table-card:last-child .recipe-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--wash);
}

.recipe-table-card:last-child .recipe-table th:first-child,
.recipe-table-card:last-child .recipe-table td:first-child { width: 34%; }

.recipe-table-card:last-child .recipe-table th:nth-child(2),
.recipe-table-card:last-child .recipe-table td:nth-child(2) { width: 52%; }
.recipe-table-card:last-child .recipe-table th:nth-child(3),
.recipe-table-card:last-child .recipe-table td:nth-child(3) { width: 14%; }

.recipe-table-card:last-child .recipe-table td {
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
}

.recipe-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed;
  border-collapse: collapse;
}

.recipe-table tbody tr > td:only-child { width: 100% !important; }

.recipe-table th,
.recipe-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}

.recipe-table tbody tr { cursor: pointer; }
.recipe-table tbody tr:hover { background: var(--wash); }
.recipe-table tbody tr.selected { background: var(--accent-light); color: var(--accent-dark); font-weight: 700; }

.recipe-table-card:first-child .recipe-table { table-layout: fixed; }
.recipe-table-card:first-child .recipe-table th:first-child,
.recipe-table-card:first-child .recipe-table td:first-child { width: 34%; }
.recipe-table-card:first-child .recipe-table th:nth-child(2),
.recipe-table-card:first-child .recipe-table td:nth-child(2) { width: 52%; }
.recipe-table-card:first-child .recipe-table th:nth-child(3),
.recipe-table-card:first-child .recipe-table td:nth-child(3) { width: 14%; }
.recipe-operation-heading,
.recipe-operation-cell { text-align: center !important; }
.recipe-short-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipe-operation-cell .recipe-row-add,
.recipe-operation-cell .recipe-row-remove {
  display: inline-grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  margin: 0 auto !important;
  vertical-align: middle;
}

/* Reçete satır işlemleri: DOM düğmesi yüklenmese bile işareti hücre üzerinde göster. */
#recipeAvailableRows td:last-child,
#recipeSelectedRows td:last-child {
  position: relative;
  padding-right: 54px !important;
}

#recipeAvailableRows td:last-child::after,
#recipeSelectedRows td:last-child::after {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

#recipeAvailableRows td:last-child::after {
  content: "+";
  border: 1px solid #079b8f;
  background: #e9fbf8;
  color: #087970;
}

#recipeSelectedRows td:last-child::after {
  content: "−";
  border: 1px solid #ef8d8d;
  background: #fff0f0;
  color: #d52f2f;
}

#recipeAvailableRows tr,
#recipeSelectedRows tr { cursor: pointer; }

.recipe-example-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
}

.recipe-example-row > input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  pointer-events: none;
}

.recipe-example-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.recipe-example-info strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe-example-info small {
  color: var(--muted);
  font-size: 10px;
}

.recipe-example-action {
  display: grid !important;
  place-items: center;
  width: 31px;
  height: 31px;
  padding: 0;
  border-radius: 9px;
  background: #fff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.recipe-example-action.add { border: 1px solid #079b8f; color: #087970; }
.recipe-example-action.remove { border: 1px solid #ef8d8d; color: #d52f2f; }
.recipe-example-action.add:hover { background: #079b8f; color: #fff; }
.recipe-example-action.remove:hover { background: #d52f2f; color: #fff; }

#recipeAvailableRows tr:has(.recipe-example-row) td,
#recipeSelectedRows tr:has(.recipe-example-row) td { padding: 0 12px !important; }
#recipeAvailableRows tr:has(.recipe-example-row) td::after,
#recipeSelectedRows tr:has(.recipe-example-row) td::after { content: none !important; }
.recipe-ingredient-name { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.recipe-ingredient-name span { min-width: 0; overflow-wrap: anywhere; }
.recipe-name-action { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; }
.recipe-name-action > span { display: block; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipe-name-action .recipe-row-add,
.recipe-name-action .recipe-row-remove { position: static; flex: 0 0 30px; margin: 0 0 0 auto; transform: none; }
.recipe-code-with-action { display: flex; align-items: center; gap: 9px; min-width: 0; }
.recipe-code-with-action span { min-width: 0; overflow-wrap: anywhere; }
.recipe-row-add {
  position: static;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  margin: 0 auto;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: #effbf9;
  color: var(--accent-dark);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.recipe-row-add:hover { background: var(--accent); color: #fff; transform: scale(1.06); }
.recipe-row-remove {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  margin-left: auto;
  border: 1px solid #ef9c9c;
  border-radius: 9px;
  background: #fff3f3;
  color: #d74343;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.recipe-row-remove:hover { background: #d74343; border-color: #d74343; color: #fff; }

.recipe-grams-input {
  width: 88px;
  min-height: 28px !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  padding: 3px 7px !important;
  font-size: 13px;
}

.recipe-transfer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Lisanslama kilidi */
.license-locked .main-nav [data-view],
.license-locked .submenu button,
.license-locked #foodToggle,
.license-locked #restaurantToggle,
.license-locked #reportsToggle,
.license-locked #primaryAction {
  pointer-events: none;
  opacity: 0.4;
  filter: grayscale(1);
}

.license-lock {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 27, 43, 0.55);
  backdrop-filter: blur(2px);
}

.license-lock-card {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 32px 28px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}

.license-lock-card h2 {
  margin: 0;
  color: var(--accent-dark);
}

.license-lock-card p {
  margin: 0;
  color: #5f6b74;
  font-size: 13px;
  line-height: 1.5;
}

.license-lock-card:hover {
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.recipe-transfer button {
  width: 82px;
  min-height: 42px;
  border-radius: 10px;
  padding: 0 8px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s;
  box-shadow: 0 5px 12px rgba(10, 154, 141, .16);
}

.recipe-transfer button:hover { background: var(--accent-dark); }

.recipe-transfer button:last-child {
  background: var(--wash);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.recipe-transfer button:last-child:hover { background: var(--line-2); }

/* ============================================================
   Entry Form
   ============================================================ */

.entry-form {
  display: grid;
  grid-template-columns: 150px minmax(220px,1fr) auto;
  align-items: end;
  gap: 12px;
  min-width: 620px;
  padding: 16px;
}

.entry-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.entry-form input {
  width: 100%;
  min-height: 42px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--ink);
  background: var(--panel);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.entry-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.entry-form button {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0 16px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
}

.form-status {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.database-form { padding: 24px; display: grid; gap: 22px; min-width: 620px; }
.database-state { padding: 16px 18px; border-radius: var(--radius-lg); display: grid; gap: 4px; border: 1px solid; }
.database-state.online { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.database-state.offline { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.database-state span { font-size: 13px; opacity: .82; }
.database-fields { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.database-fields label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.database-fields input { min-height: 44px; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 9px 12px; background: var(--panel); color: var(--ink); }
.database-fields input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.database-name { grid-column: 1 / -1; }
.database-check { display: flex; gap: 9px; align-items: center; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.database-check input { width: 17px; height: 17px; accent-color: var(--accent); }
.database-actions { display: flex; align-items: center; gap: 16px; }
.database-actions button { min-height: 44px; padding: 0 20px; border-radius: var(--radius); background: var(--accent); color: #fff; font-weight: 750; }
.database-actions button:disabled { opacity: .55; cursor: wait; }
.database-actions .form-status { grid-column: auto; }

@media (max-width: 720px) {
  .database-form { min-width: 0; padding: 16px; }
  .database-fields { grid-template-columns: 1fr; }
  .database-name { grid-column: auto; }
  .database-actions { align-items: stretch; flex-direction: column; }
}

.side-table-wrap { width: 100%; overflow-x: auto; margin-top: 12px; }
.side-table { min-width: 0; }
.side-table th, .side-table td { padding: 9px 10px; }

.side-entry-form { grid-template-columns: 1fr; align-items: stretch; min-width: 0; margin-top: 16px; }

/* ============================================================
   Menu-only view
   ============================================================ */

.menu-only-view .workspace { grid-template-columns: minmax(0,1fr); }
.menu-only-view .main-panel { min-height: 520px; }
.menu-only-view .panel-heading { display: none; }
.menu-only-view .primary-action { display: none; }
.esl-panel-screen { display: grid; gap: 20px; }
.esl-panel-toolbar { display: flex; align-items: flex-start; flex-direction: column; justify-content: flex-start; gap: 12px; }
.esl-panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.esl-panel-toolbar > .esl-toolbar-title { display: grid; gap: 4px; }
.esl-panel-toolbar span { color: var(--muted); font-size: 12px; }
.esl-panel-toolbar button { border: 1px solid var(--primary); border-radius: 9px; padding: 9px 14px; background: #fff; color: var(--primary); font-weight: 800; cursor: pointer; }
.esl-panel-toolbar > .esl-toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
.esl-panel-toolbar .esl-toolbar-actions .primary { background: #0f9487; color: #fff; }
.esl-panel-toolbar .esl-toolbar-actions .danger { border-color: #b52e2e; background: #c93d3d; color: #fff; }
.esl-code-search { min-width: 210px; border: 1px solid #cbdedb; border-radius: 9px; padding: 9px 12px; font-size: 12px; font-weight: 600; color: #14322e; background: #fff; }
.esl-code-search:focus { outline: none; border-color: var(--primary); }
.esl-code-search::placeholder { color: var(--muted); font-weight: 500; }
.esl-toolbar-row { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 16px; }
.esl-toolbar-row > .esl-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.esl-refresh-button { margin-left: auto; }
.esl-refresh-button span { display: none; }
.esl-column-filter { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.esl-column-filter > button { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid transparent; border-radius: 6px; color: #397d75; cursor: pointer; }
.esl-column-filter > button:hover, .esl-column-filter > button.active { border-color: #83bfb8; background: #dff4f1; color: #087f74; }
.esl-filter-menu { position: absolute; top: calc(100% + 7px); left: 0; z-index: 20; display: grid; min-width: 210px; max-height: 280px; overflow: auto; padding: 6px; border: 1px solid #cbdedb; border-radius: 9px; background: #fff; box-shadow: 0 12px 30px rgba(20,55,50,.18); }
.esl-filter-menu[hidden] { display: none !important; }
.esl-filter-menu button { width: 100%; padding: 8px 9px; border-radius: 6px; color: #304b48; font-size: 11px; font-weight: 700; text-align: left; cursor: pointer; }
.esl-filter-menu button:hover, .esl-filter-menu button.selected { background: #e7f6f3; color: #087f74; }
.esl-group-grid { display: grid; grid-template-columns: repeat(5, minmax(190px, 1fr)); gap: 12px; align-items: start; }
.esl-group-card { overflow: hidden; min-width: 0; border: 1px solid #d7e7e4; border-radius: 15px; background: #fff; }
.esl-group-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 74px; padding: 13px 14px; background: linear-gradient(135deg,#168b7e,#2aa797); color: #fff; }
.esl-group-card > header div { display: grid; gap: 3px; }
.esl-group-card > header small { font-weight: 900; opacity: .86; }
.esl-group-card > header strong { font-size: 15px; }
.esl-group-card > header > span { padding: 4px 7px; border: 1px solid rgba(255,255,255,.5); border-radius: 7px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.esl-device-list { display: grid; }
.esl-device-row { display: grid; gap: 8px; padding: 12px; border-top: 1px solid #edf2f1; }
.esl-device-code { display: grid; gap: 2px; }
.esl-device-code strong { color: #126f66; font-size: 13px; overflow-wrap: anywhere; }
.esl-device-code small, .esl-current-food { color: var(--muted); font-size: 10px; }
.esl-device-row select { width: 100%; min-height: 38px; border: 1px solid #cfe0dd; border-radius: 8px; padding: 7px; background: #fff; color: var(--ink); }
.esl-current-food { display: grid; gap: 2px; padding: 8px 9px; border: 1px solid #d8e8e5; border-radius: 8px; background: #f7fbfa; }
.esl-current-food b { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.esl-current-food strong { color: #13776c; font-size: 12px; line-height: 1.25; }
.esl-current-food small { color: #50827c; }
.esl-current-food.empty { background: #fafafa; }
.esl-current-food.empty strong { color: #8b9896; }
.esl-group-empty { padding: 24px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.esl-panel-footer { padding: 15px 18px; border-radius: 12px; background: #eff8f7; color: var(--muted); }
.esl-panel-footer button { border: 0; border-radius: 10px; padding: 12px 20px; background: var(--primary); color: #fff; font-weight: 800; cursor: pointer; }
.esl-panel-footer button:disabled { opacity: .45; cursor: not-allowed; }
.esl-table-wrap { max-height: calc(100vh - 330px); min-height: 300px; overflow: auto; border: 1px solid #dbe7e5; border-radius: 12px; }
.esl-table { min-width: 820px; }
.esl-table th { position: sticky; top: 0; z-index: 2; padding: 9px 12px; background: #eef8f6; color: #176f66; font-size: 10px; }
.esl-table td { padding: 8px 12px; vertical-align: middle; font-size: 11px; }
.esl-table td:first-child { display: grid; gap: 3px; }
.esl-table td:first-child small { color: var(--muted); }
.esl-code-cell { color: #126f66; letter-spacing: .03em; }
.esl-food-cell { display: flex; align-items: center; justify-content: flex-start; gap: 12px; }
.esl-food-cell > span { display: grid; gap: 3px; }
.esl-food-cell small { color: var(--muted); }
.esl-edit-button { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border: 1px solid #9acfc8; border-radius: 7px; background: #effaf8; color: #087f74; font-size: 15px; cursor: pointer; }
.esl-edit-button:hover { background: #dff5f1; }
.esl-food-cell > .esl-row-actions { display: flex; align-items: center; gap: 6px; }
.esl-delete-button { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border: 1px solid #e0aaaa; border-radius: 7px; background: #fff4f4; color: #b52e2e; font-size: 17px; cursor: pointer; }
.esl-delete-button:hover { background: #ffe5e5; }
.esl-delete-button:disabled { opacity: .35; cursor: not-allowed; }
.esl-send-button { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; border: 1px solid #8ab9dc; border-radius: 7px; background: #eef7ff; color: #17689f; font-size: 16px; cursor: pointer; }
.esl-send-button:hover { background: #dcefff; }
.esl-send-button:disabled { opacity: .35; cursor: not-allowed; }
.esl-serial-view { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.esl-serial-value { color: var(--muted); font-size: 10px; }
.esl-serial-value b { color: #126f66; font-weight: 700; }
.esl-serial-edit-button { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; border: 1px solid #9acfc8; border-radius: 6px; background: #effaf8; color: #087f74; font-size: 11px; line-height: 1; cursor: pointer; padding: 0; }
.esl-serial-edit-button:hover { background: #dff5f1; }
.esl-serial-edit-button.esl-serial-add { width: auto; flex-basis: auto; padding: 3px 8px; font-size: 10px; font-weight: 600; }
.esl-serial-form { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.esl-serial-input { width: 100px; padding: 4px 7px; border: 1px solid #9acfc8; border-radius: 6px; font-size: 10px; }
.esl-serial-save { border: none; border-radius: 6px; padding: 4px 8px; background: #0f9c8c; color: #fff; font-size: 10px; font-weight: 600; cursor: pointer; }
.esl-serial-save:hover { background: #0c8477; }
.esl-serial-cancel { border: 1px solid #dbe7e5; border-radius: 6px; padding: 4px 8px; background: #fff; color: var(--muted); font-size: 10px; cursor: pointer; }
.esl-serial-cancel:hover { background: #f4f4f4; }
.esl-selected-food { display: grid; gap: 4px; min-width: 130px; }
.esl-selected-food small { color: var(--muted); }
.esl-status { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #f3f5f5; color: #788481; font-size: 11px; font-weight: 800; }
.esl-status.online { background: #e4f7ef; color: #137454; }
.esl-edit-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px; background: rgba(5, 20, 30, .62); backdrop-filter: blur(3px); }
.esl-edit-overlay[hidden] { display: none !important; }
.esl-edit-screen { display: grid; gap: 18px; width: min(900px, 100%); max-height: calc(100vh - 48px); overflow: hidden; padding: 22px; border-radius: 15px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.esl-dialog-open { overflow: hidden; }
.esl-edit-heading { display: flex; align-items: flex-start; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid #dbe7e5; }
.esl-edit-heading > button { min-height: 40px; margin-left: auto; border: 1px solid #82c4bc; border-radius: 9px; padding: 9px 14px; background: #fff; color: #087f74; font-weight: 800; cursor: pointer; white-space: nowrap; }
.esl-edit-heading > div { display: grid; gap: 4px; }
.esl-edit-heading h3, .esl-edit-heading p { margin: 0; }
.esl-edit-heading span { color: var(--muted); font-size: 12px; }
.esl-edit-search { max-width: 720px; }
.esl-edit-status { color: var(--muted); font-size: 12px; }
.esl-bulk-screen { width: min(760px, 100%); }
.esl-bulk-date { display: grid; gap: 5px; width: 190px; color: var(--muted); font-size: 10px; font-weight: 800; }
.esl-bulk-date input { height: 36px; border: 1px solid #cbdedb; border-radius: 8px; padding: 6px 9px; background: #fff; color: var(--ink); font: inherit; }
.esl-bulk-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; max-height: 430px; overflow: auto; }
.esl-bulk-options > button { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 12px 14px; border: 1px solid #d4e4e1; border-radius: 10px; background: #f8fbfb; color: var(--ink); text-align: left; cursor: pointer; }
.esl-bulk-options > button:hover { border-color: #68b6ad; background: #edf9f7; }
.esl-bulk-options > button strong { flex: 1; }
.esl-bulk-options > button small { color: var(--muted); }
.esl-bulk-options.meals { grid-template-columns: repeat(5, minmax(100px,1fr)); }
.esl-bulk-options.meals > button { display: grid; justify-items: center; gap: 5px; min-height: 105px; text-align: center; }
.esl-bulk-options.meals > button span { font-size: 24px; }
.esl-bulk-options > button:disabled { opacity: .42; cursor: not-allowed; }
.esl-food-picker-list { display: grid; max-height: min(58vh, 560px); overflow: auto; border: 1px solid #dbe7e5; border-radius: 10px; }
.esl-food-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid #edf2f1; background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.esl-food-picker-row:last-child { border-bottom: 0; }
.esl-food-picker-row:hover { background: #f0faf8; }
.esl-food-picker-row.selected { background: #e3f7f3; box-shadow: inset 3px 0 #0f9487; }
.esl-food-picker-row span { display: grid; gap: 4px; min-width: 0; }
.esl-food-picker-row strong { overflow: hidden; text-overflow: ellipsis; }
.esl-food-picker-row small { color: var(--muted); }
.esl-food-picker-row b { color: #087f74; }
.esl-selected-send-button { align-self: flex-end; padding: 11px 18px; border: 0; border-radius: 9px; background: #0f9487; color: #fff; font-weight: 700; cursor: pointer; }
.esl-selected-send-button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 1250px) { .esl-group-grid { grid-template-columns: repeat(3, minmax(200px, 1fr)); } }
@media (max-width: 800px) { .esl-group-grid { grid-template-columns: 1fr; } .esl-panel-footer { align-items: stretch; flex-direction: column; } }
@media (max-width: 800px) { .esl-panel-toolbar { align-items: stretch; flex-direction: column; } .esl-toolbar-actions { justify-content: flex-start; } }
@media (max-width: 650px) {
  .esl-panel-screen { gap: 12px; }
  .esl-panel-toolbar { gap: 8px; }
  .esl-toolbar-row { align-items: center; flex-direction: row; gap: 5px; }
  .esl-toolbar-row > .esl-toolbar-actions { flex-wrap: wrap; gap: 5px; }
  .esl-panel-toolbar button { min-height: 28px; padding: 5px 8px; border-radius: 6px; font-size: 9px; white-space: nowrap; }
  .esl-code-search { min-width: 0; flex: 1 1 130px; min-height: 28px; padding: 5px 8px; border-radius: 6px; font-size: 9px; }
  .esl-refresh-button { display: grid; place-items: center; flex: 0 0 28px; width: 28px; margin-left: auto; padding: 0 !important; font-size: 15px !important; }
  .esl-refresh-button span { display: inline; }
  .esl-refresh-button b { display: none; }
  .esl-table { min-width: 610px; }
  .esl-table th { padding: 7px 8px; font-size: 8px; }
  .esl-table td { padding: 6px 8px; font-size: 9px; }
  .esl-edit-button, .esl-delete-button, .esl-send-button { flex-basis: 23px; width: 23px; height: 23px; border-radius: 5px; font-size: 12px; }
  .esl-row-actions { gap: 3px !important; }
  .esl-panel-footer { padding: 10px 12px; font-size: 10px; }
}
@media (max-width: 650px) { .esl-edit-overlay { padding: 10px; } .esl-edit-screen { max-height: calc(100vh - 20px); padding: 15px; } }
@media (max-width: 650px) { .esl-bulk-options, .esl-bulk-options.meals { grid-template-columns: 1fr; } }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1024px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: -100%;
    width: var(--sidebar-w);
    transition: left 0.28s cubic-bezier(0.4,0,0.2,1);
  }

  body.sidebar-open { overflow: hidden; }
  body.sidebar-open .sidebar { left: 0; box-shadow: 12px 0 36px rgba(5,18,32,.35); }
  body.sidebar-open::after { content: ""; position: fixed; inset: 0; z-index: 20; background: rgba(5,18,32,.48); backdrop-filter: blur(2px); }

  .menu-button { display: grid; }

  .hero-panel { flex-direction: column; align-items: flex-start; }

  .status-stack { flex-direction: row; flex-wrap: wrap; }

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

  .hero-panel, .metric-grid, .workspace { margin-left: 16px; margin-right: 16px; }

  .topbar { padding: 0 16px; }

  .food-form-layout { grid-template-columns: 1fr; }
  .food-card-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .nutrition-card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; }
  .food-modal-window { width: 100vw; max-height: 100vh; border-radius: 0; }
  .food-modal-window .modal-form { max-height: calc(100vh - 68px); padding: 14px; }
  .food-card-shell { grid-template-columns: 1fr; }
  .food-card-media { position: static; grid-template-columns: 120px 1fr; align-items: start; }
  .food-card-badge, .food-card-note { grid-column: 1 / -1; }
  .food-card-media .food-photo-picker::after,
  .food-card-media .food-photo-picker img { max-height: 100px; }
  .food-form-grid, .nutrition-card-grid { grid-template-columns: 1fr 1fr; }
  .food-tabs { flex-wrap: nowrap; overflow-x: auto; }
  .food-tab { white-space: nowrap; padding: 0 12px !important; }
  .food-form-footer { margin-left: -14px; margin-right: -14px; margin-bottom: -14px; padding: 12px 14px; }
  .food-form-footer span { display: none; }
  .food-form-footer button { width: 100%; }
  .meal-picker-window { width: 100vw; max-height: 100vh; border-radius: 0; }
}
