/* realign-shell.css - RE·ALIGN-style app shell (left sidebar nav + panel area)
   grafted onto the EAP dashboard, skinned with the EAP brand tokens from app.css
   (--brand periwinkle, --card, --ink, Cormorant/Montserrat/Poppins). Structure
   mirrors realign/platform (app-shell > sidebar + app-main > panel); look stays EAP.

   Scoped to the agent dashboard via <body class="rl-shell"> so the login/admin/team
   views are untouched. Increment 1 of the RE·ALIGN parity rebuild. */

/* ── layout frame ─────────────────────────────────────────────────────────── */
.rl-shell #viewDashboard.view { display: none; }
.rl-shell #viewDashboard.view.active { display: block; }

.app-shell { display: flex; min-height: 100vh; align-items: stretch; }

/* ── sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  width: 236px; flex: 0 0 236px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: rgba(255,255,255,0.92);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 20px 14px 16px; gap: 6px;
  transition: width .16s ease, flex-basis .16s ease;
  z-index: 30;
}
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 14px; }
.side-wordmark { display: flex; flex-direction: column; cursor: pointer; }
.side-wordmark .wm-mark { font-family: var(--font-head); font-size: 26px; font-weight: 700; letter-spacing: 5px; color: #fff; line-height: 1; }
.side-wordmark .wm-sub { font-family: var(--font-sub); font-size: 7px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,0.72); margin-top: 4px; }
.side-collapse { background: rgba(255,255,255,0.12); border: none; color: #fff; width: 26px; height: 26px; border-radius: 8px; cursor: pointer; font-size: 15px; line-height: 1; display: grid; place-items: center; flex: 0 0 auto; }
.side-collapse:hover { background: rgba(255,255,255,0.22); }

.tabs { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; overflow-y: auto; }
.tab {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 11px;
  background: none; border: none; cursor: pointer; text-align: left; width: 100%;
  color: rgba(255,255,255,0.82); font-family: var(--font-sub); font-size: 13.5px; font-weight: 600;
  transition: background .12s, color .12s;
}
.tab:hover { background: rgba(255,255,255,0.13); color: #fff; }
.tab.active { background: #fff; color: var(--brand-dark); box-shadow: 0 4px 12px rgba(30,32,45,0.16); }
.tab .si-ic { flex: 0 0 20px; width: 20px; height: 20px; display: grid; place-items: center; }
.tab .si-ic svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.tab .si-lb { white-space: nowrap; overflow: hidden; }

.side-spacer { flex: 1 1 auto; }
.side-bottom { display: flex; flex-direction: column; gap: 3px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.16); }
.side-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px;
  background: none; border: none; cursor: pointer; text-align: left; width: 100%;
  color: rgba(255,255,255,0.82); font-family: var(--font-sub); font-size: 13px; font-weight: 600;
}
.side-item:hover { background: rgba(255,255,255,0.13); color: #fff; }
.side-item .si-ic { flex: 0 0 20px; width: 20px; height: 20px; display: grid; place-items: center; }
.side-item .si-ic svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.side-item .si-who { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.side-item .si-who b { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-item .si-who span { font-size: 10.5px; color: rgba(255,255,255,0.66); }

/* collapsed rail */
body.nav-collapsed .sidebar { width: 66px; flex-basis: 66px; }
body.nav-collapsed .side-wordmark .wm-sub,
body.nav-collapsed .tab .si-lb,
body.nav-collapsed .side-item .si-lb,
body.nav-collapsed .side-item .si-who { display: none; }
body.nav-collapsed .tab,
body.nav-collapsed .side-item { justify-content: center; }
body.nav-collapsed .side-top { justify-content: center; }
body.nav-collapsed .side-wordmark .wm-mark { font-size: 20px; letter-spacing: 2px; }
body.nav-collapsed .side-collapse { display: none; }

/* ── main column ──────────────────────────────────────────────────────────── */
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-topbar {
  min-height: 60px; display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 10px 28px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
/* RE·ALIGN jumps straight into each surface - no per-tab title repeated in the topbar;
   the universal search bar lives here instead. */
.app-topbar .tb-titles { display: none; }
.app-topbar .tb-title { font-family: var(--font-head); font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.app-topbar .tb-sub { font-family: var(--font-body); font-size: 12.5px; color: var(--muted); line-height: 1.2; }
.app-topbar .tb-sub:empty { display: none; }
.app-topbar .tb-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); flex: 0 0 auto; }
.app-topbar .tb-right strong { color: var(--ink); }

/* Universal search - centered, grows to fill the bar (max 440px). */
.tb-search { position: relative; flex: 1 1 auto; max-width: 440px; margin-right: auto; }
.tb-search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px;
  fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
