/* ═══════════════════════════════════════════════════════════
   Portal Client CSS — AtmosTK
   ═══════════════════════════════════════════════════════════ */

/* ── Variables portal ─────────────────────────────────────── */
:root {
  --portal-sidebar-w: 260px;
  --portal-topbar-h: 56px;
  --portal-bg: #0a0a0f;
  --portal-surface: #111118;
  --portal-surface-2: #16161f;
  --portal-border: rgba(255,255,255,.08);
  --portal-cyan: #00d4ff;
  --portal-cyan-dim: rgba(0,212,255,.1);
  --portal-green: #22c55e;
  --portal-orange: #f97316;
  --portal-violet: #8b5cf6;
  --portal-red: #ef4444;
  --portal-text: #e8e8f0;
  --portal-text-muted: #888;
  --portal-radius: 10px;
}

/* ── Reset portal ────────────────────────────────────────── */
.portal-body { background: var(--portal-bg); color: var(--portal-text); min-height: 100vh; }

/* ═══ AUTH LAYOUT ════════════════════════════════════════════ */
.portal-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
.portal-auth__left {
  background: linear-gradient(145deg, #0a0a0f 0%, #0d1220 100%);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
  position: relative;
  overflow: hidden;
}
.portal-auth__left::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,212,255,.08) 0%, transparent 70%);
  top: -100px; right: -100px;
  pointer-events: none;
}
.portal-auth__logo {
  display: flex; align-items: center; gap: .75rem;
  text-decoration: none; width: fit-content;
}
.portal-auth__logo img { width: 40px; height: 40px; object-fit: contain; }
.portal-auth__logo span { font-size: 1.5rem; font-weight: 800; color: var(--portal-text); letter-spacing: -.02em; }
.portal-auth__logo em { color: var(--portal-cyan); font-style: normal; }
.portal-auth__tagline h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.portal-auth__tagline p { color: var(--portal-text-muted); line-height: 1.7; margin-bottom: 1.5rem; }
.portal-auth__features { list-style: none; display: flex; flex-direction: column; gap: 1rem; margin-top: .5rem; }
.portal-auth__features li {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(0,212,255,.04);
  border: 1px solid rgba(0,212,255,.12);
  border-radius: var(--portal-radius);
  transition: border-color .2s, background .2s;
}
.portal-auth__features li:hover {
  background: rgba(0,212,255,.07);
  border-color: rgba(0,212,255,.25);
}
.portal-auth__feature-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  background: rgba(0,212,255,.12);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--portal-cyan);
}
.portal-auth__feature-text {
  display: flex; flex-direction: column; gap: .2rem;
}
.portal-auth__feature-text strong {
  font-size: .92rem; font-weight: 700; color: var(--portal-text);
}
.portal-auth__feature-text span {
  font-size: .78rem; color: var(--portal-text-muted); line-height: 1.4;
}

/* ── Auth success state ───────────────────────────────────── */
.portal-auth__success-state {
  text-align: center;
  padding: 2rem 0;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.portal-auth__success-icon {
  width: 72px; height: 72px;
  background: rgba(34,197,94,.12);
  border: 2px solid rgba(34,197,94,.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--portal-green);
  margin-bottom: .5rem;
}
.portal-auth__success-state h2 {
  font-size: 1.8rem; font-weight: 800; margin: 0;
}
.portal-auth__success-state .portal-auth__sub {
  margin-bottom: .5rem; max-width: 320px;
}

.portal-auth__right {
  background: var(--portal-surface);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.portal-auth__card {
  width: 100%; max-width: 420px;
}
.portal-auth__card h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: .25rem; }
.portal-auth__sub { color: var(--portal-text-muted); font-size: .9rem; margin-bottom: 2rem; }

/* ── Alert banners (login / register) ─────────────────────────── */
.portal-alert {
  display: flex; align-items: center; gap: .55rem;
  padding: .75rem 1rem; border-radius: var(--portal-radius);
  font-size: .85rem; font-weight: 500; margin-bottom: 1.25rem;
  border: 1px solid transparent;
}
.portal-alert--error {
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.35);
  color: #f87171;
}
.portal-alert--success {
  background: rgba(0,212,255,.10);
  border-color: rgba(0,212,255,.35);
  color: var(--portal-cyan);
}
.portal-auth__sep {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.25rem 0; color: var(--portal-text-muted); font-size: .82rem;
}
.portal-auth__sep::before, .portal-auth__sep::after {
  content: ''; flex: 1; height: 1px; background: var(--portal-border);
}
.portal-auth__footer { text-align: center; font-size: .85rem; color: var(--portal-text-muted); margin-top: 1.25rem; }
.portal-auth__footer a { color: var(--portal-cyan); text-decoration: none; font-weight: 600; }

