/* Screen layouts — top bar, sidebar, and each of the 16 screens. */

/* ── Top bar ───────────────────────────────────────────────────────────── */
.topbar { height: var(--topbar-h); flex: none; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 22px; gap: 18px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; width: 210px; }
.topbar .brand .logo-badge { width: 30px; height: 30px; border-radius: 9px; }
.topbar .brand .logo-badge .core { width: 10px; height: 10px; }
.topbar .brand .name { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.topbar .search { flex: 1; max-width: 440px; }
.topbar .user-meta { text-align: right; line-height: 1.2; }
.topbar .user-meta .nm { font-size: 13px; font-weight: 700; }
.topbar .user-meta .sub { font-size: 11.5px; color: var(--muted); }

.body-row { flex: 1; min-height: 0; display: flex; }

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar { width: var(--sidebar-w); flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 14px; }
.sidebar .nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; min-height: 0; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px;
  font-size: 14px; font-weight: 600; cursor: pointer; color: var(--text-3); background: transparent; transition: all .14s; }
.nav-item:hover { background: var(--bg); }
.nav-item.active { color: #fff; background: var(--accent); font-weight: 700; }
.nav-item .lbl { flex: 1; }
.nav-badge { background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; min-width: 20px; height: 20px;
  padding: 0 6px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.nav-item.active .nav-badge { background: var(--on-accent); color: var(--accent); }
.side-note { border-radius: 13px; padding: 14px; flex: none; }
.side-note.user { background: var(--purple-100); }
.side-note.admin { background: var(--outlook-bg); }
.side-note .t { font-size: 12.5px; font-weight: 800; margin-bottom: 4px; }
.side-note.user .t { color: var(--heading-dark); }
.side-note.admin .t { color: var(--outlook); }
.side-note .d { font-size: 11.5px; line-height: 1.5; }
.side-note.user .d { color: var(--text-2); }
.side-note.admin .d { color: var(--text-2); }

.main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.screen-scroll { flex: 1; overflow-y: auto; padding: 30px 38px 48px; }
.screen-inner { animation: ottoFade .25s ease both; }

/* ── Inbox (3 columns) ─────────────────────────────────────────────────── */
.inbox-cols { flex: 1; min-height: 0; display: flex; }
.cat-rail { width: var(--rail-w); flex: none; border-right: 1px solid var(--border); background: var(--surface);
  overflow-y: auto; padding: 18px 14px; }
.rail-head { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--muted-2); text-transform: uppercase; padding: 0 8px 10px; }
.rail-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--text-3); }
.rail-item:hover { background: var(--bg); }
.rail-item.active { color: var(--heading-dark); background: var(--purple-150); font-weight: 700; }
.rail-item .nm { flex: 1; }
.rail-item .ct { font-size: 11.5px; font-weight: 700; color: var(--muted-2); flex: none; }
.rail-item.active .ct { color: var(--accent); }
.rail-item .dot-r { width: 9px; height: 9px; border-radius: 50%; flex: none; }

