:root {
  --bg: #eef3ef;
  --surface: #ffffff;
  --surface-soft: #f5faf6;
  --panel: #153220;
  --ink: #163021;
  --muted: #4c6b58;
  --line: #c9ddcd;
  --accent: #78c841;
  --accent-strong: #4ea01a;
  --danger: #a73737;
  --warning: #8c5a00;
  --shadow: 0 14px 34px rgba(21, 53, 30, 0.12);
}

/* ========================================
   BASE RESET
======================================== */
* {
  box-sizing: border-box;
}

/* ========================================
   GLOBAL TYPOGRAPHY
======================================== */
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 12% 8%, #f9fff8, #eef3ef 60%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Bricolage Grotesque", "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
}

/* ========================================
   TOPBAR
======================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* ========================================
   BRANDING
======================================== */
.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #20462f;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.brand-logo {
  height: 40px;
  width: auto;
  display: block;
  border-radius: 8px;
}

.eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

#systemStatus {
  margin-top: 0.25rem;
  font-size: 0.95rem;
}

.owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #bcd5c1;
  border-radius: 999px;
  padding: 0.36rem 0.75rem;
  background: linear-gradient(135deg, #f2fbf3, #e8f5ea);
  color: #1c4430;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: "Inter", "Segoe UI", sans-serif;
}

/* ========================================
   LAYOUT GRID
======================================== */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 82px);
}

