:root{
  --ink: #0F0720;
  --ink-2: #170B2E;
  --ink-3: #241653;
  --panel: #1B1038;
  --gold: #C8920A;
  --gold-light: #E3B23D;
  --paper: #F5F1E8;
  --muted: #9A8FB8;
  --radius: 3px;

  --status-available: #8FD19E;
  --status-on_hire: #E3B23D;
  --status-in_use: #7FB3E0;
  --status-in_repair: #E8836F;
  --status-retired: #6B6480;

  --type-event: #C8920A;
  --type-rehearsal: #7FB3E0;
  --type-recording: #B79CE0;
  --type-kit_hire: #8FD19E;

  --cal-daynum-h: 26px;
  --cal-bar-h: 19px;
  --cal-bar-gap: 4px;
  --cal-row-pad-bottom: 6px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3{
  font-family: 'Archivo Black', sans-serif;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}
p{ margin: 0; }
a{ color: inherit; text-decoration: none; }
button{ font-family: inherit; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible{
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.wrap{ max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* ---------- Header ---------- */
header.staff-header{
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(15,7,32,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-3);
}
.staff-nav{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 20px;
  flex-wrap: wrap;
}
.staff-brand{
  display: flex;
  align-items: center;
  gap: 12px;
}
.staff-brand img{ width: 34px; height: 34px; border-radius: 50%; }
.staff-brand-text{
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.95rem;
}
.staff-brand-text span{ color: var(--gold); }
.staff-brand-tag{
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--ink-3);
}
.staff-links{
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
  margin: 0; padding: 0;
  flex-wrap: wrap;
}
.staff-links a{
  font-weight: 700;
  font-size: 0.88rem;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}
.staff-links a:hover, .staff-links a.active{
  border-bottom-color: var(--gold);
  color: var(--gold-light);
}
.staff-signout{
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--ink-3);
  padding: 8px 14px;
  border-radius: var(--radius);
}
.staff-signout:hover{ border-color: var(--gold); color: var(--gold-light); }

main{ padding: 48px 0 80px; }

.page-head{ margin-bottom: 34px; }
.eyebrow{
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before{ content:""; width: 16px; height: 2px; background: var(--gold); }
.page-head h1{ font-size: clamp(1.7rem, 3vw, 2.3rem); margin-top: 14px; }
.page-head p{ color: var(--muted); margin-top: 10px; max-width: 560px; }

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  background: none;
}
.btn:hover{ transform: translateY(-1px); }
.btn-primary{ background: var(--gold); color: var(--ink); }
.btn-primary:hover{ background: var(--gold-light); }
.btn-ghost{ color: var(--paper); border-color: var(--ink-3); }
.btn-ghost:hover{ border-color: var(--gold); }
.btn-danger{ color: var(--status-in_repair); border-color: var(--ink-3); }
.btn-danger:hover{ border-color: var(--status-in_repair); }
.btn-sm{ padding: 7px 14px; font-size: 0.78rem; }
.btn:disabled{ opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- Dashboard cards ---------- */
.dash-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.dash-card{
  background: var(--panel);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius);
  padding: 36px;
  border-left: 3px solid var(--gold);
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.dash-card:hover{ border-color: var(--gold); transform: translateY(-2px); }
.dash-card .icon{ width: 34px; height: 34px; color: var(--gold); margin-bottom: 20px; }
.dash-card h2{ font-size: 1.3rem; margin-bottom: 10px; }
.dash-card p{ color: var(--muted); font-size: 0.95rem; margin-bottom: 20px; }
.dash-card .go{
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--gold-light);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Filters / toolbar ---------- */
.toolbar{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.toolbar-filters{ display: flex; flex-wrap: wrap; gap: 10px; }
.toolbar input[type="search"], .toolbar select{
  background: var(--panel);
  border: 1px solid var(--ink-3);
  color: var(--paper);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.88rem;
}

/* ---------- Table ---------- */
.table-wrap{
  background: var(--panel);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius);
  overflow: auto;
}
table{ width: 100%; border-collapse: collapse; min-width: 760px; }
thead th{
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--ink-3);
  white-space: nowrap;
}
tbody td{
  padding: 14px 18px;
  border-bottom: 1px solid var(--ink-3);
  font-size: 0.9rem;
  vertical-align: middle;
}
tbody tr:last-child td{ border-bottom: none; }
tbody tr{ cursor: pointer; transition: background 0.15s ease; }
tbody tr:hover{ background: rgba(200,146,10,0.06); }
.cell-muted{ color: var(--muted); }
.empty-row td{ text-align: center; color: var(--muted); padding: 40px 18px; cursor: default; }
.empty-row:hover{ background: none; }

.pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.pill::before{ content:""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-available{ color: var(--status-available); background: rgba(143,209,158,0.12); }
.pill-on_hire{ color: var(--status-on_hire); background: rgba(227,178,61,0.12); }
.pill-in_use{ color: var(--status-in_use); background: rgba(127,179,224,0.12); }
.pill-in_repair{ color: var(--status-in_repair); background: rgba(232,131,111,0.12); }
.pill-retired{ color: var(--status-retired); background: rgba(107,100,128,0.16); }

/* ---------- Modal ---------- */
.modal-backdrop{
  position: fixed; inset: 0;
  background: rgba(6,2,16,0.7);
  backdrop-filter: blur(3px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 20px;
  z-index: 100;
}
.modal-backdrop.open{ display: flex; }
.modal{
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  padding: 32px;
}
.modal-head{
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px;
}
.modal-head h2{ font-size: 1.2rem; }
.modal-close{
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 1.4rem; line-height: 1; padding: 4px;
}
.modal-close:hover{ color: var(--paper); }
.modal-actions{
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 26px; gap: 12px; flex-wrap: wrap;
}
.modal-actions .right{ display: flex; gap: 10px; margin-left: auto; }

/* ---------- Forms ---------- */
.form-row{ display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field{ margin-bottom: 18px; }
.field label{
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.field input, .field select, .field textarea{
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--ink-3);
  color: var(--paper);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 11px 12px;
  border-radius: var(--radius);
}
.field input:focus, .field select:focus, .field textarea:focus{ border-color: var(--gold); outline: none; }
.field textarea{ resize: vertical; min-height: 80px; }
.checkbox-row{ display: flex; align-items: center; gap: 10px; }
.checkbox-row input{ width: auto; }
.checkbox-row label{ margin: 0; text-transform: none; font-size: 0.9rem; color: var(--paper); letter-spacing: 0; }
.asset-picker{
  border: 1px solid var(--ink-3);
  border-radius: var(--radius);
  max-height: 160px;
  overflow-y: auto;
  padding: 6px;
}
.asset-picker label{
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; text-transform: none; font-size: 0.88rem; color: var(--paper);
  font-weight: 500; letter-spacing: 0; cursor: pointer; border-radius: var(--radius);
}
.asset-picker label:hover{ background: rgba(200,146,10,0.08); }
.asset-picker input{ width: auto; }
.form-msg{ font-size: 0.85rem; margin-top: 4px; min-height: 18px; }
.form-msg.ok{ color: var(--status-available); }
.form-msg.err{ color: var(--status-in_repair); }

/* ---------- Calendar ---------- */
.cal-toolbar{
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 14px;
}
.cal-nav{ display: flex; align-items: center; gap: 10px; }
.cal-nav button{
  background: var(--panel); border: 1px solid var(--ink-3); color: var(--paper);
  width: 36px; height: 36px; border-radius: var(--radius); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cal-nav button:hover{ border-color: var(--gold); }
.cal-month-label{ font-family: 'Archivo Black', sans-serif; font-size: 1.2rem; min-width: 170px; text-align: center; }
.cal-legend{ display: flex; gap: 16px; flex-wrap: wrap; }
.cal-legend .item{ display: flex; align-items: center; gap: 7px; font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.cal-legend .dot{ width: 9px; height: 9px; border-radius: 50%; }

.cal-weekdays{
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--ink-3);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.cal-weekday{
  background: var(--panel);
  padding: 10px 8px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  border-right: 1px solid var(--ink-3);
  min-width: 0;
}
.cal-weekday:last-child{ border-right: none; }

.cal-body{
  border: 1px solid var(--ink-3);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}
.cal-week{
  position: relative;
  border-bottom: 1px solid var(--ink-3);
  min-height: calc(var(--cal-daynum-h) + (var(--lane-count, 1) * (var(--cal-bar-h) + var(--cal-bar-gap))) + var(--cal-row-pad-bottom));
}
.cal-week:last-child{ border-bottom: none; }
.cal-week-days{
  position: absolute; inset: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: 100%;
  height: 100%;
}
.cal-day{
  min-width: 0;
  background: var(--ink-2);
  cursor: pointer;
  padding: 4px 6px 0;
  border-right: 1px solid var(--ink-3);
  transition: background 0.15s ease;
}
.cal-day:last-child{ border-right: none; }
.cal-day:hover{ background: rgba(200,146,10,0.06); }
.cal-day.other-month{ background: rgba(15,7,32,0.5); }
.cal-day.other-month .cal-daynum{ color: var(--ink-3); }
.cal-day.today{ box-shadow: inset 0 0 0 2px var(--gold); }
.cal-daynum{
  height: var(--cal-daynum-h);
  display: flex; align-items: center;
  font-size: 0.82rem; font-weight: 700; color: var(--muted);
}
.cal-day.today .cal-daynum{ color: var(--gold-light); }

.cal-week-bars{
  position: absolute;
  left: 0; right: 0; top: var(--cal-daynum-h); bottom: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: var(--cal-bar-h);
  row-gap: var(--cal-bar-gap);
  padding: 0 4px;
  pointer-events: none;
}
.cal-bar{
  min-width: 0;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
}
.cal-bar.chip-event{ background: var(--type-event); }
.cal-bar.chip-rehearsal{ background: var(--type-rehearsal); }
.cal-bar.chip-recording{ background: var(--type-recording); }
.cal-bar.chip-kit_hire{ background: var(--type-kit_hire); }
.cal-bar.provisional{
  background-image: repeating-linear-gradient(45deg, rgba(15,7,32,0.4) 0 5px, transparent 5px 10px);
}
.status-badge{
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--ink-3); border-radius: 20px; padding: 2px 9px;
}
.status-badge::before{ content: ""; width: 6px; height: 6px; border-radius: 50%; background: repeating-linear-gradient(45deg, var(--muted) 0 2px, transparent 2px 4px); }

/* ---------- Read-only "view" modals ---------- */
.view-list{ display: flex; flex-direction: column; gap: 0; }
.view-row{
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--ink-3);
}
.view-row:first-child{ border-top: none; }
.view-label{
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 2px;
}
.view-value{ font-size: 0.94rem; color: var(--paper); word-break: break-word; }
.view-value.cell-muted{ color: var(--muted); }
.view-value ul{ margin: 0; padding-left: 18px; }
.view-title{ margin-bottom: 4px; }
.view-subtitle{ color: var(--muted); font-size: 0.9rem; margin-bottom: 22px; }

/* ---------- Day detail list ---------- */
.day-list{ display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow-y: auto; padding: 2px; }
.day-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: rgba(245,241,232,0.05);
  border: 1px solid var(--ink-3);
  border-left: 3px solid var(--ink-3);
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.day-item:hover{
  border-color: var(--gold);
  background: rgba(200,146,10,0.09);
  transform: translateY(-1px);
}
.day-item.type-event{ border-left-color: var(--type-event); }
.day-item.type-rehearsal{ border-left-color: var(--type-rehearsal); }
.day-item.type-recording{ border-left-color: var(--type-recording); }
.day-item.type-kit_hire{ border-left-color: var(--type-kit_hire); }
.type-dot{ width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.type-dot.chip-event{ background: var(--type-event); }
.type-dot.chip-rehearsal{ background: var(--type-rehearsal); }
.type-dot.chip-recording{ background: var(--type-recording); }
.type-dot.chip-kit_hire{ background: var(--type-kit_hire); }
.type-dot.provisional{ background-image: repeating-linear-gradient(45deg, rgba(15,7,32,0.45) 0 2px, transparent 2px 4px); }
.day-item .info{ flex: 1; min-width: 0; }
.day-item .info .title{ font-weight: 700; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-item .info .meta{ color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.day-empty{ color: var(--muted); font-size: 0.9rem; padding: 20px 0; text-align: center; }

/* ---------- Misc ---------- */
.loading-note, .error-note{ color: var(--muted); font-size: 0.9rem; padding: 20px; text-align: center; }
.error-note{ color: var(--status-in_repair); }

@media (max-width: 760px){
  .dash-grid{ grid-template-columns: 1fr; }
  .form-row{ grid-template-columns: 1fr; }
  .staff-links{ gap: 16px; }
  .cal-legend{ display:none; }
  .modal{ padding: 24px 20px; }
  .view-row{ grid-template-columns: 100px 1fr; gap: 10px; }

  /* Calendar: shrink the bar-grid metrics — the layout (CSS Grid + calc()) */
  /* picks these up automatically, no JS recalculation needed. */
  :root{
    --cal-daynum-h: 20px;
    --cal-bar-h: 15px;
    --cal-bar-gap: 3px;
  }
  .cal-toolbar{ align-items: stretch; }
  .cal-month-label{ min-width: 0; flex: 1; }
  .cal-weekday{ padding: 7px 2px; font-size: 0.6rem; letter-spacing: 0; }
  .cal-day{ padding: 3px 3px 0; }
  .cal-daynum{ font-size: 0.72rem; }
  .cal-bar{ font-size: 0.56rem; padding: 1px 4px; letter-spacing: -0.01em; }
}