/* ═══ SIDEBAR LAYOUT ═════════════════════════════════════════ */
.portal-layout { display: flex; min-height: 100vh; }

.portal-sidebar {
  width: var(--portal-sidebar-w);
  background: var(--portal-surface);
  border-right: 1px solid var(--portal-border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .3s ease;
}
.portal-sidebar__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1rem; border-bottom: 1px solid var(--portal-border);
}
.portal-sidebar__brand {
  display: flex; align-items: center; gap: .65rem;
  text-decoration: none;
}
.portal-sidebar__brand img { width: 32px; height: 32px; object-fit: contain; }
.portal-sidebar__brand span { font-size: 1.1rem; font-weight: 800; color: var(--portal-text); letter-spacing: -.02em; }
.portal-sidebar__brand em { color: var(--portal-cyan); font-style: normal; }
.portal-sidebar__brand small { display: block; font-size: .68rem; color: var(--portal-text-muted); font-weight: 400; }
.portal-sidebar__close { display: none; background: none; border: none; color: var(--portal-text-muted); cursor: pointer; padding: .4rem; }

.portal-sidebar__user {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem; border-bottom: 1px solid var(--portal-border);
}
.portal-sidebar__user strong { display: block; font-size: .88rem; color: var(--portal-text); }
.portal-sidebar__user span { font-size: .72rem; color: var(--portal-text-muted); display: block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.portal-nav { flex: 1; padding: .75rem 0; overflow-y: auto; }
.portal-nav__link {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem; font-size: .875rem; font-weight: 500;
  color: var(--portal-text-muted); text-decoration: none;
  transition: all .2s; border-left: 3px solid transparent;
  margin: .1rem .5rem; border-radius: var(--portal-radius);
}
.portal-nav__link svg { flex-shrink: 0; width: 18px; height: 18px; }
.portal-nav__link:hover { color: var(--portal-text); background: rgba(255,255,255,.04); }
.portal-nav__link.active { color: var(--portal-cyan); background: var(--portal-cyan-dim); border-left-color: var(--portal-cyan); }
.portal-nav__link--cta { color: var(--portal-cyan); }
.portal-nav__link--danger:hover { color: var(--portal-red); background: rgba(239,68,68,.08); }
.portal-nav__divider { height: 1px; background: var(--portal-border); margin: .5rem 1rem; }

/* ── Avatar ──────────────────────────────────────────────── */
.portal-avatar {
  border-radius: 14px;
  background: var(--portal-cyan-dim);
  color: var(--portal-cyan); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  border: 2px solid rgba(0,212,255,.3);
}
.portal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.portal-avatar--xs  { width: 28px; height: 28px; font-size: .7rem; border-radius: 8px; }
.portal-avatar--sm  { width: 40px; height: 40px; font-size: .88rem; border-radius: 10px; }
.portal-avatar--md  { width: 56px; height: 56px; font-size: 1.1rem; border-radius: 12px; }
.portal-avatar--xl  { width: 96px; height: 96px; font-size: 1.8rem; border-radius: 20px; }

/* ── Main area ───────────────────────────────────────────── */
.portal-main {
  flex: 1;
  margin-left: var(--portal-sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
}
.portal-content { flex: 1; padding: 1.5rem 2rem 3rem; max-width: 100%; width: 100%; }

/* ── Topbar (mobile) ─────────────────────────────────────── */
.portal-topbar {
  display: none;
  align-items: center; justify-content: space-between;
  height: var(--portal-topbar-h);
  padding: 0 1rem;
  background: var(--portal-surface);
  border-bottom: 1px solid var(--portal-border);
  position: sticky; top: 0; z-index: 100;
}
.portal-topbar__menu {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; padding: .4rem;
}
.portal-topbar__menu span { display: block; width: 20px; height: 2px; background: var(--portal-text); border-radius: 2px; }
.portal-topbar__brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--portal-text); font-weight: 700; }
.portal-topbar__brand img { width: 24px; }
.portal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 150;
}

