@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN2014-Regular.ttf") format("truetype");
  font-weight: 400;
}
@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN2014-DemiBold.ttf") format("truetype");
  font-weight: 650;
}
@font-face {
  font-family: "DIN 2014";
  src: url("/fonts/DIN2014-Bold.ttf") format("truetype");
  font-weight: 800;
}
:root {
  --bg: #ead0a6;
  --paper: #fff8ea;
  --ink: #1e252d;
  --muted: #667783;
  --line: rgba(30, 37, 45, 0.16);
  --calendar-line: rgba(255, 255, 255, 0.72);
  --line-strong: rgba(30, 37, 45, 0.28);
  --accent: #eb8260;
  --accent-dark: #8b3f28;
  --blue: #2b495b;
  --aqua: #7c9c90;
  --olive: #8e843d;
  --danger: #a33b3b;
  --shadow: 0 18px 48px rgba(54, 39, 23, 0.12);
  --radius: 8px;
  --slot-height: 46px;
  font-family: "DIN 2014", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 88px; padding: 12px clamp(16px, 3vw, 36px); background: rgba(30,37,45,.96); border-bottom: 1px solid rgba(234,208,166,.22); backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: #ead0a6; text-decoration: none; }
.brand-mark { display: block; flex: 0 0 auto; width: 68px; height: 68px; object-fit: contain; }
.top-actions, .section-head, .calendar-toolbar, .form-row, .week-nav { display: flex; align-items: center; }
.top-actions { gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.workspace { display: grid; grid-template-columns: minmax(0,1fr) 360px; gap: 24px; padding: 24px clamp(16px,3vw,36px) 36px; }
.calendar-panel, .booking-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.calendar-panel { min-width: 0; overflow: hidden; }
.calendar-toolbar { justify-content: space-between; gap: 18px; padding: 22px 22px 18px; border-bottom: 1px solid var(--line); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(24px,3vw,36px); line-height: 1.08; }
h2 { font-size: 18px; line-height: 1.2; }
.calendar-title { display: grid; gap: 10px; min-width: min(100%, 520px); }
.week-nav { gap: 8px; flex-wrap: wrap; }
.week-nav p { min-height: 38px; display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 650; }
.week-nav .icon-button { background: var(--ink); border-color: var(--ink); color: #fff; }
.week-nav .ghost-button { background: #fff; }
.room-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.room-tab { border: 1px solid var(--line-strong); background: transparent; color: var(--ink); border-radius: 999px; padding: 8px 11px; font-size: 13px; line-height: 1; }
.room-tab.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.calendar-wrap { overflow: auto; }
.calendar-grid { display: grid; grid-template-columns: 70px repeat(7,minmax(128px,1fr)); min-width: 980px; }
.time-head, .day-head { border: 0; border-right: 0.5px solid rgba(255,255,255,.65); border-bottom: 0.5px solid rgba(255,255,255,.65); }
.time-cell, .slot-cell { border: 0; border-right: 0.5px solid var(--calendar-line); border-bottom: 0.5px solid var(--calendar-line); }
.time-head, .day-head { position: sticky; top: 0; z-index: 5; background: #f2ddba; }
.time-head { left: 0; z-index: 6; }
.day-head { min-height: 62px; padding: 12px; }
.day-head strong, .day-head span { display: block; }
.day-head strong { font-size: 14px; }
.day-head span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.time-cell { position: sticky; left: 0; z-index: 4; display: flex; align-items: flex-start; justify-content: center; min-height: var(--slot-height); padding-top: 7px; background: #f2ddba; color: var(--muted); font-size: 12px; }
.slot-cell { position: relative; min-height: var(--slot-height); appearance: none; overflow: visible; padding: 0; background: #fff8ea; border-radius: 0; }
.slot-cell:hover { background: #f6e6c8; }
.slot-cell.disabled { background: repeating-linear-gradient(135deg,#eadcc3 0,#eadcc3 7px,#e2d0b0 7px,#e2d0b0 14px); }
.slot-cell.occupied { background: #f1dbc0; }
.slot-cell.occupied:hover { background: #e7cba9; }
.slot-cell.has-booking-start { z-index: 10; }
.booking-chip { position: absolute; top: 4px; left: 5px; right: 5px; z-index: 12; display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; overflow: hidden; padding: 9px 10px; border: 1px solid rgba(255,255,255,.32); border-radius: 6px; color: #fff; text-align: left; box-shadow: 0 12px 28px rgba(34,25,18,.22); pointer-events: auto; }
.booking-chip strong, .booking-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.booking-chip strong { font-size: 13px; line-height: 1.15; }
.booking-chip span { font-size: 12px; line-height: 1.2; opacity: .92; }
.side-panel { display: flex; flex-direction: column; gap: 16px; }
.booking-box { padding: 18px; }
.booking-box form, .dialog-card, .booking-dialog-card form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 650; }
.check-line { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.check-line input { width: 18px; min-height: 18px; height: 18px; accent-color: var(--accent); }
input, select, textarea { width: 100%; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 9px 10px; background: #fff; color: var(--ink); outline: none; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,78,34,.14); }
.form-row { gap: 10px; }
.form-row > * { flex: 1; }
.price-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.price-line span, .form-note, .empty, .booking-meta { color: var(--muted); }
.price-line strong { font-size: 22px; }
.primary-button, .ghost-button, .icon-button, .link-button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; border-radius: 6px; border: 1px solid transparent; font-size: 14px; font-weight: 750; }
.primary-button { padding: 0 16px; background: var(--accent); color: #fff; }
.primary-button:hover { background: var(--accent-dark); }
.primary-button:disabled { cursor: not-allowed; opacity: .55; }
.ghost-button { padding: 0 12px; background: transparent; border-color: var(--line-strong); color: var(--ink); }
.topbar .ghost-button, .topbar .icon-button { border-color: rgba(234,208,166,.45); color: #ead0a6; }
.icon-button { width: 38px; padding: 0; background: transparent; border-color: var(--line-strong); color: var(--ink); }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.link-button { width: fit-content; min-height: 30px; padding: 0; background: transparent; color: var(--accent); }
.wide { width: 100%; }
.form-note, .empty, .booking-meta { font-size: 13px; line-height: 1.45; }
.section-head { justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.booking-list { display: grid; gap: 10px; max-height: 360px; overflow: auto; }
.booking-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.booking-card.cancelled { opacity: .6; }
.booking-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.booking-card strong { font-size: 14px; }
.booking-card button { min-height: 30px; padding: 0 10px; border-color: rgba(163,59,59,.35); color: var(--danger); }
dialog { width: min(430px,calc(100vw - 24px)); border: 0; border-radius: 10px; padding: 0; background: transparent; }
dialog::backdrop { background: rgba(33,29,24,.38); backdrop-filter: blur(4px); }
.dialog-card { padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.booking-dialog-card { gap: 16px; }
.dialog-subtitle { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 50; max-width: min(420px,calc(100vw - 36px)); padding: 13px 15px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--shadow); transform: translateY(16px); opacity: 0; pointer-events: none; transition: 160ms ease; }
.toast.show { transform: translateY(0); opacity: 1; }
@media (max-width: 1040px) {
  .workspace { grid-template-columns: 1fr; }
  .side-panel { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-only { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  :root { --slot-height: 42px; }
  .topbar { align-items: flex-start; flex-direction: column; gap: 10px; min-height: auto; padding: 10px 12px 12px; }
  .brand { gap: 10px; max-width: 100%; }
  .brand-mark { width: 58px; height: 58px; }
  .top-actions { width: 100%; }
  .top-actions .primary-button, .top-actions .ghost-button, .top-actions .icon-button { min-height: 42px; }
  .workspace { gap: 14px; padding: 14px 10px 24px; }
  .calendar-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; padding: 16px 14px 12px; }
  .calendar-title { width: 100%; }
  .week-nav { display: grid; grid-template-columns: 42px minmax(0,1fr) 42px minmax(86px,auto); width: 100%; gap: 7px; }
  .week-nav p { justify-content: center; min-height: 42px; font-size: 13px; text-align: center; }
  .week-nav .icon-button, .week-nav .ghost-button { min-height: 42px; }
  .week-nav .icon-button { width: 100%; }
  h1 { font-size: 24px; }
  .room-tabs { justify-content: flex-start; flex-wrap: nowrap; width: 100%; margin: 0 -2px; padding: 0 2px 4px; overflow-x: auto; scrollbar-width: thin; }
  .room-tab { flex: 0 0 auto; min-height: 38px; padding: 8px 12px; }
  .calendar-wrap { -webkit-overflow-scrolling: touch; }
  .calendar-grid { grid-template-columns: 56px repeat(7,minmax(94px,1fr)); min-width: 714px; }
  .day-head { min-height: 56px; padding: 10px 8px; }
  .day-head strong { font-size: 13px; }
  .day-head span { font-size: 11px; }
  .time-cell { font-size: 11px; }
  .booking-chip { top: 3px; left: 3px; right: 3px; gap: 2px; padding: 7px 8px; }
  .booking-chip strong { font-size: 12px; }
  .booking-chip span { font-size: 11px; }
  .side-panel { display: flex; }
  .form-row { flex-direction: column; }
  .booking-box { padding: 16px 14px; }
  .booking-list { max-height: none; }
  input, select, textarea { min-height: 44px; font-size: 16px; }
  .toast { right: 10px; bottom: 10px; max-width: calc(100vw - 20px); }
}
