:root {
  --primary: #E07A5F;
  --primary-dark: #C65D45;
  --primary-light: #FDF0ED;
  --secondary: #3D405B;
  --accent: #81B29A;
  --background: #FAFBFC;
  --surface: #FFFFFF;
  --text: #2D3748;
  --text-muted: #718096;
  --border: #E2E8F0;
  --success: #48BB78;
  --warning: #ED8936;
  --danger: #F56565;
  --info: #4299E1;
  --sidebar-width: 260px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
}

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

body {
  font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
  direction: rtl;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-success {
  background-color: var(--success);
  color: white;
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-warning {
  background-color: var(--warning);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
  border: 1px solid var(--border);
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  direction: rtl;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

textarea.form-input {
  min-height: 100px;
  resize: vertical;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-secondary { background: #F3F4F6; color: #374151; }

.dashboard-layout, .admin-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
}

.admin-sidebar {
  background: #1F2937;
}

.admin-sidebar .nav-item {
  color: #D1D5DB;
}

.admin-sidebar .nav-item:hover,
.admin-sidebar .nav-item.active {
  background: #374151;
  color: white;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.admin-sidebar .sidebar-header {
  border-bottom-color: #374151;
}

.brand-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 8px;
  border-radius: 16px;
  transition: all 0.3s ease;
}

.brand-link:hover {
  background: var(--primary-light);
  text-decoration: none;
}

.brand-logo {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--primary-light);
  transition: transform 0.3s ease;
}

.brand-link:hover .brand-logo {
  transform: scale(1.05);
}

.brand-name {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.admin-sidebar .logo {
  color: white;
}

.admin-badge {
  font-size: 12px;
  background: var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
}

.kitchen-name {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s;
  gap: 12px;
}

.nav-item:hover {
  background: var(--primary-light);
  text-decoration: none;
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 500;
}

.nav-item .icon {
  font-size: 18px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.admin-sidebar .sidebar-footer {
  border-top-color: #374151;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-sidebar .user-info {
  color: white;
}

.role-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
}

.role-badge.admin {
  background: var(--primary);
  color: white;
}

.logout-btn {
  display: block;
  text-align: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 14px;
}

.admin-sidebar .logout-btn {
  border-color: #4B5563;
  color: #9CA3AF;
}

.main-content {
  flex: 1;
  margin-right: var(--sidebar-width);
  padding: 24px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

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

.table th,
.table td {
  padding: 12px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: #F9FAFB;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 13px;
}

.table tr:hover {
  background: #F9FAFB;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.alert {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.alert-error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.alert-success {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.landing-page {
  min-height: 100vh;
}

.landing-header {
  background: var(--surface);
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.landing-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.landing-nav {
  display: flex;
  gap: 16px;
}

.hero {
  padding: 80px 0;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--background) 100%);
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 20px;
  color: var(--text);
}

.hero p {
  font-size: 20px;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.features {
  padding: 80px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.feature-card {
  text-align: center;
  padding: 32px;
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.feature-card h3 {
  margin-bottom: 12px;
  font-size: 20px;
}

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

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header .logo {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

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

.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

.order-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
}

.order-page-header {
  text-align: center;
  margin-bottom: 32px;
}

.menu-category {
  margin-bottom: 32px;
}

.menu-category h3 {
  font-size: 20px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.menu-item-info h4 {
  font-size: 16px;
  margin-bottom: 4px;
}

.menu-item-info p {
  color: var(--text-muted);
  font-size: 14px;
}

.menu-item-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
}

.quantity-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quantity-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
}

.quantity-value {
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}

.order-summary {
  position: sticky;
  bottom: 20px;
  background: var(--surface);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  margin-top: 32px;
}

.nav-item.locked {
  color: var(--text-muted);
  opacity: 0.7;
}

.nav-item.locked:hover {
  background: #FEF3C7;
}

.nav-item .lock-icon {
  margin-right: auto;
  font-size: 14px;
}

.plan-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
}

.plan-FREE { background: #E5E7EB; color: #374151; }
.plan-AI_BASIC { background: #DBEAFE; color: #1E40AF; }
.plan-AI_PRO { background: linear-gradient(135deg, #FDE68A, #F59E0B); color: #78350F; }
.plan-TRIAL { background: linear-gradient(135deg, #A7F3D0, #34D399); color: #065F46; }
.plan-trial { background: linear-gradient(135deg, #A7F3D0, #34D399); color: #065F46; }
.plan-PREMIUM { background: linear-gradient(135deg, #FDE68A, #F59E0B); color: #78350F; }
.plan-premium { background: linear-gradient(135deg, #FDE68A, #F59E0B); color: #78350F; }
.plan-EXPIRED { background: #FEE2E2; color: #991B1B; }
.plan-expired { background: #FEE2E2; color: #991B1B; }

.upgrade-cta {
  display: block;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  text-align: center;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.upgrade-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.upgrade-cta.trial-warning {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  animation: pulse 2s infinite;
}

.upgrade-cta.expired-warning {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  width: 48px;
  height: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
}

.sidebar-overlay.active {
  display: block;
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .main-content {
    margin-right: 0;
    padding-top: 80px;
  }
  
  .page-header {
    padding-right: 70px;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 32px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .card {
    padding: 16px;
  }
  
  .page-content {
    padding: 16px;
  }
}

@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .kanban-board {
    flex-direction: column;
  }
  
  .kanban-column {
    min-width: 100%;
  }
  
  .brand-logo {
    width: 50px;
    height: 50px;
  }
  
  .brand-name {
    font-size: 20px;
  }
  
  .btn {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .form-input {
    padding: 12px;
    font-size: 16px;
  }
  
  .card-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .table {
    font-size: 13px;
  }
  
  .table th,
  .table td {
    padding: 10px 8px;
  }
  
  .page-header h1 {
    font-size: 22px;
  }
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.admin-brand {
  flex-direction: row;
  gap: 10px;
}

.admin-brand .brand-logo {
  width: 50px;
  height: 50px;
}

.admin-brand .brand-name {
  font-size: 20px;
}

.price-annual {
  color: var(--text-muted);
  font-size: 14px;
}
