/* =========================================================================
   THE VAULT AT LAS VEGAS — member dashboard (front-end shell)
   portal.css  •  requires base.css
   ========================================================================= */

.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Sidebar ------------------------------------------------------ */
.side {
  border-right: 1px solid var(--line);
  background: var(--ink-2);
  padding: 22px 18px;
  display: flex; flex-direction: column; gap: 26px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side__nav { display: grid; gap: 2px; }
.side__group + .side__group { margin-top: 20px; }
.side__label {
  font-size: .6rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-3); padding: 0 12px 8px;
}
.side__link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-sm);
  font-size: .88rem; color: var(--text-2);
  transition: background .2s var(--ease), color .2s var(--ease);
  cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
}
.side__link:hover { background: rgba(255,255,255,.04); color: var(--text); }
.side__link.is-active { background: rgba(198,169,103,.12); color: var(--brass); }
.side__link svg { flex: none; opacity: .85; }
.side__link .count {
  margin-left: auto; font-size: .7rem; padding: 1px 7px; border-radius: 100px;
  background: rgba(255,255,255,.07); color: var(--text-2);
}
.side__foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; }
.side__user { display: flex; align-items: center; gap: 11px; }
.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brass-lo), var(--brass));
  color: #0A0A0B; font-size: .74rem; font-weight: 600; letter-spacing: .04em;
}
.side__user-name { font-size: .85rem; font-weight: 500; line-height: 1.2; }
.side__user-role { font-size: .7rem; color: var(--text-3); }