/* ── Flash ───────────────────────────────────────────────── */
.portal-flash {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1.1rem; border-radius: var(--portal-radius);
  font-size: .88rem; font-weight: 500;
  margin: .75rem 2rem 0;
}
.portal-flash--success { background: rgba(34,197,94,.1); color: #4ade80; border: 1px solid rgba(34,197,94,.2); }
.portal-flash--error   { background: rgba(239,68,68,.1); color: #f87171; border: 1px solid rgba(239,68,68,.2); }

/* ═══ COMPONENTS ═════════════════════════════════════════════ */

/* Page header */
.portal-page-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1.5rem;
}
.portal-page-header h1 { display: flex; align-items: center; gap: .6rem; font-size: 1.5rem; margin: 0; }
.portal-page-header p { font-size: .88rem; color: var(--portal-text-muted); margin: .25rem 0 0; }

/* Cards */
.portal-card {
  background: var(--portal-surface);
  border-radius: 16px;
  padding: 1.5rem;
}
.portal-card--bordered {
  /* remove border from plain cards, only bordered variant has it */
}
.portal-card__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.portal-card__header h3 { display: flex; align-items: center; gap: .5rem; font-size: .95rem; margin: 0; }
.portal-card__link { font-size: .8rem; color: var(--portal-cyan); text-decoration: none; }
.portal-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }


/* Welcome banner */
.portal-welcome {
  display: flex; align-items: center; gap: 1.5rem;
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #12121c 0%, #0d1a24 60%, rgba(0,212,255,.07) 100%);
  border-radius: 20px;
  padding: 1.75rem 2rem;
  margin-bottom: 1.75rem;
  border: 1px solid rgba(0,212,255,.1);
  box-shadow: 0 4px 32px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
}
.portal-welcome::before {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(0,212,255,.08) 0%, transparent 65%);
  top: -120px; right: -60px;
  pointer-events: none;
}
.portal-welcome::after {
  content: '';
  position: absolute;
  inset: 0; border-radius: 20px;
  background: linear-gradient(90deg, transparent 60%, rgba(0,212,255,.03) 100%);
  pointer-events: none;
}

/* Avatar welcome */
.portal-welcome__avatar {
  position: relative; flex-shrink: 0;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,212,255,.18), rgba(0,212,255,.06));
  border: 2.5px solid var(--portal-cyan);
  box-shadow: 0 0 0 5px rgba(0,212,255,.1), 0 0 20px rgba(0,212,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800; color: var(--portal-cyan);
  overflow: hidden;
  z-index: 1;
}
.portal-welcome__avatar img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%;
}
.portal-welcome__avatar::after {
  content: '';
  position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,.08) 0%, transparent 60%);
  pointer-events: none;
}

.portal-welcome__text { flex: 1; z-index: 1; }
.portal-welcome__text h1 {
  font-size: 1.45rem; font-weight: 800; margin: 0 0 .3rem;
  letter-spacing: -.02em; color: var(--portal-text);
}
.portal-welcome__text p {
  font-size: .84rem; color: var(--portal-text-muted); margin: 0;
  display: flex; align-items: center; gap: .4rem;
}
.portal-welcome__text p::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--portal-cyan);
  box-shadow: 0 0 6px var(--portal-cyan);
}
.portal-welcome .portal-btn {
  flex-shrink: 0; z-index: 1;
}

/* Stats row */
.portal-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1rem; margin-bottom: 1.5rem;
}
.portal-stat {
  background: var(--portal-surface);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  text-align: center;
}