/* ========================================
   SIDEBAR
======================================== */
.sidebar {
  background: linear-gradient(180deg, #183724, #122b1c);
  color: #f0faef;
  padding: 1.15rem;
  border-right: 1px solid rgba(162, 203, 171, 0.22);
}

.sidebar h1 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sidebar p {
  margin-top: 0.5rem;
  color: #bed9c5;
  font-size: 0.92rem;
}

/* ========================================
   MENU
======================================== */
.menu {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.44rem;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: left;
  border: 1px solid rgba(120, 200, 65, 0.15);
  color: #ceebd2;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: rgba(120, 200, 65, 0.14);
  border-color: rgba(120, 200, 65, 0.35);
  color: #e8f9e8;
  outline: none;
  transform: translateX(3px);
}

.menu-item:focus,
.menu-item:active {
  outline: none;
  box-shadow: none;
}

.menu-item.active {
  background: #78c841;
  color: #0e2218;
  border-color: #8cd05b;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(78, 160, 26, 0.35);
  transform: none;
}

/* ========================================
   MAIN CONTENT & PANELS
======================================== */
.content {
  padding: 1.2rem;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
}

.helper {
  margin-top: 0.4rem;
  color: var(--muted);
}

/* ========================================
   GRID SYSTEM
======================================== */
.kpi-grid,
.split,
.form-grid,
.hours-grid,
.filter-grid,
.action-row,
.actions-inline,
.view-toggle {
  display: grid;
  gap: 0.75rem;
}

.kpi-grid {
  margin-top: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.split {
  margin-top: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.form-grid {
  margin-top: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.hours-grid {
  margin-top: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.filter-grid {
  margin-top: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.actions-inline {
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.action-row {
  margin-top: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, max-content));
}

.action-row-spaced {
  margin-bottom: 1.25rem;
}

.view-toggle {
  margin-bottom: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(130px, max-content));
}

/* ========================================
   PANELS / CARDS
======================================== */
.card {
  margin-top: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}

.card:not(.nested):hover {
  box-shadow: 0 20px 44px rgba(21, 53, 30, 0.16);
  transform: translateY(-2px);
  border-color: #b0d0b8;
}

.card.nested {
  margin-top: 0;
  box-shadow: none;
  background: var(--surface-soft);
  transition: none;
  transform: none;
}

.card.nested:hover {
  transform: none;
  box-shadow: none;
}

.busy-days-card {
  margin-top: 0.75rem;
  background: linear-gradient(135deg, #1a3d1f, #22521f);
  border-color: rgba(120, 200, 65, 0.3);
}

.busy-days-card h3 {
  color: #a8e07a;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.busy-days-card .plain-list li {
  color: #e8f5e2;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(120, 200, 65, 0.12);
}

.busy-days-card .plain-list li:last-child {
  border-bottom: none;
}

.stat-card-wide h3 {
  font-size: 1.15rem;
  white-space: nowrap;
}

.stat-card {
  background: linear-gradient(160deg, #ffffff, #f3fbf2);
  border-left: 3px solid var(--accent);
  padding: 1.5rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
}

.stat-label {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card h3 {
  margin-top: 0.75rem;
  font-size: clamp(1.8rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

/* ========================================
   TABLES
======================================== */
.table-wrap {
  overflow-x: auto;
  margin-top: 0.95rem;
}

.reservation-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.reservation-table th,
.reservation-table td {
  border: 1px solid #c8dece;
  padding: 0.6rem 0.7rem;
  font-size: 0.88rem;
  text-align: left;
}

.reservation-table th {
  background: linear-gradient(180deg, #e4f5e5, #d6edd8);
  color: #1c3f28;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reservation-table td {
  background: #f7fff5;
}

.reservation-table tbody tr:nth-child(even) td {
  background: #eff9ed;
}

.reservation-table tbody tr {
  transition: background 0.15s ease;
}

.reservation-table tbody tr:hover td {
  background: #d8f0d6;
}

.reservation-table tbody tr.selected-row td {
  background: rgba(120, 200, 65, 0.22);
  outline: 2px solid rgba(120, 200, 65, 0.5);
  outline-offset: -1px;
}

/* ========================================
   FORMS
======================================== */
label {
  display: grid;
  gap: 0.33rem;
}

label span {
  font-size: 0.86rem;
  color: #2a4d37;
  font-weight: 600;
}

.field {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem 0.75rem;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.92rem;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(120, 200, 65, 0.18);
  background: #fafff8;
}

.hidden {
  display: none !important;
}

/* ========================================
   DEMO BANNER
======================================== */
.demo-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.65rem 1.2rem;
  background: linear-gradient(135deg, #1a3828, #102018);
  color: #d4f0d4;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(120, 200, 65, 0.2);
  flex-wrap: wrap;
}

.demo-banner i {
  color: #78c841;
}

.demo-login-btn {
  flex-shrink: 0;
}

@media (max-width: 550px) {
  .demo-banner {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .demo-login-btn {
    width: 100%;
  }
}

/* ========================================
   PRIORITY SUPPORT BADGE (PREMIUM)
======================================== */
/* ========================================
   PREMIUM KEY INSIGHTS NOTE
======================================== */
.premium-insight-note {
  color: var(--accent);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-weight: 600;
}

/* ========================================
   PRIORITY SUPPORT BADGE (PREMIUM)
======================================== */
.guest-page-url-note {
  margin-top: 0.75rem;
}

/* ========================================
   RESTAURANT CARDS (SUPER ADMIN)
======================================== */
.restaurant-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.restaurant-card {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.18s, box-shadow 0.18s;
  cursor: pointer;
}

.restaurant-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 18px rgba(120, 200, 65, 0.12);
}

.restaurant-card-name {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.restaurant-card-email {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.restaurant-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.plan-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-badge-trial    { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }
.plan-badge-basic    { background: #e8f0e9; color: #3a6b3a; }
.plan-badge-standard { background: #ddeeff; color: #1a4a88; }
.plan-badge-premium  { background: #fff4d6; color: #7a5200; }

.trial-expiry {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
  white-space: nowrap;
}
.trial-expiry-urgent  { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.trial-expiry-expired { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }

.notif-premium-tag {
  font-size: 0.7rem;
  vertical-align: middle;
}

select.field:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pw-error {
  color: #f87171;
  min-height: 1.2em;
}

.pw-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-field-wrap .field {
  flex: 1;
  padding-right: 2.5rem;
}

.pw-toggle {
  position: absolute;
  right: 0.6rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #8aad6e;
  font-size: 1rem;
  padding: 0.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
}

.pw-toggle:hover {
  color: #8aad6e;
}

.restaurant-card-view {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
}

/* ========================================
   RESTAURANT DETAIL (SUPER ADMIN)
======================================== */
.rd-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.rd-title {
  flex: 1;
  margin: 0;
  font-size: 1.35rem;
  font-family: "Bricolage Grotesque", sans-serif;
}

.rd-topbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rd-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.rd-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}

.rd-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.rd-tab:hover:not(.active) {
  color: var(--ink);
}

.rd-pane {
  /* shown/hidden via .hidden */
}

/* ── Overview KV rows ─────────────────────────────────────────────────────── */
.overview-kv {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.overview-kv-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.52rem 0.8rem;
  background: var(--surface-soft);
  border-radius: 8px;
  font-size: 0.875rem;
}

.overview-kv-icon {
  color: var(--accent);
  font-size: 0.8rem;
  text-align: center;
}

.overview-kv-label {
  color: var(--muted);
  font-weight: 500;
}

.overview-kv-val {
  font-weight: 600;
  color: var(--ink);
  text-align: right;
}

/* ── Guest URL bar ────────────────────────────────────────────────────────── */
.guest-url-bar {
  margin-top: 0.85rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
  font-family: "Courier New", monospace;
  line-height: 1.5;
}

.guest-url-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

/* ── Booking rule chips ───────────────────────────────────────────────────── */
.rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.rule-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  padding: 0.8rem 0.5rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rule-chip:hover {
  border-color: rgba(120, 200, 65, 0.4);
  box-shadow: 0 2px 10px rgba(120, 200, 65, 0.1);
}

.rule-chip-icon {
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 0.1rem;
}

.rule-chip-label {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rule-chip-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

/* ── Opening hours tiles ─────────────────────────────────────────────────── */
.oh-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.oh-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.65rem 0.25rem;
  border-radius: 10px;
  text-align: center;
  gap: 0.35rem;
}

.oh-tile--open {
  background: rgba(120, 200, 65, 0.1);
  border: 1px solid rgba(120, 200, 65, 0.28);
}

.oh-tile--closed {
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.oh-day {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.oh-tile--open .oh-day {
  color: var(--accent);
}

.oh-time {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  word-break: break-word;
}

.oh-tile--closed .oh-time {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.68rem;
}

/* Keep old rd-hours-grid in case referenced elsewhere */
.rd-hours-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.4rem; }
.rd-hour-row { display: flex; justify-content: space-between; padding: 0.35rem 0.75rem; background: var(--surface-soft); border-radius: 8px; font-size: 0.86rem; }
.rd-hour-day { color: var(--muted); font-weight: 600; }
.rd-hour-val { color: var(--ink); }

/* ========================================
   PRIORITY SUPPORT BADGE (PREMIUM)
======================================== */
.priority-support-badge {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(120, 200, 65, 0.08);
  border: 1px solid rgba(120, 200, 65, 0.3);
  border-radius: 10px;
}

.priority-support-title {
  margin: 0;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
}

.priority-support-desc {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.support-note {
  font-size: 0.88rem;
  min-height: 1.2em;
  margin: 0.5rem 0 0;
}

.helper-inline {
  margin-top: 0.6rem;
  color: var(--muted);
}

.plain-list {
  margin: 0.55rem 0 0;
  padding-left: 1.05rem;
}

.plain-list li {
  margin-bottom: 0.44rem;
}

.analytics-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.75rem;
}

.chart-card-wide {
  grid-column: span 2;
}

.chart-wrap {
  position: relative;
  margin-top: 1rem;
  height: 220px;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-list {
  margin-top: 0.7rem;
  display: grid;
  gap: 0.48rem;
}

.chart-row {
  display: grid;
  grid-template-columns: 95px 1fr 48px;
  align-items: center;
  gap: 0.5rem;
}

.chart-row span {
  font-size: 0.86rem;
  color: #335640;
}

.chart-bar {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #78c841, #4ea01a);
  position: relative;
  overflow: hidden;
}

.chart-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 60%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-200%);
  will-change: transform;
  animation: barShimmer 2.4s ease infinite;
}

@keyframes barShimmer {
  from { transform: translateX(-200%); }
  to   { transform: translateX(300%); }
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.55rem;
}

.calendar-cell {
  border: 1px solid #c7dbc9;
  border-radius: 14px;
  background: linear-gradient(160deg, #f5fdf5, #edf8ee);
  padding: 0.85rem 0.75rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.calendar-cell:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(21, 53, 30, 0.12);
  border-color: #a0ccaa;
}

.calendar-title {
  font-weight: 700;
  font-family: "Bricolage Grotesque", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  color: #1e4530;
  letter-spacing: -0.01em;
}

.calendar-meta {
  margin-top: 0.35rem;
  font-size: 0.84rem;
  color: #486955;
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.52rem 1rem;
  cursor: pointer;
  width: 8rem;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  background: var(--accent);
  color: #0e2218;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, filter 0.2s ease;
  box-shadow: 0 4px 14px rgba(78, 160, 26, 0.28);
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  left: -120%;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  transition: left 0.42s ease;
  pointer-events: none;
}

.btn:hover::after {
  left: 120%;
}

/* ========================================
   BUTTONS
======================================== */
.btn:hover,
.btn:focus-visible {
  background: #87d851;
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(78, 160, 26, 0.34);
}

.btn.ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 2px 8px rgba(21, 53, 30, 0.08);
}

.btn.ghost:hover,
.btn.ghost:focus-visible {
  background: #f3f8f3;
  border-color: #a0c8a8;
  box-shadow: 0 6px 16px rgba(21, 53, 30, 0.12);
}

.btn.view-btn.active {
  background: #78c841;
  color: #0e2218;
}

.btn.danger {
  background: #f4d8d8;
  color: #6d1d1d;
  border-color: #dbadad;
  box-shadow: 0 2px 8px rgba(167, 55, 55, 0.12);
}

.btn.danger:hover,
.btn.danger:focus-visible {
  background: #f0c8c8;
  border-color: #c89090;
  box-shadow: 0 6px 16px rgba(167, 55, 55, 0.2);
}

.status-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  min-width: 4rem;
}

.status-badge:empty {
  display: none;
}

/* ========================================
   TOPBAR ACTIONS
======================================== */
.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.topbar-actions .btn,
.topbar-actions a.btn {
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
}

.topbar-actions .btn:focus,
.topbar-actions .btn:focus-visible,
.topbar-actions .btn:active,
.topbar-actions a.btn:focus,
.topbar-actions a.btn:focus-visible,
.topbar-actions a.btn:active {
  outline: none;
  box-shadow: none;
}

/* ========================================
   TOAST
======================================== */
.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  background: linear-gradient(135deg, #1a3828, #102018);
  color: #e8f9e8;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(120, 200, 65, 0.3);
  box-shadow: 0 12px 32px rgba(8, 21, 14, 0.4);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.toast::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: #78c841;
  font-size: 0.85rem;
}

.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(162, 203, 171, 0.22);
  }

  .menu {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .chart-card-wide {
    grid-column: span 1;
  }
}

/* Action-row and actions-inline buttons must never be clipped — size to content */
.action-row .btn,
.action-row a.btn,
.actions-inline .btn,
.actions-inline a.btn {
  width: auto;
  min-width: 0;
}

@media (max-width: 550px) {
  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    padding: 0.8rem 1rem;
  }

  .admin-brand {
    justify-self: center;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }

  /* owner badge and system status span full width */
  .topbar-actions .owner-badge,
  .topbar-actions .status-badge {
    grid-column: 1 / -1;
  }

  /* Save All, Log Out span full width */
  .topbar-actions #saveAllBtn,
  .topbar-actions #logoutBtn {
    grid-column: 1 / -1;
  }

  /* Guest Page and Home Page buttons fill their 50% cell */
  .topbar-actions #guestPageBtn,
  .topbar-actions #homePageBtn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 760px) {
  .content {
    padding: 0.9rem;
  }

  .reservation-table {
    min-width: 860px;
  }

  .guest-table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  .guest-table thead {
    display: none;
  }

  .guest-table tbody,
  .guest-table tr,
  .guest-table td {
    display: block;
    width: 100%;
  }

  .guest-table tr {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border: 1px solid #b8d6bf;
    border-radius: 10px;
    background: #f7fff5;
  }

  .guest-table td {
    border: none;
    border-bottom: 1px dashed #c7dbc9;
    padding: 0.45rem 0.25rem;
    background: transparent !important;
  }

  .guest-table td:last-child {
    border-bottom: none;
  }

  .guest-table td::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: #2a4d37;
  }

  .reservation-management-table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  .reservation-management-table thead {
    display: none;
  }

  .reservation-management-table tbody,
  .reservation-management-table tr,
  .reservation-management-table td {
    display: block;
    width: 100%;
  }

  .reservation-management-table tr {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    border: 1px solid #b8d6bf;
    border-radius: 10px;
    background: #f7fff5;
  }

  .reservation-management-table td {
    border: none;
    border-bottom: 1px dashed #c7dbc9;
    padding: 0.45rem 0.25rem;
    background: transparent !important;
  }

  .reservation-management-table td:last-child {
    border-bottom: none;
  }

  .reservation-management-table td::before {
    content: attr(data-label) ": ";
    font-weight: 700;
    color: #2a4d37;
  }

  .chart-row {
    grid-template-columns: 80px 1fr 42px;
  }
}
