/* ==========================================================================
   Harbourger — Ortak Tema (Lacivert & Gri)
   Renkler logodan örneklenmiştir: koyu lacivert #131822, krem #fffffe
   ========================================================================== */

:root {
  --navy-950: #0c0f16;
  --navy-900: #131822;
  --navy-800: #1b2233;
  --navy-700: #263047;
  --navy-600: #34405c;
  --gray-700: #4b5160;
  --gray-500: #7b8190;
  --gray-300: #c7cbd3;
  --gray-200: #e3e5ea;
  --gray-100: #f1f2f5;
  --cream: #fdfcf8;
  --white: #ffffff;
  --accent: #cf9b3c; /* sıcak vurgu — fiyat/rozet için ölçülü kullanım */
  --success: #2f8f5b;
  --danger: #b3432b;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(19, 24, 34, 0.1);
  --shadow-lg: 0 12px 32px rgba(19, 24, 34, 0.22);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--gray-100);
  color: var(--navy-900);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Header ---------- */
.app-header {
  background: var(--navy-900);
  color: var(--cream);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}

.app-header img.logo {
  height: 42px;
  width: 42px;
  border-radius: 50%;
  background: var(--cream);
  object-fit: cover;
}

.app-header .titles { flex: 1; }
.app-header .titles h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.app-header .titles .subtitle {
  margin: 0;
  font-size: 12px;
  color: var(--gray-300);
}

.badge-table {
  background: var(--navy-700);
  color: var(--cream);
  border: 1px solid var(--navy-600);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Tabs (bottom nav for customer app) ---------- */
.tabbar {
  position: sticky;
  bottom: 0;
  display: flex;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -4px 16px rgba(19,24,34,0.08);
  z-index: 50;
}
.tabbar button {
  flex: 1;
  border: none;
  background: none;
  padding: 12px 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}
.tabbar button.active { color: var(--navy-900); }
.tabbar button.active::before {
  content: "";
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 3px;
  background: var(--navy-900);
  border-radius: 0 0 3px 3px;
}
.tabbar .icon { font-size: 19px; line-height: 1; }
.tabbar .cart-count {
  position: absolute;
  top: 2px;
  right: 22%;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ---------- Layout containers ---------- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 90px;
}

/* ---------- Category chips ---------- */
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  color: var(--navy-800);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.chip.active {
  background: var(--navy-900);
  color: var(--cream);
  border-color: var(--navy-900);
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

.item-card { display: flex; gap: 12px; align-items: flex-start; }
.item-card .info { flex: 1; }
.item-card h3 { margin: 0 0 4px; font-size: 15px; color: var(--navy-900); }
.item-card p.desc { margin: 0 0 8px; font-size: 12.5px; color: var(--gray-500); line-height: 1.4; }
.item-card .price { font-weight: 700; color: var(--navy-800); font-size: 14px; }
.item-card .unavailable-tag {
  font-size: 11px;
  color: var(--danger);
  font-weight: 700;
  background: rgba(179,67,43,0.1);
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 6px;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-100);
  border-radius: 10px;
  padding: 4px;
}
.qty-stepper button {
  width: 26px; height: 26px;
  border-radius: 7px;
  border: none;
  background: var(--white);
  color: var(--navy-900);
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.qty-stepper .qty-val { min-width: 18px; text-align: center; font-weight: 700; font-size: 13px; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 13.5px;
  background: var(--navy-900);
  color: var(--cream);
  box-shadow: var(--shadow);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.secondary { background: var(--white); color: var(--navy-900); border: 1px solid var(--gray-200); box-shadow: none; }
.btn.danger { background: var(--danger); }
.btn.success { background: var(--success); }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }

/* ---------- Floating waiter button ---------- */
.fab-waiter {
  position: fixed;
  right: 16px;
  bottom: 84px;
  z-index: 60;
  background: var(--navy-900);
  color: var(--cream);
  border: none;
  border-radius: 30px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
}
.fab-waiter:disabled { opacity: 0.55; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 150px;
  transform: translateX(-50%);
  background: var(--navy-900);
  color: var(--cream);
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

/* ---------- Cart / Bill rows ---------- */
.cart-row, .bill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-200);
}
.cart-row:last-child, .bill-row:last-child { border-bottom: none; }
.cart-row .name, .bill-row .name { flex: 1; font-size: 13.5px; font-weight: 600; }
.cart-row .line-total, .bill-row .line-total { font-weight: 700; font-size: 13.5px; }

.total-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 800;
  padding-top: 12px;
  margin-top: 6px;
  border-top: 2px solid var(--navy-900);
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
}
.status-Yeni { background: rgba(207,155,60,0.18); color: #8a611f; }
.status-Hazırlanıyor { background: rgba(38,48,71,0.12); color: var(--navy-700); }
.status-Servis-Edildi { background: rgba(47,143,91,0.15); color: var(--success); }
.status-Tamamlandı { background: rgba(123,129,144,0.18); color: var(--gray-700); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-500);
}
.empty-state .emoji { font-size: 34px; margin-bottom: 10px; }

/* ---------- Section titles ---------- */
.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-500);
  font-weight: 700;
  margin: 18px 0 10px;
}
.section-title:first-child { margin-top: 0; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(12,15,22,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  max-width: 420px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal h2 { margin-top: 0; font-size: 17px; color: var(--navy-900); }

/* ---------- Forms (admin) ---------- */
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 5px;
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--gray-200);
  border-radius: 9px;
  font-size: 13.5px;
  background: var(--gray-100);
  color: var(--navy-900);
}
.form-group textarea { resize: vertical; min-height: 60px; }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }

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

/* ---------- Admin layout ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 210px;
  background: var(--navy-900);
  color: var(--cream);
  padding: 18px 0;
  flex-shrink: 0;
}
.admin-sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px 18px;
  border-bottom: 1px solid var(--navy-700);
  margin-bottom: 12px;
}
.admin-sidebar .brand img { width: 36px; height: 36px; border-radius: 50%; background: var(--cream); }
.admin-sidebar .brand span { font-weight: 700; font-size: 15px; }
.admin-sidebar nav button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--gray-300);
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 3px solid transparent;
}
.admin-sidebar nav button.active {
  background: var(--navy-800);
  color: var(--cream);
  border-left-color: var(--accent);
}
.admin-main { flex: 1; padding: 26px 30px; max-width: 980px; }
.admin-main h2 { margin-top: 0; color: var(--navy-900); }

.table-list { width: 100%; border-collapse: collapse; }
.table-list th, .table-list td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 13.5px;
}
.table-list th { color: var(--gray-500); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; }

.pill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 12px; }
.table-pill {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow);
}
.table-pill h3 { margin: 0 0 8px; color: var(--navy-900); font-size: 15px; }
.table-pill .actions { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy-950);
}
.login-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: 100%;
  max-width: 340px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-card img { width: 64px; height: 64px; border-radius: 50%; margin-bottom: 12px; background: var(--navy-900); }
.login-card h1 { font-size: 18px; margin: 0 0 4px; color: var(--navy-900); }
.login-card p.hint { font-size: 12px; color: var(--gray-500); margin-bottom: 18px; }
.error-text { color: var(--danger); font-size: 12.5px; margin-top: 8px; min-height: 16px; }

.small-muted { font-size: 12px; color: var(--gray-500); }

@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; padding: 10px 0; }
  .admin-sidebar nav { display: flex; overflow-x: auto; }
  .admin-sidebar nav button { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .admin-sidebar nav button.active { border-bottom-color: var(--accent); }
  .admin-main { padding: 18px; }
}