.portal-stat__value { display: block; font-size: 1.8rem; font-weight: 800; color: var(--portal-text); line-height: 1; }
.portal-stat__label { display: block; font-size: .72rem; color: var(--portal-text-muted); margin-top: .3rem; text-transform: uppercase; letter-spacing: .06em; }
.portal-stat--cyan  .portal-stat__value { color: var(--portal-cyan); }
.portal-stat--green .portal-stat__value { color: var(--portal-green); }
.portal-stat--orange .portal-stat__value { color: var(--portal-orange); }

/* Next booking */
.portal-next-booking {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem;
  background: var(--portal-surface-2);
  border-radius: 12px;
}
.portal-next-booking__date {
  display: flex; flex-direction: column; align-items: center;
  min-width: 48px; text-align: center;
}
.portal-next-booking__day { font-size: 1.8rem; font-weight: 800; line-height: 1; color: var(--portal-cyan); }
.portal-next-booking__month { font-size: .7rem; text-transform: uppercase; color: var(--portal-text-muted); }
.portal-next-booking__info { flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.portal-next-booking__info strong { font-size: .9rem; }
.portal-next-booking__info span { font-size: .8rem; color: var(--portal-text-muted); }
.portal-next-booking__ref { font-family: monospace; font-size: .75rem; color: var(--portal-text-muted); }

/* PC config */
.portal-pc-config { display: flex; flex-direction: column; gap: .25rem; }
.portal-pc-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: .55rem .75rem; font-size: .85rem;
  border-radius: 8px;
  transition: background .15s;
}
.portal-pc-row:hover { background: rgba(255,255,255,.03); }
.portal-pc-row span { color: var(--portal-text-muted); }
.portal-pc-row strong { color: var(--portal-text); text-align: right; max-width: 60%; }
.portal-pc-row--game strong { color: var(--portal-cyan); }


/* Empty state */
.portal-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: 2rem; text-align: center;
  color: var(--portal-text-muted);
}
.portal-empty svg { opacity: .3; }

/* Table */
.portal-table-wrap { overflow-x: auto; }
.portal-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.portal-table th {
  text-align: left; padding: .5rem .75rem;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--portal-text-muted);
  background: rgba(255,255,255,.03);
}
.portal-table td { padding: .65rem .75rem; }
.portal-table tr:hover td { background: rgba(255,255,255,.025); }
.portal-table code { font-size: .78rem; color: var(--portal-cyan); }

/* Tabs */
.portal-tabs {
  display: flex; gap: .35rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
  background: var(--portal-surface);
  padding: .35rem;
  border-radius: 14px;
  width: fit-content;
}
.portal-tab {
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem 1rem; border-radius: 10px;
  font-size: .85rem; text-decoration: none; color: var(--portal-text-muted);
  transition: all .2s;
}
.portal-tab:hover { color: var(--portal-text); background: rgba(255,255,255,.06); }
.portal-tab.active { color: var(--portal-cyan); background: var(--portal-cyan-dim); }


/* Booking steps */
.portal-booking-step {
  display: flex; gap: 1.25rem;
  padding: 1.5rem;
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  margin-bottom: 1rem;
}
.portal-booking-step__num {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--portal-cyan-dim); color: var(--portal-cyan);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .9rem;
}
.portal-booking-step__body { flex: 1; }
.portal-booking-step__body h3 { font-size: 1rem; margin: 0 0 .75rem; }
.portal-booking-hint { font-size: .8rem; color: var(--portal-text-muted); margin-bottom: .75rem; }

/* Service cards */
.portal-service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.portal-service-card { cursor: pointer; }
.portal-service-card input { position: absolute; opacity: 0; pointer-events: none; }
.portal-service-card__inner {
  display: flex; flex-direction: column; gap: .4rem;
  padding: 1rem; border-radius: var(--portal-radius);
  border: 2px solid var(--portal-border);
  background: var(--portal-surface-2);
  transition: all .2s;
}
.portal-service-card__inner:hover { border-color: rgba(255,255,255,.15); }
.portal-service-card input:checked + .portal-service-card__inner {
  border-color: var(--svc-color, var(--portal-cyan));
  background: rgba(0,0,0,.3);
  box-shadow: 0 0 0 1px var(--svc-color, var(--portal-cyan));
}
.portal-service-card__icon { color: var(--svc-color, var(--portal-cyan)); margin-bottom: .25rem; }
.portal-service-card__inner strong { font-size: .9rem; color: var(--portal-text); }
.portal-service-card__inner span { font-size: .75rem; color: var(--portal-text-muted); line-height: 1.4; }

