/* InOrder POS Admin - Modern, professional theme */
:root {
  --primary: #0891b2;       /* cyan-600 - θαλάσσιο */
  --primary-dark: #0e7490;
  --accent: #f59e0b;        /* amber-500 - sand */
  --bg: #f1f5f9;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* === LOGIN === */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0891b2 0%, #06b6d4 50%, #f59e0b 100%);
}
.login-box {
  background: var(--surface);
  padding: 40px;
  border-radius: 20px;
  width: 92%;
  max-width: 400px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
  text-align: center;
}
.login-box h1 { margin: 0 0 8px; color: var(--primary); font-size: 28px; }
.login-box p { color: var(--text-muted); margin: 0 0 24px; }
.login-box input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  margin-bottom: 16px;
  outline: none;
  transition: border 0.15s;
}
.login-box input:focus { border-color: var(--primary); }
.login-box button {
  width: 100%;
  padding: 14px;
  border: none;
  background: var(--primary);
  color: white;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}
.login-box button:hover { background: var(--primary-dark); }
.error-msg { color: var(--danger); font-size: 14px; margin-top: 12px; min-height: 20px; }

/* === HEADER === */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-right: 32px;
}
nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tab-btn {
  background: none;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
}
.tab-btn:hover { background: var(--bg); color: var(--text); }
.tab-btn.active { background: var(--primary); color: white; }
.badge {
  display: inline-block;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
}
.logout-btn {
  background: none;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
}
.logout-btn:hover { color: var(--danger); border-color: var(--danger); }

/* === MAIN === */
main { padding: 24px; max-width: 1400px; margin: 0 auto; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
h2 { margin: 24px 0 16px; font-size: 20px; }
h3 { margin: 0 0 12px; font-size: 16px; }
.hint { color: var(--text-muted); font-size: 14px; }

/* === STATS === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat-label { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
.stat-value { font-size: 32px; font-weight: 700; color: var(--primary); }
.top-products .stat-value { display: none; }
.top-products div div {
  display: flex; justify-content: space-between;
  padding: 4px 0; font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.top-products div div:last-child { border-bottom: none; }

/* === ORDERS LIST === */
.orders-list { display: flex; flex-direction: column; gap: 12px; }
.order-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.order-card.takeaway { border-left-color: var(--accent); }
.order-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; flex-wrap: wrap; gap: 8px;
}
.order-meta { color: var(--text-muted); font-size: 13px; }
.order-id { font-weight: 700; color: var(--primary); }
.order-total { font-weight: 700; font-size: 18px; }
.order-items { font-size: 14px; }
.order-items > div { padding: 2px 0; display: flex; justify-content: space-between; }
.order-items .comment { color: var(--text-muted); font-style: italic; padding-left: 12px; font-size: 12px; }
.tag {
  display: inline-block; padding: 2px 8px;
  background: var(--bg); border-radius: 4px; font-size: 12px; margin-right: 4px;
}
.tag.takeaway { background: #fef3c7; color: #92400e; }
.tag.dine-in { background: #cffafe; color: #155e75; }

/* === MENU TREE === */
.menu-toolbar {
  display: flex; gap: 12px; margin-bottom: 24px;
}
.btn-primary {
  background: var(--primary); color: white; border: none;
  padding: 10px 18px; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer;
}
.btn-secondary:hover { background: var(--border); }
.btn-icon {
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  border-radius: 4px; font-size: 16px; color: var(--text-muted);
}
.btn-icon:hover { background: var(--bg); color: var(--text); }
.btn-icon.danger:hover { color: var(--danger); }

.menu-tree { display: flex; flex-direction: column; gap: 16px; }
.cat-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.cat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: linear-gradient(to right, #ecfeff, #f0f9ff);
  border-bottom: 1px solid var(--border);
}
.cat-title { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.cat-icon { font-size: 22px; }
.cat-station {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  background: white; color: var(--text-muted); font-weight: 500;
}
.cat-station.kitchen { background: #fff7ed; color: #c2410c; }
.cat-station.bar { background: #ecfeff; color: #0e7490; }
.cat-actions { display: flex; gap: 4px; }
.subcategory { padding-left: 32px; background: #fafbfc; }
.subcategory .cat-header { background: #f8fafc; }
.product-list { padding: 8px 0; }
.product-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  padding: 10px 18px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.product-row:last-child { border-bottom: none; }
.product-row:hover { background: var(--bg); }
.product-name { font-weight: 500; }
.product-price input {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: right;
  font-size: 14px;
}
.product-price input:focus { border-color: var(--primary); outline: none; }
.product-toggle {
  width: 40px; height: 22px; border-radius: 11px; background: #cbd5e1;
  position: relative; cursor: pointer; transition: background 0.15s;
  border: none; padding: 0;
}
.product-toggle.on { background: var(--success); }
.product-toggle::before {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: white;
  transition: transform 0.15s;
}
.product-toggle.on::before { transform: translateX(18px); }

/* === TABLES GRID === */
.tables-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.table-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  text-align: center; cursor: pointer;
  border: 2px solid transparent;
}
.table-card:hover { border-color: var(--primary); }
.table-name { font-size: 18px; font-weight: 700; }
.table-zone { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.table-actions { margin-top: 8px; display: flex; justify-content: center; gap: 4px; }

/* === USERS === */
.users-list { display: flex; flex-direction: column; gap: 12px; }
.user-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 16px 20px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
}
.user-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 200px; }
.user-name { font-weight: 600; font-size: 16px; }
.user-meta { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.user-status {
  padding: 4px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-rejected { background: #fee2e2; color: #991b1b; }
.user-actions { display: flex; gap: 8px; }
.btn-success {
  background: var(--success); color: white; border: none;
  padding: 8px 14px; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 600;
}
.btn-danger {
  background: var(--danger); color: white; border: none;
  padding: 8px 14px; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 600;
}

/* === SETTINGS === */
.settings-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 20px 24px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.settings-card code {
  background: var(--bg); padding: 2px 6px; border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px;
}

/* === MODAL === */
.modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-content {
  background: var(--surface); border-radius: var(--radius);
  padding: 24px; width: 92%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal-content h2 { margin-top: 0; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; margin-bottom: 4px; color: var(--text-muted); }
.form-group input, .form-group select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary); }
.modal-actions {
  display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px;
}

/* === TOAST === */
#toast-container {
  position: fixed; top: 80px; right: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--surface); padding: 12px 18px;
  border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  border-left: 4px solid var(--primary); font-size: 14px;
  animation: slideIn 0.2s; max-width: 320px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* MOBILE */
@media (max-width: 768px) {
  header { flex-wrap: wrap; height: auto; padding: 12px; }
  nav { width: 100%; order: 3; margin-top: 8px; overflow-x: auto; }
  .tab-btn { white-space: nowrap; }
  main { padding: 12px; }
  .product-row { grid-template-columns: 1fr auto; row-gap: 4px; }
}
