/* Asnan Tower booking — the building is the interface.
   Dark tower rail on the left, lit working floors on the right. */

:root {
  --ink: #0F1B2D;
  --rail: #132239;
  --rail-lit: #1E3557;
  --rail-edge: #294467;
  --paper: #EDEFF2;
  --surface: #FFFFFF;
  --brass: #B98B2E;
  --brass-lit: #E0B44E;
  --teal: #0B6E78;
  --teal-soft: #E1F0F1;
  --clay: #9B2C2C;
  --clay-soft: #FBEAEA;
  --muted: #667C99;
  --line: #D5DCE5;

  --display: 'Bricolage Grotesque', 'Arial Narrow', system-ui, sans-serif;
  --body: 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;

  --r: 4px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .06), 0 8px 24px -12px rgba(15, 27, 45, .18);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body[dir='rtl'] { font-family: var(--body); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; letter-spacing: -.015em; }

button, input, select, textarea { font: inherit; color: inherit; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */

.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

.rail {
  background: var(--rail);
  color: #C9D6E6;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.rail-head { padding: 22px 20px 16px; border-bottom: 1px solid var(--rail-edge); }

.wordmark {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.1;
}

.wordmark span { display: block; color: var(--brass-lit); font-size: 11px; letter-spacing: .3em; margin-top: 5px; }

.rail-label {
  padding: 14px 20px 8px;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #7E93AE;
}

/* The floor plates: a real directory board, top floor first. */
.floors { flex: 1; overflow-y: auto; padding-bottom: 16px; }

.floor {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  padding: 11px 20px;
  background: none;
  border: 0;
  border-bottom: 1px solid rgba(41, 68, 103, .5);
  text-align: start;
  cursor: pointer;
  color: inherit;
  transition: background .18s ease;
}

.floor:hover { background: var(--rail-lit); }

.floor[aria-current='true'] { background: var(--rail-lit); box-shadow: inset 3px 0 0 var(--brass-lit); }
body[dir='rtl'] .floor[aria-current='true'] { box-shadow: inset -3px 0 0 var(--brass-lit); }

.floor-no {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--brass);
  border: 1px solid rgba(185, 139, 46, .4);
  border-radius: 2px;
  padding: 3px 0;
  text-align: center;
  transition: color .18s ease, border-color .18s ease;
}

.floor[aria-current='true'] .floor-no,
.floor:hover .floor-no { color: var(--brass-lit); border-color: var(--brass-lit); }

.floor-name { font-size: 13.5px; color: #E4EBF3; line-height: 1.3; }
.floor-meta { font-size: 11px; color: #7E93AE; margin-top: 2px; }

.rail-foot { padding: 14px 20px; border-top: 1px solid var(--rail-edge); font-size: 11.5px; color: #7E93AE; }
.rail-foot a { color: var(--brass-lit); text-decoration: none; }
.rail-foot a:hover { text-decoration: underline; }

/* ---------- canvas ---------- */

.canvas { padding: 0 0 64px; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 { font-size: 17px; }
.topbar .grow { flex: 1; }

.tabs { display: flex; gap: 2px; }
.tabs a {
  padding: 6px 12px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--r);
}
.tabs a:hover { background: var(--paper); color: var(--ink); }
.tabs a[aria-current='page'] { background: var(--ink); color: #fff; }

.wrap { max-width: 940px; padding: 28px 32px; }
.wrap-wide { max-width: 1400px; padding: 28px 32px; }

/* ---------- steps ---------- */

.step { margin-bottom: 30px; }

.step-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }

.step-no {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--brass);
  border-bottom: 1px solid var(--brass);
  padding-bottom: 1px;
}

.step h2 { font-size: 15px; font-weight: 600; }

.step-hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

/* ---------- cards & controls ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.pad { padding: 20px; }

.picker { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13.5px;
  text-align: start;
  transition: border-color .15s ease, background .15s ease;
}

.chip:hover { border-color: var(--ink); }
.chip[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip small { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.chip[aria-pressed='true'] small { color: #A8BBD4; }

/* Date strip */
.dates { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }

.date {
  flex: 0 0 auto;
  width: 62px;
  padding: 9px 0;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color .15s ease;
}
.date:hover:not(:disabled) { border-color: var(--ink); }
.date[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.date:disabled { opacity: .34; cursor: not-allowed; }
.date b { display: block; font-family: var(--mono); font-size: 17px; font-weight: 500; }
.date span { display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.date[aria-pressed='true'] span { color: #A8BBD4; }

/* Slot grid */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(94px, 1fr)); gap: 7px; }

.slot {
  font-family: var(--mono);
  font-size: 13.5px;
  padding: 11px 0;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.slot:hover:not(:disabled) { border-color: var(--teal); background: var(--teal-soft); }
.slot[aria-pressed='true'] { background: var(--teal); border-color: var(--teal); color: #fff; }
.slot:disabled { background: var(--paper); color: #A6B4C6; cursor: not-allowed; text-decoration: line-through; }

/* Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--teal);
  outline-offset: -1px;
  border-color: var(--teal);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.btn {
  padding: 10px 18px;
  border: 1px solid var(--ink);
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: opacity .15s ease;
}
.btn:hover:not(:disabled) { opacity: .87; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost { background: none; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn-danger { background: var(--clay); border-color: var(--clay); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }

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

/* ---------- feedback ---------- */

.note { padding: 11px 14px; border-radius: var(--r); font-size: 13.5px; margin-bottom: 14px; }
.note-error { background: var(--clay-soft); color: var(--clay); border: 1px solid #E9C4C4; }
.note-info { background: var(--teal-soft); color: var(--teal); border: 1px solid #BFDDE0; }

.empty { color: var(--muted); font-size: 13.5px; padding: 22px; text-align: center; }

.skeleton { background: linear-gradient(90deg, var(--line), #E7ECF2, var(--line)); background-size: 200% 100%; animation: shimmer 1.1s infinite; border-radius: var(--r); height: 38px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Confirmation ticket — the one flourish, styled like a lobby pass. */
.ticket {
  background: var(--ink);
  color: #fff;
  border-radius: var(--r);
  padding: 26px 28px;
  position: relative;
  overflow: hidden;
}
.ticket::after {
  content: '';
  position: absolute;
  inset-inline-end: -50px;
  top: -50px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(224, 180, 78, .16), transparent 68%);
}
.ticket-code {
  font-family: var(--mono);
  font-size: 34px;
  letter-spacing: .1em;
  color: var(--brass-lit);
  margin: 6px 0 16px;
}
.ticket dl { display: grid; grid-template-columns: 88px 1fr; gap: 7px 16px; margin: 0; font-size: 14px; }
.ticket dt { color: #8FA5C0; font-size: 12px; }
.ticket dd { margin: 0; }
.ticket-label { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: #8FA5C0; }

/* ---------- tables & schedule grid ---------- */

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: start; font-weight: 500; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #F7F9FB; }

.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.tag-booked { background: var(--teal-soft); color: var(--teal); border-color: #BFDDE0; }
.tag-cancelled { background: var(--clay-soft); color: var(--clay); border-color: #E9C4C4; }
.tag-completed { background: #EAF3E9; color: #3F6B3A; border-color: #CBE0C8; }

.board { overflow-x: auto; }
.board table { min-width: 760px; }
.board th:first-child, .board td:first-child { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; min-width: 190px; }
.board tbody tr:hover td:first-child { background: #F7F9FB; }

.cell { display: block; width: 100%; min-height: 30px; border: 1px solid transparent; border-radius: 2px; background: none; cursor: pointer; font-size: 11.5px; padding: 4px 6px; text-align: start; }
.cell-free { background: repeating-linear-gradient(135deg, #F4F7FA, #F4F7FA 4px, transparent 4px, transparent 8px); }
.cell-free:hover { background: var(--teal-soft); border-color: var(--teal); }
.cell-taken { background: var(--ink); color: #fff; }
.cell-taken:hover { opacity: .85; }
.cell-closed { background: var(--paper); cursor: not-allowed; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat b { display: block; font-family: var(--mono); font-size: 25px; font-weight: 500; line-height: 1.1; }
.stat span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- modal ---------- */

dialog { border: 0; border-radius: var(--r); padding: 0; box-shadow: 0 24px 60px -20px rgba(15, 27, 45, .45); max-width: 420px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(15, 27, 45, .5); }
.modal-head { padding: 18px 22px 0; }
.modal-body { padding: 14px 22px; }
.modal-foot { padding: 14px 22px 20px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; }
  .floors { display: flex; overflow-x: auto; padding: 0 12px 10px; }
  .floor { flex: 0 0 auto; width: 172px; border-bottom: 0; border-inline-end: 1px solid rgba(41, 68, 103, .5); }
  .floor[aria-current='true'] { box-shadow: inset 0 3px 0 var(--brass-lit); }
  .rail-foot { display: none; }
  .topbar, .wrap, .wrap-wide { padding-inline: 18px; }
  .row2 { grid-template-columns: 1fr; }
  .ticket dl { grid-template-columns: 78px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