/* ---------- Topbar ------------------------------------------------------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 16px clamp(18px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(10,10,11,.9);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.topbar__title { font-family: var(--display); font-size: 1.5rem; font-weight: 400; line-height: 1; }
.topbar__sub { font-size: .76rem; color: var(--text-3); margin-top: 4px; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.side-toggle { display: none; }

.view { padding: clamp(20px, 3vw, 34px); display: grid; gap: clamp(18px, 2.4vw, 28px); }
.view[hidden] { display: none; }

/* ---------- Panels ------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel__head {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.panel__title { font-size: .95rem; font-weight: 600; }
.panel__head .btn { margin-left: auto; }
.panel__body { padding: 20px; }
.panel__body--flush { padding: 0; }

/* ---------- Stat tiles --------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
@media (max-width: 940px) { .tiles { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px;
}
.tile dt { font-size: .62rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); }
.tile dd {
  margin: 10px 0 0; font-family: var(--display); font-size: 2rem; font-weight: 400; line-height: 1;
}
.tile__note { margin-top: 8px; font-size: .76rem; color: var(--text-3); }

/* ---------- Vehicle cards ------------------------------------------------ */
.fleet { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
@media (max-width: 1100px) { .fleet { grid-template-columns: minmax(0,1fr); } }
.vehicle {
  display: grid; grid-template-columns: 132px minmax(0,1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; transition: border-color .25s var(--ease);
}
.vehicle:hover { border-color: var(--line-2); }
@media (max-width: 520px) { .vehicle { grid-template-columns: minmax(0,1fr); } }
.vehicle__img {
  background:
    radial-gradient(90% 70% at 40% 30%, rgba(198,169,103,.18), transparent 65%),
    linear-gradient(150deg, #232329, #101013);
  border-right: 1px solid var(--line);
  min-height: 132px;
  display: grid; place-items: center;
}
@media (max-width: 520px) { .vehicle__img { border-right: 0; border-bottom: 1px solid var(--line); min-height: 110px; } }
.vehicle__img svg { opacity: .5; }
.vehicle__body { padding: 16px 18px; display: grid; gap: 10px; align-content: start; }
.vehicle__name { font-weight: 600; font-size: .98rem; }
.vehicle__meta { font-size: .76rem; color: var(--text-3); }
.vehicle__stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 2px; }
.vehicle__stat dt { font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.vehicle__stat dd { margin: 3px 0 0; font-size: .86rem; font-variant-numeric: tabular-nums; }
.vehicle__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

.meter { height: 4px; border-radius: 100px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 6px; }
.meter span { display: block; height: 100%; background: var(--ok); border-radius: 100px; }
.meter--warn span { background: var(--warn); }

/* ---------- Tables ------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .87rem; min-width: 620px; }
.tbl th, .tbl td { padding: 13px 20px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th {
  font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-3); font-weight: 500; background: var(--ink-2);
  position: sticky; top: 0;
}
.tbl tbody tr:hover { background: rgba(255,255,255,.02); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Timeline ----------------------------------------------------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline li { position: relative; padding-block: 12px; }
.timeline li::before {
  content: ""; position: absolute; left: -25px; top: 19px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink); border: 1.5px solid var(--brass);
}
.timeline__t { font-size: .9rem; font-weight: 500; }
.timeline__m { font-size: .76rem; color: var(--text-3); margin-top: 3px; }
.timeline__d { font-size: .85rem; color: var(--text-2); margin-top: 5px; }

/* ---------- Request builder ---------------------------------------------- */
.req-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
@media (max-width: 900px) { .req-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .req-grid { grid-template-columns: minmax(0,1fr); } }
.req-option {
  border: 1px solid var(--line); border-radius: var(--r); padding: 16px;
  cursor: pointer; transition: border-color .2s var(--ease), background .2s var(--ease);
  display: block;
}
.req-option:hover { border-color: var(--line-2); background: var(--surface-2); }
.req-option input { position: absolute; opacity: 0; pointer-events: none; }
.req-option:has(input:checked) { border-color: var(--brass); background: rgba(198,169,103,.08); }
.req-option__name { font-size: .9rem; font-weight: 600; }
.req-option__price { font-size: .8rem; color: var(--brass); margin-top: 4px; font-variant-numeric: tabular-nums; }
.req-option__desc { font-size: .78rem; color: var(--text-3); margin-top: 6px; }

.summary-line { display: flex; justify-content: space-between; gap: 16px; padding-block: 9px; font-size: .88rem; }
.summary-line + .summary-line { border-top: 1px solid var(--line); }
.summary-total { font-weight: 600; color: var(--brass); }

/* ---------- Chat --------------------------------------------------------- */
.chat { display: grid; gap: 12px; max-height: 420px; overflow-y: auto; padding: 20px; }
.msg { max-width: 78%; padding: 12px 15px; border-radius: var(--r); font-size: .88rem; line-height: 1.55; }
.msg--them { background: var(--ink-2); border: 1px solid var(--line); justify-self: start; }
.msg--me { background: rgba(198,169,103,.13); border: 1px solid rgba(198,169,103,.3); justify-self: end; }
.msg__who { font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 5px; }
.chat-form { display: flex; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }
.chat-form .input { flex: 1; }

/* ---------- Notice ------------------------------------------------------- */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid rgba(198,169,103,.32); background: rgba(198,169,103,.07);
  border-radius: var(--r); padding: 14px 16px; font-size: .85rem; color: var(--text-2);
}
.notice strong { color: var(--brass); }

/* ---------- Responsive shell --------------------------------------------- */
@media (max-width: 880px) {
  .app { grid-template-columns: minmax(0,1fr); }
  .side {
    position: fixed; inset: 0 auto 0 0; width: 268px; z-index: 60; height: 100dvh;
    transform: translateX(-100%); transition: transform .3s var(--ease);
  }
  .side.is-open { transform: none; }
  .side-toggle { display: grid; place-items: center; width: 40px; height: 40px;
    border: 1px solid var(--line); border-radius: var(--r-sm); background: none; cursor: pointer; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: none; }
  .scrim.is-on { display: block; }
}

@media (max-width: 640px) {
  /* The topbar action duplicates "New Request" in the sidebar — drop it rather
     than let it crowd the title. */
  .topbar__actions { display: none; }
  .topbar__sub { display: none; }
  .topbar { padding-block: 12px; }
  .topbar__title { font-size: 1.3rem; }
}