/* Mini calendar */
.portal-mini-calendar {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 3px; max-width: 380px;
}
.portal-cal-header { text-align: center; font-size: .7rem; font-weight: 700; color: var(--portal-text-muted); padding: .3rem 0; text-transform: uppercase; }
.portal-cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: .82rem; cursor: pointer;
  transition: all .15s; border: 1px solid transparent;
}
.portal-cal-day:hover:not(.disabled):not(.empty) { background: rgba(255,255,255,.08); }
.portal-cal-day.selected { background: var(--portal-cyan); color: #000; font-weight: 700; }
.portal-cal-day.today { border-color: var(--portal-cyan); color: var(--portal-cyan); }
.portal-cal-day.blocked { background: rgba(239,68,68,.1); color: #ef4444; cursor: not-allowed; text-decoration: line-through; }
.portal-cal-day.disabled { opacity: .3; cursor: not-allowed; }
.portal-cal-day.empty { cursor: default; }
.portal-cal-day.has-booking { position: relative; }
.portal-cal-day.has-booking::after { content: ''; position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--portal-orange); }
.portal-cal-nav { grid-column: 1/8; display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.portal-cal-nav button { background: none; border: none; color: var(--portal-text-muted); cursor: pointer; padding: .3rem .6rem; border-radius: 6px; font-size: .85rem; }
.portal-cal-nav button:hover { background: rgba(255,255,255,.06); }
.portal-cal-nav span { font-size: .88rem; font-weight: 600; }
.portal-date-selected {
  margin-top: .75rem; padding: .6rem 1rem; background: var(--portal-cyan-dim);
  border: 1px solid rgba(0,212,255,.2); border-radius: var(--portal-radius);
  font-size: .85rem; color: var(--portal-cyan); font-weight: 600;
}

/* Slots */
.portal-slots { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.portal-slots__placeholder { font-size: .85rem; color: var(--portal-text-muted); }
.portal-slot { cursor: pointer; }
.portal-slot input { position: absolute; opacity: 0; pointer-events: none; }
.portal-slot span {
  display: flex; flex-direction: column; align-items: center;
  padding: .6rem 1rem; border-radius: var(--portal-radius);
  font-size: .82rem; font-weight: 500;
  background: var(--portal-surface-2); color: var(--portal-text);
  border: 1.5px solid var(--portal-border);
  transition: all .2s; min-width: 110px; text-align: center;
}
.portal-slot span:hover { border-color: var(--portal-cyan); }
.portal-slot input:checked + span { background: var(--portal-cyan-dim); border-color: var(--portal-cyan); color: var(--portal-cyan); }
.portal-slot--taken span { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.portal-slot--taken em { font-size: .7rem; color: var(--portal-red); font-style: normal; }
.portal-slot em { font-size: .7rem; color: var(--portal-text-muted); font-style: normal; }

/* Booking actions */
.portal-booking-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1rem; }
.portal-form__textarea {
  width: 100%; background: var(--portal-surface-2); border: 1px solid var(--portal-border);
  color: var(--portal-text); padding: .75rem 1rem; border-radius: var(--portal-radius);
  font-size: .88rem; font-family: inherit; resize: vertical;
  transition: border-color .2s;
}
.portal-form__textarea:focus { outline: none; border-color: var(--portal-cyan); }

/* Bookings list */
.portal-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.portal-filter {
  padding: .35rem .85rem; border-radius: 99px; font-size: .8rem;
  text-decoration: none; color: var(--portal-text-muted);
  background: var(--portal-surface);
  transition: all .2s;
}
.portal-filter:hover { color: var(--portal-text); }
.portal-filter.active { background: var(--portal-cyan-dim); color: var(--portal-cyan); }

.portal-bookings-list { display: flex; flex-direction: column; gap: .75rem; }
.portal-booking-item {
  display: flex; align-items: center; gap: 1rem;
  background: var(--portal-surface);
  border-radius: 14px; padding: 1rem 1.25rem;
  transition: background .2s;
}
.portal-booking-item:hover { background: var(--portal-surface-2); }
.portal-booking-item__date {
  display: flex; flex-direction: column; align-items: center;
  min-width: 44px; text-align: center;
}
.portal-booking-item__day { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--portal-cyan); }
.portal-booking-item__month { font-size: .68rem; text-transform: uppercase; color: var(--portal-text-muted); }
.portal-booking-item__info { flex: 1; }
.portal-booking-item__service { font-size: .92rem; font-weight: 600; margin-bottom: .2rem; }
.portal-booking-item__meta { font-size: .78rem; color: var(--portal-text-muted); display: flex; align-items: center; gap: .4rem; }
.portal-booking-item__meta code { color: var(--portal-text-muted); font-family: monospace; }
.portal-booking-item__desc { font-size: .78rem; color: var(--portal-text-muted); margin-top: .2rem; }
.portal-booking-item__status { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; flex-shrink: 0; }

/* Pagination */
.portal-pagination { display: flex; gap: .4rem; margin-top: 1rem; justify-content: center; }
.portal-page-btn {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; text-decoration: none; color: var(--portal-text-muted);
  background: var(--portal-surface);
  transition: all .2s;
}
.portal-page-btn.active { background: var(--portal-cyan-dim); color: var(--portal-cyan); }

/* Avatar section */
.portal-avatar-section { display: flex; align-items: flex-start; gap: 2rem; padding: .5rem 0; }
.portal-avatar-info { display: flex; flex-direction: column; gap: .5rem; }
.portal-avatar-info h3 { font-size: 1rem; margin: 0; }
.portal-avatar-info p { font-size: .82rem; color: var(--portal-text-muted); margin: 0; }

/* Security info */
.portal-security-info { margin-top: 2rem; padding-top: 1.5rem; }
.portal-security-info h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--portal-text-muted); margin-bottom: 1rem; }


