:root{
  --bg:#ddd;
  --panel:#ffffff;
  --ink:#0f233c;
  --muted:#6b7280;
  --primary:#0a6cf1;
  --primary-soft:#e0edff;
  --border:#e5e7eb;
  --card-border: #2f3c4f;
  --ok:#1ece5e;
  --warn:#f59e0b;
  --error:#ef4444;
}
:root.dark{
  --bg:#020617;
  --panel:#020617;
  --ink:#e5e7eb;
  --muted:#9aa3af;
  --primary:#60a5fa;
  --primary-soft:#0b1220;
  --border:#1f2937;
}

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

html,body{
  height:100dvh;
}

body{
  margin:0;
  display:flex;
  font-family:system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--ink);
  background:var(--bg);
  overflow:hidden; /* prevent double-scroll; let columns manage their own scroll */
}

/* Sidebar */
.sidebar{
  width:260px;
  padding:16px;
  border-right:1px solid var(--border);
  background:color-mix(in oklab, var(--panel) 92%, #000 3%);
  display:flex;
  flex-direction:column;
  gap:12px;
  height:100dvh;
  overflow-y:auto;
  position:sticky;
  top:0;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
}
.logo{
  font-size:22px;
}
.brand-title{
  font-weight:700;
}
.brand-sub{
  font-size:12px;
  color:var(--muted);
}

#nav{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.nav-item{
  display:flex;
  gap:10px;
  align-items:center;
  padding:9px 12px;
  border-radius:999px;
  color:var(--ink);
  text-decoration:none;
  font-size:14px;
  transition:background-color .18s ease, color .18s ease, transform .08s ease;
}
.nav-item:hover{
  background:var(--primary-soft);
}
.nav-item.active{
  background:var(--primary);
  color:#fff;
  box-shadow:0 8px 18px rgba(15, 23, 42, 0.25);
}
.nav-item i{
  width:18px;
  display:inline-block;
  text-align:center;
}

.sidebar-bottom{
  margin-top:auto;
}

/* Content column */
.content{
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
  height:100dvh;
  overflow:auto;
}
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 18px;
  border-bottom:1px solid var(--border);
  background:var(--panel);
  position:sticky;
  top:0;
  z-index:5;
}
.topbar h2{
  margin:0;
  font-size:18px;
}
.top-actions{
  display:flex;
  gap:8px;
  align-items:center;
}
.view{
  padding:16px;
  padding-bottom:40px;
}

/* Buttons, cards, grid */
.btn{
  background:var(--primary);
  color:#fff;
  border:none;
  border-radius:999px;
  padding:9px 14px;
  font-size:14px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  transition:background-color .15s ease, box-shadow .15s ease, transform .08s ease;
}
.btn:hover{
  background:#2563eb;
  box-shadow:0 6px 14px rgba(37, 99, 235, 0.35);
}
.btn:active{
  transform:translateY(1px);
  box-shadow:none;
}
.btn.ghost{
  background:transparent;
  color:var(--ink);
  border:1px solid var(--border);
  box-shadow:none;
}
.btn.ghost:hover{
  background:rgba(148, 163, 184, 0.12);
}
.btn.secondary{
  background:#e5efff;
  color:#1d4ed8;
}
.btn.danger{
  background:var(--error);
}

.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px 16px;
  margin-bottom:12px;
  box-shadow:0 10px 30px rgba(15, 23, 42, 0.06);
}
.card.stretch{
  height:100%;
}
.card-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}
.card-title{
  font-weight:600;
  font-size:14px;
}
.card-subtitle{
  font-size:12px;
  color:var(--muted);
}

/* Rows/Cols – plus a 2-col grid helper that fills remaining width nicely */
.row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.col{
  flex:1 1 280px;
}
.row.grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
@media (max-width: 900px){
  .row.grid-2{grid-template-columns:1fr}
  .sidebar{display:none;}
  body{flex-direction:column;}
}

/* Table */
.table{
  width:100%;
  border-collapse:collapse;
  background:var(--panel);
  border-radius:14px;
  overflow:hidden;
}
.table th,
.table td{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  text-align:left;
  vertical-align:top;
  font-size:13px;
}
.table th{
  background:rgba(148, 163, 184, 0.08);
  font-weight:600;
}
.table tr:last-child td{
  border-bottom:none;
}
.table tr:hover td{
  background:rgba(15, 23, 42, 0.02);
}

/* Badges */
.badge{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  font-size:12px;
  line-height:1.2;
  vertical-align:middle;
}
.badge.info  { background:#e5efff; color:#1d4ed8; }
.badge.warn  { background:color-mix(in oklab, #f59e0b 20%, #fff 80%); color:#8a4b00; }
.badge.danger{ background:#ffe6e6; color:#b3261e; }
.badge.ok    { background:color-mix(in oklab, #16a34a 20%, #fff 80%); color:#16a34a; }
.badge.err   { background:color-mix(in oklab, #ef4444 20%, #fff 80%); color:#ef4444; }

/* Forms */
.form-row{
  display:flex;
  gap:8px;
}
.input,
select{
  width:100%;
  background:var(--panel);
  border:1px solid var(--muted);
  border-radius:10px;
  color:var(--ink);
  padding:9px 11px;
  margin: 10px 0px;
  outline:none;
  font-size:14px;
}
.input:focus,
select:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 1px rgba(37, 99, 235, 0.35);
}

/* Scroll containers */
.content{
  min-height:0;
}
.view{
  flex:1;
  min-height:0;
  overflow:auto;
}
.modal{
  max-height:90dvh;
  overflow:auto;
}

/* Modal */
.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15, 23, 42, .40);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:50;
}
.modal{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
  width:min(720px, calc(100vw - 24px));
  box-shadow:0 24px 65px rgba(15, 23, 42, .45);
}
.modal-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}
.modal-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  margin-top:12px;
}

/* Toast */
.toast{
  position:fixed;
  right:16px;
  bottom:16px;
  background:var(--panel);
  color:var(--ink);
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  z-index:60;
  box-shadow:0 16px 40px rgba(15, 23, 42, 0.35);
}

/* Booking Creation: Slots Card */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.slot-card {
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.slot-card.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}

.slot-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.slot-time {
  font-size: 13px;
  color: #374151;
}

.slot-seats {
  font-size: 12px;
  color: #065f46;
}

.slot-price {
  font-size: 13px;
  margin: 6px 0;
}
