:root {
  --ink: #23282c;
  --muted: #68717c;
  --line: #e4e7eb;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --primary: #fd7406;
  --primary-dark: #d85b00;
  --primary-soft: #fff0e5;
  --danger: #c44848;
  --danger-soft: #fff0ef;
  --warning: #a85b11;
  --warning-soft: #fff5e8;
  --blue: #3e74c5;
  --shadow: 0 12px 32px rgba(16, 22, 31, .08);
}

html, body, .topbar, .panel, .metric-card, .auth-card, .modal-dialog, .modal-dialog > header, .modal-actions, .bottom-nav, .field input, .field textarea, .field select, .filter-bar select, .filter-search, .quick-search input, .task-check, .timeline-card, .opportunity-card, .task-owner, .data-table tr {
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.sidebar {
  background: radial-gradient(circle at 82% -5%, rgba(253, 116, 6, .16), transparent 32%), #0b0f15;
  color: #eef1f5;
}

.sidebar > .brand { justify-content: center; }
.sidebar > .brand--stage { position: relative; }
.sidebar > .brand--stage .brand-stage { position: absolute; top: 100%; left: 50%; margin-top: 3px; transform: translateX(-50%); }
.sidebar > .brand--stage + .main-nav { margin-top: 53px; }
.brand { gap: 8px; }
.brand-stage { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; border: 1px solid rgba(253, 116, 6, .7); border-radius: 999px; color: #fd9b55; background: rgba(253, 116, 6, .11); font-size: 9px; font-weight: 800; letter-spacing: .1em; line-height: 1; }
.brand-mark { width: 27px; height: 35px; border-radius: 0; background: transparent; box-shadow: none; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand b { color: #fd7406; }
.brand-wordmark { width: 150px; height: 78px; object-fit: contain; }
.brand-inline { display: none; align-items: center; gap: 8px; }
.brand-crm-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 7px; background: #23282c; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.brand--full { gap: 7px; margin-bottom: 14px; }
.brand--center .brand-crm-chip { margin-left: -7px; }
.brand--login { margin-bottom: 30px; color: #23282c; }
.brand--login .brand-mark { width: 32px; height: 42px; }

.main-nav { margin-top: 30px; }
.nav-item { color: #b8c0cb; display: flex; align-items: center; gap: 10px; }
.nav-item__label { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.nav-icon, .bottom-nav__icon { display: inline-flex; align-items: center; justify-content: center; }
.nav-icon { width: 22px; height: 22px; }
.nav-icon svg, .bottom-nav__icon svg { width: 18px; height: 18px; display: block; }
.nav-item__badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; background: transparent; border: 1.5px solid #fd7406; color: #fd7406; font-size: 11px; font-weight: 800; line-height: 1; }
.nav-item:hover { background: rgba(255, 255, 255, .06); }
.nav-item.is-active { background: rgba(253, 116, 6, .16); color: #fff; box-shadow: inset 2px 0 0 #fd7406; }
.sidebar-user { grid-template-columns: 34px 1fr; border-top-color: rgba(255, 255, 255, .1); }
.sidebar-user small { color: #97a2b0; }
.sidebar-user form { grid-column: 1 / -1; margin-top: 4px; }
.logout-button { width: 100%; min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: rgba(255,255,255,.04); color: #b8c0cb; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.logout-button:hover { border-color: rgba(253,116,6,.7); background: rgba(253,116,6,.1); color: #fff; }
.avatar { background: #252d38; }
.avatar--soft { background: var(--primary-soft); color: var(--primary); }

.button--primary { box-shadow: 0 7px 18px rgba(253, 116, 6, .24); }
.button--secondary:hover { border-color: #ffbd83; background: #fff8f3; }
.button--ai {
  gap: 3px;
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 52%, #4338ca 100%);
  box-shadow: 0 9px 20px rgba(91, 33, 182, .28);
}
.button--ai:hover {
  color: #fff;
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 52%, #4f46e5 100%);
  box-shadow: 0 12px 24px rgba(91, 33, 182, .36);
}
.button--ai:focus-visible {
  outline: 3px solid rgba(139, 92, 246, .34);
  outline-offset: 3px;
}
.button--ai:disabled,
.button--ai[aria-disabled="true"],
.button--followup:disabled,
.button--followup[aria-disabled="true"],
.button--meeting:disabled,
.button--meeting[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .42;
  box-shadow: none;
  filter: saturate(.45);
}
.eyebrow { color: var(--primary); }
.bar-list u { background: linear-gradient(90deg, #fd7406, #ffab55); }
.metric-icon--green { background: #fff0e5; color: #ed6800; }
.metric-icon--amber { background: #fff0e5; color: #a95000; }
.metric-icon--muted { background: #f0f3f5; color: #7b8791; }
.metric-icon--live { background: #e2f5e9; color: #258963; }
.company-logo { background: linear-gradient(145deg, #fff0e5, #fffaf6); color: var(--primary); border-color: #ffd8bb; }
.section-title > span { background: var(--primary-soft); color: var(--primary); }
.task-check:hover { border-color: var(--primary); box-shadow: inset 0 0 0 4px var(--primary-soft); }
.is-complete .task-check { background: var(--primary); border-color: var(--primary); }
.timeline-dot { background: var(--primary); box-shadow: 0 0 0 2px #ffd9be; }

.theme-toggle { display: inline-flex; align-items: center; justify-content:center; gap: 7px; min-height: 36px; margin: 18px 4px 0; padding: 0 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: rgba(255,255,255,.04); color: #c9d0d9; cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; }
.theme-toggle:hover { border-color: rgba(253,116,6,.65); color: #fff; background: rgba(253,116,6,.1); }
.theme-toggle__icon { font-size: 14px; line-height: 1; color: #ff9a4b; }
.theme-toggle--auth { display: flex; width: max-content; margin: -7px auto 24px; border-color: #e4e7eb; background: #fff; color: var(--muted); }
.theme-toggle--auth:hover { color: var(--ink); background: #fff8f3; }
.sidebar-research { display: grid; gap: 2px; margin: auto 4px 16px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.1); border-left: 2px solid rgba(253,116,6,.8); border-radius: 8px; background: rgba(255,255,255,.035); }
.sidebar-research span { color: #9aa6b4; font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.sidebar-research time { color: #eef1f5; font-size: 11px; font-weight: 600; }
.sidebar-research + .sidebar-user { margin-top: 0; }

.auth-page { background: radial-gradient(circle at 70% 15%, #ffe4cc 0, transparent 31%), linear-gradient(145deg, #fffaf6, #f2f4f7); }
.auth-card { border-color: #e3e6ea; box-shadow: 0 25px 60px rgba(18, 24, 33, .12); }

:root[data-theme="dark"] {
  --ink: #eef1f5;
  --muted: #a6afbb;
  --line: #29313c;
  --bg: #0b0f15;
  --panel: #131a23;
  --primary: #ff7c16;
  --primary-dark: #ea6500;
  --primary-soft: #2b1c12;
  --danger-soft: #321b1d;
  --warning-soft: #342513;
  --shadow: 0 12px 34px rgba(0, 0, 0, .22);
}

:root[data-theme="dark"] .topbar { background: rgba(13, 18, 25, .94); }
:root[data-theme="dark"] .quick-search input, :root[data-theme="dark"] .field input, :root[data-theme="dark"] .field textarea, :root[data-theme="dark"] .field select, :root[data-theme="dark"] .filter-bar select, :root[data-theme="dark"] .filter-search, :root[data-theme="dark"] .task-check { background: #0e141d; border-color: #303946; color: var(--ink); }
:root[data-theme="dark"] .quick-search input { background: #151d27; }
:root[data-theme="dark"] .filter-search input { color: var(--ink); caret-color: var(--ink); }
:root[data-theme="dark"] .filter-search input::placeholder { color: #98a7b5; opacity: 1; }
:root[data-theme="dark"] .quick-search input:focus, :root[data-theme="dark"] .field input:focus, :root[data-theme="dark"] .field textarea:focus, :root[data-theme="dark"] .field select:focus { border-color: #ff8a30; box-shadow: 0 0 0 3px rgba(253, 116, 6, .16); }
:root[data-theme="dark"] .metric-card, :root[data-theme="dark"] .timeline-card, :root[data-theme="dark"] .opportunity-card, :root[data-theme="dark"] .modal-dialog, :root[data-theme="dark"] .modal-dialog > header, :root[data-theme="dark"] .modal-actions, :root[data-theme="dark"] .auth-card { background: var(--panel); border-color: var(--line); }
:root[data-theme="dark"] .metric-icon--muted { background: #26313c; color: #a8b1ba; }
:root[data-theme="dark"] .metric-icon--live { background: #183b2c; color: #a5e6c0; }
:root[data-theme="dark"] .dashboard-section--overview .eyebrow { color: #a8b1ba; }
:root[data-theme="dark"] .task-owner, :root[data-theme="dark"] .opportunity-process, :root[data-theme="dark"] .timeline-card blockquote { background: #1b2430; color: var(--muted); }
:root[data-theme="dark"] .data-table th { background: #18212c; color: #aeb7c3; }
:root[data-theme="dark"] .data-table td, :root[data-theme="dark"] .task-row, :root[data-theme="dark"] .timeline article:before, :root[data-theme="dark"] .company-info dl > div { border-color: #26303b; }
:root[data-theme="dark"] .data-table tbody .company-row:hover { background: rgba(253, 116, 6, .12); box-shadow: inset 3px 0 0 #fd7406; }
:root[data-theme="dark"] .button--secondary { background: #151e28; border-color: #36404c; color: var(--ink); }
:root[data-theme="dark"] .button--secondary:hover { background: #202a35; border-color: #ff9341; }
:root[data-theme="dark"] .icon-button:hover { background: #202a35; color: var(--ink); }
:root[data-theme="dark"] .auth-page { background: radial-gradient(circle at 70% 15%, rgba(253,116,6,.18) 0, transparent 31%), #090d13; }
:root[data-theme="dark"] .brand--full .brand-wordmark, :root[data-theme="dark"] .brand--full .brand-crm-chip { display: none; }
:root[data-theme="dark"] .brand--full .brand-inline { display: inline-flex; font-size: 19px; color: var(--ink); }
:root[data-theme="dark"] .brand--full .brand-inline .brand-mark { width: 27px; height: 35px; }
:root[data-theme="dark"] .theme-toggle--auth { background: #141c26; border-color: #303a46; color: var(--muted); }
:root[data-theme="dark"] .bottom-nav { background: rgba(18, 25, 34, .97); }
:root[data-theme="dark"] .bottom-nav a { color: #9ca7b4; }

.metrics-grid--simple { grid-template-columns: repeat(3, minmax(220px, 340px)); }
.dashboard-primary-stat { margin: 0 0 16px; }
.dashboard-primary-stat__card { position: relative; display: block; min-height: 138px; max-width: 480px; padding: 20px 22px 17px; overflow: hidden; border: 1px solid #d9e4e1; border-radius: 18px; background: linear-gradient(135deg, #fff 0%, #fbfdfc 66%, #f5faf8 100%); box-shadow: var(--shadow); }
.dashboard-primary-stat__card:hover { border-color: #bfd8d2; box-shadow: 0 16px 35px rgba(16, 22, 31, .11); transform: translateY(-2px); }
.dashboard-primary-stat__label { display: block; margin: 0 52px 10px 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.dashboard-primary-stat__card strong { display: block; color: var(--ink); font-size: 39px; letter-spacing: -.045em; line-height: 1; }
.dashboard-primary-stat__card em { display: block; margin-top: 13px; color: #71827d; font-size: 11px; font-style: normal; }
.dashboard-primary-stat__card .metric-icon { top: 18px; right: 18px; width: 42px; height: 42px; font-size: 15px; }
.dashboard-meeting-alert { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 13px; align-items: center; margin: 0 0 16px; padding: 14px 16px; border: 1px solid #afd9f2; border-left: 4px solid #3f94c7; border-radius: 18px; background: linear-gradient(100deg, #edf8ff, #fbfdff 68%); box-shadow: var(--shadow); }
.dashboard-meeting-alert__icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; background: #dcefff; color: #2e75aa; font-size: 20px; font-weight: 800; }
.dashboard-meeting-alert__copy { min-width: 0; }
.dashboard-meeting-alert .eyebrow { margin-bottom: 3px; color: #367fb3; }
.dashboard-meeting-alert h2 { margin: 0; color: var(--ink); font-size: 17px; letter-spacing: -.025em; }
.dashboard-meeting-alert__list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.dashboard-meeting-alert__list a, .dashboard-meeting-alert__more { display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: baseline; min-width: 0; padding: 6px 8px; border: 1px solid #bdddf0; border-radius: 9px; background: rgba(255,255,255,.78); color: var(--ink); font-size: 11px; }
.dashboard-meeting-alert__list a:hover { border-color: #6eadcf; background: #fff; transform: translateY(-1px); }
.dashboard-meeting-alert__list time { color: #2875aa; font-weight: 800; white-space: nowrap; }
.dashboard-meeting-alert__list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-meeting-alert__list span { grid-column: 1 / -1; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-meeting-alert__more { display: inline-flex; align-items: center; color: #39739a; font-weight: 700; }
.dashboard-meeting-alert__button { width: max-content; min-height: 34px; margin-top: 10px; padding: 0 12px; border: 1px solid #5da5d2; background: #fff; color: #246b9e; box-shadow: 0 5px 12px rgba(33, 112, 160, .14); white-space: nowrap; }
.dashboard-meeting-alert__button:hover { border-color: #287daf; background: #edf8ff; color: #185a88; box-shadow: 0 7px 16px rgba(33, 112, 160, .20); }
.dashboard-workspace { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dashboard-section { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.dashboard-section--overview .eyebrow { color: #7b8791; }
.dashboard-section--actions { order: -1; border-color: #f0d6be; background: linear-gradient(135deg, #fff9f3, var(--panel) 60%); }
.dashboard-section__header { padding: 17px 18px 11px; }
.dashboard-section__header .eyebrow { margin-bottom: 4px; }
.dashboard-section__header h2 { margin: 0; color: var(--ink); font-size: 17px; letter-spacing: -.025em; }
.dashboard-section__header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.dashboard-info-cards { display: grid; gap: 8px; padding: 0 11px 11px; }
.dashboard-info-cards .metric-card { min-height: 106px; padding: 14px 16px 12px; }
.dashboard-action-cards { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 0 11px 11px; }
.dashboard-action-cards .metric-card { min-height: 106px; padding: 14px 16px 12px; }
.dashboard-action-cards .metric-card strong { font-size: 29px; }
.dashboard-ready { display: flex; align-items: center; gap: 13px; margin: 0 14px 14px; padding: 18px; border: 1px solid #b9e1d0; border-radius: 13px; background: #effaf5; color: #176848; }
.dashboard-ready > span { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #258963; color: #fff; font-size: 15px; font-weight: 900; }
.dashboard-ready b { display: block; font-size: 13px; }
.dashboard-ready p { margin: 2px 0 0; font-size: 11px; }
.metric-card--web-inquiry { border-color: #b7d0ef; background: linear-gradient(135deg, #eef6ff, var(--panel) 54%); box-shadow: inset 3px 0 0 #4f86cc, 0 12px 28px rgba(49, 112, 191, .10); }
.metric-card--action { padding-top: 15px; }
.metric-card__action { display: block; margin: 0 45px 5px 0; color: #a95000; font-size: 9px; font-weight: 850; letter-spacing: .1em; line-height: 1.1; text-transform: uppercase; }
.metric-card--action small { margin-top: 0; }
.metric-card--attention { border-color: rgba(253, 116, 6, .72); background: linear-gradient(135deg, rgba(253, 116, 6, .14), var(--panel) 50%); box-shadow: inset 3px 0 0 #fd7406, 0 12px 28px rgba(253, 116, 6, .12); }
.metric-card--attention:hover { border-color: #fd7406; box-shadow: inset 3px 0 0 #fd7406, 0 14px 32px rgba(253, 116, 6, .2); }
.metric-card--followup { border-color: #e7c55a; background: linear-gradient(135deg, #fff8dd, var(--panel) 54%); box-shadow: inset 3px 0 0 #d89a00, 0 12px 28px rgba(188, 137, 0, .11); }
.metric-card--followup:hover { border-color: #d89a00; box-shadow: inset 3px 0 0 #d89a00, 0 14px 32px rgba(188, 137, 0, .18); }
.metric-card--waiting { border-color: #e6c176; background: linear-gradient(135deg, #fff8ed, var(--panel) 54%); box-shadow: inset 3px 0 0 #d99023, 0 12px 28px rgba(192, 126, 28, .10); }
.metric-card--waiting:hover { border-color: #d99023; box-shadow: inset 3px 0 0 #d99023, 0 14px 32px rgba(192, 126, 28, .17); }
.metric-card--inactive { border-color: #d7dde1; background: linear-gradient(135deg, #f5f7f8, var(--panel) 54%); box-shadow: inset 3px 0 0 #89939b, 0 12px 28px rgba(70, 81, 91, .08); }
.metric-card--inactive:hover { border-color: #89939b; box-shadow: inset 3px 0 0 #89939b, 0 14px 32px rgba(70, 81, 91, .14); }
.metric-card--active-negotiation { border-color: #a8dbbd; background: linear-gradient(135deg, #edf9f1, var(--panel) 54%); box-shadow: inset 3px 0 0 #36a56e, 0 12px 28px rgba(31, 137, 91, .10); }
.metric-card--active-negotiation:hover { border-color: #36a56e; box-shadow: inset 3px 0 0 #218855, 0 14px 32px rgba(31, 137, 91, .17); }
.topbar-context { margin-left: auto; display: flex; align-items: baseline; gap: 10px; color: var(--muted); white-space: nowrap; }
.topbar-context__date { font-size: 14px; font-weight: 750; text-transform: capitalize; }
.topbar-context__time { color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.company-notes { margin: 0; white-space: pre-wrap; color: var(--ink); }
.required-mark { color: #d73a2f; font-weight: 850; }
.duplicate-warning__archive { display: inline-flex; margin-left: 6px; padding: 2px 6px; border-radius: 999px; background: #e8edf0; color: #586873; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.field:has(select) { position: relative; }
.field:has(select) select { appearance: none; -webkit-appearance: none; padding-right: 48px; }
.field:has(select)::after { content: ""; position: absolute; right: 22px; bottom: 17px; width: 7px; height: 7px; border-right: 2px solid #5f6872; border-bottom: 2px solid #5f6872; transform: rotate(45deg); pointer-events: none; }
.company-identity__meta a { color: #c65900; font-weight: 750; }
.company-identity__meta a:hover { color: #9e4700; text-decoration: underline; }
.company-identity__outreach { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 11px; row-gap: 2px; width: fit-content; max-width: 100%; margin-top: 13px; padding: 10px 13px; border: 1px solid #bcd7ef; border-radius: 12px; background: linear-gradient(135deg, #f6fbff, #eaf5ff); box-shadow: 0 8px 20px rgba(48, 99, 145, .10), inset 3px 0 0 #4a90c7; color: var(--muted); font-size: 11px; }
.company-identity__outreach > span { grid-column: 1; grid-row: 1 / span 2; display: flex; min-width: 118px; min-height: 32px; padding: 0 10px; align-items: center; justify-content: center; gap: 5px; border-radius: 8px; background: #dceefd; color: #28608e; font-size: 10px; font-weight: 850; letter-spacing: .055em; text-transform: uppercase; }
.company-identity__outreach > span b { font: inherit; white-space: nowrap; }
.company-identity__outreach-origin { display: inline-flex; padding: 2px 5px; border: 1px solid currentColor; border-radius: 999px; font-size: 8px; font-style: normal; font-weight: 900; letter-spacing: .04em; line-height: 1; }
.company-identity__outreach-origin--ai { color: #6a3bc7; background: #f1ebff; }
.company-identity__outreach-origin--manual { color: #5d6a74; background: #eef1f3; }
.email-draft-recipient > span { color: #667989; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.company-identity__outreach-email, .email-draft-recipient__email { appearance: none; padding: 0; border: 0; background: transparent; color: #234f79; font: inherit; font-weight: 850; text-align: left; cursor: copy; }
.company-identity__outreach-email { grid-column: 2; grid-row: 1; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.company-identity__outreach-email:hover, .email-draft-recipient__email:hover, .company-identity__outreach small a { color: #c65900; text-decoration: underline; }
.company-identity__outreach small { grid-column: 2; grid-row: 2; overflow: hidden; color: #657b8e; text-overflow: ellipsis; white-space: nowrap; }
.company-identity__outreach-action { grid-column: 3; grid-row: 1 / span 2; align-self: center; white-space: nowrap; }
.company-identity__outreach.is-missing { border-color: #e6d9cd; background: linear-gradient(135deg, #fffdf9, #faf3ec); box-shadow: 0 8px 20px rgba(100, 68, 40, .07), inset 3px 0 0 #bc8b61; }
.company-identity__outreach.is-missing > span { background: #f5e8dc; color: #8b5b36; }
.company-identity__outreach.is-missing strong { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: #6b5544; font-weight: 700; }
.email-draft-form { display: grid; gap: 18px; }
.email-draft-recipient { display: grid; gap: 8px; padding: 16px; border: 1px solid #d6e1e8; border-radius: 12px; background: #f7fafc; }
.email-draft-recipient > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 13px; }
.email-draft-recipient__email { color: #355c84; }
.email-draft-recipient small { color: var(--muted); font-size: 11px; }
.email-draft-recipient.is-missing { border-color: #e2d8cb; background: #fdfaf7; }
.email-draft-recipient.is-missing strong { color: #795a43; font-size: 13px; }
.email-draft-thread-context { overflow: hidden; border: 1px solid #d8dfe5; border-radius: 12px; background: #fbfcfd; }
.email-draft-thread-context summary { display: flex; align-items: center; gap: 12px; padding: 13px 15px; color: #35546c; cursor: pointer; font-size: 12px; font-weight: 800; list-style: none; }
.email-draft-thread-context summary::-webkit-details-marker { display: none; }
.email-draft-thread-context summary::after { content: ""; flex: 0 0 auto; width: 7px; height: 7px; margin: -4px 2px 0 auto; border-right: 2px solid #47718c; border-bottom: 2px solid #47718c; transform: rotate(45deg); transition: transform .16s ease, margin .16s ease; }
.email-draft-thread-context[open] summary::after { margin: 3px 2px 0 auto; transform: rotate(225deg); }
.email-draft-thread-context > div { display: grid; gap: 5px; padding: 14px 15px 16px; border-top: 1px solid #e2e8ed; }
.email-draft-thread-context > div > span { color: #687988; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.email-draft-thread-context > div > strong { color: #213645; font-size: 13px; }
.email-draft-thread-context article { max-height: 220px; margin-top: 7px; padding: 12px; overflow: auto; border: 1px solid #e1e7eb; border-radius: 9px; background: #fff; color: #344653; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 1.55; }
.email-draft-preview { display: grid; gap: 10px; padding: 14px; border: 1px solid #d8dfe5; border-radius: 14px; background: #f6f8fa; }
.email-draft-preview > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.email-draft-preview > header div { display: grid; gap: 2px; }
.email-draft-preview > header span { color: #34495c; font-size: 11px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.email-draft-preview > header small { color: var(--muted); font-size: 11px; }
.email-draft-preview > header i { padding: 4px 7px; border-radius: 999px; background: #f1ebff; color: #6331c9; font-size: 9px; font-style: normal; font-weight: 900; letter-spacing: .06em; }
.email-draft-preview__message { overflow: hidden; border: 1px solid #d9dfe4; border-radius: 10px; background: #fff; box-shadow: 0 5px 14px rgba(31, 48, 62, .06); }
.email-draft-preview__message dl { display: grid; gap: 5px; margin: 0; padding: 12px 14px; border-bottom: 1px solid #e5e9ed; color: #61717e; font-size: 11px; }
.email-draft-preview__message dl div { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 8px; }
.email-draft-preview__message dt { font-weight: 750; }
.email-draft-preview__message dd { min-width: 0; margin: 0; color: #273946; overflow-wrap: anywhere; }
.email-draft-preview__body { padding: 20px 18px 8px; color: #1d2e3b; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.58; white-space: pre-wrap; }
.email-draft-preview__logo { display: inline-flex; width: 48px; height: 48px; margin: 8px 18px 20px; align-items: center; justify-content: center; border-radius: 10px; overflow: hidden; }
.email-draft-preview__logo img { display: block; width: 48px; height: 48px; object-fit: contain; }
.company-row { cursor: pointer; }
.data-table tbody .company-row:hover { background: linear-gradient(90deg, #ffd3ae 0%, #ffe0ca 56%, #fff0e5 100%); box-shadow: inset 4px 0 0 #fd7406; }
.data-table tbody .company-row--attention-follow_up { background: #fff9df; box-shadow: inset 4px 0 0 #d89400; }
.data-table tbody .company-row--attention-waiting_reply { background: #fff8ee; box-shadow: inset 4px 0 0 #d99023; }
.data-table tbody .company-row--attention-inactive { background: #f5f6f7; box-shadow: inset 4px 0 0 #88939c; }
.data-table tbody .company-row--attention-first_contact { box-shadow: inset 3px 0 0 #fd7406; }
.data-table tbody .company-row--active-negotiation { background: #effaf4; box-shadow: inset 4px 0 0 #36a56e; }
.data-table tbody .company-row--active-negotiation:hover { background: #e3f6eb; box-shadow: inset 4px 0 0 #218855; }
.company-row:focus { outline: 2px solid #fd7406; outline-offset: -2px; }
.comment-meta, .comment-actions, .comment-actions form { display: flex; align-items: center; }
.comment-meta { gap: 10px; }
.comment-actions { gap: 2px; }
.comment-actions form { margin: 0; }
.text-button--danger { color: #ba3b24; }
.text-button--danger:hover { color: #8f2717; }
.contact-person-list { display: grid; gap: 8px; padding: 0 22px 18px; }
.contact-person { display: flex; align-items: stretch; justify-content: space-between; gap: 22px; padding: 14px 16px; border: 1px solid #cfe6da; border-radius: 12px; background: rgba(255,255,255,.55); }
.contact-person b, .contact-person small { display: block; }
.contact-person b { font-size: 13px; }
.contact-person small, .contact-person__details { color: var(--muted); font-size: 10px; }
.contact-person p { margin: 8px 0 0; padding-left: 9px; border-left: 2px solid #69b990; color: var(--ink); font-size: 11px; }
.contact-person__aside { display: flex; align-items: center; gap: 14px; padding-left: 18px; border-left: 1px solid #cfe6da; white-space: nowrap; }
.contact-person__details { display: grid; justify-items: end; gap: 3px; }
.contact-person__actions { display: flex; gap: 3px; }
.contact-person__details a { color: var(--muted); }
.contact-person__details a:hover { color: var(--primary); text-decoration: underline; }
.comment-contact { color: #a95000 !important; font-weight: 700; }
.company-panel { border-top-width: 3px; }
.company-panel .panel-header { align-items: center; }
.company-panel .panel-header:before { display: grid; width: 29px; height: 29px; border-radius: 9px; place-items: center; font-size: 14px; font-weight: 850; }
.company-panel .panel-header > div { flex: 1; }
.company-panel--notes { background: #f8fbff; border-color: #dbe8f8; border-top-color: #7faee7; }
.company-panel--notes .panel-header:before { content: "i"; background: #e7f1fd; color: #386da9; }
.company-panel--automation { background: #f7f9fb; border-color: #dce4ea; border-top-color: #8396a4; }
.company-panel--automation .panel-header:before { content: "⌁"; background: #e9eef2; color: #536674; }
.automatic-lead-reason { padding: 2px 42px 24px 78px; }
.automatic-lead-reason p { margin: 0; color: var(--text); line-height: 1.65; }
.automatic-lead-reason a, .automatic-lead-reason small { display: inline-block; margin-top: 12px; color: #546b7a; font-size: 12px; }
.automatic-lead-reason a:hover { color: #334d5d; text-decoration: underline; }
.company-panel--contacts { background: #f7fcf9; border-color: #d8eee3; border-top-color: #69b990; }
.company-panel--contacts .panel-header:before { content: "@"; background: #e5f6ed; color: #217653; }
.company-panel--timeline { background: #fafbfc; border-color: #dfe5ea; border-top-color: #8998a5; }
.company-panel--timeline .panel-header:before { content: "↗"; background: #eef1f4; color: #5d6c78; }
.company-panel--timeline .timeline-card { background: #fff; border-color: #dde4e9; }
.company-panel--timeline .timeline-dot { background: #7c8a96; box-shadow: 0 0 0 2px #d6e0e6; }
.button--meeting { border-color: #7560a8; background: #f5f1ff; color: #513c7e; box-shadow: none; }
.button--meeting:hover { background: #ece4ff; border-color: #5f4b93; }
.button--schedule-meeting { border-color: #3fae69; background: linear-gradient(135deg, #c7f7d5, #f1fff5); color: #12653a; box-shadow: 0 8px 18px rgba(31, 143, 76, .20); }
.button--schedule-meeting:hover { border-color: #238f50; background: linear-gradient(135deg, #b1f1c5, #e7ffef); box-shadow: 0 11px 23px rgba(31, 143, 76, .28); }
.button__icon { display: inline-flex; width: 15px; height: 15px; flex: 0 0 auto; }
.button__icon svg { display: block; width: 100%; height: 100%; }
.button--followup { border-color: #4c89ad; background: linear-gradient(135deg, #e8f6ff, #f4fbff); color: #285b7c; box-shadow: 0 7px 16px rgba(50, 120, 164, .12); }
.button--followup:hover { border-color: #286c99; background: #d9f0ff; color: #174967; }
/* Keep the four relevant header actions balanced when they no longer fit on one line. */
@media (max-width: 1750px) and (min-width: 781px) {
  .company-header { align-items: center; }
  .company-actions {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    align-content: center;
    justify-content: end;
    margin-right: 16px;
  }
  .company-actions .button { min-width: 168px; }
}
@media (max-width: 1250px) and (min-width: 781px) {
  .company-header { flex-direction: column; }
  .company-identity { width: 100%; align-self: stretch; justify-content: flex-start; }
  .company-identity > div { width: 100%; }
  .company-actions { align-self: stretch; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .company-actions .button { min-width: 0; }
}
.company-panel--meetings { background: #fbf9ff; border-color: #e2daf0; border-top-color: #9a82c4; }
.company-panel--meetings .panel-header:before { content: "◌"; background: #eee7fb; color: #624b90; }
.company-panel--sent-emails { background: #f8fbff; border-color: #d8e5f0; border-top-color: #6f9ec5; }
.company-panel--sent-emails .panel-header:before { content: "✉"; background: #e6f0f8; color: #396d95; }
.sent-email-list { display: grid; gap: 9px; padding: 0 22px 22px; }
.sent-email-record { overflow: hidden; border: 1px solid #d5e2ec; border-radius: 12px; background: #fff; }
.sent-email-record summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; cursor: pointer; list-style: none; }
.sent-email-record summary::-webkit-details-marker { display: none; }
.sent-email-record summary::after { content: "⌄"; flex: 0 0 auto; color: #467796; font-size: 15px; transition: transform .16s ease; }
.sent-email-record[open] summary::after { transform: rotate(180deg); }
.sent-email-record summary > div { min-width: 0; }
.sent-email-record span, .sent-email-record b, .sent-email-record small { display: block; }
.sent-email-record span { color: #52728a; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.sent-email-record b { overflow: hidden; margin: 3px 0; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sent-email-record small { color: var(--muted); font-size: 10px; }
.sent-email-record article { padding: 15px 16px; border-top: 1px solid #dce7ee; color: var(--text); font-size: 12px; line-height: 1.65; white-space: normal; }
.sent-email-record__logo { display: inline-flex; margin-top: 18px; text-decoration: none; }
.sent-email-record__logo img { display: block; width: 42px; height: 42px; border: 0; border-radius: 10px; }
.meeting-record-list { display: grid; gap: 12px; padding: 0 22px 22px; }
.meeting-record { padding: 16px; border: 1px solid #e2dae9; border-radius: 13px; background: #fff; }
.meeting-record.is-pending { border-left: 3px solid #ad95d1; }
.meeting-record.is-processed { border-left: 3px solid #69aa87; }
.meeting-record header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.meeting-record__header-actions { display: flex; flex: 0 0 auto; align-items: flex-end; flex-direction: column; gap: 5px; }
.meeting-record__eyebrow { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.meeting-record h3 { margin: 4px 0 3px; font-size: 14px; }
.meeting-record header small, .meeting-record__summary small { color: var(--muted); font-size: 10px; }
.meeting-status { display: inline-flex; flex: 0 0 auto; border-radius: 999px; padding: 5px 8px; font-size: 9px; font-weight: 800; }
.meeting-status--pending { background: #eee7fb; color: #604783; }
.meeting-status--processed { background: #e8f5ee; color: #287052; }
.meeting-record__raw { margin-top: 14px; padding-top: 11px; border-top: 1px solid #ebe5f2; }
.meeting-record__raw summary { cursor: pointer; color: #5f4b84; font-size: 11px; font-weight: 750; }
.meeting-record__raw div { margin-top: 10px; }
.meeting-record__raw p { margin: 0 0 10px; color: var(--text); font-size: 12px; line-height: 1.6; }
.meeting-record__summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-top: 14px; padding: 13px; border-radius: 10px; background: #f7f5fa; }
.meeting-record__summary > div { flex: 1; }
.meeting-record__summary > span { display: block; color: #654d8a; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.meeting-record__summary p { margin: 5px 0; white-space: pre-wrap; font-size: 12px; line-height: 1.6; }
.meeting-record__summary .text-button { align-self: flex-end; white-space: nowrap; }
.meeting-record__summary-actions { display: flex; align-self: flex-end; gap: 3px; white-space: nowrap; }
.company-summary { position: relative; overflow: hidden; padding: 0; background: linear-gradient(145deg, #ffe5d0 0%, #fff0e5 100%); }
.company-summary:before { content: ""; position: absolute; top: 0; right: 0; width: 52%; height: 52%; background: radial-gradient(circle at top right, rgba(253,116,6,.15), transparent 74%); pointer-events: none; }
.company-summary__header, .company-summary__status, .company-summary__highlights, .company-summary__details, .company-summary form { position: relative; }
.company-summary__header { padding: 22px 24px 0; }
.company-summary__header > span, .company-summary__highlights span, .company-summary__details dt { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.company-summary__header h2 { margin: 3px 0 0; font-size: 20px; }
.company-summary__status { margin: 14px 16px 0; padding: 14px; border: 1px solid #e5a46d; border-radius: 14px; background: rgba(255,250,246,.62); box-shadow: inset 0 0 0 1px rgba(255,255,255,.38); }
.company-status-form { margin-top: 14px; }
.company-status-form label { position: relative; display: block; }
.company-status-form label > span { display: block; margin: 0 0 5px; color: #9b4b0a; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.company-status-form label::after { content: ""; position: absolute; right: 20px; top: calc(100% - 19.5px); width: 7px; height: 7px; border-right: 2px solid #5f6872; border-bottom: 2px solid #5f6872; transform: translateY(-50%) rotate(45deg); pointer-events: none; }
.company-status-form select { width: 100%; height: 39px; appearance: none; -webkit-appearance: none; padding: 0 48px 0 11px; border: 1px solid #e9b98e; border-radius: 9px; background: rgba(255,255,255,.82); color: var(--ink); font: inherit; font-size: 11px; font-weight: 750; }
.company-status-last-change { margin: 9px 0 0; color: #795a43; font-size: 10px; line-height: 1.35; }
.company-status-history { margin: 10px 0 0; color: var(--muted); font-size: 10px; font-weight: 400; }
.company-status-history summary { display: inline-flex; align-items: center; gap: 6px; color: #9b4b0a; cursor: pointer; font-weight: 500; list-style: none; }
.company-status-history summary::-webkit-details-marker { display: none; }
.company-status-history summary::after { content: ""; width: 6px; height: 6px; margin: -3px 0 3px 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .16s ease; }
.company-status-history[open] summary::after { margin: 3px 0 -3px 2px; transform: rotate(225deg); }
.company-status-history > p { margin: 8px 0 0; font-weight: 400; }
.company-status-history strong { color: var(--text); font-weight: 700; }
.company-cell b { display: block; margin: 0; overflow-wrap: anywhere; }
.company-cell__meta { display: block; margin: 2px 0 0; }
.company-status-date { display: inline; margin: 0 0 0 6px; }
.company-status-date--attention { color: var(--ink); font-weight: 750; }
.data-table td[data-label="Přidal"], .data-table td[data-label="Kontaktuje"] { white-space: nowrap; }
.data-table td[data-label="Poslední komentář"] { width: 1%; min-width: 280px; }
.company-last-comment { display: -webkit-box; overflow: hidden; max-width: 520px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.45; text-overflow: ellipsis; }
.company-table-action-heading, .company-table-action { width: 1%; text-align: right; white-space: nowrap; }
.data-table .company-table-action .button--archive { min-height: 32px; padding: 0 11px; font-size: 10px; }
.company-cell__automatic { display: inline-flex; align-items: center; margin: 0 0 0 6px; padding: 2px 6px; border-radius: 999px; background: #eef1f4; color: #586774; font-size: 9px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.company-priority-form { position: relative; margin: 0; }
.company-priority-form::after { content: ""; position: absolute; top: 50%; right: 15px; width: 7px; height: 7px; border-right: 2px solid #5f6872; border-bottom: 2px solid #5f6872; transform: translateY(-65%) rotate(45deg); pointer-events: none; }
.company-priority-form select { width: 100%; min-width: 112px; height: 34px; appearance: none; -webkit-appearance: none; padding: 0 37px 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; font-size: 10px; font-weight: 700; }
.priority--normalni i { background: #7d8b99; }
.company-status-history ol { display: grid; gap: 6px; margin: 8px 0 0; padding: 9px 0 0; border-top: 1px solid #edc5a6; list-style: none; }
.company-status-history li { display: grid; gap: 2px; }
.company-status-history time { color: var(--muted); font-size: 9px; }
.company-summary__highlights { display: grid; gap: 0; margin: 16px 18px 0; border: 1px solid #f0ded0; border-radius: 12px; background: rgba(255,255,255,.7); }
.company-summary__highlights > div { min-width: 0; padding: 11px 12px; border-top: 1px solid #f0ded0; }
.company-summary__highlights > div:first-child { border-top: 0; }
.company-summary__highlights strong, .company-summary__highlights small { display: block; }
.company-summary__highlights strong { margin-top: 3px; font-size: 12px; }
.company-summary__highlights small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; white-space: normal; }
.company-summary__archive { position: relative; margin: 16px 20px 18px; padding-top: 13px; border-top: 1px solid #e8bb98; }
.company-summary__archive > span { display: block; color: #9b4b0a; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.company-summary__archive .button--archive { width: 100%; margin: 8px 0 0; }
.company-followup-control, .company-followup-sent, .company-attention-box { position: relative; display: grid; gap: 4px; margin: 13px 18px 0; padding: 12px; border: 1px solid #c9dfef; border-radius: 12px; background: rgba(240,249,255,.72); }
.company-live-lead { position: relative; display: grid; gap: 4px; margin: 13px 18px 0; padding: 12px; border: 1px solid #9ed6b6; border-radius: 12px; background: rgba(237,250,242,.86); }
.company-live-lead > span { color: #27865b; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.company-live-lead strong { color: #176a45; font-size: 12px; }
.company-live-lead p { margin: 0; color: #467260; font-size: 10px; line-height: 1.4; }
.company-followup-control > span, .company-followup-sent > span, .company-attention-box > span { color: #3f7190; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.company-followup-control strong, .company-followup-sent strong, .company-attention-box strong { font-size: 12px; }
.company-followup-control small, .company-followup-sent small, .company-attention-box p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.company-followup-control .button { width: 100%; margin-top: 6px; }
.company-followup-control.is-due { border-color: #e59a53; background: #fff4e8; }
.company-followup-control.is-due > span, .company-followup-control.is-due strong { color: #97500f; }
.company-followup-sent { border-color: #b9d5df; background: rgba(246,251,253,.76); }
.company-attention-box--first_contact { border-color: #e7ac77; background: #fff5ec; }
.company-attention-box--first_contact > span, .company-attention-box--first_contact strong { color: #9d520c; }
.company-attention-box--follow_up { border-color: #dfae37; background: #fff9df; }
.company-attention-box--follow_up > span, .company-attention-box--follow_up strong { color: #856400; }
.company-attention-box--waiting_reply { border-color: #e2b35a; background: #fff7e6; }
.company-attention-box--waiting_reply > span, .company-attention-box--waiting_reply strong { color: #93630d; }
.company-attention-box--inactive { border-color: #c9ced2; background: #f3f4f5; }
.company-attention-box--inactive > span, .company-attention-box--inactive strong { color: #65717a; }
.button--archive { min-height: 40px; border-color: #d46927; background: #fff7f2; color: #a84600; box-shadow: none; }
.button--archive:hover { border-color: #b84700; background: #ffeadc; }
.button--danger { min-height: 40px; border-color: #bb3f2d; background: #c94b37; color: #fff; box-shadow: 0 5px 14px rgba(166,51,35,.16); }
.button--danger:hover { background: #aa3827; }
.modal-copy { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.65; }
.modal--confirm .modal-backdrop { background: rgba(8, 15, 25, .52); backdrop-filter: blur(8px); }
.modal--confirm .modal-dialog { top: 50%; right: auto; bottom: auto; left: 50%; width: min(460px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 26px 80px rgba(0,0,0,.28); transform: translate(-50%, -50%); }
.modal--confirm .modal-dialog > header { position: static; padding: 21px 22px 15px; }
.modal--confirm .modal-form { padding: 20px 22px 22px; }
.modal--confirm .modal-actions { position: static; margin: 22px 0 0; padding: 15px 0 0; background: transparent; }
:root[data-theme="dark"] .company-summary { background: linear-gradient(145deg, rgba(253,116,6,.22), rgba(253,116,6,.10)), #141d28; border-color: var(--line); }
:root[data-theme="dark"] .company-summary:before { background: none; }
:root[data-theme="dark"] .company-summary__highlights { background: rgba(9,13,19,.32); border-color: #3a2c23; }
:root[data-theme="dark"] .company-summary__highlights > div { border-color: #3a2c23; }
:root[data-theme="dark"] .company-summary__status { background: rgba(9,13,19,.28); border-color: #925328; box-shadow: inset 0 0 0 1px rgba(255,184,125,.05); }
:root[data-theme="dark"] .company-summary__archive { border-color: #754223; }
:root[data-theme="dark"] .company-summary__archive > span { color: #ffab6b; }
:root[data-theme="dark"] .company-followup-control, :root[data-theme="dark"] .company-followup-sent { border-color: #31566d; background: rgba(16,42,57,.54); }
:root[data-theme="dark"] .company-followup-control > span, :root[data-theme="dark"] .company-followup-sent > span { color: #9bd2f1; }
:root[data-theme="dark"] .company-followup-control.is-due { border-color: #8f5527; background: rgba(80,44,20,.46); }
:root[data-theme="dark"] .company-followup-control.is-due > span, :root[data-theme="dark"] .company-followup-control.is-due strong { color: #ffc08d; }
:root[data-theme="dark"] .company-attention-box--first_contact { border-color: #85502d; background: rgba(74,39,19,.42); }
:root[data-theme="dark"] .company-attention-box--first_contact > span, :root[data-theme="dark"] .company-attention-box--first_contact strong { color: #ffc08d; }
:root[data-theme="dark"] .company-attention-box--follow_up { border-color: #8a6924; background: rgba(78,58,12,.46); }
:root[data-theme="dark"] .company-attention-box--follow_up > span, :root[data-theme="dark"] .company-attention-box--follow_up strong { color: #ffe193; }
:root[data-theme="dark"] .company-attention-box--waiting_reply { border-color: #83642c; background: rgba(71,53,18,.46); }
:root[data-theme="dark"] .company-attention-box--waiting_reply > span, :root[data-theme="dark"] .company-attention-box--waiting_reply strong { color: #f7d589; }
:root[data-theme="dark"] .company-attention-box--inactive { border-color: #4b565f; background: rgba(51,59,67,.6); }
:root[data-theme="dark"] .company-attention-box--inactive > span, :root[data-theme="dark"] .company-attention-box--inactive strong { color: #c3ccd3; }
:root[data-theme="dark"] .company-live-lead { border-color: #316b51; background: rgba(20,58,42,.5); }
:root[data-theme="dark"] .company-live-lead > span, :root[data-theme="dark"] .company-live-lead strong { color: #9ee0bb; }
:root[data-theme="dark"] .company-live-lead p { color: #b9d8c4; }
:root[data-theme="dark"] .data-table tbody .company-row--attention-follow_up { background: rgba(103,73,10,.28); box-shadow: inset 4px 0 0 #e2aa32; }
:root[data-theme="dark"] .data-table tbody .company-row--attention-waiting_reply { background: rgba(106,77,19,.25); box-shadow: inset 4px 0 0 #dba539; }
:root[data-theme="dark"] .data-table tbody .company-row--attention-inactive { background: rgba(86,96,106,.2); box-shadow: inset 4px 0 0 #89939b; }
:root[data-theme="dark"] .data-table tbody .company-row--active-negotiation { background: rgba(25,92,61,.32); box-shadow: inset 4px 0 0 #50b681; }
:root[data-theme="dark"] .company-panel--notes { background: rgba(61,102,151,.12); border-color: #283e58; border-top-color: #5e98d3; }
:root[data-theme="dark"] .company-panel--notes .panel-header:before { background: #1c334c; color: #a9d1ff; }
:root[data-theme="dark"] .company-panel--automation { background: rgba(113,132,147,.10); border-color: #374955; border-top-color: #8097a8; }
:root[data-theme="dark"] .company-panel--automation .panel-header:before { background: #263641; color: #c4d3dd; }
:root[data-theme="dark"] .automatic-lead-reason a, :root[data-theme="dark"] .automatic-lead-reason small { color: #b9c8d2; }
:root[data-theme="dark"] .company-panel--contacts { background: rgba(31,112,75,.12); border-color: #254638; border-top-color: #5caf83; }
:root[data-theme="dark"] .company-panel--contacts .panel-header:before { background: #1b392b; color: #96e1b7; }
:root[data-theme="dark"] .contact-person { background: rgba(8,22,18,.42); border-color: #285542; }
:root[data-theme="dark"] .contact-person__aside { border-color: #285542; }
:root[data-theme="dark"] .contact-person p { border-color: #5caf83; }
:root[data-theme="dark"] .company-panel--timeline { background: rgba(128,145,160,.10); border-color: #33404a; border-top-color: #8496a4; }
:root[data-theme="dark"] .company-panel--timeline .panel-header:before { background: #24303a; color: #c0ccd6; }
:root[data-theme="dark"] .company-panel--timeline .timeline-card { background: #111923; border-color: #34414b; }
:root[data-theme="dark"] .company-panel--timeline .timeline-dot { background: #a6b4bf; box-shadow: 0 0 0 2px #34414b; }
:root[data-theme="dark"] .button--meeting { background: #282039; border-color: #6f599e; color: #decfff; }
:root[data-theme="dark"] .button--meeting:hover { background: #332847; border-color: #a98ee0; }
:root[data-theme="dark"] .button--schedule-meeting { border-color: #42b976; background: linear-gradient(135deg, #174c31, #123525); color: #c7f8d7; box-shadow: 0 8px 18px rgba(0, 0, 0, .22); }
:root[data-theme="dark"] .button--schedule-meeting:hover { border-color: #65d596; background: linear-gradient(135deg, #1e5e3d, #16452f); }
:root[data-theme="dark"] .company-panel--meetings { background: rgba(94,70,132,.13); border-color: #413254; border-top-color: #9678c5; }
:root[data-theme="dark"] .company-panel--meetings .panel-header:before { background: #302441; color: #d8c7ff; }
:root[data-theme="dark"] .company-panel--sent-emails { background: rgba(38,75,107,.14); border-color: #29465e; border-top-color: #6696bc; }
:root[data-theme="dark"] .company-panel--sent-emails .panel-header:before { background: #1d3548; color: #abd4f0; }
:root[data-theme="dark"] .sent-email-record { background: #111b25; border-color: #2d4c62; }
:root[data-theme="dark"] .sent-email-record summary::after, :root[data-theme="dark"] .sent-email-record span { color: #a2c8e2; }
:root[data-theme="dark"] .sent-email-record article { border-color: #2d4c62; }
:root[data-theme="dark"] .meeting-record { background: #131722; border-color: #40354f; }
:root[data-theme="dark"] .meeting-record.is-pending { border-left-color: #a88ad0; }
:root[data-theme="dark"] .meeting-record.is-processed { border-left-color: #5da47e; }
:root[data-theme="dark"] .meeting-status--pending { background: #302443; color: #d7c8f7; }
:root[data-theme="dark"] .meeting-status--processed { background: #183929; color: #9ce0b8; }
:root[data-theme="dark"] .meeting-record__raw { border-color: #40354f; }
:root[data-theme="dark"] .meeting-record__raw summary { color: #d7c8f7; }
:root[data-theme="dark"] .meeting-record__summary { background: #1b1d29; }
:root[data-theme="dark"] .meeting-record__summary > span { color: #d7c8f7; }
:root[data-theme="dark"] .duplicate-warning__archive { background: #2a333d; color: #c2ccd4; }
:root[data-theme="dark"] .button--danger { background: #a84334; border-color: #d97564; color: #fff; }
:root[data-theme="dark"] .button--danger:hover { background: #c45745; }
:root[data-theme="dark"] .field:has(select)::after, :root[data-theme="dark"] .company-status-form label::after, :root[data-theme="dark"] .company-priority-form::after { border-color: #d9e0e8; }
:root[data-theme="dark"] .company-status-form label > span { color: #ffab6b; }
:root[data-theme="dark"] .company-status-form select { background: rgba(10,15,22,.54); border-color: #704325; color: var(--ink); }
:root[data-theme="dark"] .company-status-last-change { color: #d8b89e; }
:root[data-theme="dark"] .company-status-history summary { color: #ffab6b; }
:root[data-theme="dark"] .company-status-history ol { border-color: #754223; }
:root[data-theme="dark"] .company-identity__meta a { color: #ffab6b; }
:root[data-theme="dark"] .company-identity__outreach { border-color: #365c7b; background: linear-gradient(135deg, #132330, #182d3d); box-shadow: 0 10px 24px rgba(0,0,0,.18), inset 3px 0 0 #67a9dc; }
:root[data-theme="dark"] .company-identity__outreach > span { background: #203f56; color: #b6ddfb; }
:root[data-theme="dark"] .company-identity__outreach-origin--ai { color: #d2c1ff; background: #38285d; }
:root[data-theme="dark"] .company-identity__outreach-origin--manual { color: #c6d0d8; background: #313d47; }
:root[data-theme="dark"] .email-draft-recipient > span { color: #aab8c5; }
:root[data-theme="dark"] .company-identity__outreach-email, :root[data-theme="dark"] .email-draft-recipient__email { color: #a9d2ff; }
:root[data-theme="dark"] .company-identity__outreach-email:hover, :root[data-theme="dark"] .company-identity__outreach small a, :root[data-theme="dark"] .email-draft-recipient__email:hover { color: #ffab6b; }
:root[data-theme="dark"] .company-identity__outreach.is-missing { border-color: #5d4738; background: linear-gradient(135deg, #201a18, #251e19); box-shadow: 0 10px 24px rgba(0,0,0,.16), inset 3px 0 0 #d69b6c; }
:root[data-theme="dark"] .company-identity__outreach.is-missing > span { background: #3b2d24; color: #ffd2ae; }
:root[data-theme="dark"] .company-identity__outreach.is-missing strong { color: #c6d0d9; }
:root[data-theme="dark"] .email-draft-recipient { border-color: #344251; background: #111923; }
:root[data-theme="dark"] .email-draft-recipient.is-missing { border-color: #5d4738; background: #201a18; }
:root[data-theme="dark"] .email-draft-recipient.is-missing strong { color: #ffd0ab; }
:root[data-theme="dark"] .email-draft-thread-context { border-color: #344251; background: #111923; }
:root[data-theme="dark"] .email-draft-thread-context summary { color: #bbccda; }
:root[data-theme="dark"] .email-draft-thread-context summary::after { color: #a5c5dc; }
:root[data-theme="dark"] .email-draft-thread-context > div { border-color: #344251; }
:root[data-theme="dark"] .email-draft-thread-context > div > span { color: #aab8c5; }
:root[data-theme="dark"] .email-draft-thread-context > div > strong { color: #e0e8ef; }
:root[data-theme="dark"] .email-draft-thread-context article { border-color: #344251; background: #172330; color: #dbe5ec; }
:root[data-theme="dark"] .email-draft-preview { border-color: #334251; background: #111923; }
:root[data-theme="dark"] .email-draft-preview > header span { color: #b9c8d7; }
:root[data-theme="dark"] .email-draft-preview__message { border-color: #3a4651; background: #fdfdfd; }
:root[data-theme="dark"] .button--archive { background: rgba(253,116,6,.14); border-color: #b35d22; color: #ffbd88; }
:root[data-theme="dark"] .button--archive:hover { background: rgba(253,116,6,.24); border-color: #ff9341; }
:root[data-theme="dark"] .button--followup { border-color: #386c8a; background: #152a38; color: #b1dfff; box-shadow: none; }
:root[data-theme="dark"] .button--followup:hover { border-color: #60a7d0; background: #1a384a; color: #d8efff; }
.badge--ke_kontaktovani { background: #fff0e5; color: #a95000; }
.badge--kontaktovano { background: #eaf2fc; color: #3c6ca5; }
.badge--follow_up { background: #fff0b8; color: #855d00; }
.badge--aktivni_jednani { background: #e2f5e9; color: #1c714b; }
.badge--nema_zajem, .badge--nezadouci_kontakt, .badge--nereaguje { background: #f1eef0; color: #6f5d65; }
.badge--neaktualni { background: #f3eeee; color: #735f5f; }

:root[data-theme="dark"] .badge--ke_kontaktovani { background: #3a2517; color: #ffab6b; }
:root[data-theme="dark"] .badge--kontaktovano { background: #1c2d42; color: #9bc7ff; }
:root[data-theme="dark"] .badge--follow_up { background: #4a380d; color: #ffe19a; }
:root[data-theme="dark"] .badge--aktivni_jednani { background: #183b2c; color: #a5e6c0; }
:root[data-theme="dark"] .badge--nema_zajem, :root[data-theme="dark"] .badge--nezadouci_kontakt, :root[data-theme="dark"] .badge--nereaguje { background: #30282d; color: #d5c1ca; }

.bulk-follow-up-toolbar, .bulk-follow-up__actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin:16px 0; }
.bulk-follow-up { padding:24px; margin-bottom:20px; min-width:0; }
.bulk-follow-up .check-line { color:var(--ink); font-size:14px; line-height:1.5; }
.check-line.company-reply { color:var(--ink); font-size:13px; }
.bulk-follow-up .check-line input { flex-shrink:0; }
.bulk-follow-up__item .check-line > span { color:var(--muted); }
.bulk-follow-up__item { padding:18px 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.bulk-follow-up__item .check-line { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
.bulk-follow-up__item details { margin:12px 0 0 26px; }
.bulk-follow-up__item summary { cursor:pointer; }
.bulk-follow-up__body { line-height:1.65; max-width:680px; }
.bulk-follow-up [data-status="sent"] { color:#258a60; }
.bulk-follow-up [data-status="uncertain"] { color:#c16423; }
:root[data-theme="dark"] .bulk-follow-up [data-status="sent"] { color:#7ce6b7; }
:root[data-theme="dark"] .bulk-follow-up [data-status="uncertain"] { color:#ffc28c; }
:root[data-theme="dark"] .badge--neaktualni { background: #30282a; color: #d5c1c4; }
:root[data-theme="dark"] .company-cell__automatic { background: #26323d; color: #c6d0d8; }
:root[data-theme="dark"] .company-priority-form select { background: #0e141d; border-color: #303946; color: var(--ink); }
:root[data-theme="dark"] .metric-card--attention { background: linear-gradient(135deg, rgba(253, 116, 6, .18), var(--panel) 52%); }
:root[data-theme="dark"] .metric-card__action { color: #ffb275; }
:root[data-theme="dark"] .dashboard-primary-stat__card { border-color: #2d3a46; background: linear-gradient(135deg, #151d27, #111822); }
:root[data-theme="dark"] .dashboard-primary-stat__card em { color: #96a5b0; }
:root[data-theme="dark"] .dashboard-meeting-alert { border-color: #285775; border-left-color: #4d9dcc; background: linear-gradient(100deg, #132b3b, #161d26 68%); }
:root[data-theme="dark"] .dashboard-meeting-alert__icon { background: #193e56; color: #a4dcff; }
:root[data-theme="dark"] .dashboard-meeting-alert .eyebrow, :root[data-theme="dark"] .dashboard-meeting-alert__list time { color: #9dd7fb; }
:root[data-theme="dark"] .dashboard-meeting-alert__list a, :root[data-theme="dark"] .dashboard-meeting-alert__more { border-color: #2b5b78; background: rgba(16, 27, 37, .76); color: var(--ink); }
:root[data-theme="dark"] .dashboard-meeting-alert__list a:hover { border-color: #4e9bc8; background: #182b3a; }
:root[data-theme="dark"] .dashboard-meeting-alert__more { color: #aac9db; }
:root[data-theme="dark"] .dashboard-meeting-alert__button { border-color: #4d9dcc; background: #173c54; color: #c9ecff; box-shadow: 0 5px 12px rgba(0, 0, 0, .24); }
:root[data-theme="dark"] .dashboard-meeting-alert__button:hover { border-color: #83c9ef; background: #1c4b67; color: #e0f5ff; }
:root[data-theme="dark"] .dashboard-section--actions { border-color: #5c3d29; background: linear-gradient(135deg, rgba(97, 57, 28, .28), var(--panel) 58%); }
:root[data-theme="dark"] .dashboard-ready { border-color: #2b6b54; background: #142f27; color: #a9e6c8; }
:root[data-theme="dark"] .dashboard-ready > span { background: #3a9b73; }
:root[data-theme="dark"] .metric-card--web-inquiry { border-color: #35577e; background: linear-gradient(135deg, rgba(33, 71, 112, .35), var(--panel) 54%); }
:root[data-theme="dark"] .metric-card--followup { border-color: #80631f; background: linear-gradient(135deg, rgba(87, 65, 9, .38), var(--panel) 54%); }
:root[data-theme="dark"] .metric-card--waiting { border-color: #7c6029; background: linear-gradient(135deg, rgba(87, 62, 14, .34), var(--panel) 54%); }
:root[data-theme="dark"] .metric-card--inactive { border-color: #434d57; background: linear-gradient(135deg, rgba(69, 79, 89, .30), var(--panel) 54%); }
:root[data-theme="dark"] .metric-card--active-negotiation { border-color: #316b51; background: linear-gradient(135deg, rgba(25,92,61,.36), var(--panel) 54%); }

/* Settings are balanced in pairs on desktop, while their forms stay compact. */
.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 1240px;
  grid-auto-rows: 1fr;
  align-items: stretch;
}

.settings-grid > .panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-bottom: 0;
}

.settings-grid > .form-panel > form,
.settings-grid > .panel > .download-list {
  flex: 1;
}

.settings-grid > .panel > .download-list {
  justify-content: center;
}

.settings-email-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: end;
  align-content: space-between;
  gap: 14px;
}

.settings-email-form .switch-line {
  grid-column: 1 / -1;
}

.settings-email-form .button {
  min-height: 42px;
}

.settings-password-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-content: space-between;
}

.settings-password-form__current,
.settings-password-form .button {
  grid-column: 1 / -1;
}

.automation-settings form .button {
  margin-top: auto;
}

/* Administration is intentionally compact: actions stay grouped with the
   account they affect, while dangerous password resets are clearly distinct. */
.password-required-card { max-width: 640px; }
.admin-intro { display: flex; align-items: flex-start; gap: 10px; max-width: 1000px; margin: -8px 0 16px; padding: 13px 15px; border: 1px solid #d9e6ef; border-radius: 12px; background: #f7fbff; color: #4b6379; font-size: 12px; }
.admin-intro > span { color: #466b9b; font-size: 18px; line-height: 1; }
.admin-intro p { margin: 0; line-height: 1.55; }
.admin-users { display: grid; gap: 14px; max-width: 1000px; }
.admin-user-card { overflow: hidden; }
.admin-user-card.is-inactive { opacity: .72; }
.admin-user-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.admin-user-card > header > div:first-child { display: flex; align-items: center; gap: 11px; }
.admin-user-card h2 { margin: 0; font-size: 15px; }
.admin-user-card h2 small { font-size: 10px; font-weight: 600; color: var(--muted); }
.admin-user-card header p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.admin-user-card__state { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.admin-role, .admin-state, .admin-password-pending { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 9px; font-weight: 800; }
.admin-role--admin { background: #eee8ff; color: #6846b1; }
.admin-role--user { background: #edf2f1; color: #667875; }
.admin-state { background: #f5eceb; color: #85625d; }
.admin-state.is-active { background: #e3f5ed; color: #167052; }
.admin-user-card__body { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: 0; }
.admin-account-form, .admin-reset-form { display: grid; gap: 10px; padding: 16px 20px; align-content: start; }
.admin-account-form { border-right: 1px solid var(--line); grid-template-columns: minmax(0, 1fr) auto; }
.admin-account-form .field { grid-column: 1 / -1; }
.admin-active-toggle { margin: 0; align-self: center; }
.admin-reset-form { grid-template-columns: minmax(0, 1fr) auto; }
.admin-reset-form .field, .admin-reset-form small { grid-column: 1 / -1; }
.admin-reset-form small { color: var(--muted); font-size: 10px; }
.admin-user-card > footer { display: flex; justify-content: space-between; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.admin-password-pending { background: #fff2dc; color: #98620e; }
.admin-audit { max-width: 1000px; margin-top: 16px; }
.admin-audit header { padding: 18px 20px 10px; }
.admin-audit header > div { display: flex; gap: 10px; align-items: flex-start; }
.admin-audit header > div > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: #466b9b; background: #e9f2ff; }
.admin-audit h2 { margin: 0; font-size: 15px; }
.admin-audit header p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.admin-audit__list { padding: 0 20px 12px; }
.admin-audit__list article { display: grid; grid-template-columns: 145px 1fr; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.admin-audit__list time { color: var(--muted); font-size: 10px; }
.admin-audit__list p { margin: 0; font-size: 11px; }

:root[data-theme="dark"] .admin-intro { background: #121d2a; border-color: #2c4056; color: #afc1d3; }
:root[data-theme="dark"] .admin-role--admin { background: #322458; color: #d5c5ff; }
:root[data-theme="dark"] .admin-role--user { background: #263039; color: #b8c3cc; }
:root[data-theme="dark"] .admin-state.is-active { background: #17382d; color: #8fe1bf; }
:root[data-theme="dark"] .admin-password-pending { background: #3b2c17; color: #ffd28a; }

@media (max-width: 780px) {
  .company-actions .button--ai { flex-direction: column; gap: 0; line-height: 1.15; white-space: nowrap; }
  .metrics-grid--simple { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-workspace { grid-template-columns: 1fr; }
  .dashboard-meeting-alert { grid-template-columns: 40px minmax(0, 1fr); }
  .dashboard-meeting-alert__button { width: 100%; }
  .topbar-context { display: none; }
  .bottom-nav { grid-template-columns: repeat(6, 1fr); }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar select { min-width: 0; width: 100%; padding-right: 26px; font-size: 10px; }
  .filter-bar .filter-search { grid-column: 1 / -1; }
  .filter-bar .filter-clear { grid-column: 1 / -1; justify-self: start; padding: 5px 1px; }
  .data-table tr { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; width: 100%; }
  .data-table td { min-width: 0; }
  .data-table td[data-label="Poslední komentář"] { grid-column: 1 / -1; width: auto; min-width: 0; }
  .company-last-comment { max-width: none; }
  .company-priority-form, .company-priority-form select { min-width: 0; }
  .mobile-menu { color: #fd7406; }
  .topbar > .button { gap: 0; }
  .topbar > .button span { display: grid; place-items: center; width: 100%; }
  .bottom-user-avatar { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: #252d38; color: #fff; font-size: 9px; font-weight: 800; }
  .content { padding-bottom: calc(128px + env(safe-area-inset-bottom)); }
  .data-table .company-row td.company-table-action { display: none; }
  .data-table .company-row td.company-table-action--visible { display: block; grid-column: 1 / -1; }
  .contact-person { display: grid; grid-template-columns: 1fr; gap: 12px; }
  .contact-person__aside { justify-content: space-between; padding: 12px 0 0; border-top: 1px solid #cfe6da; border-left: 0; }
  .theme-toggle { margin-top: 14px; }
  :root[data-theme="dark"] .data-table tr { background: var(--panel); border-color: var(--line); }
  :root[data-theme="dark"] .contact-person__aside { border-color: #285542; }
  .meeting-record header, .meeting-record__summary { display: grid; }
  .meeting-record__header-actions { justify-items: start; align-items: start; }
  .meeting-status { justify-self: start; }
  .meeting-record__summary .button { width: 100%; }
  .meeting-record__summary-actions { align-self: auto; flex-wrap: wrap; }
  .sent-email-record summary { align-items: flex-start; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-grid > .detail-side { display: flex; grid-column: 1 / -1; min-width: 0; width: 100%; }
  .settings-email-form,
  .settings-password-form { grid-template-columns: 1fr; }
  .settings-grid { grid-auto-rows: auto; }
  .settings-grid > .panel { height: auto; }
  .settings-grid > .form-panel > form,
  .settings-grid > .panel > .download-list { flex: initial; }
  .settings-password-form__current,
  .settings-password-form .button { grid-column: auto; }
  .admin-user-card > header, .admin-user-card > footer { align-items: flex-start; flex-direction: column; }
  .admin-user-card__state { justify-content: flex-start; }
  .admin-user-card__body { grid-template-columns: 1fr; }
  .admin-account-form { border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-account-form, .admin-reset-form { grid-template-columns: 1fr; }
  .admin-account-form .button, .admin-reset-form .button { width: 100%; }
  .admin-audit__list article { grid-template-columns: 1fr; gap: 3px; }
}

@media (max-width: 480px) {
  .dashboard-primary-stat__card { max-width: none; min-height: 140px; }
  .dashboard-action-cards { grid-template-columns: 1fr; }
}

/* Once the workspace becomes narrow, settings are easier to use as a single
   readable column. This also prevents the compact forms from competing for
   width inside two small cards. */
@media (max-width: 1100px) {
  /* On narrower desktop widths, keep the company status prominent and
     readable instead of leaving it as a narrow remnant of the side column. */
  .detail-side { display: flex; order: -1; width: 100%; min-width: 0; }
  .detail-grid > .detail-side > .company-summary { width: 100%; max-width: none; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar-context { display: none; }
}

@media (hover: none) and (pointer: coarse) {
  .detail-grid { display: block; width: 100%; }
  .detail-grid > .detail-side { display: flex; width: 100%; min-width: 0; margin-top: 16px; }
  .company-summary { width: 100%; max-width: none; }
}

/* Calendar, scheduled meetings and secure company attachments. */
.calendar-heading { align-items: flex-start; max-width: 1220px; }
.calendar-heading .page-heading { margin-bottom: 20px; }
.calendar { overflow: hidden; max-width: 1220px; }
.calendar__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.calendar__toolbar > div { display: flex; align-items: center; gap: 10px; }
.calendar__toolbar strong { font-size: 14px; }
.calendar__toolbar a:not(.button) { color: var(--primary); font-size: 10px; font-weight: 750; }
.calendar__grid { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); overflow-x: auto; }
.calendar-day { min-height: 310px; border-right: 1px solid var(--line); background: var(--panel); }
.calendar-day:last-child { border-right: 0; }
.calendar-day > header { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.calendar-day > header strong { color: var(--ink); font-size: 12px; }
.calendar-day.is-today > header { background: transparent; color: var(--muted); }
.calendar-day.is-today > header strong { padding: 3px 7px; border-radius: 7px; background: var(--primary-soft); color: var(--primary-dark); }
.calendar-day__events { display: grid; align-content: start; gap: 7px; padding: 9px; }
.calendar-day__empty { padding: 7px 3px; color: #a1aaa8; font-size: 10px; }
.calendar-event { display: grid; gap: 3px; padding: 9px; border: 1px solid #b9dfd0; border-left: 3px solid #36a56e; border-radius: 9px; background: #f2fbf6; color: var(--ink); }
.calendar-event:hover { border-color: #36a56e; background: #eaf8f0; }
.calendar-event time { color: #227353; font-size: 10px; font-weight: 800; }
.calendar-event b { overflow: hidden; font-size: 11px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event span, .calendar-event small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-note { max-width: 1220px; margin: 10px 2px 0; color: var(--muted); font-size: 11px; }

.company-panel--scheduled-meetings { background: #f5fbf8; border-color: #d2eadc; border-top-color: #5aaa82; }
.company-panel--scheduled-meetings .panel-header:before { content: "◷"; background: #e2f5e9; color: #238157; }
.scheduled-meeting-list { display: grid; gap: 8px; padding: 0 22px 22px; }
.scheduled-meeting { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 12px 14px; border: 1px solid #d6e8df; border-left: 3px solid #38a66f; border-radius: 11px; background: #fff; }
.scheduled-meeting.is-past { opacity: .68; border-left-color: #95a59e; }
.scheduled-meeting time { display: grid; gap: 2px; color: #236a50; font-size: 10px; }
.scheduled-meeting time b { color: var(--ink); font-size: 11px; }
.scheduled-meeting h3 { margin: 0; font-size: 13px; }
.scheduled-meeting p { display: -webkit-box; overflow: hidden; margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.scheduled-meeting__actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 3px; }
.modal--scheduled-meeting .modal-dialog { width: min(520px, 100%); }
.modal--scheduled-meeting .modal-form { max-width: 520px; }
.modal--scheduled-meeting .form-grid { gap: 12px; }
.modal--scheduled-meeting .meeting-schedule-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.modal--scheduled-meeting .meeting-schedule-row .field:has(select)::after { right: 22px; bottom: 23px; }
.modal--scheduled-meeting .field input, .modal--scheduled-meeting .field select { height: 40px; }
.modal--scheduled-meeting .field textarea { min-height: 92px; }
.meeting-date-control { position: relative; display: block; }
.meeting-date-control__input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.meeting-date-control__button { display: flex; width: 100%; height: 40px; align-items: center; justify-content: space-between; gap: 8px; padding: 0 7px 0 12px; border: 1px solid #dbe6e3; border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; text-align: left; }
.meeting-date-control__button:hover { border-color: #ffbd83; background: #fff8f3; }
.meeting-date-control__button:focus-visible { outline: 0; border-color: #ff8a30; box-shadow: 0 0 0 3px rgba(253, 116, 6, .16); }
.meeting-date-control__icon { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 7px; background: #f4e8df; color: #bb570e; }
.meeting-date-control__icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.meeting-date-picker { position: absolute; z-index: 8; top: calc(100% + 6px); left: 0; width: 300px; padding: 10px; border: 1px solid #dbe6e3; border-radius: 12px; background: #fff; box-shadow: 0 18px 36px rgba(16, 22, 31, .18); }
.meeting-date-picker[hidden] { display: none; }
.meeting-date-picker__header { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; margin-bottom: 8px; }
.meeting-date-picker__header strong { color: var(--ink); font-size: 11px; text-align: center; text-transform: capitalize; }
.meeting-date-picker__header button { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 21px; line-height: 1; cursor: pointer; }
.meeting-date-picker__header button:hover:not(:disabled) { background: #fff0e5; color: #c85a00; }
.meeting-date-picker__header button:disabled { opacity: .35; cursor: default; }
.meeting-date-picker__weekdays, .meeting-date-picker__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.meeting-date-picker__weekdays { margin-bottom: 4px; color: #89939b; font-size: 9px; font-weight: 800; text-align: center; text-transform: uppercase; }
.meeting-date-picker__days button { height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font: inherit; font-size: 10px; cursor: pointer; }
.meeting-date-picker__days button:hover:not(:disabled) { background: #fff0e5; color: #c85a00; }
.meeting-date-picker__days button.is-outside { color: #a9b0b5; }
.meeting-date-picker__days button.is-today { box-shadow: inset 0 0 0 1px #fd9b55; }
.meeting-date-picker__days button.is-selected { background: #fd7406; color: #fff; font-weight: 800; box-shadow: 0 4px 10px rgba(216, 91, 0, .22); }
.meeting-date-picker__days button:disabled { color: #c2c8cc; cursor: default; }
:root[data-theme="dark"] .meeting-date-control__button { border-color: #303946; background: #0e141d; color: var(--ink); }
:root[data-theme="dark"] .meeting-date-control__button:hover { border-color: #ff9341; background: #151e28; }
:root[data-theme="dark"] .meeting-date-control__icon { background: #2c241f; color: #ffb07a; }
:root[data-theme="dark"] .meeting-date-picker { border-color: #34404d; background: #17212c; box-shadow: 0 20px 42px rgba(0, 0, 0, .38); }
:root[data-theme="dark"] .meeting-date-picker__header button:hover:not(:disabled), :root[data-theme="dark"] .meeting-date-picker__days button:hover:not(:disabled) { background: #2b1c12; color: #ffb172; }
:root[data-theme="dark"] .meeting-date-picker__weekdays, :root[data-theme="dark"] .meeting-date-picker__days button.is-outside { color: #718090; }
:root[data-theme="dark"] .meeting-date-picker__days button.is-today { box-shadow: inset 0 0 0 1px #ff9850; }
:root[data-theme="dark"] .meeting-date-picker__days button:disabled { color: #43505d; }
@media (max-width: 380px) { .modal--scheduled-meeting .meeting-schedule-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; } }

.company-panel--files { background: #f8fbfd; border-color: #d7e4eb; border-top-color: #7a9fb6; }
.company-panel--files .panel-header:before { content: "▤"; background: #e8f1f7; color: #456f89; }
.company-file-upload { display: flex; align-items: center; gap: 10px; padding: 0 22px 18px; }
.detail-side .company-panel--files { width: 100%; }
.detail-side .company-file-upload { flex-direction: column; align-items: stretch; padding: 0 16px 16px; }
.detail-side .company-file-upload__dropzone { flex: none; width: 100%; }
.detail-side .company-file-upload .button { width: 100%; }
.detail-side .company-file-list { padding: 0 16px 16px; }
.company-file-upload__input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }
.company-file-upload__dropzone { display: grid; flex: 1; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 9px; min-height: 74px; padding: 11px 13px; border: 1px dashed #a8c3d2; border-radius: 11px; background: rgba(255,255,255,.64); cursor: pointer; }
.company-file-upload__dropzone:hover, .company-file-upload__dropzone.is-dragging { border-color: #4589ae; background: #edf7fd; }
.company-file-upload__dropzone > span { grid-row: 1 / span 3; display: grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; background: #e6f1f8; color: #3d789d; font-size: 17px; font-weight: 850; }
.company-file-upload__dropzone b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.company-file-upload__dropzone small, .company-file-upload__dropzone em { display: block; overflow: hidden; color: var(--muted); font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.company-file-upload__dropzone em:empty { display: none; }
.company-file-upload__dropzone em { color: #286c94; font-weight: 700; }
.company-file-list { display: grid; gap: 7px; padding: 0 22px 22px; }
.company-file-list article { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid #dae5eb; border-radius: 10px; background: #fff; }
.company-file__icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 7px; background: #e8f1f7; color: #4b758e; font-size: 13px; }
.company-file-list a { display: block; overflow: hidden; color: #245c80; font-size: 11px; font-weight: 750; text-decoration: underline; text-decoration-color: #b7d0df; text-overflow: ellipsis; white-space: nowrap; }
.company-file-list a:hover { color: var(--primary-dark); }
.company-file-list small { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.admin-storage { max-width: 1000px; margin-top: 16px; overflow: hidden; }
.admin-storage > header { padding: 18px 20px 12px; }
.admin-storage > header > div { display: flex; align-items: flex-start; gap: 10px; }
.admin-storage > header > div > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: #e8f1f7; color: #456f89; }
.admin-storage h2 { margin: 0; font-size: 15px; }
.admin-storage header p, .admin-storage-form p { margin: 2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.admin-storage__metrics { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 10px; padding: 0 20px 14px; }
.admin-storage__metrics article { display: grid; align-content: start; gap: 4px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fafcfd; }
.admin-storage__metrics span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.admin-storage__metrics strong { color: var(--ink); font-size: 18px; letter-spacing: -.03em; }
.admin-storage__metrics strong small, .admin-storage__metrics article > small { color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: 0; }
.storage-meter { height: 6px; overflow: hidden; border-radius: 99px; background: #e4eaed; }
.storage-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4f9c7b, #86c5a9); }
.admin-storage-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px 12px; align-items: end; padding: 15px 20px 18px; border-top: 1px solid var(--line); }
.admin-storage-form p { grid-column: 1 / -1; }

:root[data-theme="dark"] .calendar { background: #121a24; border-color: #2d3c4b; box-shadow: 0 16px 34px rgba(0, 0, 0, .24); }
:root[data-theme="dark"] .calendar__toolbar { border-color: #2d3c4b; background: #151f2a; }
:root[data-theme="dark"] .calendar__toolbar a:not(.button) { color: #ffae6c; }
:root[data-theme="dark"] .calendar-day, :root[data-theme="dark"] .company-file-list article, :root[data-theme="dark"] .scheduled-meeting { background: #121b24; border-color: #2d3d48; }
:root[data-theme="dark"] .calendar-day:nth-child(odd) { background: #14202b; }
:root[data-theme="dark"] .calendar-day > header { border-color: #2d3d48; background: #17232f; color: #98a7b5; }
:root[data-theme="dark"] .calendar-day.is-today > header { background: #17232f; color: #98a7b5; }
:root[data-theme="dark"] .calendar-day.is-today > header strong { background: #1b4158; color: #bde5fb; }
:root[data-theme="dark"] .calendar-day__empty { color: #768595; }
:root[data-theme="dark"] .calendar-event { border-color: #2f765a; border-left-color: #63c992; background: linear-gradient(135deg, #15392c, #142d26); }
:root[data-theme="dark"] .calendar-event:hover { border-color: #65ca94; background: #1a4535; }
:root[data-theme="dark"] .calendar-event time, :root[data-theme="dark"] .scheduled-meeting time { color: #a5e6c0; }
:root[data-theme="dark"] .company-panel--scheduled-meetings { background: #101e19; border-color: #28523f; }
:root[data-theme="dark"] .company-panel--files { background: #111c25; border-color: #2c4556; }
:root[data-theme="dark"] .company-file-upload__dropzone { border-color: #426278; background: #101b24; }
:root[data-theme="dark"] .company-file-upload__dropzone:hover, :root[data-theme="dark"] .company-file-upload__dropzone.is-dragging { background: #142633; border-color: #5b9bc0; }
:root[data-theme="dark"] .company-file-upload__dropzone > span, :root[data-theme="dark"] .company-file__icon { background: #1d3444; color: #a8d7ef; }
:root[data-theme="dark"] .company-file-list a { color: #b4dcf2; }
:root[data-theme="dark"] .admin-storage__metrics article { background: #111923; border-color: #2d3b47; }
:root[data-theme="dark"] .storage-meter { background: #2a3540; }

@media (max-width: 780px) {
  .calendar-heading { display: block; }
  .calendar-heading > .button { display: inline-flex; margin: -10px 0 16px; }
  .calendar__toolbar { padding: 11px 10px; }
  .calendar__toolbar .button { min-height: 34px; padding: 0 8px; font-size: 10px; }
  .calendar__toolbar > div { display: grid; gap: 1px; text-align: center; }
  .calendar__toolbar strong { font-size: 11px; }
  .calendar__grid { grid-template-columns: 1fr; gap: 8px; overflow: visible; padding: 8px; background: #f3f6f7; }
  .calendar-day { min-height: 0; overflow: hidden; border: 1px solid #dce5e7; border-radius: 11px; background: #fff; }
  .calendar-day:last-child { border-bottom: 1px solid #dce5e7; }
  .calendar-day > header { padding: 10px 12px 6px; border-bottom: 0; background: transparent; }
  .calendar-day__events { gap: 7px; padding: 0 12px 11px; }
  .calendar-day__empty { padding: 0; }
  .calendar-day.is-today { border-color: #dce5e7; background: #fff; }
  .calendar-day.is-today > header { background: transparent; color: var(--muted); }
  .calendar-day.is-today > header strong { background: #e8f5fd; color: #2875aa; }
  :root[data-theme="dark"] .calendar__grid { background: #0e161f; }
  :root[data-theme="dark"] .calendar-day,
  :root[data-theme="dark"] .calendar-day:nth-child(odd) { border-color: #2b3d4c; background: #121b24; }
  :root[data-theme="dark"] .calendar-day > header { background: transparent; }
  :root[data-theme="dark"] .calendar-day.is-today { border-color: #2b3d4c; background: #121b24; }
  :root[data-theme="dark"] .calendar-day.is-today > header { background: transparent; color: #98a7b5; }
  :root[data-theme="dark"] .calendar-day.is-today > header strong { background: #1b4158; color: #bde5fb; }
  .scheduled-meeting { grid-template-columns: 72px minmax(0, 1fr); gap: 9px; }
  .scheduled-meeting__actions { grid-column: 1 / -1; justify-content: flex-start; }
  .scheduled-meeting-list, .company-file-list { padding-left: 16px; padding-right: 16px; }
  .company-file-upload { display: grid; padding: 0 16px 16px; }
  .company-file-upload .button { width: 100%; }
  .company-file-list article { grid-template-columns: 27px minmax(0, 1fr); }
  .company-file-list .text-button { grid-column: 1 / -1; justify-self: start; }
  .admin-storage__metrics, .admin-storage-form { grid-template-columns: 1fr; }
  .admin-storage-form .button { width: 100%; }
}
.bulk-follow-up [data-bulk-stop][hidden] { display: none; }
