/* Admin UI - Hostinger-safe PHP + Vue */

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

:root {
  --sidebar-bg: #24211f;
  --sidebar-w: 248px;
  --accent: #a0782f;
  --accent-strong: #7e5e24;
  --bg: #f6f2ec;
  --surface: #ffffff;
  --surface-soft: #fbf8f3;
  --text: #262626;
  --text-muted: #6d6860;
  --border: #e2d9ce;
  --success: #23724d;
  --danger: #b03232;
  --warning: #b97813;
  --info: #286f91;
  --radius: 8px;
  --shadow: 0 8px 24px rgba(38, 38, 38, .08);
}

[v-cloak] { display: none; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo h2 { color: #f5dfaa; font-size: 1.05rem; font-weight: 700; letter-spacing: 0; }
.sidebar-logo p { color: rgba(255,255,255,.58); font-size: .78rem; margin-top: 4px; }

.sidebar-nav { padding: 16px 0; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  color: rgba(255,255,255,.72);
  font-size: .9rem;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(160,120,47,.18); color: #f5dfaa; border-left-color: #f5dfaa; }
.nav-item .icon { width: 20px; text-align: center; font-size: .95rem; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); }
.btn-logout {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius);
  color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.08);
  cursor: pointer;
}
.btn-logout:hover { background: rgba(176,50,50,.24); color: #ffd8d8; }

.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page-header {
  min-height: 72px;
  background: var(--surface);
  padding: 18px 30px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-header h1 { font-size: 1.25rem; font-weight: 650; }
.page-body { padding: 28px; flex: 1; }

.card {
  background: var(--surface);
  border: 1px solid rgba(226,217,206,.78);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}
.card-title, .eyebrow {
  color: var(--text-muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 5px;
}
.section-heading, .toolbar, .flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.section-heading { margin-bottom: 16px; }
.section-heading h3, .toolbar h2, .ops-header h2 { font-size: 1.2rem; line-height: 1.25; }
.toolbar { margin-bottom: 18px; }
.toolbar-actions, .ops-actions, .row-actions, .flex { display: flex; align-items: center; gap: 8px; }
.toolbar-actions { flex-wrap: wrap; justify-content: flex-end; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.small { font-size: .8rem; }
.truncate {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.kpi-grid, .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.kpi-card, .stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow);
}
.kpi-icon, .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--accent-strong);
}
.kpi-value, .stat-value { font-size: 2rem; line-height: 1; font-weight: 750; }
.kpi-label, .stat-label { font-size: .82rem; color: var(--text-muted); margin-top: 5px; }
.tone-warning .kpi-icon { color: var(--warning); background: #fff3df; }
.tone-success .kpi-icon { color: var(--success); background: #e3f4eb; }
.tone-accent .kpi-icon { color: var(--accent-strong); background: #f7edd8; }
.tone-neutral .kpi-icon { color: var(--info); background: #e6f2f7; }

.ops-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.refresh-note { color: var(--text-muted); font-size: .82rem; white-space: nowrap; }
.ops-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .75fr); gap: 20px; margin-bottom: 20px; }
.warning-stack { display: grid; gap: 8px; margin-bottom: 14px; }
.inline-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: .86rem;
  background: var(--surface-soft);
  color: var(--text-muted);
}
.warning-warning { color: #7a4f08; background: #fff4df; }
.warning-info { color: #235d78; background: #e8f3f8; }

.reservation-stack, .service-list, .banner-list { display: grid; gap: 10px; }
.reservation-card, .service-row, .banner-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}
.reservation-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ead8ad;
  color: #4d3a15;
  font-weight: 750;
}
.reservation-title, .reservation-meta, .banner-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.reservation-title span, .reservation-meta, .reservation-note, .banner-row small {
  color: var(--text-muted);
  font-size: .82rem;
}
.reservation-note { margin-top: 5px; }
.reservation-actions { display: flex; gap: 6px; }
.service-row, .banner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.service-row span { display: block; color: var(--text-muted); font-size: .82rem; margin-top: 2px; }
.banner-content { flex: 1; min-width: 0; }
.banner-content p { color: var(--text-muted); margin: 5px 0 7px; }

.health-grid, .summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.health-card, .summary-strip > div {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}
.health-card { display: flex; gap: 12px; align-items: flex-start; }
.health-card i { color: var(--accent-strong); margin-top: 3px; }
.health-card strong, .summary-strip strong { display: block; font-size: 1.45rem; line-height: 1; }
.health-card span, .summary-strip span { display: block; color: var(--text-muted); font-size: .82rem; margin-top: 5px; }
.health-card small { display: block; color: var(--text-muted); font-size: .75rem; margin-top: 3px; }
.summary-strip { margin-bottom: 18px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th {
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: .76rem;
  font-weight: 750;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 12px 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fdfbf8; }
.table-summary { display: flex; align-items: baseline; gap: 6px; color: var(--text-muted); margin-bottom: 12px; }
.table-summary strong { color: var(--text); font-size: 1.25rem; }
code { font-family: Consolas, "SFMono-Regular", monospace; font-size: .82rem; }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-pending { background: #fff3cd; color: #765300; }
.badge-confirmed, .badge-active { background: #dff1e6; color: #145c39; }
.badge-cancelled { background: #f8d7da; color: #7b1c24; }
.badge-inactive { background: #ededed; color: #5e5e5e; }

.btn, .icon-button, .badge-button {
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-weight: 650;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
}
.btn { padding: 9px 15px; font-size: .88rem; }
.btn:disabled, .icon-button:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); text-decoration: none; }
.btn-secondary { background: #ece4d8; color: var(--text); }
.btn-secondary:hover { background: #e1d5c5; text-decoration: none; }
.btn-danger { background: #f8d7da; color: var(--danger); }
.btn-success { background: #dff1e6; color: var(--success); }
.btn-sm { padding: 6px 10px; font-size: .8rem; }

.icon-button {
  width: 34px;
  height: 34px;
  background: #ece4d8;
  color: var(--text);
}
.icon-button:hover { background: #e1d5c5; }
.icon-button.success { background: #dff1e6; color: var(--success); }
.icon-button.danger { background: #f8d7da; color: var(--danger); }
.badge-button {
  min-height: 30px;
  padding: 5px 9px;
  background: #ededed;
  color: var(--text-muted);
  font-size: .78rem;
}
.badge-button.active { background: #f7edd8; color: #755517; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: .82rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.form-control {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
  font: inherit;
  color: var(--text);
  background: #fff;
}
.form-control:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(160,120,47,.16); }
textarea.form-control { min-height: 92px; resize: vertical; }
.search-input { width: min(360px, 100%); }
.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 650;
}
.check-row input { width: 16px; height: 16px; accent-color: var(--accent); }

.switch-button {
  width: 42px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: #cfc7bc;
  cursor: pointer;
  position: relative;
}
.switch-button::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
.switch-button.on { background: var(--success); }
.switch-button.on::before { transform: translateX(18px); }

.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 22px; transition: .2s; }
.toggle-slider::before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .2s; }
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

.tab-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tab {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  background: #ece4d8;
  color: var(--text-muted);
  font-size: .84rem;
  font-weight: 700;
}
.tab span { color: inherit; opacity: .78; margin-left: 3px; }
.tab.active { background: var(--accent); color: #fff; }
.tab:hover:not(.active) { border-color: #d7c9b6; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.46);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: min(680px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}
.modal-header, .modal-footer {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-header { border-bottom: 1px solid var(--border); }
.modal-footer { border-top: 1px solid var(--border); justify-content: flex-end; }
.modal-header h3 { font-size: 1.05rem; }
.modal-close { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 1.15rem; }
.modal-body { padding: 20px 22px; }

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-bottom: 16px;
  border-left: 4px solid transparent;
}
.alert-success { background: #dff1e6; color: #145c39; border-left-color: var(--success); }
.alert-error { background: #f8d7da; color: #7b1c24; border-left-color: var(--danger); }
.alert-info { background: #e8f3f8; color: #235d78; border-left-color: var(--info); }
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  min-width: 240px;
  box-shadow: var(--shadow);
}

.loading-panel, .empty-state {
  min-height: 160px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 24px;
}
.empty-state i, .loading-panel i { font-size: 1.5rem; color: var(--accent-strong); }
.empty-state strong { color: var(--text); }
.empty-state.compact { min-height: 130px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chart-container { position: relative; height: 280px; }
.compact-chart { height: 250px; }
.metric-bar {
  width: min(320px, 100%);
  height: 5px;
  background: #eee5d7;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 7px;
}
.metric-bar span { display: block; height: 100%; background: var(--accent); }

.dish-img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}
.image-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: #eee5d7;
  color: var(--text-muted);
}
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
.img-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  background: #eee5d7;
}
.img-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0,0,0,.5);
  opacity: 0;
  transition: opacity .2s;
}
.img-item:hover .img-actions { opacity: 1; }
.image-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  color: #fff;
  font-size: .76rem;
}
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 34px;
  display: grid;
  place-items: center;
  gap: 7px;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--surface-soft);
  transition: border-color .2s, background .2s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: #fffaf0; }
.upload-zone input { display: none; }
.upload-icon { font-size: 2rem; color: var(--accent-strong); }

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg);
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px;
  width: min(380px, 100%);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-card .logo { text-align: center; margin-bottom: 28px; }
.login-card .logo h1 { color: var(--accent-strong); font-size: 1.35rem; letter-spacing: 0; }
.login-card .logo p { color: var(--text-muted); font-size: .84rem; margin-top: 4px; }
.login-card .btn-primary { width: 100%; }

@media (max-width: 1100px) {
  .kpi-grid, .stats-grid, .health-grid, .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-layout, .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .admin-layout { display: block; }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }
  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 8px;
  }
  .nav-item {
    border-left: 0;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    padding: 10px 12px;
  }
  .nav-item.active { border-left-color: transparent; border-bottom-color: #f5dfaa; }
  .sidebar-footer { display: none; }
  .main-content { margin-left: 0; }
  .page-header, .page-body { padding: 18px; }
  .toolbar, .ops-header, .section-heading, .service-row, .banner-row {
    align-items: stretch;
    flex-direction: column;
  }
  .toolbar-actions, .ops-actions { justify-content: flex-start; }
  .search-input { width: 100%; }
  .kpi-grid, .stats-grid, .health-grid, .summary-strip { grid-template-columns: 1fr; }
  .reservation-card { grid-template-columns: 42px minmax(0, 1fr); }
  .reservation-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
