:root {
  --navy: #0a1730;
  --navy-2: #102445;
  --ink: #12213a;
  --muted: #64748b;
  --line: #dbe3ee;
  --surface: #ffffff;
  --canvas: #f4f7fb;
  --blue: #2463eb;
  --teal: #0a8f7b;
  --amber: #c67a09;
  --red: #b93838;
  --shadow: 0 18px 45px rgba(20, 38, 70, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); font-size: 16px; line-height: 1.5; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.mobile-topbar, .mobile-nav { display: none; }
.network-banner { position: sticky; top: 0; z-index: 20; padding: 9px 16px; color: #fff; background: var(--red); text-align: center; font-size: .84rem; font-weight: 750; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; background: var(--navy); color: #fff; display: flex; flex-direction: column; }
.brand { display: flex; gap: 13px; align-items: center; color: #fff; text-decoration: none; font-weight: 760; line-height: 1.05; letter-spacing: -.02em; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; background: linear-gradient(135deg, #5b8cff, #2cc6ad); border-radius: 12px; color: #fff; font-weight: 850; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.brand-mark.large { width: 56px; height: 56px; border-radius: 16px; font-size: 1.2rem; }
.sidebar nav { display: grid; gap: 6px; margin-top: 44px; }
.sidebar nav a { color: #bcc9dd; text-decoration: none; padding: 11px 13px; border-radius: 10px; font-weight: 650; }
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: rgba(255,255,255,.10); }
.sidebar-user { margin-top: auto; display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; background: #dfe7f4; color: var(--navy); border-radius: 50%; font-weight: 800; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: #93a4be; font-size: .75rem; }
.sidebar-user form { grid-column: 2; }
.link-button { border: 0; color: #aebbd0; background: transparent; padding: 0; cursor: pointer; font-size: .85rem; }
.main { padding: 42px clamp(24px, 4vw, 68px) 80px; max-width: 1500px; width: 100%; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 28px; }
.page-header h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1; margin: 4px 0 8px; letter-spacing: -.045em; }
.page-header p { margin: 0; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions form { margin: 0; }
.install-tip { margin: -10px 0 22px; padding: 12px 14px; border: 1px solid #bed0eb; border-radius: 12px; color: #294b78; background: #eaf2ff; }
.eyebrow { color: var(--blue) !important; text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; font-weight: 800; }
.button { border: 0; border-radius: 10px; min-height: 42px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-weight: 720; cursor: pointer; }
.button.primary { background: var(--blue); color: #fff; box-shadow: 0 9px 18px rgba(36,99,235,.18); }
.button.secondary { background: #edf2f8; color: #23334e; }
.button.danger { background: var(--red); color: #fff; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.wide { width: 100%; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric-card { display: grid; gap: 6px; min-height: 156px; padding: 22px; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; text-decoration: none; box-shadow: var(--shadow); }
.metric-card span { color: var(--muted); font-weight: 700; }
.metric-card strong { font-size: 2.6rem; line-height: 1; letter-spacing: -.04em; }
.metric-card small { color: var(--muted); margin-top: auto; }
.metric-card.accent { color: #fff; background: linear-gradient(145deg, var(--navy-2), #173d70); border-color: transparent; }
.metric-card.accent span, .metric-card.accent small { color: #bed0eb; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 24px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.panel-heading h2 { margin: 0 0 3px; font-size: 1.25rem; }
.panel-heading p { margin: 0; color: var(--muted); }
.panel-heading a { color: var(--blue); font-weight: 700; text-decoration: none; }
.meeting-row { display: grid; grid-template-columns: 74px minmax(0,1fr) auto auto; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid #e8edf4; }
.meeting-row time { font-weight: 800; text-transform: uppercase; font-size: .85rem; }
.meeting-row time small { display: block; color: var(--muted); font-weight: 500; text-transform: none; }
.meeting-row h3 { margin: 0 0 3px; font-size: 1rem; }
.meeting-row p { margin: 0; color: var(--muted); }
.pill { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; background: #e9eef6; color: #3c4b64; padding: 5px 9px; font-size: .74rem; font-weight: 800; letter-spacing: .02em; }
.pill.sales_prospect, .state-approved { background: #dce8ff; color: #2456b4; }
.pill.partner { background: #d9f1ed; color: #087262; }
.pill.vendor { background: #f8e8ce; color: #965a02; }
.pill.investor { background: #ebe0fb; color: #6c35a5; }
.state-synced { background: #d9f1df; color: #24703a; }
.state-conflict { background: #f7dada; color: #9e2929; }
.state-error, .state-applying { background: #f7dada; color: #9e2929; }
.success-box, .error-box, .warning-box { border-radius: 12px; padding: 13px 15px; margin-bottom: 18px; }
.success-box { background: #e1f4e7; color: #23663a; }
.error-box { background: #fae1e1; color: #8c2626; }
.warning-box { background: #fff2d8; color: #7e4c08; }
.filter-row { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.filter { padding: 7px 11px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .88rem; }
.filter.active { background: var(--navy); color: #fff; }
.review-list, .approval-list { display: grid; gap: 14px; }
.review-card, .approval-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: 0 8px 28px rgba(23,40,72,.05); }
.review-card { display: grid; grid-template-columns: minmax(230px,.8fr) minmax(440px,1.5fr); gap: 24px; }
.review-context time, .review-context small { color: var(--muted); font-size: .82rem; }
.review-context .email-evidence { display: block; margin-top: 8px; color: var(--teal); font-weight: 750; }
.review-context h2 { font-size: 1.1rem; margin: 6px 0; }
.review-context p { margin: 0 0 8px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { color: #3f4e66; font-size: .83rem; font-weight: 750; }
input, select, textarea { width: 100%; margin-top: 5px; color: var(--ink); background: #fff; border: 1px solid #cfd8e6; border-radius: 9px; padding: 10px 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,99,235,.12); }
textarea { resize: vertical; }
.check-label { display: flex; align-items: center; gap: 8px; align-self: end; min-height: 42px; }
.check-label input { width: 18px; height: 18px; margin: 0; }
.crm-links { grid-column: 1 / -1; color: var(--muted); }
.crm-links[open] { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.crm-links summary { grid-column: 1/-1; cursor: pointer; font-weight: 700; }
.review-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.voice-layout { display: grid; grid-template-columns: minmax(320px,.8fr) minmax(420px,1.2fr); gap: 20px; align-items: start; }
.voice-recorder { display: grid; gap: 16px; }
.record-box { display: grid; place-items: center; text-align: center; min-height: 180px; border: 1px dashed #b8c5d8; border-radius: 14px; background: #f8fafd; }
.record-button { display: grid; place-items: center; gap: 10px; color: var(--red); background: transparent; border: 0; cursor: pointer; }
.record-button span { width: 54px; height: 54px; background: var(--red); border: 7px solid #fde7e7; border-radius: 50%; }
.record-button[aria-pressed="true"] span { border-radius: 14px; animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px rgba(185,56,56,.09); } }
.record-box p { color: var(--muted); margin: 0; }
.record-box audio { width: min(100%, 340px); }
.record-timer { color: var(--ink); font-size: 1.25rem; font-variant-numeric: tabular-nums; font-weight: 800; }
.note-list article { padding: 16px 0; border-top: 1px solid #e8edf4; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; }
.note-list strong, .note-list small { display: block; }
.note-list small { color: var(--muted); }
.note-list article > p { grid-column: 1/-1; margin: 0; color: #46546b; }
.next-step { background: #edf5ff; border-radius: 9px; padding: 10px !important; }
.approval-title { display: flex; gap: 12px; align-items: center; }
.approval-check { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; }
.batch-bar { position: sticky; top: 14px; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 16px; padding: 14px 16px; border: 1px solid #cbd8ea; border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.batch-bar small { display: block; color: var(--muted); }
.error-text { color: var(--red); font-weight: 700; }
.approval-title h2 { margin: 0; font-size: 1.08rem; }
.approval-title p { margin: 2px 0 0; color: var(--muted); }
.change-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.change-grid div { padding: 13px 15px; }
.change-grid div + div { background: #f2f7ff; border-left: 1px solid var(--line); }
.change-grid small { color: var(--muted); font-weight: 700; }
.change-grid p { margin: 5px 0 0; }
.rationale { color: var(--muted); }
.table-panel { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
code { font-size: .78rem; color: #46546b; }
.empty-state { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--ink); margin: 0 0 4px; }
.empty-state p { margin: 0; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, #1d467d 0, var(--navy) 38%, #071124 100%); }
.login-card { width: min(520px, 100%); padding: 42px; border-radius: 22px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.login-card h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; letter-spacing: -.045em; margin: 18px 0; }
.login-card > p:not(.eyebrow) { color: var(--muted); }
.login-card .button { margin-top: 20px; }
.privacy-note { font-size: .83rem; text-align: center; }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 16px 20px; flex-direction: row; align-items: center; overflow-x: auto; }
  .sidebar nav { display: flex; margin: 0 20px; }
  .sidebar-user { margin: 0 0 0 auto; border: 0; padding: 0; min-width: 190px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .review-card, .voice-layout { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  body { font-size: 16px; }
  .app-shell { display: block; min-height: calc(100vh - 64px); }
  .sidebar { display: none; }
  .mobile-topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 10px 14px; color: #fff; background: var(--navy); box-shadow: 0 8px 24px rgba(7,17,36,.16); }
  .mobile-topbar .brand { font-size: .9rem; }
  .mobile-topbar .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .mobile-account { position: relative; }
  .mobile-account summary { list-style: none; cursor: pointer; }
  .mobile-account summary::-webkit-details-marker { display: none; }
  .mobile-account > div { position: absolute; right: 0; top: 48px; width: min(280px, calc(100vw - 28px)); padding: 14px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
  .mobile-account small { display: block; color: var(--muted); }
  .mobile-account .link-button { min-height: 44px; color: var(--red); font-weight: 750; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); min-height: 72px; padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: rgba(255,255,255,.98); border-top: 1px solid var(--line); box-shadow: 0 -8px 28px rgba(20,38,70,.10); backdrop-filter: blur(14px); }
  .mobile-nav a { display: grid; place-items: center; align-content: center; min-width: 0; min-height: 52px; color: var(--muted); text-decoration: none; font-size: .70rem; font-weight: 760; }
  .mobile-nav a::before { content: ""; width: 7px; height: 7px; margin-bottom: 6px; border: 2px solid currentColor; border-radius: 50%; }
  .mobile-nav a.active { color: var(--blue); }
  .mobile-nav .record-nav { position: relative; color: var(--red); }
  .mobile-nav .record-nav::before { display: none; }
  .mobile-nav .record-nav b { width: 34px; height: 34px; margin-top: -22px; margin-bottom: 3px; background: var(--red); border: 6px solid #fff; border-radius: 50%; box-shadow: 0 5px 16px rgba(185,56,56,.28); }
  .main { padding: 24px 14px calc(104px + env(safe-area-inset-bottom)); }
  .page-header { align-items: flex-start; flex-direction: column; }
  .page-header h1 { font-size: 2.2rem; }
  .header-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .header-actions .button, .header-actions form, .header-actions form .button { width: 100%; }
  .metric-grid, .form-grid, .change-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 112px; padding: 17px; }
  .metric-card strong { font-size: 2.2rem; }
  .change-grid div + div { border-left: 0; border-top: 1px solid var(--line); }
  .meeting-row { grid-template-columns: 58px minmax(0,1fr); gap: 12px; }
  .meeting-row .pill, .meeting-row .button { grid-column: 2; }
  .meeting-row .button { width: 100%; min-height: 48px; }
  .review-card { padding: 16px; }
  .crm-links[open] { grid-template-columns: 1fr; }
  .voice-layout { grid-template-columns: 1fr; }
  .voice-recorder { padding: 18px 14px; }
  .voice-recorder select, .voice-recorder input, .voice-recorder textarea { min-height: 48px; font-size: 16px; }
  .record-box { min-height: 230px; padding: 20px 12px; }
  .record-button { min-width: 170px; min-height: 132px; }
  .record-button span { width: 76px; height: 76px; border-width: 9px; }
  .voice-recorder .button.wide { position: sticky; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 5; min-height: 54px; box-shadow: 0 10px 25px rgba(36,99,235,.24); }
  .review-actions { justify-content: stretch; flex-direction: column; }
  .review-actions form, .review-actions .button { width: 100%; }
  .review-actions .button { min-height: 48px; }
  .approval-card { padding: 16px; }
  .approval-title { align-items: flex-start; flex-wrap: wrap; }
  .batch-bar { top: 72px; align-items: stretch; flex-direction: column; }
  .batch-bar .button { min-height: 52px; }
  .panel { padding: 18px 14px; }
}