.msg-list { width: var(--list-w); flex: none; border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto; }
.msg-list-head { position: sticky; top: 0; background: var(--surface); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--divider-2); padding: 16px 20px 13px; z-index: 1; }
.msg-list-head .t { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.msg-list-head .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.msg-row { padding: 14px 18px; border-bottom: 1px solid var(--divider); cursor: pointer;
  border-left: 3px solid transparent; display: block; }
.msg-row:hover { background: var(--purple-50); }
.msg-row.active { background: var(--purple-tint); border-left-color: var(--accent); }
.msg-row .sender { font-size: 14px; font-weight: 700; color: var(--text); }
.msg-row.unread .sender { font-weight: 800; }
.msg-row .subj { font-size: 13px; font-weight: 600; color: var(--body-text-2); margin: 2px 0 1px; }
.msg-row.unread .subj { font-weight: 700; }
.msg-row .snip { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.msg-row .time { font-size: 11.5px; color: var(--muted-2); flex: none; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 4px; }

.reading { flex: 1; min-width: 0; overflow-y: auto; background: var(--bg); }
.reading-inner { padding: 26px 30px 40px; max-width: 760px; }
.mail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.move-chip { font-size: 11.5px; font-weight: 700; border: 1px solid var(--border-purple-2); background: var(--surface);
  padding: 3px 9px; border-radius: var(--r-tag); cursor: pointer; }
.move-chip:hover { background: var(--purple-100); }
.mail-subject { font-size: 23px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; margin-bottom: 16px; }
.mail-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 22px 24px; }
.mail-body { white-space: pre-wrap; font-size: 14.5px; line-height: 1.65; color: var(--body-text-3); }
.action-row { display: flex; gap: 10px; margin-top: 16px; }

.empty-state { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #B6B6C2; padding: 40px; text-align: center; }
.empty-state .glyph { width: 56px; height: 56px; border-radius: 16px; background: var(--purple-200);
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.empty-state .glyph .core { width: 16px; height: 16px; border-radius: 50%; background: #C9BEF4; }

/* ── Draft panel ───────────────────────────────────────────────────────── */
.draft-panel { margin-top: 22px; background: var(--surface); border: 1.5px solid var(--border-purple); border-radius: var(--r-card);
  overflow: hidden; box-shadow: var(--shadow-draft); }
.draft-head { display: flex; align-items: center; gap: 10px; padding: 14px 20px;
  background: linear-gradient(90deg, var(--purple-tint), var(--purple-50)); border-bottom: 1px solid var(--purple-200); }
.draft-head .icon { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.draft-head .icon .core { width: 8px; height: 8px; border-radius: 50%; background: var(--on-accent); }
.draft-head .t { font-size: 14px; font-weight: 800; letter-spacing: -.01em; color: var(--heading-dark); }
.draft-head .s { font-size: 11.5px; color: #8A82A0; }
.draft-body { padding: 16px 20px 18px; }
.draft-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.draft-note { font-size: 11.5px; color: var(--muted-2); }
.draft-sent { padding: 26px 20px; text-align: center; }
.draft-sent .ring { width: 46px; height: 46px; border-radius: 50%; background: var(--success-bg);
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; color: var(--success); font-size: 22px; font-weight: 800; }
.no-draft { margin-top: 22px; background: var(--surface); border: 1px dashed var(--border); border-radius: 14px; padding: 18px 20px;
  display: flex; align-items: center; gap: 12px; }

/* ── Briefing ──────────────────────────────────────────────────────────── */
.greet-date { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.greet-h { font-size: 30px; font-weight: 800; letter-spacing: -.025em; margin: 4px 0; }
.greet-sub { font-size: 15px; color: var(--text-2); line-height: 1.5; margin-bottom: 26px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 15px; padding: 18px 18px 16px; }
.stat-card .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.stat-card .l { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.brief-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.wait-row { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 11px; cursor: pointer; }
.wait-row:hover { background: var(--purple-50); }
.otto-today { background: linear-gradient(160deg, #6C4CE6, #8B5CF0); border-radius: var(--r-card); padding: 22px; color: #fff; }

/* ── Tasks ─────────────────────────────────────────────────────────────── */
.task-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 15px 18px;
  display: flex; align-items: flex-start; gap: 14px; }
.task-title { font-size: 14.5px; font-weight: 700; color: var(--text); }
.task-title.done { color: var(--muted-3); text-decoration: line-through; }
.due { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-tag); color: var(--text-2); background: var(--divider); }
.due.urgent { color: var(--danger); background: var(--danger-bg); }

/* ── Categories ────────────────────────────────────────────────────────── */
.cat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.cat-card .hd { display: flex; align-items: center; gap: 11px; }
.cat-card .nm { font-size: 15px; font-weight: 800; flex: 1; }
.cat-ai { font-size: 13px; color: var(--text-2); line-height: 1.5; margin-top: 10px; padding-left: 23px; }
.cat-ai .lab { color: var(--muted-2); font-weight: 700; }
.subcat { display: flex; gap: 9px; align-items: flex-start; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--divider-2); border-radius: 10px; }
.subcat .nm { font-size: 13px; font-weight: 700; color: var(--heading-dark); }
.subcat .ai { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 1px; }

/* ── Integrations ──────────────────────────────────────────────────────── */
.integ-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.integ-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; gap: 14px; align-items: flex-start; }
.integ-icon { width: 40px; height: 40px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 14px; }
.integ-btn { height: 34px; padding: 0 14px; border-radius: 9px; font-size: 12.5px; font-weight: 700; cursor: pointer; flex: none; border: none; }
.integ-btn.on { border: 1px solid var(--success-border); background: var(--success-bg); color: var(--success-text); }
.integ-btn.off { background: var(--accent); color: #fff; }

/* ── Settings ──────────────────────────────────────────────────────────── */
.settings-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 17px 20px; border-bottom: 1px solid var(--divider); }
.set-row:last-child { border-bottom: none; }
.set-row .lbl { font-size: 14.5px; font-weight: 700; }
.set-row .desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; }
.locked-note { margin-top: 16px; background: var(--purple-100); border: 1px solid var(--border-purple); border-radius: 14px;
  padding: 16px 18px; display: flex; gap: 12px; align-items: flex-start; }

/* ── Page headers ──────────────────────────────────────────────────────── */
.page-h { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.page-sub { font-size: 14px; color: var(--text-2); margin: 4px 0 24px; }
.page-head-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }

/* ── Outlook view ──────────────────────────────────────────────────────── */
.ol-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--surface-3); }
.ol-banner { flex: none; background: var(--outlook-bg); border-bottom: 1px solid var(--outlook-border); padding: 11px 18px; display: flex; align-items: center; gap: 10px; }
.ol-banner .ico { width: 22px; height: 22px; border-radius: 6px; background: var(--outlook); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 12px; }
.ol-banner .tx { font-size: 13px; color: #2A4A6B; line-height: 1.4; }
.ol-cols { flex: 1; min-height: 0; display: flex; }
.ol-folders { width: var(--ol-folders-w); flex: none; background: var(--surface-2); border-right: 1px solid var(--border-2); overflow-y: auto; padding: 14px 10px; }
.ol-folder { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-2); }
.ol-folder.active { color: var(--text); background: var(--outlook-bg-2); font-weight: 700; }
.ol-folder .ct { margin-left: auto; font-size: 11px; font-weight: 700; color: #8A8A98; }
.ol-section { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; color: #9AA4B2; text-transform: uppercase; padding: 16px 8px 7px; }
.ol-list { width: var(--ol-list-w); flex: none; background: var(--surface); border-right: 1px solid var(--border-2); overflow-y: auto; }
.ol-list-head { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 13px 16px; font-size: 14px; font-weight: 800; }
.ol-row { padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; border-left: 3px solid transparent; display: block; }
.ol-row.active { border-left-color: var(--outlook); background: var(--outlook-bg-2); }
.ol-bar { width: 3px; align-self: stretch; border-radius: 2px; flex: none; }
.ol-read { flex: 1; min-width: 0; overflow-y: auto; padding: 22px; }
.ol-addin { margin-top: 16px; background: var(--surface); border: 1.5px solid var(--outlook-border); border-radius: 12px; overflow: hidden; }
.ol-addin-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: var(--outlook-bg-2); border-bottom: 1px solid var(--outlook-border); }

/* ── Admin tables / matrix ─────────────────────────────────────────────── */
.table { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.table .thead, .table .trow { display: grid; gap: 12px; padding: 13px 18px; align-items: center; }
.table .thead { background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.table .trow { border-bottom: 1px solid var(--divider); }
.table .trow:last-child { border-bottom: none; }
.users-grid { grid-template-columns: 2.4fr 1.4fr .9fr 1fr .9fr; }
.matrix-grid { grid-template-columns: 1.7fr repeat(5, 1fr); gap: 8px; }
.role-select { width: 100%; height: 34px; border: 1px solid var(--border-purple-2); border-radius: 8px; padding: 0 8px; font-size: 12.5px; font-weight: 600; color: var(--heading-dark); background: var(--surface); outline: none; cursor: pointer; }
.status-pill { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-tag); }
.sys-row { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--divider); }
.sys-row:last-child { border-bottom: none; }
.audit-row { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--divider); }
.audit-row:last-child { border-bottom: none; }
.scope-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--divider); }
.model-card { border: 2px solid var(--border); background: var(--surface); border-radius: 13px; padding: 16px; cursor: pointer; }
.model-card.sel { border-color: var(--accent); background: var(--purple-50); }
.bill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.bill-card-grad { background: linear-gradient(160deg, #6C4CE6, #8B5CF0); border-radius: var(--r-card); padding: 22px; color: #fff; }
.progress { height: 7px; border-radius: 5px; overflow: hidden; }
.progress > div { height: 100%; border-radius: 5px; }
.invoice-row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--divider); }
.invoice-row:last-child { border-bottom: none; }

/* ── Marketing + auth ──────────────────────────────────────────────────── */
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 120% at 80% -10%, var(--purple-100) 0%, var(--bg) 46%); padding: 32px; min-height: 100vh; }
.auth-card { width: 460px; max-width: 100%; animation: ottoFade .5s ease both; }
.auth-box { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 34px 32px; box-shadow: var(--shadow-card); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 30px; }
.auth-brand .logo-badge { width: 36px; height: 36px; }
.auth-brand .logo-badge .core { width: 12px; height: 12px; }
.auth-brand .name { font-size: 23px; font-weight: 800; letter-spacing: -.02em; }
.provider-row { display: flex; align-items: center; gap: 13px; padding: 15px 16px; border: 1.5px solid var(--border); border-radius: 13px; cursor: pointer; transition: all .15s; background: var(--surface); width: 100%; text-align: left; }
.provider-row:hover { border-color: var(--accent); background: var(--purple-50); }
.provider-tag { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 15px; }
.principle { display: flex; gap: 8px; align-items: flex-start; background: var(--purple-100); border-radius: 11px; padding: 12px 14px; }
.scan-ring { width: 52px; height: 52px; border-radius: 50%; border: 4px solid var(--purple-200); border-top-color: var(--accent); animation: ottoSpin 1s linear infinite; margin-bottom: 22px; }
.scan-bar { height: 8px; border-radius: 6px; background: var(--purple-200); overflow: hidden; }
.scan-bar > div { height: 100%; border-radius: 6px; background: var(--accent); transition: width .12s linear; }
.divider-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 12px; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sso-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 46px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); font-size: 14px; font-weight: 700; cursor: pointer; color: var(--text); }
.sso-btn:hover { background: var(--bg); }

/* Landing */
.landing { min-height: 100vh; background: radial-gradient(130% 120% at 85% -10%, var(--purple-100) 0%, var(--bg) 50%); }
.landing-nav { display: flex; align-items: center; padding: 22px 40px; max-width: 1120px; margin: 0 auto; }
.landing-hero { max-width: 1120px; margin: 0 auto; padding: 40px 40px 80px; }
.hero-h { font-size: 54px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; max-width: 760px; }
.hero-sub { font-size: 19px; color: var(--text-2); line-height: 1.55; max-width: 600px; margin: 22px 0 30px; }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 64px; }
.feat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 24px; }
.feat-ico { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 14px; }
.btn-xl { height: 52px; padding: 0 26px; font-size: 16px; border-radius: 13px; }

@media (max-width: 900px) {
  .hero-h { font-size: 38px; }
  .feat-grid, .integ-grid, .bill-grid, .brief-grid, .stat-grid { grid-template-columns: 1fr; }
}