/* Modal */
.portal-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.portal-modal__box {
  background: var(--portal-surface-2); border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius); padding: 1.75rem;
  max-width: 460px; width: 100%;
  position: relative; z-index: 2;
}
.portal-modal__box h3 { font-size: 1.1rem; margin: 0 0 .5rem; }
.portal-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 999; }

/* ═══ FORM STYLES ════════════════════════════════════════════ */
.portal-form { display: flex; flex-direction: column; gap: 1rem; }
.portal-form__group { display: flex; flex-direction: column; gap: .4rem; }
.portal-form__group label {
  font-size: .82rem; font-weight: 600; color: var(--portal-text-muted);
  display: flex; justify-content: space-between; align-items: center;
}
.portal-form__group label small { font-weight: 400; }
.portal-form__group input,
.portal-form__group select,
.portal-form__group textarea {
  background: var(--portal-surface-2); border: 1px solid var(--portal-border);
  color: var(--portal-text); padding: .7rem 1rem; border-radius: var(--portal-radius);
  font-size: .9rem; font-family: inherit; width: 100%;
  transition: border-color .2s; box-sizing: border-box;
}
.portal-form__group input:focus,
.portal-form__group select:focus,
.portal-form__group textarea:focus { outline: none; border-color: var(--portal-cyan); }
.portal-form__group input:disabled { opacity: .5; cursor: not-allowed; }
.portal-form__group select { cursor: pointer; }
.portal-form__link { font-size: .78rem; color: var(--portal-cyan); text-decoration: none; }
.portal-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.portal-form__actions { display: flex; gap: .75rem; justify-content: flex-end; padding-top: .5rem; }
.portal-form__section-title {
  display: flex; align-items: center; gap: .5rem;
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--portal-text-muted);
  padding: .5rem .75rem; border-radius: 8px;
  background: rgba(255,255,255,.03);
  margin-bottom: .25rem;
}

.portal-form__group--readonly input { background: rgba(255,255,255,.03); }
.portal-input-eye { position: relative; }
.portal-input-eye input { padding-right: 2.8rem; }
.eye-toggle {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--portal-text-muted);
  cursor: pointer; padding: .2rem; display: flex;
}

