/* ============================================================
   AKSHU ELITE — Staff Booking Dashboard
   Reuses brand tokens, fonts, .btn and .field from main.css
   ============================================================ */

body.dash { background: var(--ink); min-height: 100vh; }
body.dash::after { opacity: 0.025; }

/* ---------- passcode gate ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 800;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(80% 60% at 50% 18%, rgba(198, 161, 91, 0.12), transparent 60%),
    var(--ink);
}
.gate.hidden { display: none; }
.gate-card {
  width: min(420px, 100%);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(170deg, var(--ink-3), var(--ink-2));
  padding: clamp(2.2rem, 5vw, 3.2rem);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}
.gate-card .brand-mark {
  display: block;
  width: 64px; height: 64px;
  margin: 0 auto 1.4rem;
  border: 1px solid var(--gold);
  border-radius: 50%;
  overflow: hidden;
}
.gate-card .brand-mark img { width: 100%; height: 100%; object-fit: cover; object-position: 52% 42%; transform: scale(1.12); }
.gate-card h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); margin-bottom: 0.4rem; }
.gate-card p { color: var(--cream-dim); font-size: 0.98rem; margin-bottom: 1.8rem; }
.gate-field { position: relative; margin-bottom: 1.2rem; }
.gate-field input {
  width: 100%;
  text-align: center;
  letter-spacing: 0.4em;
  font-size: 1.15rem;
  font-family: var(--sans);
  color: var(--cream);
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.gate-field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(198, 161, 91, 0.14); }
.gate-err { color: #f0a98f; font-size: 0.9rem; min-height: 1.2em; margin-bottom: 0.8rem; }
.gate .btn { width: 100%; justify-content: center; }
.gate-back { display: inline-block; margin-top: 1.6rem; font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cream-faint); }
.gate-back:hover { color: var(--gold); }

/* ---------- top bar ---------- */
.dash-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem clamp(1.2rem, 4vw, 2.6rem);
  background: rgba(26, 22, 18, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.dash-bar .brand { display: flex; align-items: center; gap: 0.8rem; }
.dash-bar .brand-mark { display: block; width: 42px; height: 42px; border: 1px solid var(--gold); border-radius: 50%; overflow: hidden; flex: none; }
.dash-bar .brand-mark img { width: 100%; height: 100%; object-fit: cover; object-position: 52% 42%; transform: scale(1.12); }
.dash-bar .brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; line-height: 1.1; }
.dash-bar .brand-name small { display: block; font-family: var(--sans); font-weight: 500; font-size: 0.56rem; letter-spacing: 0.42em; text-transform: uppercase; color: var(--gold-bright); margin-top: 2px; }
.dash-bar-right { display: flex; align-items: center; gap: 1.2rem; }
.dash-live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-dim);
}
.dash-live .dot { width: 8px; height: 8px; border-radius: 50%; background: #8a8170; box-shadow: 0 0 0 0 rgba(138,129,112,0.5); }
.dash-live.online .dot { background: #25d366; animation: livePulse 2.2s ease-out infinite; }
.dash-live.warn .dot { background: #e7c069; }
.dash-live.warn { color: #e7c069; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.5); } 70%,100% { box-shadow: 0 0 0 7px rgba(37,211,102,0); } }
.dash-logout {
  font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--cream-dim); border: 1px solid var(--line); border-radius: 999px;
  padding: 0.5rem 1.1rem; cursor: pointer; background: transparent; transition: all 0.3s var(--ease);
}
.dash-logout:hover { border-color: var(--gold); color: var(--gold-bright); }

/* ---------- layout ---------- */
.dash-wrap { width: min(1480px, 94vw); margin: 0 auto; padding: clamp(1.3rem, 3vw, 1.9rem) 0 3.5rem; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.4rem; }
.dash-head h2 { font-weight: 500; font-size: clamp(2.1rem, 4.4vw, 2.9rem); letter-spacing: 0.005em; line-height: 1; }
.dash-head .today { color: var(--cream-dim); font-family: var(--serif); font-style: italic; font-size: 1.12rem; margin-top: 0.45rem; letter-spacing: 0.01em; }
.dash-head .today b { font-style: normal; color: var(--gold-bright); font-weight: 500; }

/* ---------- stat cards ---------- */
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; margin-bottom: 1.4rem; }
.dash-stat {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--ink-2), var(--ink));
  padding: 1.25rem 1.4rem 1.3rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.dash-stat:hover { border-color: var(--line); transform: translateY(-2px); }
.dash-stat::before { content: ""; position: absolute; top: 0; left: 1.4rem; right: 1.4rem; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); opacity: 0.5; }
.dash-stat .label { font-size: 0.63rem; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-bright); }
.dash-stat .value { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(1.95rem, 3.6vw, 2.55rem); color: var(--cream); line-height: 1; margin-top: 0.55rem; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.dash-stat .sub { font-size: 0.78rem; color: var(--cream-faint); margin-top: 0.3rem; letter-spacing: 0.02em; }

/* ---------- controls bar ---------- */
.dash-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem;
  margin-bottom: 1.2rem;
}
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button {
  font-family: var(--sans); font-size: 0.74rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cream-dim); background: transparent; border: 0; border-radius: 999px;
  padding: 0.55rem 1.2rem; cursor: pointer; transition: all 0.3s var(--ease);
}
.seg button.active { background: var(--gold); color: var(--ink); }
.dash-controls .spacer { flex: 1 1 auto; }
.dash-controls input[type="search"],
.dash-controls input[type="date"],
.dash-controls select {
  font-family: var(--sans); font-size: 0.95rem; color: var(--cream);
  background: var(--ink-2); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 0.7rem 1rem; transition: border-color 0.3s;
}
.dash-controls input:focus, .dash-controls select:focus { outline: none; border-color: var(--gold); }
.dash-controls input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.75) sepia(0.5) saturate(3); cursor: pointer; }
.dash-controls select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c6a15b' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.3rem; cursor: pointer; }
.dash-controls select option { background: var(--ink-2); }
.dash-controls .btn { padding: 0.7rem 1.5rem; font-size: 0.74rem; }
.search-wrap { position: relative; display: inline-flex; align-items: center; }
.search-wrap .search-ico { position: absolute; left: 0.95rem; width: 17px; height: 17px; color: var(--gold); pointer-events: none; }
.search-wrap input[type="search"] { padding-left: 2.7rem; min-width: 230px; }
.btn-ico { width: 16px; height: 16px; }

