/* Approved partner portal redesign.
   This layer deliberately sits after the legacy Aurora styles: it unifies the
   typography, spacing and scroll behaviour of every migrated V2 workspace. */
:root {
  --approved-content: 1680px;
  --approved-page-gap: 20px;
  --approved-card-radius: 14px;
  --approved-control-radius: 10px;
  --approved-body: 14px;
  --approved-small: 12.5px;
}

body {
  font-size: var(--approved-body);
  line-height: 1.45;
  background: rgb(var(--m-bg));
}

#app { grid-template-columns: 252px minmax(0, 1fr); }
#nav .nav-brand { height: 64px; padding-inline: 18px; }
#nav .nav-brand .t { font-size: 15px; }
#nav .nav-brand .s { font-size: 12px; }
#nav .nav-items { padding: 12px; }
#nav .nav-note { padding: 18px 10px 7px; font-size: 11px; }
#nav a { height: 40px; padding-inline: 10px; font-size: 14px; border-radius: 10px; }
#nav a .count { font-size: 12px; }
#nav .nav-user { padding: 14px 16px; }
#nav .nav-user .t { font-size: 14px; }
#nav .nav-user .s { font-size: 12px; }

#topbar { height: 64px; padding-inline: 24px; }
#topbar .crumbs { font-size: 14px; }
#topbar .who, .role-badge { font-size: 12px; }
#screen { padding: 26px clamp(20px, 2.2vw, 38px); }

.page-head { align-items: flex-start; margin-bottom: 20px; }
.page-head h1,
.iv-head h1,
.cl-head h1,
.fnv-head h1,
.st-title,
.cr-head h1,
.kn-head h1 { font-size: 28px !important; line-height: 1.15 !important; letter-spacing: -.025em !important; }
.page-head .sub,
.iv-head p,
.cl-sub,
.fnv-head .sub,
.st-sub,
.cr-sub,
.kn-sub { font-size: 14px !important; line-height: 1.55 !important; color: rgb(var(--m-text2)) !important; }

.card,
.tile,
.iv-col,
.iv-kpis,
.cl-kpis,
.cl-panel,
.fn-kpi,
.fn-toolbar,
.pj-panel,
.pj-project,
.cr-panel,
.tm-panel,
.kn-panel,
.lv-hero {
  border-radius: var(--approved-card-radius) !important;
  border-color: rgb(var(--m-border-strong)) !important;
  box-shadow: 0 1px 2px rgb(15 23 42 / .03), 0 8px 24px rgb(15 23 42 / .035) !important;
}

.btn { min-height: 38px; padding-inline: 14px; font-size: 14px; border-radius: var(--approved-control-radius); }
.btn.sm { min-height: 34px; padding-inline: 12px; font-size: 12.5px; }
.chip { font-size: 12px; padding: 3px 9px; }
.field label { font-size: 12px; }
.field input, .field select, .field textarea { font-size: 14px; min-height: 40px; }

table.data,
.cl-table,
.pj-table,
.ld-table { font-size: 14px !important; }
table.data th,
.cl-table th,
.pj-table th,
.ld-table th { font-size: 11.5px !important; padding: 11px 14px !important; }
table.data td,
.cl-table td,
.pj-table td,
.ld-table td { padding: 12px 14px !important; }

/* Use the available desktop canvas. The old 900/1120px caps made the portal
   look like a narrow admin panel and caused the tiny typography complaints. */
.pj-wrap,
.cr-wrap,
.tm-wrap,
.rp-wrap,
.kn-wrap,
.lv-wrap,
.clv,
.fnv,
.iv,
.stv,
.vc,
.mlv,
.td-wrap,
.pr-wrap,
.dl,
.cc-shell,
.cw { width: 100% !important; max-width: var(--approved-content) !important; margin-inline: auto !important; }

/* Production screens use the full application canvas. The navigation already
   gives the page its left edge; a second centred max-width made everything
   look miniature on partner desktop displays. */
.pj-wrap,
.cr-wrap,
.tm-wrap,
.rp-wrap,
.kn-wrap,
.lv-wrap,
.clv,
.fnv,
.iv,
.stv,
.vc,
.mlv,
.td-wrap,
.pr-wrap,
.dl,
.cc-shell,
.cw { max-width: none !important; margin-inline: 0 !important; }

.cc-shell { min-width: 0; }
.cc-shell > .card { width: 100%; max-width: none; }
.cc-shell .cc-name { font-size: 19px !important; line-height: 1.2 !important; }
.cc-shell .cc-sub,
.cc-shell .cc-primary-contact { font-size: 13px !important; }
.cc-shell .cc-primary-tabs button { min-height: 42px; font-size: 13.5px !important; }
.cc-shell .cc-sec-t { font-size: 14px !important; }
.cc-shell .cc-sec,
.cc-shell .cc-blk { font-size: 13.5px !important; line-height: 1.5 !important; }

