/* =========================
   Basis / Tokens
========================= */
:root{
  --bg: #f5f5f7;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;

  --border: #ddd;
  --border-soft: #e5e7eb;

  --primary: #0073e6;
  --primary-hover: #005bb5;

  --danger: #cc0000;
  --danger-hover: #a80000;

  --sidebar: #1f2933;
  --sidebar-hover: #323f4b;
  --sidebar-active: #111827;
  --sidebar-text: #cbd2d9;

  --radius: 8px;
  --radius-sm: 4px;

  --shadow: 0 0 10px rgba(0,0,0,.05);
  --shadow-auth: 0 8px 20px rgba(15, 23, 42, 0.12);
}

*{ box-sizing:border-box; }
html, body{ margin:0; padding:0; }

body{
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* =========================
   Forms (globaal)
========================= */
form div{ margin-bottom: .75rem; }
label{ font-weight: 600; }

input, select, button{
  font-size: 1rem;
  box-sizing: border-box;
}

input, select{
  padding: 8px;
  width: 100%;
  max-width: 320px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: #fff;
}

button{
  padding: .5rem .75rem;
  cursor: pointer;
}

/* =========================
   Layout
========================= */
.layout{
  display:flex;
  min-height: calc(100vh - 60px); /* headerhoogte */
  background: var(--bg);
}

.main-content{
  flex: 1;
  padding: 20px 24px;
  min-width: 0; /* voorkomt overflow in flex */
}

/* Legacy container */
.main-container{
  flex: 1;
  max-width: 100%;
  margin: 20px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

/* =========================
   Header
========================= */
.header{
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;

  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 12px;
}

.header-left{
  display:flex;
  align-items:center;
  gap: 14px;
  min-width: 0;
}

.logo-link{
  display:flex;
  align-items:center;
  gap: 12px;
  text-decoration:none;
  color: inherit;
  min-width: 0;
}

.logo{ height: 34px; display:block; }
.app-title{
  font-size: 18px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right{
  display:flex;
  align-items:center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content:flex-end;
}

.user-name{
  font-size: 14px;
  color: #555;
}

/* Legacy fallback */
.header-user a{
  color: #fff;
  text-decoration:none;
}

/* =========================
   Buttons / Links
========================= */
.logout-button,
.login-link,
.btn,
.btn-primary{
  display:inline-block;
  padding: 8px 14px;
  border-radius: 5px;
  text-decoration:none;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
  border: none;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.2;
}

.btn{
  background: #0073ff;
  color: #fff !important;
}
.btn:hover{ background: #0059c9; }

.btn-secondary{
  background: #666;
  color: #fff !important;
}
.btn-secondary:hover{ background: #444; }

/* Primary (auth) – gelijkgetrokken */
.btn-primary{
  background: #2563eb;
  color: #fff;
}
.btn-primary:hover{ background: #1d4ed8; }

/* Header specifieke knoppen */
.logout-button{
  background: var(--danger);
  color: #fff;
}
.logout-button:hover{ background: var(--danger-hover); }

.login-link{
  background: var(--primary);
  color: #fff;
}
.login-link:hover{ background: var(--primary-hover); }

.btn-link{
  background: none;
  border: none;
  padding: 0;
  color: #2563eb;
  font-size: 13px;
  cursor: pointer;
  text-decoration:none;
}
.btn-link:hover{ text-decoration: underline; }

/* =========================
   Sidebar
========================= */
.sidebar{
  width: 220px;
  background: var(--sidebar);
  color: #f9fafb;
  padding: 16px 0;
  flex-shrink: 0;
}

.sidebar-nav ul{
  list-style:none;
  margin: 0;
  padding: 0;
}

.sidebar-item{ margin-bottom: 4px; }

.sidebar-link{
  display:block;
  padding: 10px 18px;
  color: var(--sidebar-text);
  text-decoration:none;
  font-size: 14px;
  transition: background .2s ease, color .2s ease, padding-left .2s ease;
}

.sidebar-link:hover{
  background: var(--sidebar-hover);
  color: #fff;
  padding-left: 22px;
}

.sidebar-item.active > .sidebar-link{
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
}

.sidebar-link-group{ cursor: default; opacity: .9; }

.sidebar-subnav { list-style: none; margin: 6px 0 0 0; padding: 0; }
.sidebar-subitem{ margin: 0; }
.sidebar-sublink{
  display:block;
  padding: 8px 18px 8px 28px;
  text-decoration:none;
  font-size: 13px;
  color: var(--sidebar-text);
}
.sidebar-sublink:hover{ background: var(--sidebar-hover); color:#fff; }

/* ===== Sidebar: Actief hotel context (samengevoegd, 1 bron van waarheid) ===== */
.sidebar-context{
  padding: 12px 16px;
  margin: 8px 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}

.sidebar-context-title{
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 6px;
  opacity: 1; /* expliciet: overschrijft oudere .75 */
}

.sidebar-context-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.sidebar-context-name{
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-context-link{
  font-size: 12px;
  color: #93c5fd;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.sidebar-context-link:hover{ text-decoration: underline; }

.sidebar-badge{
  display:inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  background: #b91c1c;
  color: #ffffff;
  vertical-align: middle;
}

/* =========================
   Tabellen
========================= */
.table{
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: var(--surface);
}

.table th,
.table td{
  border: 1px solid var(--border);
  padding: 8px 10px;
}

.table th{ background: #f0f0f0; }

/* =========================
   Cards
========================= */
.card{
  padding: 18px;
  border-radius: var(--radius);
  background: #fafafa;
  border: 1px solid #eee;
  margin-bottom: 20px;
}
.card h2{ margin-top: 0; }

/* =========================
   Auth / Login
========================= */
.auth-container{
  display:flex;
  justify-content:center;
  align-items:center;
  min-height: calc(100vh - 60px);
  padding: 16px;
}

.auth-card{
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 28px;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-auth);
}

.auth-title{
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.auth-subtitle{
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 18px;
}

.auth-field{ margin-bottom: 14px; }
.auth-field label{
  display:block;
  font-size: 13px;
  color: #374151;
  margin-bottom: 4px;
}
.auth-field input[type="email"],
.auth-field input[type="password"]{
  width: 100%;
  max-width: none;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.auth-actions{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top: 18px;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-error{
  color: #b91c1c;
  background: #fee2e2;
  border: 1px solid #fecaca;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 12px;
}

/* =========================
   Inventory (grid)
========================= */
.inv-table .inv-day{
  text-align: center;
  font-size: 12px;
  white-space: nowrap;
}

.inv-cell{
  height: 26px;
  min-width: 34px;
  cursor: default;
  position: relative;
}

.inv-open{ background: #16a34a; }
.inv-closed{ background: #dc2626; }
.inv-unknown{ background: #cbd5e1; }

.inv-cell.inv-open.inv-has-restr{ background: #22c55e; }

.inv-cell.inv-has-restr::after{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.30);
  z-index: 1;
  pointer-events: none;
}

.inv-legend{
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  position: relative;
}

.inv-table td,
.inv-table th{ vertical-align: middle; }

.inv-table td.inv-cell{ padding: 0; }

/* =========================
   Responsive
========================= */
@media (max-width: 768px){
  .header{
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .header-right{
    align-self: stretch;
    justify-content: space-between;
  }

  .layout{ flex-direction: column; }

  .sidebar{
    width: 100%;
    padding: 10px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-nav ul{
    display:flex;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 0 10px;
  }

  .sidebar-item{ margin-bottom: 0; }

  .sidebar-link{
    white-space: nowrap;
    padding: 10px 14px;
  }

  .sidebar-link:hover{ padding-left: 14px; }

  .main-content{ padding: 16px; }

  /* Forms: inputs niet vast beperken op mobiel */
  input, select{ max-width: none; }

  /* Inventory tables: laat horizontaal scrollen als er veel kolommen zijn */
  .inv-table{ display: block; overflow-x: auto; }
}

@media (max-width: 420px){
  .app-title{ font-size: 16px; }
  .user-name{ display:none; }
}

.booking-card {
  background: #fff;
  border: 1px solid #e6e8ec;
  border-radius: 14px;
  padding: 18px;
  margin: 0 0 18px;
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.04);
}

.booking-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.booking-table th,
.booking-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eceff3;
  vertical-align: top;
}

.booking-table th {
  text-align: left;
  font-weight: 600;
  background: #fafbfc;
}

.booking-table .right,
.right {
  text-align: right;
}

.booking-muted {
  margin-top: 4px;
  color: #667085;
  font-size: 13px;
}

.booking-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.booking-totals-box {
  background: #fafbfc;
  border: 1px solid #e6e8ec;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 18px;
}

.booking-total-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}

.booking-total-line-grand {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #dfe3e8;
  font-size: 18px;
}

.booking-error {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.booking-confirm-wrap {
  max-width: 980px;
  margin: 24px auto;
  padding: 0 16px 32px;
}

.booking-title {
  margin: 0 0 6px;
}

.booking-subtitle {
  margin: 0 0 12px;
}

.booking-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.booking-pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f2f4f7;
  color: #344054;
  font-size: 13px;
}

.booking-child-ages-summary {
  margin-top: 18px;
}