/* AriaConnectAI — app.ariaconnectai.com Phase 1A shell
   Design tokens recovered from the sealed Phase A1 prototype
   (/home/ubuntu/ARIACONNECTAI_APP_VISUAL_REVIEW/mockups/styles.css).
   Demo Data only. Not connected to production. No auth implemented. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Serif:ital,wght@0,400;0,600;1,400&family=Sora:wght@500;600;700;800&display=swap');

:root {
  --navy-950: #020508;
  --navy-900: #050c17;
  --navy-850: #071422;
  --navy-800: #0a1a2e;
  --navy-700: #10243d;
  --navy-600: #163353;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-300: #93c5fd;
  --cyan-500: #06b6d4;
  --cyan-400: #22d3ee;
  --gold-500: #d4af37;
  --gold-400: #e4c45a;
  --gold-300: #f4d160;
  --green-500: #10b981;
  --green-400: #34d399;
  --red-500: #ef4444;
  --amber-400: #fbbf24;
  --text: #e8edf5;
  --text-2: #8aa0ba;
  --text-3: #4a6380;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.12);
  --glass: rgba(10, 26, 46, 0.72);
  --glass-strong: rgba(7, 20, 34, 0.92);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --font-display: 'Sora', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-transcript: 'IBM Plex Serif', Georgia, serif;
  --sidebar-w: 264px;
  --header-h: 64px;
  --tab-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  min-height: 100%;
  background: var(--navy-950);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(37, 99, 235, 0.18), transparent 55%),
    radial-gradient(ellipse 40% 40% at 100% 20%, rgba(212, 175, 55, 0.06), transparent 50%),
    radial-gradient(ellipse 50% 40% at 0% 80%, rgba(6, 182, 212, 0.07), transparent 50%),
    var(--navy-950);
}

img { display: block; max-width: 100%; }
button, a, input, select { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
h1, h2, h3 { font-family: var(--font-display); }

/* ── Demo banner ── */
.demo-banner {
  position: sticky; top: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .4rem 1rem; text-align: center; flex-wrap: wrap;
  background: linear-gradient(90deg, rgba(212,175,55,.18), rgba(37,99,235,.18));
  border-bottom: 1px solid rgba(212,175,55,.35);
  font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--gold-300);
}
.demo-banner .sep { opacity: .5; }
.demo-banner .phi { color: var(--blue-300); }

/* ── Dev auth gate ── */
.dev-gate {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.dev-gate-card {
  width: min(420px, 100%); background: var(--glass-strong); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); text-align: center;
}
.dev-gate-card .logo { width: 56px; margin: 0 auto 1.2rem; }
.dev-gate-card h1 { font-size: 1.3rem; margin-bottom: .4rem; }
.dev-gate-card p { color: var(--text-2); font-size: .88rem; margin-bottom: 1.5rem; line-height: 1.5; }
.dev-gate-tag {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--amber-400); border: 1px solid rgba(251,191,36,.4); border-radius: var(--radius-pill);
  padding: .25rem .7rem; margin-bottom: 1rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.2rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .88rem;
  transition: transform .15s ease, box-shadow .15s ease; white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--cyan-400); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg, var(--blue-600), var(--cyan-500)); color: #fff; }