/* Inbox: three independently scrollable working columns. */
.iv-kpi .v { font-size: 24px !important; }
.iv-kpi .l { font-size: 12.5px !important; }
.iv-ws { grid-template-columns: minmax(290px, 330px) minmax(480px, 1fr) minmax(300px, 340px) !important; height: calc(100vh - 278px) !important; min-height: 560px !important; }
.iv-col { min-height: 0 !important; overflow: hidden !important; }
.iv-rows, .iv-msgs, .iv-contact-scroll { min-height: 0; overflow: auto !important; }
.iv-search input, .iv-input { font-size: 14px !important; }
.iv-rc .nm b, .iv-msg, .iv-summary li { font-size: 13.5px !important; }
.iv-rc .prev, .iv-ct-facts dd, .iv-ct-facts dt, .iv-ct-quick button { font-size: 12.5px !important; }

/* Clients and leads: readable operational tables, sticky headers. */
.cl-search { width: min(380px, 42vw) !important; height: 40px !important; }
.cl-search input { font-size: 14px !important; }
.cl-kpi-v { font-size: 26px !important; }
.cl-kpi-l { font-size: 13px !important; }
.cl-kpi-s, .cl-cli-sub, .cl-dot { font-size: 12px !important; }
.cl-panel-body, .ld-table-wrap { overflow: auto !important; }
.cl-table thead, .ld-table thead { position: sticky; top: 0; z-index: 2; background: rgb(var(--m-surface)); }

/* Funnel and campaigns: horizontal canvas must scroll instead of squeezing. */
.fn-kpis { grid-template-columns: repeat(5, minmax(190px, 1fr)) !important; overflow-x: auto; }
.fnv .fn-v, .pj-mv { font-size: 26px !important; }
.fnv .fn-k, .pj-mk { font-size: 12px !important; }
.fnv .fn-s, .pj-ms { font-size: 12px !important; }
.fnv .kanban, .pjv .kanban { grid-auto-columns: minmax(270px, 1fr) !important; padding-bottom: 10px; }
.fnv .fn-name, .pjv .kanban .kcard .name { font-size: 14px !important; }
.fnv .fn-meta, .pjv .kanban .kcard .meta { font-size: 12px !important; }

/* Settings keep their journey tabs visible and scrollable, not wrapped into a
   second navigation system. */
.stv .st-tabs { position: sticky; top: -26px; z-index: 7; padding: 8px 0 10px; background: rgb(var(--m-bg)); }
.stv .st-tabs .seg { gap: 6px !important; }
.stv .st-tabs button { min-height: 38px; padding-inline: 14px; font-size: 13px !important; }
.stv .card-head .t { font-size: 15px; }
.stv .hint, .stv .sub, .stv .set-check { font-size: 12.5px !important; }

/* Calling workplace: all three panes own their scroll; the script remains
   centered but no longer wastes half of the screen. */
.cw { height: calc(100vh - 116px) !important; overflow: hidden !important; }
.cw-body { min-height: 0 !important; overflow: hidden !important; grid-template-columns: minmax(300px, 350px) minmax(640px, 1fr) minmax(330px, 390px) !important; }
.cw-col { min-height: 0 !important; overflow: hidden !important; }
.cw-scroll { min-height: 0 !important; overflow: auto !important; }
.cw-card, .cw-note, .cw-notes { max-width: 1100px !important; }
.cw-cli-main h1 { font-size: 20px !important; }
.cw-colhead h2 { font-size: 15px !important; }
.cw-qmain b, .cw-note-item, .cw-card, .cw-goal { font-size: 15px !important; }
.cw-quote { font-size: 15px !important; line-height: 1.55 !important; }
.cw-step, .cw-line, .cw-qmain .ph, .cw-cli-main p, .cw-nextstep p { font-size: 13px !important; }

/* Reports and secondary workspaces follow the same canvas and readable scale. */
.cr-metric .v, .tm-mv, .lv-hero .num { font-size: 26px !important; }
.cr-table, .tm-table { font-size: 14px !important; }
.kn-input { min-height: 44px !important; font-size: 14px !important; }
.kn-answer-body, .kb-src-txt { font-size: 13.5px !important; line-height: 1.55 !important; }
.ml-app { height: calc(100vh - 224px) !important; min-height: 560px !important; grid-template-columns: 210px minmax(320px, 380px) minmax(520px, 1fr) !important; }
.ml-list, .ml-read-scroll, .ml-folders { min-height: 0; overflow: auto !important; }

@media (max-width: 1280px) {
  #app { grid-template-columns: 236px minmax(0, 1fr); }
  .iv-ws { grid-template-columns: 280px minmax(440px, 1fr) !important; }
  .iv-contact { display: none !important; }
  .cw-body { grid-template-columns: 280px minmax(500px, 1fr) !important; }
  .cw-client { display: none !important; }
}

@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; }
  #screen { padding: 18px 14px; }
  .page-head h1, .iv-head h1, .cl-head h1, .fnv-head h1, .st-title, .cr-head h1, .kn-head h1 { font-size: 24px !important; }
  .iv-ws, .cw-body, .ml-app { display: block !important; height: auto !important; min-height: 0 !important; overflow: visible !important; }
  .iv-col, .cw-col, .ml-app > * { min-height: 420px; margin-bottom: 14px; }
}
