/* ═══════════════════════════════════════════════════
   MINI MAR CATERING — css/admin.css
   Admin panel styles: login, sidebar, topbar,
   panels, tables, stats, charts, modals, calendar
   ═══════════════════════════════════════════════════ */

html, body { height: 100%; background: var(--bg); }

/* ── LOGIN SCREEN ── */
.login-screen {
  position: fixed; inset: 0;
  background: linear-gradient(160deg, var(--green) 0%, #2d5940 60%, #1a3325 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 24px;
}
.login-card {
  background: white; border-radius: 20px; padding: 48px 40px;
  width: 100%; max-width: 400px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.3);
}
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.login-logo-mark {
  width: 48px; height: 48px; background: var(--gold);
  border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.login-logo-text strong { display: block; font-size: 18px; font-weight: 800; color: var(--green); letter-spacing: 0.5px; }
.login-logo-text span   { font-size: 11px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }
.login-sub   { color: var(--muted); font-size: 14px; margin-bottom: 32px; margin-top: 8px; }
.login-btn {
  width: 100%; padding: 14px; background: var(--green); color: white;
  border: none; border-radius: var(--r-sm); font-size: 15px; font-weight: 700;
  margin-top: 8px; transition: all 0.2s; font-family: 'Outfit', sans-serif;
}
.login-btn:hover { background: var(--green-mid); }
.login-hint  { margin-top: 16px; text-align: center; font-size: 12px; color: var(--muted-lt); }
.login-error {
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px;
  padding: 10px 14px; font-size: 13px; color: var(--red);
  margin-top: 12px; display: none; text-align: center;
}
.back-link   { display: block; text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); transition: color 0.2s; text-decoration: none; }
.back-link:hover { color: var(--gold); }

/* ── ADMIN SHELL ── */
.admin-shell { display: none; height: 100vh; overflow: hidden; }
.admin-shell.show { display: flex; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w); background: var(--green);
  display: flex; flex-direction: column;
  height: 100vh; overflow-y: auto; flex-shrink: 0;
}
.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 11px;
}
.sidebar-logo-mark {
  width: 40px; height: 40px; background: var(--gold);
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 18px; flex-shrink: 0;
}
.sidebar-logo-text strong { color: white; font-size: 15px; font-weight: 800; display: block; }
.sidebar-logo-text span   { color: rgba(255,255,255,0.45); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; }
.sidebar-sec {
  padding: 20px 20px 8px;
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,0.3); text-transform: uppercase; letter-spacing: 1.5px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 16px; margin: 2px 10px; border-radius: 10px;
  color: rgba(255,255,255,0.65); font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.nav-item:hover  { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active { background: rgba(245,166,35,0.18); color: var(--gold); }
.nav-item i      { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--red); color: white;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 100px; display: none;
}
.sidebar-footer  { margin-top: auto; padding: 16px 10px; }
.sidebar-logout  {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 10px;
  color: rgba(255,255,255,0.45); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; border: none; background: none; width: 100%;
}
.sidebar-logout:hover { background: rgba(239,68,68,0.12); color: var(--red); }

/* ── MAIN AREA ── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  background: white; border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; box-shadow: var(--shadow);
}
.topbar h1  { font-size: 18px; font-weight: 700; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.admin-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: var(--bg); border-radius: 10px; font-size: 13px;
}
.admin-badge strong { color: var(--text); font-weight: 600; }
.admin-badge span   { color: var(--muted); font-size: 12px; }
.admin-avatar {
  width: 32px; height: 32px; background: var(--green);
  border-radius: 8px; display: flex; align-items: center;
  justify-content: center; color: white; font-size: 13px;
}
.view-site-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; color: var(--muted); font-size: 13px; font-weight: 500;
  background: white; transition: all 0.2s; text-decoration: none;
}
.view-site-btn:hover { border-color: var(--gold); color: var(--gold-dark); }

/* ── CONTENT ── */
.content { flex: 1; overflow-y: auto; padding: 28px; }

/* ── PANELS ── */
.panel { display: none; }
.panel.show { display: block; }

/* ── STAT CARDS ── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card {
  background: white; border-radius: var(--r); padding: 22px 24px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 18px;
  border: 1px solid var(--border);
}
.stat-icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.si-gold   { background: var(--gold-light); color: var(--gold); }
.si-green  { background: rgba(31,61,43,0.10); color: var(--green); }
.si-blue   { background: rgba(59,130,246,0.10); color: var(--blue); }
.si-red    { background: rgba(239,68,68,0.10); color: var(--red); }
.si-purple { background: rgba(139,92,246,0.10); color: var(--purple); }
.stat-info .num { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-info .lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ── TABLE CARD ── */
.table-card { background: white; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--border); }
.tc-header  {
  padding: 18px 22px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap;
}
.tc-header h3 { font-size: 15px; font-weight: 700; color: var(--text); }
.tbl   { width: 100%; border-collapse: collapse; }
.tbl thead tr { background: var(--bg); }
.tbl th {
  padding: 12px 16px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(245,166,35,0.02); }