.btn-gold { background: linear-gradient(135deg, var(--gold-500), var(--gold-300)); color: #1a1400; }
.btn-ghost { background: rgba(255,255,255,.04); border: 1px solid var(--border-2); color: var(--text); }
.btn-sm { padding: .45rem .8rem; font-size: .8rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── App shell ── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: var(--navy-900);
  border-right: 1px solid var(--border); padding: 1.2rem 1rem; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: .6rem; padding: .4rem .4rem 1.2rem; }
.brand img { width: 30px; }
.brand .wordmark { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.nav-group { margin-bottom: 1.1rem; }
.nav-group-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); padding: 0 .6rem; margin-bottom: .4rem;
}
.nav-item {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: .87rem; font-weight: 500; margin-bottom: .1rem;
}
.nav-item .ic { width: 18px; height: 18px; flex: 0 0 18px; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav-item.active { background: rgba(37,99,235,.14); color: var(--text); box-shadow: inset 2px 0 0 var(--blue-500); }
.nav-item.sub { padding-left: 1.6rem; font-size: .84rem; }
.nav-pillar-receptionist.active { box-shadow: inset 2px 0 0 var(--gold-500); background: rgba(212,175,55,.1); }
.sidebar-cta { margin: .6rem 0 1rem; }
.sidebar-cta .btn { width: 100%; }
.sidebar-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--header-h); display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; border-bottom: 1px solid var(--border); background: rgba(5,12,23,.6);
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(8px);
}
.topbar-left { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.breadcrumbs { font-size: .8rem; color: var(--text-2); display: flex; align-items: center; gap: .4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumbs .cur { color: var(--text); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: .6rem; }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.04); border: 1px solid var(--border-2); position: relative;
}
.icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--red-500); }
.lang-select { display: flex; gap: .2rem; background: rgba(255,255,255,.04); border: 1px solid var(--border-2); border-radius: var(--radius-pill); padding: .2rem; }
.lang-select button { padding: .3rem .55rem; border-radius: var(--radius-pill); font-size: .74rem; font-weight: 700; color: var(--text-2); }
.lang-select button.on { background: var(--blue-600); color: #fff; }
.account-menu { display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem .3rem .3rem; border-radius: var(--radius-pill); border: 1px solid var(--border-2); background: rgba(255,255,255,.03); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--blue-600), var(--cyan-500)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .78rem; }
.account-menu .name { font-size: .82rem; font-weight: 600; }

.mobile-topbar { display: none; }
.tabbar { display: none; }

.route-outlet { padding: 1.6rem 1.8rem 3rem; max-width: 1280px; width: 100%; }
.page-head { margin-bottom: 1.4rem; }
.page-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-300); margin-bottom: .3rem; }
.page-kicker.interpreter { color: var(--cyan-400); }
.page-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-title { font-size: 1.5rem; font-weight: 700; }
.page-sub { color: var(--text-2); font-size: .9rem; margin-top: .3rem; max-width: 62ch; }