/* ---------- list / table ---------- */
.book-list { display: flex; flex-direction: column; gap: 0.7rem; }
.book-row {
  display: grid;
  grid-template-columns: 96px 1.4fr 1.3fr 1fr auto;
  align-items: center;
  gap: 1.2rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--ink-2);
  padding: 1rem 1.3rem 1rem 1.5rem;
  box-shadow: inset 3px 0 0 var(--line-soft);
  transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease), box-shadow 0.3s;
}
.book-row:hover { border-color: var(--line); background: var(--ink-3); transform: translateX(3px); }
.book-row.st-pending   { box-shadow: inset 3px 0 0 #e7c069; }
.book-row.st-confirmed { box-shadow: inset 3px 0 0 #6fcaa0; }
.book-row.st-completed { box-shadow: inset 3px 0 0 #8ab4f0; }
.book-row.st-cancelled { box-shadow: inset 3px 0 0 #d98a76; }
.book-row.st-cancelled .who b { text-decoration: line-through; text-decoration-color: rgba(217,138,118,0.6); }
.book-row .time { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.book-row .time small { display: block; font-family: var(--sans); font-style: normal; font-size: 0.68rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cream-faint); font-variant-numeric: tabular-nums; margin-top: 1px; }
.book-row .who b { font-size: 1.05rem; color: var(--cream); display: block; }
.book-row .who span { font-size: 0.85rem; color: var(--cream-faint); }
.book-row .svc { font-size: 0.98rem; color: var(--cream-dim); }
.book-row .acts { display: flex; gap: 0.4rem; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line-soft);
  background: transparent; color: var(--cream-dim); cursor: pointer;
  display: grid; place-items: center; transition: all 0.25s var(--ease);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { border-color: var(--gold); color: var(--gold-bright); background: rgba(198,161,91,0.06); }
.icon-btn.danger:hover { border-color: #b3604a; color: #f0a98f; background: rgba(179,96,74,0.08); }

/* status pill (also a dropdown trigger) */
.pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: 999px; padding: 0.5rem 0.85rem 0.5rem 0.95rem; cursor: pointer; border: 1px solid transparent;
  white-space: nowrap; transition: filter 0.25s, transform 0.2s var(--ease);
}
.pill:hover { filter: brightness(1.12); transform: translateY(-1px); }
.pill .pdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill .pchev { display: inline-flex; opacity: 0.65; margin-left: 0.05rem; }
.pill .pchev svg { width: 13px; height: 13px; }
.pill.pending   { color: #e7c069; background: rgba(231,192,105,0.12); border-color: rgba(231,192,105,0.35); }
.pill.confirmed { color: #6fcaa0; background: rgba(111,202,160,0.12); border-color: rgba(111,202,160,0.35); }
.pill.completed { color: #8ab4f0; background: rgba(138,180,240,0.12); border-color: rgba(138,180,240,0.35); }
.pill.cancelled { color: #d98a76; background: rgba(217,138,118,0.12); border-color: rgba(217,138,118,0.35); }

/* status menu — anchored to the status cell so it drops right under the pill */
.status-cell { position: relative; }
.status-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  background: var(--ink-3); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.4rem; min-width: 170px; box-shadow: 0 24px 50px rgba(0,0,0,0.55);
  display: none;
  transform-origin: top left;
}
.status-menu.open { display: block; animation: menuIn 0.16s var(--ease); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
/* when the row sits low on screen, flip the menu above the pill */
.status-cell.flip-up .status-menu { top: auto; bottom: calc(100% + 6px); transform-origin: bottom left; }
.status-menu button {
  display: flex; align-items: center; gap: 0.6rem; width: 100%;
  font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cream-dim); background: transparent; border: 0; border-radius: 8px;
  padding: 0.6rem 0.7rem; cursor: pointer; text-align: left; transition: background 0.2s;
}
.status-menu button:hover { background: var(--ink-2); color: var(--cream); }
.status-menu .sw { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* empty state */
.empty {
  text-align: center; padding: 4rem 2rem; border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--cream-dim);
}
.empty .ico { color: var(--gold); display: inline-flex; margin-bottom: 1.1rem; opacity: 0.85; }
.empty .ico svg { width: 44px; height: 44px; }
.empty h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }

/* ---------- calendar / day view ---------- */
.cal-nav { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.2rem; }
.cal-arrow {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--gold-bright);
  cursor: pointer; display: grid; place-items: center; transition: all 0.25s var(--ease);
}
.cal-arrow svg { width: 19px; height: 19px; }
.cal-arrow:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); transform: translateY(-1px); }
.cal-nav-label { font-size: 0.98rem; color: var(--cream-dim); }
.cal-nav-label strong { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 1.25rem; color: var(--gold-bright); font-variant-numeric: tabular-nums; }
.cal-today {
  margin-left: auto; font-family: var(--sans); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--cream-dim);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 0.55rem 1.15rem; cursor: pointer; transition: all 0.25s var(--ease);
}
.cal-today:hover { border-color: var(--gold); color: var(--gold-bright); }
.cal-day { border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; background: var(--ink-2); }
.cal-slot { display: grid; grid-template-columns: 90px 1fr; border-bottom: 1px solid var(--line-soft); min-height: 64px; }
.cal-slot:last-child { border-bottom: 0; }
.cal-slot .hr { padding: 0.9rem 1rem; font-size: 0.78rem; font-weight: 500; letter-spacing: 0.12em; color: var(--cream-faint); border-right: 1px solid var(--line-soft); text-transform: uppercase; font-variant-numeric: tabular-nums; }
.cal-slot .items { padding: 0.6rem; display: flex; flex-wrap: wrap; gap: 0.5rem; align-content: flex-start; }
.cal-slot.has .hr { color: var(--gold-bright); }
.cal-chip {
  display: inline-flex; flex-direction: column; gap: 2px;
  border-radius: 10px; padding: 0.55rem 0.9rem; cursor: pointer;
  border-left: 3px solid currentColor; transition: transform 0.2s var(--ease), filter 0.2s;
}
.cal-chip:hover { transform: translateY(-2px); filter: brightness(1.12); }
.cal-chip b { font-size: 0.92rem; color: var(--cream); font-family: var(--sans); font-weight: 500; }
.cal-chip span { font-size: 0.76rem; color: var(--cream-dim); font-variant-numeric: tabular-nums; }
.cal-chip.pending   { background: rgba(231,192,105,0.12); color: #e7c069; }
.cal-chip.confirmed { background: rgba(111,202,160,0.12); color: #6fcaa0; }
.cal-chip.completed { background: rgba(138,180,240,0.12); color: #8ab4f0; }
.cal-chip.cancelled { background: rgba(217,138,118,0.12); color: #d98a76; text-decoration: line-through; }

/* ---------- modal (add / edit) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 700; display: grid; place-items: center; padding: 1.5rem;
  background: rgba(26,22,18,0.9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none; transition: opacity 0.35s var(--ease); overflow-y: auto;
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-card {
  width: min(560px, 100%); border: 1px solid var(--line); border-radius: 20px;
  background: linear-gradient(170deg, var(--ink-3), var(--ink-2)); padding: clamp(1.8rem, 4vw, 2.6rem);
  box-shadow: 0 40px 100px rgba(0,0,0,0.6); transform: translateY(24px) scale(0.98);
  transition: transform 0.4s var(--ease);
}
.modal.open .modal-card { transform: none; }
.modal-card h3 { font-size: 1.7rem; margin-bottom: 1.6rem; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.modal-grid .full { grid-column: 1 / -1; }
.modal-actions { display: flex; gap: 0.8rem; margin-top: 1.8rem; }
.modal-actions .btn { flex: 1; justify-content: center; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translate(-50%, 20px);
  background: var(--ink-3); border: 1px solid var(--line); border-left: 3px solid var(--gold);
  color: var(--cream); padding: 0.9rem 1.4rem; border-radius: 12px; font-size: 0.92rem;
  box-shadow: 0 24px 50px rgba(0,0,0,0.5); z-index: 900; opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .book-row { grid-template-columns: 1fr auto; row-gap: 0.6rem; }
  .book-row .time { grid-column: 1; }
  .book-row .status-cell { grid-column: 2; grid-row: 1; justify-self: end; }
  .book-row .who { grid-column: 1 / -1; }
  .book-row .svc { grid-column: 1 / -1; }
  .book-row .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .modal-grid { grid-template-columns: 1fr; }
  .dash-controls input[type="search"] { width: 100%; }
  .dash-live span { display: none; }
}
@media (max-width: 460px) {
  .dash-stats { grid-template-columns: 1fr; }
}