/* ═══ BUTTONS ════════════════════════════════════════════════ */
.portal-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; padding: .65rem 1.25rem;
  border-radius: var(--portal-radius); font-size: .875rem;
  font-weight: 600; text-decoration: none; cursor: pointer;
  border: none; transition: all .2s; font-family: inherit;
  white-space: nowrap;
}
.portal-btn--primary { background: var(--portal-cyan); color: #000; }
.portal-btn--primary:hover { background: #33dcff; }
.portal-btn--ghost {
  background: transparent; color: var(--portal-text-muted);
  border: 1px solid var(--portal-border);
}
.portal-btn--ghost:hover { background: rgba(255,255,255,.06); color: var(--portal-text); }
.portal-btn--danger { background: rgba(239,68,68,.15); color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.portal-btn--danger:hover { background: rgba(239,68,68,.25); }
.portal-btn--full { width: 100%; }
.portal-btn--sm  { padding: .4rem .9rem; font-size: .8rem; }
.portal-btn--xs  { padding: .25rem .65rem; font-size: .75rem; }
.portal-btn--icon { gap: .5rem; }
.portal-btn--file { cursor: pointer; }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .6rem; border-radius: 99px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.badge--success  { background: rgba(34,197,94,.1);  color: #4ade80; }
.badge--info     { background: rgba(0,212,255,.1);  color: #00d4ff; }
.badge--warning  { background: rgba(251,191,36,.1); color: #fbbf24; }
.badge--error    { background: rgba(239,68,68,.1);  color: #f87171; }
.badge--primary  { background: rgba(139,92,246,.1); color: #a78bfa; }
.badge--dark     { background: rgba(107,114,128,.1);color: #9ca3af; }
.badge--orange   { background: rgba(249,115,22,.1); color: #fb923c; }

/* ═══ ADMIN CALENDAR ════════════════════════════════════════ */
.cal-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem;
}
.cal-toolbar__left { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.cal-toolbar__right { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.cal-toolbar__month { font-size: 1.2rem; font-weight: 700; margin: 0; min-width: 160px; text-align: center; }
.cal-stat { font-size: .82rem; color: var(--text-muted); }
.cal-legend { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.cal-legend__item {
  padding: .25rem .75rem; border-radius: 99px; font-size: .75rem; font-weight: 600;
  background: rgba(0,0,0,.3); border-left: 3px solid var(--c, #888); color: var(--c, #888);
}
.cal-legend__item--blocked { --c: #ef4444; }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-header-cell {
  text-align: center; padding: .4rem 0;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
}
.cal-cell {
  min-height: 110px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
  padding: .4rem; display: flex; flex-direction: column; gap: 2px;
  transition: border-color .2s;
}
.cal-cell:hover { border-color: rgba(255,255,255,.15); }
.cal-cell--empty { background: transparent; border-color: transparent; }
.cal-cell--today { border-color: var(--cyan); }
.cal-cell--blocked { background: rgba(239,68,68,.06); border-color: rgba(239,68,68,.2); }
.cal-cell--sunday { opacity: .55; }
.cal-cell__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .25rem; margin-bottom: .25rem;
}
.cal-cell__num { font-size: .85rem; font-weight: 700; color: var(--text); }
.cal-cell--today .cal-cell__num { color: var(--cyan); }
.cal-cell__count {
  font-size: .68rem; background: var(--cyan-dim); color: var(--cyan);
  border-radius: 99px; padding: 0 .4rem; font-weight: 700; min-width: 18px; text-align: center;
}
.cal-cell__block-badge { font-size: .75rem; display: flex; align-items: center; gap: .15rem; }
.cal-unblock-btn {
  background: none; border: none; color: #ef4444; cursor: pointer;
  font-size: .7rem; padding: 0; line-height: 1; opacity: .6;
}
.cal-unblock-btn:hover { opacity: 1; }
.cal-cell__add-btn {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: .9rem; padding: 0; opacity: 0; transition: opacity .15s;
}
.cal-cell:hover .cal-cell__add-btn { opacity: 1; }
.cal-cell__events { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: hidden; }
.cal-event {
  display: flex; align-items: center; gap: .3rem;
  padding: .2rem .4rem; border-radius: 4px; text-decoration: none;
  font-size: .7rem; overflow: hidden; white-space: nowrap;
  transition: filter .15s;
}
.cal-event:hover { filter: brightness(1.2); }
.cal-event__dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cal-event__name { flex: 1; overflow: hidden; text-overflow: ellipsis; color: rgba(255,255,255,.85); }
.cal-event__time { font-size: .65rem; color: rgba(255,255,255,.55); flex-shrink: 0; }
.cal-event--more { background: rgba(255,255,255,.05); color: var(--text-muted); justify-content: center; }
.cal-blocked-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .75rem; border-radius: 99px;
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.2);
  font-size: .8rem;
}
.cal-blocked-chip strong { color: #f87171; }
.cal-blocked-chip span { color: var(--text-muted); }

/* Admin modals */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  max-width: 500px; width: 100%;
}
.modal-box--lg { max-width: 680px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-header h3 { font-size: 1.1rem; margin: 0; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.2rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .75rem; padding: 1rem 1.5rem; border-top: 1px solid var(--border); margin: 0 -1.75rem -1.75rem; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 999; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .4rem; padding: .5rem 0; }
.form-group label { font-size: .82rem; font-weight: 600; color: var(--text-muted); }

/* ═══ RESPONSIVE ════════════════════════════════════════════ */
@media (max-width: 900px) {
  .portal-auth { grid-template-columns: 1fr; }
  .portal-auth__left { display: none; }
  .portal-grid-2 { grid-template-columns: 1fr; }
  .portal-stats { grid-template-columns: repeat(2, 1fr); }
  .portal-service-grid { grid-template-columns: 1fr 1fr; }
  .portal-form__row { grid-template-columns: 1fr; }
  .cal-grid { gap: 2px; }
  .cal-cell { min-height: 80px; }
  .cal-event__time { display: none; }
  .portal-tabs { width: 100%; }
}
@media (max-width: 768px) {
  .portal-sidebar { transform: translateX(-100%); }
  .portal-sidebar.open { transform: translateX(0); }
  .portal-sidebar__close { display: flex; }
  .portal-main { margin-left: 0; }
  .portal-topbar { display: flex; }
  .portal-content { padding: 1rem; }
  .portal-stats { grid-template-columns: repeat(2, 1fr); }
  .cal-cell { min-height: 60px; }
  .cal-cell__head { flex-wrap: wrap; }
  .portal-card { padding: 1.1rem; }
  .portal-avatar-section { flex-direction: column; align-items: center; text-align: center; }
  .portal-tabs { width: 100%; justify-content: center; }
}
@media (max-width: 500px) {
  .portal-stats { grid-template-columns: 1fr 1fr; }
  .portal-service-grid { grid-template-columns: 1fr; }
  .portal-booking-step { flex-direction: column; gap: .75rem; }
  .portal-welcome { flex-wrap: wrap; }
  .cal-toolbar { flex-direction: column; align-items: flex-start; }
  .portal-booking-item { flex-wrap: wrap; }
  .portal-booking-item__status { width: 100%; flex-direction: row; justify-content: flex-start; }
}


/* ─── PORTAL FLASH (used outside portal pages) ──────────────*/
.portal-flash { display:flex; align-items:center; gap:.6rem; padding:.75rem 1rem; border-radius:8px; font-size:.88rem; }
.portal-flash--success { background:rgba(34,197,94,.12); border:1px solid rgba(34,197,94,.25); color:#22c55e; }
.portal-flash--error   { background:rgba(239,68,68,.12);  border:1px solid rgba(239,68,68,.25);  color:#ef4444; }

/* ─── PORTAL AUTH SEP (used outside portal pages) ───────────*/
.portal-auth__sep {
  display:flex; align-items:center; gap:.75rem;
  color: rgba(255,255,255,.3); font-size:.8rem; margin: 1rem 0;
}
.portal-auth__sep::before, .portal-auth__sep::after {
  content:''; flex:1; height:1px; background:rgba(255,255,255,.1);
}

