/* ========== labbaytak PWA Styles — RTL, Phone-First ========== */
:root {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #d1fae5;
  --danger: #dc2626;
  --warning: #f59e0b;
  --bg: #f9fafb;
  --card: #ffffff;
  --text: #111827;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
}

/* Header */
.app-header {
  background: var(--primary);
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header h1 { font-size: 1.2rem; font-weight: 700; }
.app-header .logo { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.5px; }
.btn-icon {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: white; color: var(--primary); border: 2px solid var(--primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-block { width: 100%; display: flex; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 0.9rem; color: var(--text-secondary); }
.form-input {
  width: 100%; padding: 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--primary); }

/* Restaurant list */
.restaurant-card {
  background: var(--card);
  margin: 8px 16px;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s;
}
.restaurant-card:active { transform: scale(0.98); }
.restaurant-card .name { font-size: 1.05rem; font-weight: 700; }
.restaurant-card .meta { font-size: 0.8rem; color: var(--text-secondary); margin-top: 4px; }
.restaurant-card .category { background: var(--primary-light); color: var(--primary-dark); padding: 2px 10px; border-radius: 20px; font-size: 0.75rem; }

/* Menu items */
.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.menu-item:last-child { border-bottom: none; }
.menu-item .info { flex: 1; }
.menu-item .name { font-weight: 600; }
.menu-item .desc { font-size: 0.8rem; color: var(--text-secondary); }
.menu-item .price { font-weight: 700; color: var(--primary); font-size: 1.05rem; }
.menu-item .add-btn {
  background: var(--primary); color: white; border: none;
  width: 36px; height: 36px; border-radius: 50%; font-size: 1.3rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Cart */
.cart-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 2px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 200;
  max-width: 480px;
  margin: 0 auto;
}
.cart-bar .total { font-weight: 700; font-size: 1.05rem; }
.cart-bar .count { background: var(--primary); color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; }

/* Order status */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-pending { background: #fef3c7; color: #92400e; }
.status-accepted { background: #dbeafe; color: #1e40af; }
.status-preparing { background: #fef3c7; color: #92400e; }
.status-ready { background: #d1fae5; color: #065f46; }
.status-picked_up { background: #e0e7ff; color: #3730a3; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-cancelled { background: #fee2e2; color: #991b1b; }

/* Order card */
.order-card { margin-bottom: 10px; }
.order-card .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-card .id { font-weight: 700; color: var(--primary); }
.order-card .time { font-size: 0.75rem; color: var(--text-secondary); }
.order-card .items { font-size: 0.85rem; color: var(--text-secondary); }
.order-card .footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.order-card .total { font-weight: 700; }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid var(--border); }
.tab {
  flex: 1; text-align: center; padding: 12px;
  font-weight: 600; cursor: pointer; color: var(--text-secondary);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.2s;
}
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Empty state */
.empty { text-align: center; padding: 40px 20px; color: var(--text-secondary); }
.empty .icon { font-size: 3rem; margin-bottom: 12px; }

/* Login page */
.login-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
}
.login-page .brand { font-size: 2.5rem; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.login-page .tagline { color: var(--text-secondary); margin-bottom: 30px; }

/* Bottom nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--card); border-top: 1px solid var(--border);
  display: flex; z-index: 200;
  max-width: 480px; margin: 0 auto;
}
.bottom-nav a {
  flex: 1; text-align: center; padding: 8px 4px;
  color: var(--text-secondary); text-decoration: none; font-size: 0.7rem;
}
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a .icon { font-size: 1.3rem; display: block; margin-bottom: 2px; }

/* Utility */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-secondary); font-size: 0.85rem; }
.mt-2 { margin-top: 8px; }
.mb-2 { margin-bottom: 8px; }
.pb-80 { padding-bottom: 80px; }

/* Scroll area */
.scroll-area { padding-bottom: 120px; }

/* Toast */
.toast {
  position: fixed; bottom: 80px; left: 16px; right: 16px;
  background: #111827; color: white; padding: 12px 16px;
  border-radius: 10px; z-index: 999; text-align: center;
  animation: slideUp 0.3s ease; max-width: 448px; margin: 0 auto;
}
.toast.success { background: var(--primary); }
.toast.error { background: var(--danger); }

/* Order tracker */
.tracker { display: flex; justify-content: space-between; padding: 20px 4px; position: relative; }
.tracker::before {
  content: ''; position: absolute; top: 30px; left: 20px; right: 20px; height: 3px;
  background: var(--border); z-index: 0;
}
.tracker-step { display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 1; flex: 1; }
.tracker-dot {
  width: 24px; height: 24px; border-radius: 50%; background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; transition: all 0.3s;
}
.tracker-step.active .tracker-dot { background: var(--primary); color: white; }
.tracker-step.done .tracker-dot { background: var(--primary-light); color: var(--primary-dark); }
.tracker-label { font-size: 0.65rem; color: var(--text-secondary); text-align: center; }
.tracker-step.active .tracker-label, .tracker-step.done .tracker-label { color: var(--primary); font-weight: 600; }

/* Search bar */
.search-bar {
  padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 48px; z-index: 50;
}
.search-input {
  width: 100%; padding: 10px 16px; border: 2px solid var(--border);
  border-radius: 25px; font-size: 0.9rem; font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--primary); }

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Notification badge */
.has-badge { position: relative; }
.has-badge::after {
  content: attr(data-badge);
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Admin sidebar (desktop) */
@media (min-width: 769px) {
  body { max-width: 100%; }
  .app-header { max-width: 100%; }
  .admin-layout { display: flex; }
  .admin-sidebar { width: 240px; background: var(--card); min-height: 100vh; border-left: 1px solid var(--border); padding: 16px; }
  .admin-content { flex: 1; padding: 20px; }
  .bottom-nav, .cart-bar { max-width: 100%; }
}