/* ===== ADMIN STYLES ===== */
:root {
  --green-dark: #1B4332;
  --green-mid: #2D6A4F;
  --green-light: #52B788;
  --green-pale: #D8F3DC;
  --white: #FFFFFF;
  --off-white: #F0F4F1;
  --text-dark: #1A1A1A;
  --text-muted: #666;
  --border: #e0ebe5;
  --shadow: 0 2px 12px rgba(27,67,50,0.1);
  --radius: 10px;
  --sidebar-w: 240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--off-white); color: var(--text-dark); min-height: 100vh; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ===== LOGIN SCREEN ===== */
.login-screen {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.login-card {
  background: var(--white);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo {
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
  color: var(--green-dark);
  letter-spacing: 3px;
  margin-bottom: 0.25rem;
}
.login-logo span { color: var(--green-light); }
.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}
.login-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 0.4rem;
}
.login-form input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 1.25rem;
}
.login-form input:focus { border-color: var(--green-light); }
.login-btn {
  width: 100%;
  background: var(--green-dark);
  color: var(--white);
  padding: 0.9rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  transition: background 0.2s;
}
.login-btn:hover { background: var(--green-mid); }
.login-error {
  background: #ffeaea;
  color: #c0392b;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}
.login-error.show { display: block; }

/* ===== ADMIN LAYOUT ===== */
.admin-layout {
  display: none;
  min-height: 100vh;
}
.admin-layout.visible { display: flex; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--green-dark);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 1.5rem 1.5rem 1rem;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 0.5rem;
}
.sidebar-logo span { color: var(--green-light); }
.sidebar-subtitle {
  padding: 0 1.5rem;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.sidebar-nav { flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  transition: all 0.2s;
  border-left: 3px solid transparent;
  cursor: pointer;
}
.nav-item:hover { color: var(--white); background: rgba(255,255,255,0.05); }
.nav-item.active { color: var(--white); background: rgba(82,183,136,0.15); border-left-color: var(--green-light); }
.nav-item .icon { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.logout-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  width: 100%;
  transition: all 0.2s;
}
.logout-btn:hover { background: rgba(255,255,255,0.1); color: var(--white); }

/* ===== MAIN CONTENT ===== */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.admin-topbar {
  background: var(--white);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--green-dark); }
.topbar-badge {
  background: var(--green-pale);
  color: var(--green-dark);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}
.admin-content {
  padding: 2rem;
  flex: 1;
}

/* ===== PANELS ===== */
.panel { display: none; }
.panel.active { display: block; }

/* ===== STATS CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--green-light);
}
.stat-card .stat-val {
  font-size: 2rem;
  font-weight: 900;
  color: var(--green-dark);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== CARDS / SECTIONS ===== */
.admin-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.admin-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.admin-card-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
}
.admin-card-body { padding: 1.5rem; }

/* ===== BUTTONS ===== */
.btn-green {
  background: var(--green-dark);
  color: var(--white);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-green:hover { background: var(--green-mid); }
.btn-outline-green {
  background: transparent;
  color: var(--green-dark);
  border: 2px solid var(--green-dark);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-outline-green:hover { background: var(--green-dark); color: var(--white); }
.btn-danger {
  background: #fff0f0;
  color: #c0392b;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s;
}
.btn-danger:hover { background: #ffd5d5; }
.btn-edit {
  background: var(--green-pale);
  color: var(--green-dark);
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s;
  margin-right: 0.4rem;
}
.btn-edit:hover { background: #b7e4c7; }

/* ===== TABLE ===== */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  background: var(--off-white);
  border-bottom: 2px solid var(--border);
}
.admin-table td {
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #f9fbfa; }
.category-tag {
  background: var(--green-pale);
  color: var(--green-dark);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}
.avail-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}
.avail-badge.yes { background: var(--green-pale); color: var(--green-dark); }
.avail-badge.no { background: #ffeaea; color: #c0392b; }

/* ===== FORM ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: var(--white);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--green-light); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green-dark); }
.form-check label { font-size: 0.9rem; color: var(--text-dark); font-weight: 500; margin: 0; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

/* ===== HOURS TABLE ===== */
.hours-admin-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.hours-admin-row {
  display: grid;
  grid-template-columns: 120px 1fr 1fr 80px;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--off-white);
  border-radius: 8px;
}
.hours-admin-row .day-label { font-weight: 600; font-size: 0.9rem; }
.hours-admin-row input { padding: 0.5rem; border: 2px solid var(--border); border-radius: 6px; font-size: 0.875rem; outline: none; }
.hours-admin-row input:focus { border-color: var(--green-light); }
.toggle-open {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.toggle-open input { width: 16px; height: 16px; accent-color: var(--green-dark); }

/* ===== PROMOTIONS ===== */
.promo-card {
  background: var(--off-white);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-left: 4px solid var(--green-light);
}
.promo-card h4 { font-size: 0.95rem; color: var(--green-dark); margin-bottom: 0.25rem; }
.promo-card p { font-size: 0.85rem; color: var(--text-muted); }
.promo-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* ===== ORDERS LOG ===== */
.order-log-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--off-white);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}
.order-num {
  background: var(--green-dark);
  color: var(--white);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.order-details { flex: 1; }
.order-item-name { font-weight: 600; font-size: 0.9rem; color: var(--green-dark); }
.order-time { font-size: 0.8rem; color: var(--text-muted); }
.order-status {
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}
.order-status.done { background: var(--green-pale); color: var(--green-dark); }
.order-status.pending-s { background: #fff3cd; color: #856404; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--green-dark);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(27,67,50,0.3);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal h3 { font-size: 1.1rem; color: var(--green-dark); margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .admin-main { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .hours-admin-row { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
  .hours-admin-row .day-label { grid-column: span 2; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
