@font-face { font-family: "Raleway"; src: url("/brand/raleway.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/brand/barlow-condensed-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #f5f4f8;
  --surface: #ffffff;
  --surface-2: #eeebf8;
  --ink: #141318;
  --muted: #6e6c75;
  --line: #dcd9e3;
  --sidebar: #100078;
  --sidebar-2: #291699;
  --green: #247a52;
  --green-soft: #e5f4ec;
  --amber: #a96919;
  --amber-soft: #fff2d8;
  --blue: #3369a8;
  --blue-soft: #e9f2fd;
  --red: #b84444;
  --red-soft: #fdeaea;
  --purple: #7251a3;
  --purple-soft: #f0eafd;
  --shadow: 0 18px 55px rgba(20, 19, 24, 0.14);
  --radius: 12px;
  --brand: #1800ad;
  --brand-deep: #100078;
  --brand-soft: #eeebff;
  --brand-light: #c9c0ff;
}

[hidden] { display: none !important; }
.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--surface); }
.login-story { background: var(--brand); color: #fff; padding: clamp(40px, 7vw, 120px); display: flex; flex-direction: column; justify-content: center; }
.login-brand { display: flex; align-items: center; gap: 20px; margin-bottom: 60px; }
.login-brand .brand-logo { width: 38px; height: auto; }
.login-brand > span { font-size: 14px; font-weight: 600; letter-spacing: .16em; line-height: 1.5; }
.login-story .eyebrow { color: #ded9ff; font-size: 12px; letter-spacing: 2px; }
.login-story h1 { font-size: clamp(48px, 5.4vw, 82px); line-height: .98; letter-spacing: -.015em; text-transform: uppercase; margin: 20px 0; }
.login-story p { color: #ded9ff; line-height: 1.8; }
.login-detail { margin-top: 70px; font-size: 12px; letter-spacing: 2px; color: #ded9ff; }
.login-detail span { padding: 0 18px; }
.login-card { margin: auto; width: min(420px, 85%); display: grid; gap: 20px; padding: 48px 0; }
.login-card h2 { font-size: 36px; margin: 0; letter-spacing: -1px; }
.login-card p { color: var(--muted); margin: 0; }
.login-card .field-error { color: #a63131; }
.login-card small { color: var(--muted); line-height: 1.7; }
.login-card button { min-height: 48px; }
.sync-state { border: 0; background: transparent; cursor: pointer; }
.view-options { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 15px; }
.view-options label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.view-options select { background: #fff; border: 1px solid var(--line); padding: 8px 10px; border-radius: 8px; font-size: 12px; color: var(--ink); }
.data-table .company-cell { position: sticky; left: 0; z-index: 1; box-shadow: 1px 0 var(--line); }
.color-legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 12px 0 22px; color: var(--muted); font-size: 12px; }
.color-legend span { display: inline-flex; align-items: center; gap: 6px; }
.color-legend i { width: 7px; height: 7px; border-radius: 50%; }
.data-table tbody tr { border-left: 6px solid var(--record-color, transparent); }
.data-table tbody td.company-cell { background: color-mix(in srgb, var(--record-color) 28%, white); }
.data-table tbody td.company-cell .company-title { color: color-mix(in srgb, var(--record-color) 76%, #111); }
.data-table tbody .inline-select { border-color: color-mix(in srgb, var(--record-color) 68%, var(--line)); }
.text-button { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.text-button.company-title { font-weight: 650; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.drawer-company, .drawer-company>div:last-child { min-width: 0; }
.drawer-company h2, .drawer-company .company-meta { overflow-wrap: anywhere; }
.drawer-header-actions { flex-shrink: 0; }
.notice, .migration-banner { padding: 14px 18px; background: var(--brand-soft); border: 1px solid #dcd6ff; border-radius: 10px; color: var(--brand-deep); font-size: 12px; line-height: 1.6; margin-bottom: 20px; }
.migration-banner { margin: 18px 32px 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.due-label { font-size: 12px; font-weight: 600; color: var(--muted); display: inline-block; }
.due-label.late { color: #b14a3c; background: #fff0ea; padding: 3px 7px; border-radius: 5px; }
.pipeline-summary { display: flex; align-items: center; gap: 26px; padding: 18px 22px; margin-bottom: 20px; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.pipeline-summary strong { font-size: 23px; color: var(--ink); margin-right: 5px; font-weight: 650; }
.pipeline-summary label { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.board-hint { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 20px 0 12px; gap: 12px; }
.view-root .kanban { display: flex; align-items: flex-start; gap: 16px; overflow-x: auto; padding: 4px 2px 20px; width: 100%; max-width: 100%; scroll-snap-type: x proximity; }
.view-root .kanban-column { min-width: 278px; width: 278px; flex: 0 0 278px; background: #efedf4; border: 1px solid var(--line); border-radius: 14px; padding: 14px 10px 10px; border-top: 3px solid var(--stage-color); scroll-snap-align: start; }
.view-root .kanban-header { padding: 0 3px; display: flex; align-items: center; font-size: 12px; font-weight: 650; }
.kanban-header>span { display: flex; align-items: center; gap: 7px; }
.kanban-header i { width: 7px; height: 7px; border-radius: 50%; background: var(--stage-color); }
.kanban-header b { background: white; padding: 3px 8px; border-radius: 6px; font-size: 12px; color: var(--muted); }
.column-hint { margin: 8px 3px 18px; font-size: 12px; color: var(--muted); }
.view-root .kanban-cards { max-height: calc(100vh - 350px); min-height: 230px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 0 2px 6px; scrollbar-width: thin; }
.view-root .kanban-card { background: white; padding: 15px; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 4px #15271904; cursor: grab; margin: 0; }
.view-root .kanban-card:hover { border-color: #bab1dd; box-shadow: 0 4px 15px #21332408; }
.view-root .kanban-card .company-title { font-size: 13px; line-height: 1.45; word-break: break-word; }
.view-root .kanban-card .company-meta { font-size: 12px; margin-top: 4px; }
.kanban-card .badge { font-size: 12px; padding: 4px 7px; white-space: normal; }
.kanban-card-top { align-items: flex-start; }
.card-tags { display: flex; gap: 5px; flex-wrap: wrap; margin: 14px 0 10px; }
.card-next { font-size: 12px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.card-date { margin: 8px 0 14px; }
.card-owner { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.card-owner .owner-dot { width: 23px; height: 23px; font-size: 12px; }
.card-stage { margin-top: 12px; padding-top: 10px; border-top: 1px solid #efedf4; }
.card-stage select { width: 100%; font-size: 12px; color: var(--muted); padding: 6px; background: var(--bg); border-radius: 5px; }
.column-empty { padding: 38px 12px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.8; border: 1px dashed var(--line); border-radius: 8px; }
.kanban-column.drag-over { outline: 2px dashed var(--brand); outline-offset: -4px; }
.show-more { font-size: 12px; width: 100%; flex-shrink: 0; }
.followup-row { display: grid; grid-template-columns: 1.1fr 1.4fr auto; gap: 24px; align-items: center; padding: 22px; border-bottom: 1px solid var(--line); }
.followup-row>div:first-child { display: grid; justify-items: start; gap: 7px; }
.followup-row>div:last-child { display: flex; gap: 8px; }
.settings-card p { color: var(--muted); line-height: 1.8; font-size: 12px; }
#templates-form>.field { max-width: 600px; margin-bottom: 20px; }
#templates-form textarea { min-height: 240px; }
#templates-form>.button { margin-top: 20px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
@media(max-width: 760px) {
 .company-drawer .drawer-header-top { flex-wrap: wrap; }
 .company-drawer .drawer-company { width: 100%; }
 .company-drawer .drawer-header-actions { width: 100%; justify-content: space-between; }
 .company-drawer .drawer-company .company-meta { font-size: 12px; }
 .login-screen { grid-template-columns: 1fr; }
 .login-story { padding: 36px; }
 .login-brand { margin-bottom: 24px; }
 .login-brand .brand-logo { width: 24px; }
 .login-brand > span { font-size: 12px; }
 .login-story h1 { font-size: 44px; }
 .login-story p, .login-detail { display: none; }
 .login-card { padding: 32px 0; }
 .pipeline-summary { gap: 14px; padding: 14px; }
 .pipeline-summary label { margin-left: 0; }
 .board-hint span:first-child { display: none; }
 .view-root .kanban-cards { max-height: 64vh; }
 .followup-row { grid-template-columns: 1fr; gap: 8px; }
 .migration-banner { margin: 14px; }
 .color-legend { gap: 9px; }
}

* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Raleway", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px 16px;
  display: flex; flex-direction: column; background: var(--sidebar); color: #fff;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 24px; }
.brand-logo { display: block; width: 26px; height: auto; flex-shrink: 0; object-fit: contain; }
.sidebar .brand-logo, .login-brand .brand-logo { filter: brightness(0) invert(1); }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 14px; font-weight: 600; letter-spacing: .09em; }
.brand span { color: var(--brand-light); font-size: 12px; margin-top: 2px; }
.nav-list { display: grid; gap: 4px; }
.nav-item {
  width: 100%; border: 0; background: transparent; color: #ded9ff; border-radius: 9px;
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; text-align: left;
  cursor: pointer; font-weight: 600; transition: .16s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: var(--sidebar-2); box-shadow: inset 3px 0 #c9c0ff; }
.nav-item span { width: 18px; text-align: center; font-size: 17px; font-weight: 400; }
.nav-item b {
  margin-left: auto; min-width: 22px; padding: 2px 6px; text-align: center; border-radius: 10px;
  background: #fff; color: var(--brand-deep); font-size: 12px;
}
.sidebar-footer { margin-top: auto; display: grid; gap: 8px; }
.mailbox-status { display: flex; gap: 8px; align-items: center; padding: 11px 12px; color: var(--brand-light); font-size: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.mailbox-status i, .sync-state i { width: 7px; height: 7px; background: #65c98f; border-radius: 50%; box-shadow: 0 0 0 3px rgba(101,201,143,.12); }

.main-area { min-width: 0; }
.topbar {
  height: 68px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  gap: 18px; padding: 0 28px; background: rgba(255,255,255,.94); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.global-search { width: min(470px, 42vw); position: relative; display: flex; align-items: center; }
.global-search > span { position: absolute; left: 13px; color: var(--muted); font-size: 18px; }
.global-search input {
  width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  padding: 0 52px 0 39px; outline: none;
}
.global-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(24,0,173,.1); background: #fff; }
.global-search kbd { position: absolute; right: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; font-size: 12px; background: #fff; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sync-state { color: var(--muted); font-size: 12px; display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.button {
  min-height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 650; cursor: pointer;
  text-decoration: none; transition: .15s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(22,38,29,.08); }
.button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.button.green { background: var(--green); color: #fff; border-color: var(--green); }
.button.ghost { background: transparent; }
.button.small { min-height: 32px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.avatar { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 800; cursor: pointer; }
.menu-toggle { display: none; }

.view-root { padding: 28px; max-width: 1600px; margin: 0 auto; }
.page-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.eyebrow { display: block; color: var(--brand); text-transform: uppercase; letter-spacing: .11em; font-size: 12px; font-weight: 800; margin-bottom: 5px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 700; margin-bottom: 7px; font-size: 42px; line-height: 1.15; letter-spacing: -.025em; }
h2 { font-family: "Barlow Condensed", "Arial Narrow", sans-serif; font-weight: 700; margin-bottom: 7px; font-size: 30px; letter-spacing: -.015em; }
h3 { margin-bottom: 8px; font-size: 14px; }
.page-header p, .section-heading p { color: var(--muted); margin: 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi-card, .panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.kpi-card { padding: 18px; }
.kpi-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; font-weight: 650; }
.kpi-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-size: 15px; }
.kpi-value { margin-top: 12px; font-size: 29px; font-weight: 760; letter-spacing: -.04em; }
.kpi-note { color: var(--muted); font-size: 12px; margin-top: 3px; }
.kpi-note strong { color: var(--green); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr); gap: 18px; }
.panel { min-width: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 18px 13px; }
.panel-header h3 { margin: 0; font-size: 14px; }
.panel-header a { color: var(--brand); text-decoration: none; font-weight: 700; font-size: 12px; }
.panel-body { padding: 0 18px 18px; }
.channel-bars { display: grid; gap: 15px; padding-top: 5px; }
.bar-row { display: grid; grid-template-columns: 86px 1fr 42px; gap: 12px; align-items: center; font-size: 12px; }
.bar-track { height: 9px; border-radius: 99px; background: #efedf4; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--green); }
.bar-row:nth-child(2) .bar-fill { background: var(--blue); }
.bar-row:nth-child(3) .bar-fill { background: var(--purple); }
.bar-row:nth-child(4) .bar-fill { background: var(--amber); }
.bar-value { text-align: right; font-weight: 750; }

.pipeline-mini { display: grid; gap: 2px; }
.pipeline-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pipeline-row:last-child { border: 0; }
.pipeline-label { display: flex; align-items: center; gap: 9px; }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.pipeline-row:nth-child(2) .stage-dot { background: var(--blue); }
.pipeline-row:nth-child(3) .stage-dot { background: var(--amber); }
.pipeline-row:nth-child(4) .stage-dot { background: var(--purple); }
.pipeline-row:nth-child(5) .stage-dot { background: #888; }
.pipeline-count { font-weight: 750; }

.queue-list { display: grid; }
.queue-item { display: grid; grid-template-columns: 36px minmax(130px, 1fr) minmax(160px, 1.3fr) auto; align-items: center; gap: 13px; padding: 12px 0; border-top: 1px solid var(--line); }
.queue-item:first-child { border-top: 0; }
.company-logo { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); color: var(--brand); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.company-title { font-weight: 720; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-meta { color: var(--muted); font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 4px 8px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 750; white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.dark { background: var(--ink); color: #fff; }

.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select, .field input, .field select, .field textarea, .inline-select {
  min-height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 11px; color: var(--ink); outline: none;
}
.filters input { min-width: 240px; }
.filters input:focus, .filters select:focus, .field input:focus, .field select:focus, .field textarea:focus, .inline-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(24,0,173,.09); }
.filter-count { margin-left: auto; color: var(--muted); font-size: 12px; }

.bulk-toolbar {
  min-height: 50px; display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: 11px; background: #fff;
}
.bulk-toolbar.has-selection { border-color: #c9c0ff; background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(24,0,173,.05); }
.select-page { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-weight: 700; cursor: pointer; }
.select-page input, .check-cell input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.bulk-count { color: var(--muted); white-space: nowrap; padding-right: 2px; }
.bulk-count strong { color: var(--ink); }
.bulk-controls { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.bulk-select {
  min-height: 34px; max-width: 170px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); padding: 0 28px 0 9px;
}
.bulk-select:disabled { color: var(--muted); background: var(--bg); }

.table-wrap { overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; min-width: 1180px; }
.data-table th { position: sticky; top: 0; z-index: 1; background: var(--bg); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .065em; text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 11px 13px; border-bottom: 1px solid #efedf4; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--bg); }
.data-table .check-cell { width: 42px; min-width: 42px; padding-left: 14px; padding-right: 6px; }
.company-cell { min-width: 190px; }
.next-action-cell { min-width: 210px; }
.inline-select { min-height: 32px; max-width: 180px; padding: 0 28px 0 9px; border-radius: 8px; font-size: 12px; }
.row-edit { white-space: nowrap; }
.channel-icons { display: flex; gap: 6px; }
.channel-link { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 800; background: #fff; }
.channel-link:hover { border-color: var(--brand); color: var(--brand); }
.channel-link.disabled { opacity: .28; pointer-events: none; }
.pagination { display: flex; justify-content: space-between; align-items: center; padding: 13px 3px 0; color: var(--muted); font-size: 12px; }
.pagination-actions { display: flex; gap: 7px; }

.kanban { display: grid; grid-template-columns: repeat(6, minmax(245px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 12px; }
.kanban-column { min-height: 530px; background: #efedf4; border-radius: var(--radius); padding: 11px; }
.kanban-column.drag-over { box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-soft); }
.kanban-header { display: flex; justify-content: space-between; align-items: center; padding: 3px 3px 12px; font-weight: 750; }
.kanban-header span:last-child { color: var(--muted); font-size: 12px; font-weight: 700; }
.kanban-cards { display: grid; gap: 9px; }
.kanban-card { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 12px; cursor: grab; box-shadow: 0 2px 5px rgba(29,48,38,.035); }
.kanban-card:active { cursor: grabbing; }
.kanban-card-top { display: flex; justify-content: space-between; gap: 8px; }
.kanban-card .company-title { white-space: normal; }
.kanban-card .company-meta { margin-top: 7px; white-space: normal; }
.kanban-card-footer { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.owner-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--brand); }

.approval-list { display: grid; gap: 10px; }
.approval-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; display: grid; grid-template-columns: minmax(170px, 1fr) 140px minmax(220px, 1.5fr) auto; align-items: center; gap: 16px; }
.approval-actions { display: flex; gap: 7px; }

.campaign-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.campaign-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.campaign-cover { height: 7px; background: var(--green); }
.campaign-card:nth-child(2) .campaign-cover { background: var(--blue); }
.campaign-card:nth-child(3) .campaign-cover { background: var(--purple); }
.campaign-content { padding: 18px; }
.campaign-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px 0; margin: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.campaign-stat strong, .campaign-stat span { display: block; }
.campaign-stat strong { font-size: 17px; }
.campaign-stat span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.template-preview { color: var(--muted); font-size: 12px; line-height: 1.55; min-height: 92px; }

.activity-timeline { max-width: 900px; }
.activity-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.activity-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.activity-row p { color: var(--muted); margin: 4px 0 0; font-size: 12px; }
.activity-time { color: var(--muted); font-size: 12px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.settings-wide { grid-column: 1 / -1; }
.settings-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.team-account { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); padding: 12px 0; }
.team-account small { display: block; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.issued-credentials { background: var(--brand-soft); border: 1px solid var(--brand-light); border-radius: 10px; padding: 14px; margin-top: 14px; }
.issued-credentials pre { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.8; }
.issued-credentials .button { margin-right: 7px; }
.team-period { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.team-table-wrap { overflow-x: auto; padding: 0 18px 18px; }
.team-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 620px; }
.team-table th, .team-table td { padding: 11px 10px; border-top: 1px solid var(--line); text-align: left; }
.team-table th { color: var(--muted); font-weight: 700; }
.team-table small { display: block; color: var(--muted); margin-top: 3px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border: 0; }
.setting-copy span { display: block; }
.setting-copy span:first-child { font-weight: 700; }
.setting-copy span:last-child { color: var(--muted); font-size: 12px; margin-top: 3px; }
.toggle { width: 40px; height: 23px; border-radius: 99px; background: #dcd9e3; position: relative; border: 0; cursor: pointer; }
.toggle::after { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .18s; box-shadow: 0 1px 4px rgba(0,0,0,.17); }
.toggle.on { background: var(--brand); }
.toggle.on::after { left: 20px; }

.backdrop { position: fixed; inset: 0; background: rgba(20,19,24,.32); z-index: 60; backdrop-filter: blur(2px); }
.company-drawer { position: fixed; top: 0; right: 0; z-index: 70; width: min(650px, 94vw); height: 100vh; background: #fff; transform: translateX(102%); transition: transform .23s ease; box-shadow: var(--shadow); overflow-y: auto; }
.company-drawer.open { transform: translateX(0); }
.drawer-header { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(255,255,255,.97); backdrop-filter: blur(10px); z-index: 2; }
.drawer-header-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.drawer-header-actions { display: flex; align-items: center; gap: 8px; }
.drawer-company { display: flex; gap: 13px; align-items: center; }
.drawer-company .company-logo { width: 46px; height: 46px; border-radius: 13px; font-size: 14px; }
.drawer-company h2 { margin: 0 0 4px; }
.drawer-tabs { display: flex; gap: 20px; margin-top: 20px; }
.drawer-tab { padding: 0 0 10px; border: 0; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; border-bottom: 2px solid transparent; }
.drawer-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.drawer-tab:disabled { opacity: .38; cursor: not-allowed; }
.drawer-body { padding: 22px 24px 34px; }
.drawer-section { margin-bottom: 25px; }
.drawer-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.drawer-section-heading h3 { margin: 0; }
.contact-grid, .status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.info-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-width: 0; }
.info-box span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 5px; }
.info-box strong, .info-box a { color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 650; }
.field > span em { margin-left: 4px; color: var(--muted); font-style: normal; font-weight: 500; }
.field textarea { min-height: 112px; padding: 10px 11px; resize: vertical; line-height: 1.5; }
.field.full { grid-column: 1 / -1; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); box-shadow: 0 0 0 3px rgba(184,68,68,.09); }
.field-error { color: var(--red); font-size: 12px; line-height: 1.35; }
.drawer-form { display: grid; gap: 12px; }
.research-progress { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: var(--brand-soft); color: var(--brand-deep); padding: 12px; border-radius: 9px; margin-bottom: 16px; font-size: 12px; }
.research-progress span { max-width: 310px; line-height: 1.5; }
.research-upload { display: grid; gap: 9px; padding: 15px; margin-bottom: 16px; border: 1px solid #c9c0ff; border-radius: 11px; background: #f5f2ff; }
.research-upload strong { color: var(--brand-deep); font-size: 14px; }
.research-upload p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.research-upload-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.research-upload input[type=file] { min-width: 0; max-width: 100%; flex: 1 1 220px; font-size: 12px; }
.research-upload input[type=file]::file-selector-button { border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; margin-right: 9px; background: #fff; cursor: pointer; }
.research-upload #research-import-feedback { margin: 0; overflow-wrap: anywhere; }
.research-first { text-align: center; padding: 40px 24px; background: #f5f2ff; border-color: #d9d1ff; }
.research-first h3 { margin: 0 0 8px; font-size: 21px; }
.research-first p { max-width: 420px; margin: 0 auto 18px; color: var(--muted); line-height: 1.7; }
.research-group { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #faf9fe; }
.research-group h4 { margin: 0 0 2px; color: var(--brand-deep); font-size: 13px; }
.research-group .field textarea { min-height: 72px; background: #fff; }
.message-card { border: 1px solid var(--line); border-radius: 11px; margin-bottom: 12px; overflow: hidden; }
.message-card-header { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.message-card textarea { width: 100%; min-height: 120px; padding: 12px; border: 0; outline: 0; resize: vertical; line-height: 1.5; color: var(--ink); }
.message-card-actions { display: flex; gap: 7px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--line); background: #faf9fc; }
.draft-history { border: 1px solid var(--line); border-radius: 9px; padding: 12px; margin: 16px 0; font-size: 12px; }
.draft-history summary { cursor: pointer; font-weight: 700; }
.draft-history-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding: 10px 0; }
.message-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.empty-state { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 6px; }

dialog { width: min(610px, 92vw); max-height: 88vh; overflow: auto; border: 0; border-radius: 16px; padding: 0; box-shadow: var(--shadow); color: var(--ink); }
dialog::backdrop { background: rgba(20,19,24,.42); backdrop-filter: blur(3px); }
dialog form { padding: 22px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 19px; }
.dialog-header h2 { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.form-note { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.edit-form-actions { position: sticky; bottom: -34px; display: flex; justify-content: flex-end; gap: 8px; margin: 20px -24px -34px; padding: 13px 24px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 15px; border-radius: 9px; opacity: 0; pointer-events: none; z-index: 100; transition: .2s ease; box-shadow: var(--shadow); font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .campaign-grid { grid-template-columns: 1fr; }
  .approval-card { grid-template-columns: 1fr 130px minmax(200px, 1fr); }
  .approval-actions { grid-column: 1 / -1; }
  .sync-state { display: none; }
  .bulk-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .bulk-controls { width: 100%; margin-left: 0; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .bulk-select { flex: 0 0 auto; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: 248px; transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: grid; }
  .topbar { padding: 0 16px; }
  .global-search { width: auto; flex: 1; }
  .global-search kbd { display: none; }
  .topbar-actions .button { font-size: 0; width: 38px; padding: 0; }
  .topbar-actions .button::before { content: "+"; font-size: 20px; line-height: 1; }
  .view-root { padding: 20px 16px; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .settings-title, .team-account, .research-progress { align-items: flex-start; flex-direction: column; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi-card { padding: 14px; }
  .kpi-value { font-size: 24px; }
  .page-header { display: block; }
  .page-actions { margin-top: 14px; }
  .queue-item { grid-template-columns: 36px 1fr auto; }
  .queue-item > :nth-child(3) { display: none; }
  .contact-grid, .status-grid, .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .topbar-actions .avatar { display: none; }
  .filters > * { flex: 1 1 140px; }
  .filters input { min-width: 0; }
  .filter-count { width: 100%; margin-left: 0; }
}

/* Brand interactions; semantic status colours remain independent. */
::selection { background: var(--brand); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--brand-deep); border-color: var(--brand-deep); }
.field > span, .field-error, .view-options label, .view-options select, .button.small, .inline-select, .data-table th, .card-next, .card-stage select, .due-label, .settings-card p { font-size: 14px; }
.login-card small { font-size: 12px; }
.login-card input { min-height: 46px; }
.view-root .kanban-header, .view-root .kanban-card .company-title { font-size: 14px; }
.kpi-value, .pipeline-summary strong { font-variant-numeric: lining-nums tabular-nums; }
.drawer-tabs { flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