/* ── Grids / cards ── */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.metric-card { background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.metric-card .v { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; }
.metric-card .l { font-size: .78rem; color: var(--text-2); margin-top: .2rem; }
.panel { background: var(--glass); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; margin-bottom: 1.2rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 1rem; flex-wrap: wrap; }
.panel-head h3 { font-size: 1rem; font-weight: 700; }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table th { text-align: left; color: var(--text-3); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; padding: .5rem .7rem; border-bottom: 1px solid var(--border); }
.data-table td { padding: .7rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem; border-radius: var(--radius-pill); font-size: .72rem; font-weight: 700; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: rgba(52,211,153,.12); color: var(--green-400); }
.badge-live { background: rgba(239,68,68,.12); color: var(--red-500); }
.badge-warn { background: rgba(251,191,36,.12); color: var(--amber-400); }
.badge-neutral { background: rgba(148,163,184,.12); color: var(--text-2); }
.badge-info { background: rgba(96,165,250,.12); color: var(--blue-400); }

/* ── States: empty / loading / error / setup-required ── */
.state-block { padding: 2.4rem 1.5rem; text-align: center; border-radius: var(--radius); border: 1px dashed var(--border-2); }
.state-icon { width: 46px; height: 46px; border-radius: 14px; margin: 0 auto .9rem; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.05); font-size: 1.3rem; }
.state-title { font-weight: 700; margin-bottom: .3rem; }
.state-sub { color: var(--text-2); font-size: .86rem; max-width: 42ch; margin: 0 auto 1rem; }
.state-setup .state-icon { color: var(--gold-400); }
.state-error .state-icon { color: var(--red-500); }
.state-loading .spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--blue-400); animation: spin .8s linear infinite; margin: 0 auto .8rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Confirmation dialog ── */
.dialog-backdrop { position: fixed; inset: 0; background: rgba(2,5,8,.7); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1.2rem; }
.dialog { width: min(420px, 100%); background: var(--glass-strong); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.dialog h3 { margin-bottom: .5rem; }
.dialog p { color: var(--text-2); font-size: .88rem; margin-bottom: 1.2rem; }
.dialog-actions { display: flex; gap: .6rem; justify-content: flex-end; }

/* ── Notification panel ── */
.notif-panel { position: absolute; right: 1.5rem; top: calc(var(--header-h) + 8px); width: 340px; max-width: 90vw; background: var(--glass-strong); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: .6rem; z-index: 200; }
.notif-item { padding: .7rem .7rem; border-radius: var(--radius-sm); }
.notif-item:hover { background: rgba(255,255,255,.04); }
.notif-item .t { font-weight: 600; font-size: .84rem; }
.notif-item .d { font-size: .78rem; color: var(--text-2); margin-top: .1rem; }
.notif-item .ts { font-size: .7rem; color: var(--text-3); margin-top: .3rem; }

/* ── lang visibility (matches rest of site: [data-lang] on <html>) ── */
[data-lang] .en, [data-lang] .es, [data-lang] .pt { display: none; }
html[data-lang="en"] .en, html[data-lang="es"] .es, html[data-lang="pt"] .pt { display: inline; }
h1[data-lang] .en, .block-i18n.en { display: none; }
html[data-lang="en"] .block-i18n.en, html[data-lang="es"] .block-i18n.es, html[data-lang="pt"] .block-i18n.pt { display: block; }

/* ── Interpreter live surfaces (recovered from Phase A1) ── */
.live-stage { text-align: center; padding: 2rem 1rem; }
.live-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .8rem; border-radius: var(--radius-pill); background: rgba(239,68,68,.14); color: #fca5a5; font-weight: 700; font-size: .78rem; margin-bottom: .8rem; }
.live-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; }
.live-timer { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; }
.lang-pair-row { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.2rem auto; max-width: 420px; }
.lang-pill { flex: 1; background: rgba(255,255,255,.03); border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: .7rem; text-align: center; }
.lang-pill .code { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.lang-pill .role { font-size: .72rem; color: var(--text-2); }
.agent-orb { width: 130px; height: 130px; border-radius: 50%; margin: 1.4rem auto; background: radial-gradient(circle at 35% 30%, var(--blue-400), var(--blue-700)); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 2.2rem; box-shadow: 0 0 0 8px rgba(37,99,235,.12), 0 0 40px rgba(37,99,235,.35); }
.audio-controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; max-width: 460px; margin: 1.4rem auto; }
.audio-btn { padding: .9rem .5rem; border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: rgba(255,255,255,.03); font-size: .75rem; font-weight: 600; }
.transcript-turn { max-width: 78%; margin-bottom: .9rem; background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .8rem 1rem; }
.transcript-turn.b { margin-left: auto; background: rgba(37,99,235,.08); border-color: rgba(37,99,235,.25); }
.transcript-turn .meta { display: flex; justify-content: space-between; font-size: .72rem; color: var(--text-3); margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .04em; }
.transcript-turn .src { font-family: var(--font-transcript); }
.transcript-turn .tr { color: var(--blue-300); margin-top: .35rem; padding-top: .35rem; border-top: 1px dashed var(--border-2); }

/* ── Responsive ── */
@media (max-width: 960px) {
  .app { flex-direction: column; }
  .main { width: 100%; }
  .sidebar { display: none; }
  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between; height: 56px;
    padding: 0 1rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 60;
    background: rgba(5,12,23,.85); backdrop-filter: blur(8px);
  }
  .mobile-topbar .brand { padding: 0; }
  .mobile-topbar .brand .wordmark { font-size: .95rem; }
  .topbar { display: none; }
  .route-outlet { padding: 1.1rem 1rem calc(var(--tab-h) + var(--safe-b) + 1.5rem); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0;
    height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: var(--navy-900); border-top: 1px solid var(--border); z-index: 300;
  }
  .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; font-size: .64rem; color: var(--text-2); font-weight: 600; }
  .tabbar button .ic { width: 20px; height: 20px; }
  .tabbar button.active { color: var(--blue-400); }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .audio-controls { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 961px) and (max-width: 1180px) {
  .sidebar { width: 220px; flex-basis: 220px; }
  .route-outlet { padding: 1.4rem; }
}

/* ── Review-only chrome (route grid for local dev/capture, never ships) ── */
.dev-route-bar { position: sticky; top: 0; z-index: 950; background: var(--navy-900); border-bottom: 1px solid var(--border-2); padding: .5rem .8rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.dev-route-bar a { font-size: .68rem; padding: .25rem .55rem; border-radius: var(--radius-sm); background: rgba(255,255,255,.04); color: var(--text-2); border: 1px solid var(--border); }
.dev-route-bar a.active { background: rgba(37,99,235,.18); color: var(--text); border-color: var(--blue-500); }
