/* ==========================================================================
   Account dashboard — page styles for account.html
   Loaded after site.css. Everything here builds on the site tokens.
   ========================================================================== */

.btn--sm{min-height:40px;padding:8px 14px;font-size:13.5px;border-radius:10px}
.btn--danger{background:var(--danger);color:#fff}
.btn--danger:hover{background:#991B1B}
.btn--danger[disabled]{background:#E5A3A3;cursor:progress}

.account-shell{max-width:1040px}
.account-shell > #accountAlert{margin-block-end:20px}
#accountContent > .callout{max-width:760px;margin-inline:auto}

/* The current crumb is the one thing the patient is looking at; keep it legible. */
.breadcrumb span[aria-current]{opacity:1;color:var(--text);font-weight:700}
.breadcrumb span[aria-hidden]{opacity:.55}

/* Keep the footer at the bottom even when a state is short (signed out, error). */
body{display:flex;flex-direction:column;min-height:100vh;min-height:100dvh}
body > main{flex:1 0 auto}

.page-hero--account{padding-block:clamp(28px,3.6vw,44px)}
.account-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:clamp(20px,4vw,48px);flex-wrap:wrap}
.account-hero__copy{max-width:620px}
.account-hero__copy h1{margin-block-end:8px}
.account-hero__copy p{font-size:clamp(15px,1.4vw,17px)}
.account-hero__side{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.account-hero__actions{display:flex;gap:8px;flex-wrap:wrap}

.wallet-readout{
  display:flex;flex-direction:column;gap:1px;padding:8px 16px;min-width:150px;
  border:1px solid var(--border);border-radius:var(--r);background:var(--surface);
  box-shadow:var(--shadow-sm);
}
.wallet-readout__label{font-size:11.5px;font-weight:700;color:var(--text-muted)}
.wallet-readout strong{font-size:17px;font-weight:800;letter-spacing:-.01em}

/* What is next ---------------------------------------------------------- */

.spotlight{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;
  gap:20px;align-items:center;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  padding:20px 24px;box-shadow:var(--shadow-sm);margin-block-end:20px;
  animation:spotlight-in .32s ease-out both;
}
@keyframes spotlight-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.spotlight{animation:none}}

.spotlight__date{
  width:76px;height:76px;border-radius:16px;background:var(--primary-soft);color:var(--primary);
  display:grid;place-content:center;text-align:center;line-height:1.05;
}
.spotlight__date b{font-family:var(--font-latin);font-size:27px;font-weight:800;letter-spacing:-.02em}
.spotlight__date span{font-size:11.5px;font-weight:700}
.spotlight__icon{
  width:52px;height:52px;border-radius:14px;background:var(--warning-soft);color:var(--warning);
  display:grid;place-items:center;flex:none;
}
.spotlight__icon svg{width:24px;height:24px}
.spotlight--empty .spotlight__icon{background:var(--surface-muted);color:var(--text-muted)}
.spotlight__body h2{font-size:17px;margin-block-end:2px}
.spotlight__center{font-weight:700;font-size:15.5px}
.spotlight__meta{font-size:13.5px;color:var(--text-muted)}
.spotlight__meta-part{white-space:nowrap}
.spotlight__meta-part + .spotlight__meta-part::before{content:" · ";color:var(--text-muted);opacity:.7}
.spotlight__ref{font-size:12.5px;color:var(--text-muted);margin-block-start:2px}
.spotlight__ref b{font-weight:700;color:var(--text)}
.spotlight__side{display:flex;flex-direction:column;align-items:flex-end;gap:10px}

.spotlight--attention{background:var(--warning-soft);border-color:#FDE68A}
.spotlight--attention .spotlight__meta,
.spotlight--attention .spotlight__ref,
.spotlight--attention .spotlight__ref b{color:#7C4A03}
.spotlight--empty{border-style:dashed;box-shadow:none;background:transparent}

/* Bookings panel -------------------------------------------------------- */

.panel{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--r-lg);
  box-shadow:var(--shadow-sm);overflow:hidden;
}
.panel__head{
  display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;
  padding:14px 20px;border-block-end:1px solid var(--border);
}
.panel__head h2{font-size:17px;display:flex;align-items:center;gap:8px}
.count-pill{
  display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:22px;padding:0 7px;
  border-radius:var(--r-pill);background:var(--surface-muted);color:#475569;
  font-family:var(--font-latin);font-size:11.5px;font-weight:800;
}

.segmented{display:inline-flex;gap:2px;padding:3px;background:var(--surface-muted);border-radius:var(--r-pill)}
.segmented button{
  display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;
  color:#475569;font-size:13px;font-weight:700;padding:7px 12px;min-height:36px;
  border-radius:var(--r-pill);cursor:pointer;
}
.segmented button:hover{color:var(--text)}
.segmented button[aria-pressed="true"]{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}
.segmented button[aria-pressed="true"] .count-pill{background:var(--primary-soft);color:var(--primary)}

.booking-table{min-width:780px}
.booking-table tbody tr:focus{outline:2px solid var(--primary);outline-offset:-2px;background:#FAFCFE}
.booking-table__booking{display:grid;gap:3px;min-width:170px}
.booking-table__center{font-size:15px;font-weight:800;line-height:1.3}
.booking-table__ref{font-size:12px;color:var(--text-muted)}
.booking-table__ref b{font-weight:700;color:var(--text)}
.booking-table__sessions{width:100%;border-collapse:collapse;font-size:12.5px;min-width:0}
.booking-table__sessions thead th{
  background:transparent;padding:0 0 6px;border:0;
  font-size:10.5px;font-weight:700;color:var(--text-muted);
  white-space:nowrap;text-align:start;
}
.booking-table__sessions thead th.cell-end{text-align:end}
.booking-table__sessions tbody td{padding:5px 0;border:0;border-block-start:1px solid var(--border);vertical-align:top}
.booking-table__sessions tbody tr:first-child td{border-block-start:0}
.booking-table__sessions tbody tr:hover{background:transparent}
.booking-sessions__date{display:block;color:var(--text);font-weight:700;font-variant-numeric:tabular-nums}
.booking-sessions__time{display:block;color:var(--text-muted);font-size:11.5px}
.booking-sessions__type{color:var(--text-muted)}
.booking-sessions__shift{display:block;font-size:11.5px;color:var(--text-muted);margin-block-start:1px}
.booking-sessions__amount{text-align:end;white-space:nowrap}
.booking-sessions__amount b{font-weight:700;color:var(--text)}
.booking-table__total{white-space:nowrap}
.booking-table__total b{display:block;font-size:15px;font-weight:800;color:var(--text)}
.booking-table__total .booking-table__total-label{display:none}
.booking-table__actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.booking-table tbody .booking-summary-row td{border-block-end:0;padding-block-end:6px}
.booking-table tbody .booking-sessions-row td{border-block-end:1px solid var(--border);padding-block-start:0;padding-block-end:16px}
.booking-table tbody .booking-sessions-row:last-child td{border-block-end:0}
.booking-sessions-row:hover{background:transparent}
.booking-sessions-panel{display:grid;gap:8px}
.booking-sessions-panel__head{display:flex;align-items:center;gap:8px;font-size:13.5px;color:var(--text-muted)}
.booking-sessions-panel__head strong{font-size:13.5px;color:var(--text)}

.booking-note{display:flex;gap:6px;align-items:flex-start;font-size:12.5px;color:var(--text-muted);margin-block-start:8px}
.booking-note svg{width:15px;height:15px;flex:none;margin-block-start:2px}
.booking-note--warning{color:var(--warning)}
.booking-note--danger{color:var(--danger)}

.panel-empty{display:grid;justify-items:center;gap:12px;padding:40px 20px;text-align:center;color:var(--text-muted);font-size:14px}

/* Invoices -------------------------------------------------------------- */

.account-section{margin-block-start:28px}
.section-title{font-size:17px;display:flex;align-items:center;gap:8px;margin-block-end:12px}
.cell-end{text-align:end}
.cell-sub{display:block;font-size:11.5px;color:var(--text-muted);font-weight:600}

/* Empty + loading ------------------------------------------------------- */

.empty-state__icon{
  display:inline-grid;place-items:center;width:56px;height:56px;border-radius:16px;
  background:var(--surface-muted);color:var(--text-muted);margin-block-end:14px;
}
.empty-state__icon svg{width:26px;height:26px}
.empty-state h2{font-size:20px;margin-block-end:6px}
.empty-state__actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-block-start:16px}
.empty-state--account{max-width:620px;margin-inline:auto;padding:56px 24px}

.account-skeleton{display:grid;gap:16px}
.skeleton{
  background:linear-gradient(90deg,var(--surface-muted) 25%,#F4F8FA 37%,var(--surface-muted) 63%);
  background-size:400% 100%;border-radius:var(--r-lg);
  animation:skeleton 1.5s ease-in-out infinite;
}
.skeleton--spotlight{height:120px}
.skeleton--row{height:132px}
@keyframes skeleton{from{background-position:100% 50%}to{background-position:0 50%}}
@media (prefers-reduced-motion:reduce){.skeleton{animation:none}}

/* Cancel dialog --------------------------------------------------------- */

.dialog{
  margin:auto;border:0;border-radius:var(--r-lg);padding:0;width:fit-content;min-width:min(100% - 32px,360px);max-width:min(100% - 32px,640px);
  max-height:calc(100dvh - 32px);overflow:auto;
  box-shadow:var(--shadow-lg);color:var(--text);
}
.dialog::backdrop{background:rgba(14,42,71,.45)}
.dialog__form{display:grid;gap:12px;padding:24px;background:var(--surface)}
.dialog h2{font-size:20px}
.dialog h2:focus{outline:none}
.dialog p{font-size:13.5px;color:var(--text-muted)}
.dialog__field{display:grid;gap:6px}
.dialog__field label{font-size:13px;font-weight:700}
.dialog__field textarea{
  width:100%;min-height:92px;resize:vertical;
  border:1.5px solid var(--input-border);border-radius:var(--r);
  padding:10px 12px;font:inherit;font-size:14.5px;color:var(--text);background:var(--surface);
}
.dialog__field textarea::placeholder{color:#64748B}
.dialog__actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}

/* Responsive ------------------------------------------------------------ */

@media (max-width:820px){
  .spotlight{grid-template-columns:auto minmax(0,1fr);gap:16px;padding:18px}
  .spotlight__side{grid-column:1/-1;flex-direction:row;align-items:center;justify-content:space-between;width:100%}
}

@media (max-width:760px){
  .booking-table{min-width:0;font-size:13.5px}
  .booking-table > thead{display:none}
  .booking-table tbody .booking-summary-row{
    display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;
    padding:16px 16px 8px;border-block-end:0;
  }
  .booking-table .booking-summary-row td{padding:0;border:0;vertical-align:middle}
  .booking-table .booking-summary-row td:nth-child(1){grid-area:1/1/2/2}
  .booking-table .booking-summary-row td:nth-child(2){grid-area:1/2;justify-self:end}
  .booking-table .booking-summary-row td:nth-child(3){grid-area:2/1;align-self:center}
  .booking-table .booking-summary-row td:nth-child(4){grid-area:2/2;justify-self:end}
  .booking-table tbody .booking-sessions-row{display:block;padding:0 16px 16px;border-block-end:1px solid var(--border)}
  .booking-table .booking-sessions-row td{display:block;padding:0;border:0}
  .booking-table tbody .booking-sessions-row:last-child{border-block-end:0}
  .booking-table tbody tr:hover{background:transparent}
  .booking-table__total .booking-table__total-label{display:block}
  .booking-table__sessions{min-width:0}
  .booking-table__actions{justify-content:flex-end}
}

@media (max-width:640px){
  /* Invoices become two-line rows: number + amount, then date + status. */
  .invoice-table thead{display:none}
  .invoice-table tbody tr{
    display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 12px;
    padding:14px 16px;border-block-end:1px solid var(--border);
  }
  .invoice-table tbody tr:last-child{border-block-end:0}
  .invoice-table tbody tr:hover{background:transparent}
  .invoice-table tbody td{padding:0;border:0;vertical-align:middle}
  .invoice-table tbody td:nth-child(1){grid-area:1/1}
  .invoice-table tbody td:nth-child(2){grid-area:2/1;font-size:12.5px;color:var(--text-muted);align-self:center}
  .invoice-table tbody td:nth-child(3){grid-area:2/2;justify-self:end;align-self:center}
  .invoice-table tbody td:nth-child(4){grid-area:1/2;justify-self:end}
}

@media (max-width:560px){
  .account-hero{flex-direction:column;align-items:stretch}
  .account-hero__side{justify-content:space-between}
  .account-hero__actions{width:100%;align-items:center;justify-content:space-between}
  .account-hero__actions .btn--primary{flex:1 1 auto}
  .account-hero__actions .btn--ghost{flex:0 0 auto;padding-inline:10px}
  .spotlight__meta{display:flex;flex-wrap:wrap;gap:2px 8px}
  .spotlight__meta-part + .spotlight__meta-part::before{content:none}
  .segmented{width:100%}
  .segmented button{flex:1;justify-content:center;min-height:44px}
  .booking-table__sessions{font-size:12px}
  .booking-table__sessions thead th{font-size:10px}
  .booking-table__sessions tbody td{padding:5px 0}
  .spotlight__date{width:64px;height:64px}
  .spotlight__date b{font-size:23px}
}

/* Below ~380px the three filter labels cannot sit on one line without
   clipping. Let them wrap instead of shrinking the text below 13px. */
@media (max-width:380px){
  .panel__head{gap:10px}
  .segmented{flex-wrap:wrap;justify-content:center;gap:4px;border-radius:var(--r-lg)}
  .segmented button{min-width:0;flex:1 1 auto;border-radius:var(--r)}
}

/* The bookings table already sits inside the panel card. */
.panel .table-wrap{border:0;border-radius:0;background:transparent}
