:root {
  --primary: #dc2626;
  --primary-soft: #fee2e2;
  --primary-dark: #b91c1c;
  --accent: #f97316;
  --background: #fef2f2;
  --surface: #ffffff;
  --border-subtle: #dde4f0;
  --text-main: #1a2942;
  --text-muted: #6b7280;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
  --shadow-subtle: 0 10px 25px rgba(15, 23, 42, 0.06);
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #fef2f2 0, #fee2e2 40%, #ffe4e6 100%);
  color: var(--text-main);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: conic-gradient(from 190deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 10px 25px rgba(220, 38, 38, 0.45);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
}

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

.app-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card {
  background: radial-gradient(circle at top left, #fef2f2 0, #ffffff 55%);
  border-radius: 26px;
  padding: 26px 26px 22px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.login-card {
  max-width: 440px;
  width: 100%;
}

.card-title {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: 0.01em;
}

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

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-inline {
  gap: 10px;
}

.form-row-2,
.form-row-3 {
  display: grid;
  gap: 10px;
}

.form-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.form-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.form-field input {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s;
  background: rgba(255, 255, 255, 0.95);
}

.form-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.18),
    0 12px 28px rgba(185, 28, 28, 0.25);
  background: #ffffff;
}

.form-footer {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.checkbox input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

.btn {
  border-radius: 999px;
  border: none;
  font-size: 14px;
  padding: 9px 18px;
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff;
  box-shadow: 0 14px 35px rgba(185, 28, 28, 0.55);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(185, 28, 28, 0.65);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 10px 26px rgba(185, 28, 28, 0.45);
}

.btn-block {
  width: 100%;
}

.hint-text {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}

.tiny-text {
  font-size: 11px;
}

.app-footer {
  padding: 12px 24px 18px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
}

/* ADMIN LAYOUT */

.admin-layout {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 20px;
}

.admin-sidebar {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 22px;
  padding: 16px 14px 14px;
  box-shadow: var(--shadow-subtle);
  border: 1px solid rgba(209, 213, 219, 0.85);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-sidebar-header h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

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

.admin-menu-item {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 8px 13px;
  font-size: 13px;
  text-align: left;
  background: #f1f5f9;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease,
    transform 0.08s ease;
}

.admin-menu-item:hover {
  background: #fee2e2;
}

.admin-menu-item.active {
  background: linear-gradient(135deg, #b91c1c, #f97316);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(185, 28, 28, 0.55);
}

.btn-secondary-light {
  margin-top: 4px;
  width: 100%;
  background: #e5e7eb;
  color: #111827;
  border-radius: 999px;
  border: none;
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

.btn-secondary-light:hover {
  background: #d1d5db;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.5);
}

.admin-content {
  background: radial-gradient(circle at top left, #fee2e2 0, #ffffff 55%);
  border-radius: 24px;
  padding: 20px 20px 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(199, 210, 254, 0.9);
}

.admin-section h3 {
  margin: 0 0 6px;
  font-size: 19px;
}

.admin-section + .admin-section {
  margin-top: 14px;
}

.table-wrapper {
  margin-top: 12px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(209, 213, 219, 0.9);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  overflow-x: auto;
}

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

.data-table thead {
  background: #fee2e2;
}

.data-table th,
.data-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.data-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.table-action {
  border: none;
  background: transparent;
  font-size: 12px;
  color: #2563eb;
  cursor: pointer;
  margin-right: 6px;
}

.table-action.delete {
  color: #dc2626;
}

/* MENU LAYOUT */

.menu-layout {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 20px;
}

.menu-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.menu-header {
  background: radial-gradient(circle at top left, #fee2e2 0, #ffffff 65%);
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-subtle);
  border: 1px solid rgba(189, 209, 234, 0.7);
}

.menu-header h2 {
  margin: 0 0 2px;
  font-size: 18px;
}

.select {
  margin-top: 10px;
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  padding: 9px 13px;
  font-size: 13px;
  background: #ffffff;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.18);
}

.category-list {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  padding: 10px;
  box-shadow: var(--shadow-subtle);
  border: 1px solid rgba(209, 213, 219, 0.8);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subcategories-container {
  margin-bottom: 20px;
}

.subcategories-container .category-list {
  margin-top: 12px;
}

.category-pill {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  cursor: pointer;
  background: #fee2e2;
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease,
    box-shadow 0.1s ease;
}

.category-pill span.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.9);
}

.category-pill.active {
  background: linear-gradient(135deg, #b91c1c, #f97316);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(185, 28, 28, 0.6);
}

.category-pill.active span.dot {
  background: #e5f2ff;
}

.menu-content {
  background: radial-gradient(circle at top left, #fee2e2 0, #ffffff 55%);
  border-radius: 26px;
  padding: 20px 22px 18px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(199, 210, 254, 0.8);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.menu-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.menu-topbar h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

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

.menu-logo {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background-color: var(--primary-soft);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: var(--primary-dark);
  box-shadow: 0 8px 20px rgba(185, 28, 28, 0.4);
}

.menu-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.badge {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
}

.badge-outline {
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.7);
}

/* Kampanyalı ürün toggle */
.menu-discount-toggle {
  margin-left: auto;
  align-self: center;
}

.discount-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.1);
  box-shadow: 0 8px 18px rgba(127, 29, 29, 0.2);
}

.discount-toggle-label-text {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.discount-toggle-label-text.highlight {
  color: var(--primary-dark);
  font-weight: 600;
}

.discount-toggle-switch {
  position: relative;
  width: 46px;
  height: 22px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: #e5e7eb;
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.discount-toggle-switch .discount-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.25);
  transition: transform 0.18s ease;
}

.discount-toggle-switch[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 24px rgba(185, 28, 28, 0.6);
}

.discount-toggle-switch[aria-pressed="true"] .discount-toggle-knob {
  transform: translateX(24px);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.product-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(209, 213, 219, 0.9);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
}

.product-image {
  height: 110px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.product-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.08),
    rgba(15, 23, 42, 0.05)
  );
}

.product-body {
  padding: 10px 11px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

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

.product-footer {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-price {
  font-weight: 600;
  color: var(--primary-dark);
  font-size: 14px;
}

.btn-ghost {
  background: #fee2e2;
  color: var(--primary-dark);
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.9);
  cursor: pointer;
  transition: background 0.12s ease, transform 0.1s ease,
    box-shadow 0.12s ease;
}

.btn-ghost:hover {
  background: #fecaca;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.45);
  transform: translateY(-1px);
}

.btn-ghost:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(220, 38, 38, 0.4);
}

.order-summary {
  padding: 14px 14px 11px;
}

.cart-items {
  list-style: none;
  margin: 10px 0 8px;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  padding: 6px 4px;
  border-radius: 999px;
}

.cart-item:nth-child(odd) {
  background: #f1f5f9;
}

.cart-item-qty {
  font-weight: 600;
  color: var(--primary-dark);
}

.cart-item-name {
  flex: 1;
}

.cart-item-price {
  font-weight: 500;
}

.order-total {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed rgba(148, 163, 184, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
}

.back-business {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* RESPONSIVE */

@media (max-width: 960px) {
  .app-main {
    align-items: stretch;
  }

  .menu-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 14px 16px 4px;
  }

  .app-main {
    padding: 10px;
  }

  .login-card {
    padding: 22px 18px 18px;
  }

  .menu-content {
    padding: 16px 14px 12px;
  }

  .menu-topbar {
    flex-direction: column;
  }

  .app-footer {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  .admin-content {
    padding: 16px 14px 12px;
  }

  .data-table {
    font-size: 12px;
    min-width: 460px;
  }

  .btn,
  .btn-secondary-light {
    padding: 10px 18px;
  }

  .order-summary {
    padding: 12px 10px 10px;
  }

  .menu-header {
    padding: 14px 12px 12px;
  }

  /* Garson paneli sipariş tablosu için kart görünüm */
  #waiter-orders-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  #waiter-orders-table thead {
    display: none;
  }

  #waiter-orders-table tbody {
    display: block;
  }

  #waiter-orders-table tr {
    display: block;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    padding: 10px 12px 8px;
    margin-bottom: 10px;
  }

  #waiter-orders-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: none;
    font-size: 12px;
  }

  #waiter-orders-table td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--text-muted);
    margin-right: 8px;
  }

  #waiter-orders-table td:last-child {
    justify-content: flex-end;
  }
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-content {
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.3);
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 22px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
}

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

.modal-body {
  padding: 20px 22px;
}

.order-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}

.order-detail-item:last-child {
  border-bottom: none;
}

.order-detail-item-name {
  flex: 1;
  font-weight: 500;
}

.order-detail-item-qty {
  margin: 0 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.order-detail-item-price {
  font-weight: 600;
  color: var(--primary-dark);
}

.order-detail-total {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
}

/* Adisyon (sipariş detay / yazdır) */
.modal-content-adisyon {
  max-width: 480px;
}

.adisyon-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.adisyon-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.05em;
}

.adisyon-meta {
  margin: 4px 0;
  font-size: 13px;
  color: var(--text-muted);
}

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

.adisyon-table th,
.adisyon-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.adisyon-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-secondary);
}

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

.adisyon-total {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 2px solid var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
}