.empty-row td { text-align: center; padding: 60px; color: var(--muted); }
.empty-row i  { font-size: 36px; display: block; margin-bottom: 10px; opacity: 0.3; }

/* ── STATUS SELECT ── */
.status-select {
  padding: 5px 10px; border: 1.5px solid var(--border);
  border-radius: 6px; font-family: 'Outfit', sans-serif;
  font-size: 12px; font-weight: 600; cursor: pointer; background: white; color: var(--text);
}
.status-select:focus { outline: none; }

/* ── BAR CHART ── */
.chart-card {
  background: white; border-radius: var(--r); padding: 24px;
  box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 24px;
}
.chart-card h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 20px; }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.bar-wrap  { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar {
  width: 100%; background: var(--gold-light);
  border-radius: 6px 6px 0 0; transition: height 0.4s;
  min-height: 4px; position: relative;
}
.bar:hover { background: var(--gold); }
.bar-val   { font-size: 10px; font-weight: 700; color: var(--muted); position: absolute; top: -18px; width: 100%; text-align: center; }
.bar-label { font-size: 10px; color: var(--muted); text-align: center; }

/* ── AVAILABILITY CALENDAR ── */
.avail-cal { background: white; border-radius: var(--r); padding: 24px; border: 1px solid var(--border); }
.avail-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.avail-cal-header h3 { font-size: 16px; font-weight: 700; color: var(--text); }
.avail-cal-nav { display: flex; gap: 8px; }
.avail-cal-nav button {
  width: 32px; height: 32px; border: 1px solid var(--border);
  border-radius: 8px; background: white; color: var(--muted); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.avail-cal-nav button:hover { border-color: var(--gold); color: var(--gold-dark); }
.avail-day-names { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.avail-day-names span { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.avail-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.a-day {
  aspect-ratio: 1; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.2s; border: 1.5px solid transparent;
}
.a-day.empty   { cursor: default; }
.a-day.free:hover  { background: var(--gold-light); border-color: var(--gold); color: var(--gold-dark); }
.a-day.blocked { background: #fef2f2; color: var(--red); border-color: #fecaca; }
.a-day.past    { opacity: 0.35; cursor: not-allowed; }
.avail-legend  { display: flex; gap: 20px; margin-top: 16px; flex-wrap: wrap; }
.avail-legend span { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.legend-dot    { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ── GALLERY MANAGER GRID ── */
.gal-mgr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.gal-mgr-item {
  position: relative; border-radius: var(--r-sm);
  aspect-ratio: 4/3; display: flex; align-items: center;
  justify-content: center; font-size: 50px; overflow: hidden;
}
.gal-mgr-item .gal-del {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px;
  background: rgba(239,68,68,0.9); border: none; border-radius: 6px;
  color: white; font-size: 12px; display: flex; align-items: center;
  justify-content: center; opacity: 0; transition: opacity 0.2s; cursor: pointer;
}
.gal-mgr-item:hover .gal-del { opacity: 1; }
.gal-cat-lbl {
  position: absolute; bottom: 8px; left: 8px;
  background: rgba(0,0,0,0.6); color: white;
  font-size: 10px; padding: 2px 8px; border-radius: 4px; text-transform: capitalize;
}

/* ── MENU ITEM EDITOR ── */
.menu-editor { border: 1.5px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.menu-editor-list { max-height: 200px; overflow-y: auto; }
.menu-item-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
}
.menu-item-row:last-child { border-bottom: none; }
.menu-item-row input {
  flex: 1; border: none; background: transparent;
  font-family: 'Outfit', sans-serif; font-size: 13px;
  color: var(--text); padding: 2px 0;
}
.menu-item-row input:focus { outline: none; }
.menu-item-row button {
  width: 24px; height: 24px; border: none; background: none;
  color: var(--muted); font-size: 14px;
  display: flex; align-items: center; justify-content: center; border-radius: 4px;
}
.menu-item-row button:hover { background: rgba(239,68,68,0.1); color: var(--red); }
.menu-add-row {
  padding: 9px 12px; display: flex; align-items: center; gap: 8px; background: var(--bg);
}
.menu-add-row input {
  flex: 1; border: none; background: transparent;
  font-family: 'Outfit', sans-serif; font-size: 13px; color: var(--text); padding: 2px 0;
}
.menu-add-row input:focus { outline: none; }
.menu-add-row button { font-size: 14px; color: var(--gold-dark); border: none; background: none; font-weight: 700; }

/* ── MODAL ── */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 1000;
  align-items: center; justify-content: center; padding: 24px;
}
.modal-bg.open { display: flex; }
.modal {
  background: white; border-radius: 16px; padding: 32px;
  width: 100%; max-width: 600px; max-height: 90vh;
  overflow-y: auto; box-shadow: 0 24px 80px rgba(0,0,0,0.25);
}
.modal-wide   { max-width: 780px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--text); }
.modal-close {
  background: var(--bg); border: none; width: 32px; height: 32px;
  border-radius: 8px; font-size: 18px; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(239,68,68,0.1); color: var(--red); }
.modal-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .stats-row { grid-template-columns: 1fr; }
  .content   { padding: 16px; }
  .sidebar   { display: none; }
}