#tbSearchInput { width: 100%; height: 38px; padding: 0 14px 0 36px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); font: inherit; font-size: 13.5px; transition: border-color .12s, box-shadow .12s; }
#tbSearchInput::placeholder { color: var(--muted); }
#tbSearchInput:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.tb-search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.14); padding: 6px; z-index: 40; max-height: 70vh; overflow-y: auto; }
.tbs-group { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  padding: 9px 12px 4px; }
.tbs-row { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; border: 0; background: transparent;
  border-radius: 9px; padding: 8px 12px; cursor: pointer; font: inherit; }
.tbs-row:hover, .tbs-row.on { background: color-mix(in srgb, var(--brand) 12%, var(--card)); }
.tbs-title { font-size: 13.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbs-sub { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbs-empty { padding: 14px 12px; color: var(--muted); font-size: 13px; }
@media (max-width: 720px) { .tb-search { max-width: none; } }
.app-panel { flex: 1 1 auto; padding: 26px 28px 60px; max-width: 1180px; width: 100%; }

/* ── mobile ───────────────────────────────────────────────────────────────── */
.mobilebar { display: none; }
.nav-scrim { display: none; }
@media (max-width: 860px) {
  .mobilebar {
    display: flex; align-items: center; gap: 14px; height: 54px; padding: 0 16px;
    background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 40;
  }
  .mobilebar .hamburger { background: rgba(255,255,255,0.16); border: none; color: #fff; width: 36px; height: 36px; border-radius: 9px; font-size: 18px; cursor: pointer; }
  .mobilebar .wm-mark { font-family: var(--font-head); font-size: 22px; letter-spacing: 4px; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 250px; flex-basis: 250px;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: rgba(20,20,30,0.45); z-index: 25; }
  .app-topbar { display: none; }
  .app-panel { padding: 18px 16px 50px; }
  body.nav-collapsed .sidebar { width: 250px; flex-basis: 250px; }
}

/* ── Command Center home ──────────────────────────────────────────────────── */
.cc-wrap { display: flex; flex-direction: column; gap: 20px; }

/* Dynamic rotating greeting (RE·ALIGN-style): big centered Cormorant text, no box. */
.cc-greet-hero { text-align: center; padding: 10px 8px 16px; }
.cc-greet-hero .cc-greet { font-family: var(--font-head); font-weight: 700; color: var(--ink); line-height: 1.14; font-size: clamp(25px, 3.4vw, 38px); max-width: 780px; margin: 0 auto; }
.cc-greet-hero .cc-greet-sub { display: none; }

/* Today's Calendar rows */
.cc-cal-empty { color: var(--muted); font-size: 13.5px; padding: 8px 0; }
.cc-cal-row { display: flex; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cc-cal-row:last-child { border-bottom: none; }
.cc-cal-time { font-family: var(--font-sub); font-size: 12.5px; font-weight: 700; color: var(--brand-dark); white-space: nowrap; min-width: 62px; }
.cc-cal-main { flex: 1; min-width: 0; }
.cc-cal-main b { font-size: 14px; color: var(--ink); font-weight: 600; }
.cc-cal-type { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.cc-hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; border-radius: var(--radius); padding: 28px 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.cc-greet { font-family: var(--font-head); font-size: 34px; font-weight: 700; line-height: 1.05; }
.cc-greet-sub { font-family: var(--font-body); font-size: 14px; color: rgba(255,255,255,0.86); margin-top: 6px; }
.cc-hero-stats { display: flex; gap: 22px; }
.cc-stat { text-align: center; }
.cc-stat-n { font-family: var(--font-sub); font-size: 30px; font-weight: 700; line-height: 1; }
.cc-stat-l { font-family: var(--font-sub); font-size: 10px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: rgba(255,255,255,0.78); margin-top: 5px; }

.cc-split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .cc-split { grid-template-columns: 1fr; } }

.cc-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 620px) { .cc-tiles { grid-template-columns: 1fr; } }

/* ── agent pill bar is replaced by the sidebar; keep in DOM (wiring), hide it ── */
.rl-shell #agentTabs { display: none !important; }
/* The panels live in .page-wrap (there is no .app-panel element), so the panel
   gutter + max-width belong here - otherwise content runs flush under the sidebar
   and clips on the right. Matches the topbar's 28px side padding. */
.rl-shell .page-wrap { max-width: 1200px; padding: 24px 28px 60px; margin: 0; }
@media (max-width: 860px) { .rl-shell .page-wrap { padding: 18px 16px 50px; } }
/* Team view keeps its current single-column layout: hide the agent sidebar. */
.rl-team #agentSidebar { display: none; }
.rl-team .app-topbar .tb-title { font-size: 22px; }
