:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #667281;
  --line: #dfe5ea;
  --soft: #f4f7f8;
  --panel: #ffffff;
  --nav: #12252b;
  --nav-soft: #1b363d;
  --teal: #0d7c78;
  --teal-dark: #075f5c;
  --teal-soft: #dff4f1;
  --blue: #2463a5;
  --amber: #a56211;
  --amber-soft: #fff1d6;
  --red: #b3323c;
  --shadow: 0 20px 55px rgba(22, 45, 50, .12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #eaf0f1; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.app-root { min-height: 100vh; }
.muted { color: var(--muted); }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .13em; }
.brand-mark { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 16px; background: var(--teal); color: white; font-size: 25px; font-weight: 850; box-shadow: 0 10px 24px rgba(13, 124, 120, .25); }
.brand-mark.small { width: 36px; height: 36px; border-radius: 11px; font-size: 18px; box-shadow: none; }

.login-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; align-items: center; justify-items: center; padding: 36px 20px; background: radial-gradient(circle at 15% 15%, #d4ece8 0, transparent 35%), linear-gradient(135deg, #eef5f4 0%, #dfe9ea 100%); }
.login-brand { display: flex; align-items: center; gap: 14px; justify-self: start; max-width: 1060px; width: 100%; }
.login-brand strong, .login-brand span { display: block; }
.login-brand strong { font-size: 21px; }
.login-brand span { color: var(--muted); font-size: 13px; margin-top: 2px; }
.login-card { width: min(460px, 100%); padding: 38px; border: 1px solid rgba(255,255,255,.8); border-radius: 24px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.login-card h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: -.04em; }
.login-card form { display: grid; gap: 16px; margin-top: 26px; }
label > span { display: block; margin: 0 0 7px; color: #34434d; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cfd9de; border-radius: 10px; background: #fff; color: var(--ink); padding: 11px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,124,120,.12); }
.primary, .secondary, .ghost, .danger { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 750; }
.primary { background: var(--teal); color: white; }
.primary:hover { background: var(--teal-dark); }
.secondary { border: 1px solid var(--line); background: white; color: var(--ink); }
a.secondary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.ghost { background: transparent; color: inherit; }
.danger { background: #fff0f1; color: var(--red); }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .55; }
.wide { width: 100%; }
.form-error { min-height: 20px; margin: -4px 0 0; color: var(--red); font-size: 13px; }
.demo-accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.demo-accounts button { border: 1px solid var(--line); border-radius: 10px; background: var(--soft); padding: 10px; color: #3f4e58; font-size: 12px; }
.login-note { color: var(--muted); font-size: 12px; }

.workspace { min-height: 100vh; display: grid; grid-template-columns: 236px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; color: #e6f0f1; background: var(--nav); padding: 22px 16px 16px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 25px; }
.side-brand strong { font-size: 18px; }
.sidebar nav { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; border-radius: 10px; padding: 10px 12px; background: transparent; color: #b9cccf; text-align: left; }
.nav-item:hover, .nav-item.is-active { background: var(--nav-soft); color: white; }
.nav-item span:first-child { width: 20px; text-align: center; }
.nav-count { margin-left: auto; border-radius: 999px; background: rgba(255,255,255,.13); padding: 2px 7px; font-size: 11px; }
.nav-badge { margin-left: auto; min-width: 21px; border-radius: 999px; background: #f3b84b; color: #402b08; padding: 2px 7px; font-size: 11px; font-weight: 850; text-align: center; }
.side-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: 16px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 0 6px 13px; }
.user-chip > span { display: grid; flex: 0 0 34px; height: 34px; place-items: center; border-radius: 50%; background: #dff4f1; color: var(--teal-dark); font-weight: 850; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 13px; }
.user-chip small { margin-top: 2px; color: #8eaaae; font-size: 11px; }
.side-footer .ghost { color: #a8bec1; border: 1px solid rgba(255,255,255,.12); }
.side-footer .ghost + .ghost { margin-top: 8px; }

.main-area { min-width: 0; background: #f3f6f7; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; height: 70px; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); padding: 0 28px; backdrop-filter: blur(10px); }
.global-search { display: flex; width: min(480px, 55vw); align-items: center; gap: 8px; border-radius: 10px; background: var(--soft); padding: 0 12px; }
.global-search input { border: 0; background: transparent; box-shadow: none; }
.local-badge { margin-left: auto; color: var(--teal); font-size: 12px; font-weight: 750; }
.icon-button { display: none; border: 0; background: transparent; font-size: 20px; }
.page { padding: 30px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.page-heading h1 { margin: 0 0 7px; font-size: 30px; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card, .panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 8px 24px rgba(24,47,53,.05); }
.metric-card { padding: 18px; }
.metric-card small, .metric-card strong, .metric-card span { display: block; }
.metric-card small { color: var(--muted); font-weight: 700; }
.metric-card strong { margin: 9px 0 3px; font-size: 30px; letter-spacing: -.03em; }
.metric-card span { color: var(--muted); font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 18px; }
.admin-action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.admin-action-card { display: block; border: 1px solid var(--line); border-radius: 14px; background: white; color: var(--ink); padding: 18px; text-align: left; box-shadow: 0 8px 24px rgba(24,47,53,.05); }
.admin-action-card:hover { border-color: #9ed4ce; background: #f5fbfa; }
.admin-action-card strong, .admin-action-card span { display: block; }
.admin-action-card strong { margin-bottom: 7px; font-size: 15px; }
.admin-action-card span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.panel { overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 16px 18px; }
.panel-head > div:last-child { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-body { padding: 18px; }
.panel + .panel { margin-top: 18px; }
.empty { padding: 28px; color: var(--muted); text-align: center; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid #edf0f2; padding: 13px 16px; text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #fafbfb; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
td { font-size: 13px; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); }
.row-link { border: 0; background: transparent; color: var(--teal); font-weight: 750; }
.danger-link { color: var(--red); }
.table-actions { display: flex; min-width: 250px; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
tr.is-disabled-row td { background: #f7f8f9; color: #68757e; }
tr.is-login-success td:first-child { box-shadow: inset 3px 0 0 #62b482; }
tr.is-login-failed td:first-child { box-shadow: inset 3px 0 0 #d36b73; }
.user-agent-cell { min-width: 220px; max-width: 360px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.task-list { margin: 0; padding: 6px 0; list-style: none; }
.task-list li { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 13px 18px; border-bottom: 1px solid #edf0f2; }
.task-list li:last-child { border-bottom: 0; }
.task-dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--teal); }
.task-list strong, .task-list small { display: block; }
.task-list strong { font-size: 13px; }
.task-list small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; background: var(--teal-soft); color: var(--teal-dark); font-size: 11px; font-weight: 750; }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.danger { background: #fff0f1; color: var(--red); }
.pill.neutral { background: #edf1f3; color: #52616b; }
.pill.success { background: #dff4e8; color: #17623c; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }
.toolbar .spacer { flex: 1; }
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.bulk-assignment-bar { display: grid; grid-template-columns: minmax(130px, .55fr) minmax(190px, .8fr) minmax(260px, 1.4fr) auto; align-items: end; gap: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f2faf8; padding: 14px 16px; }
.bulk-assignment-bar > div strong, .bulk-assignment-bar > div span { display: block; }
.bulk-assignment-bar > div span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.selection-check { min-width: 54px; }
.selection-check span:not(.sr-only) { margin: 0; white-space: nowrap; }
.filter-button { border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--muted); padding: 7px 11px; font-size: 12px; }
.filter-button.is-active { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-dark); font-weight: 750; }
.view-section + .view-section { margin-top: 18px; }
.form-body, .section-body { padding: 18px; }
.stack { display: grid; gap: 14px; }
.span-2 { grid-column: 1 / -1; }
.section-heading { margin: 0; font-size: 15px; }
.action-strip, .page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.inline-action { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.inline-action > label { flex: 1; min-width: 180px; }
.check-field, .check-row { display: flex; align-items: flex-start; gap: 9px; color: #45545e; font-size: 12px; line-height: 1.45; }
.check-field input, .check-row input { width: auto; margin: 2px 0 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.channel-fieldset { min-width: 0; margin: 0; border: 1px solid #d7e1e5; border-radius: 11px; padding: 12px; }
.channel-fieldset legend { padding: 0 5px; color: #34434d; font-size: 13px; font-weight: 750; }
.channel-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.channel-check { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 9px 10px; color: #45545e; font-size: 12px; }
.channel-check:has(input:checked) { border-color: #9ed4ce; background: var(--teal-soft); color: var(--teal-dark); }
.channel-check input { width: auto; margin: 0; }
.channel-check span { display: inline; margin: 0; color: inherit; font-size: inherit; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
textarea { min-height: 110px; resize: vertical; }
.help-text { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.notice { display: flex; align-items: flex-start; gap: 10px; border: 1px solid #cfe4e1; border-radius: 11px; background: #f0faf8; color: #285d59; padding: 12px 14px; font-size: 12px; line-height: 1.5; }
.notice.warn { border-color: #efd7ab; background: #fff8e9; color: #7d531b; }
.notice.danger { border-color: #efc4c8; background: #fff4f5; color: #8c3038; }
.modal-body > .notice { margin-bottom: 16px; }
.account-form-grid { margin-top: 16px; }
.security-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: #f7fafb; }
.security-metrics > div { padding: 15px 18px; border-right: 1px solid var(--line); }
.security-metrics > div:last-child { border-right: 0; }
.security-metrics small, .security-metrics strong { display: block; }
.security-metrics small { color: var(--muted); font-size: 11px; }
.security-metrics strong { margin-top: 5px; font-size: 22px; }
.split-view { display: grid; grid-template-columns: minmax(290px, .78fr) minmax(0, 1.55fr); gap: 18px; align-items: start; }
.sticky-panel { position: sticky; top: 90px; }
.record-list { display: grid; gap: 8px; margin: 0; padding: 10px; list-style: none; }
.record-list button { width: 100%; border: 1px solid transparent; border-radius: 10px; background: transparent; padding: 12px; text-align: left; }
.record-list button:hover, .record-list button.is-active { border-color: #cce2df; background: #f0f8f7; }
.record-list strong, .record-list small { display: block; }
.record-list strong { font-size: 13px; }
.record-list small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px; }
.detail-header h1, .detail-header h2 { margin: 0 0 7px; letter-spacing: -.025em; }
.detail-header p { margin: 0; color: var(--muted); }
.detail-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fact-card { border: 1px solid var(--line); border-radius: 10px; background: #fbfcfc; padding: 12px; }
.fact-card small, .fact-card strong, .fact-card span { display: block; }
.fact-card small { margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.fact-card strong, .fact-card span { font-size: 13px; line-height: 1.45; }
.field-grid, .field-pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-pairs > div { border-bottom: 1px solid #edf0f2; padding: 3px 0 10px; }
.field-pairs dt { margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.field-pairs dd { margin: 0; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.contact-card, .draft-card, .revision-card { border: 1px solid var(--line); border-radius: 12px; background: #fbfcfc; padding: 15px; }
.contact-card h3, .draft-card h3, .revision-card h3 { margin: 0; font-size: 15px; }
.contact-card p, .draft-card p, .revision-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.activity-list, .attachment-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.activity-item, .attachment-list li { border: 1px solid #e7ecee; border-radius: 10px; background: #fbfcfc; padding: 12px; }
.activity-item strong, .activity-item small, .attachment-list strong, .attachment-list small { display: block; }
.activity-item small, .attachment-list small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.danger-zone { border: 1px solid #efc4c8; border-radius: 12px; background: #fff8f8; padding: 14px; }
.email-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .75fr); gap: 16px; align-items: start; }
.message-card { border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 11px; background: white; padding: 14px; }
.message-card.is-inbound { border-left-color: var(--amber); background: #fffcf6; }
.message-card.is-outbound { background: #f5fbfa; }
.message-body { margin-top: 10px; color: #34434d; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.email-subject-link { display: block; max-width: 220px; padding: 0; text-align: left; white-space: normal; }
.email-preview-cell { min-width: 260px; max-width: 390px; }
.email-preview { display: -webkit-box; overflow: hidden; color: #34434d; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.suggested-email-card > p { margin: 0; }
.suggested-email-card > p > strong, .suggested-email-card > p > span, .suggested-email-card > div > strong { display: block; }
.suggested-email-card > p > strong, .suggested-email-card > div > strong { margin-bottom: 6px; color: var(--muted); font-size: 12px; }
.suggested-email-card > p > span { font-size: 14px; font-weight: 700; }
.sent-record { border-top: 1px solid var(--line); padding-top: 15px; }
tr.is-overdue td { background: #fff7f7; }
tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tr.is-replied td { background: #f3fbf7; }
tr.is-replied td:first-child { box-shadow: inset 3px 0 0 #3b9b66; }
tr.is-unreplied td { background: #fffbf2; }
tr.is-unreplied td:first-child { box-shadow: inset 3px 0 0 #d69a31; }
.channel-pills, .export-actions, .status-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.status-legend { justify-content: flex-end; border-bottom: 1px solid var(--line); padding: 9px 16px; color: var(--muted); font-size: 11px; }
.legend-swatch { display: inline-block; width: 9px; height: 9px; margin-right: 4px; border-radius: 3px; }
.legend-swatch.replied { background: #62b482; }
.legend-swatch.unreplied { background: #e3ad50; }
.compact { padding: 7px 10px; font-size: 12px; }
.followup-reminder { align-items: center; margin-bottom: 18px; }
.followup-reminder .row-link { margin-left: auto; }
.contact-history { margin-top: 7px; color: var(--muted); font-size: 11px; }
.contact-history summary { cursor: pointer; color: var(--teal); font-weight: 750; }
.contact-history ul { display: grid; gap: 6px; margin: 7px 0 0; padding: 0; list-style: none; }
.contact-history li { border-left: 2px solid #cfe4e1; padding-left: 8px; }
.contact-history li strong, .contact-history li span { display: block; }
.contact-history li > span { margin-top: 2px; color: var(--muted); font-weight: 400; }
.report-description { min-width: 260px; max-width: 430px; white-space: normal; line-height: 1.5; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); padding: 0 16px; }
.tab { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 12px 10px 10px; white-space: nowrap; }
.tab.is-active { border-bottom-color: var(--teal); color: var(--teal); font-weight: 750; }
.timeline { margin: 0; padding: 4px 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 14px 1fr; gap: 12px; padding: 11px 0; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 25px; bottom: -11px; width: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline-dot { z-index: 1; width: 13px; height: 13px; margin-top: 2px; border: 3px solid #d9efec; border-radius: 50%; background: var(--teal); }
.timeline strong, .timeline small, .timeline p { display: block; margin: 0; }
.timeline p { margin-top: 4px; color: #45545e; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.timeline small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.entity-card { border: 1px solid var(--line); border-radius: 12px; background: white; padding: 16px; }
.entity-card h3 { margin: 0 0 5px; font-size: 15px; }
.entity-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.entity-card .detail-actions { margin-top: 14px; justify-content: flex-start; }
.stepper { display: grid; grid-template-columns: repeat(7, minmax(80px, 1fr)); overflow-x: auto; padding: 6px 0 12px; }
.step { position: relative; min-width: 92px; color: var(--muted); text-align: center; font-size: 11px; }
.step::before { content: ''; display: block; width: 13px; height: 13px; margin: 0 auto 7px; border: 3px solid #d7e0e3; border-radius: 50%; background: white; }
.step::after { content: ''; position: absolute; z-index: -1; top: 6px; left: 50%; width: 100%; height: 2px; background: #dfe5e8; }
.step:last-child::after { display: none; }
.step.is-done, .step.is-current { color: var(--teal-dark); font-weight: 750; }
.step.is-done::before, .step.is-current::before { border-color: #9ed4ce; background: var(--teal); }
.step.is-done::after { background: #9ed4ce; }
.status-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.stage-track { display: grid; grid-template-columns: repeat(7, minmax(92px, 1fr)); overflow-x: auto; gap: 2px; padding: 8px 0; }
.stage-track > * { min-width: 92px; }
.code-block { overflow: auto; border-radius: 10px; background: #13252b; color: #d9eef0; padding: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: pre-wrap; }
.quote-lines input { min-width: 90px; }
.quote-lines td { vertical-align: top; }
.modal-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 0; border-radius: 16px; padding: 0; box-shadow: 0 24px 80px rgba(12,31,37,.28); }
.modal-dialog::backdrop { background: rgba(15,34,39,.56); backdrop-filter: blur(3px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 17px 20px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-close { border: 0; border-radius: 50%; background: var(--soft); width: 32px; height: 32px; }
.modal-body { max-height: calc(100vh - 150px); overflow-y: auto; padding: 20px; }
.inline-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.inline-form label { flex: 1; min-width: 160px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; color: #45545e; font-size: 12px; line-height: 1.45; }
.checkbox-row input { width: auto; margin-top: 2px; }
.file-drop { display: grid; min-height: 150px; place-items: center; border: 2px dashed #bfd0d5; border-radius: 13px; background: #f8fbfb; padding: 22px; text-align: center; }
.file-drop input { width: min(380px, 100%); }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 380px; border-radius: 12px; background: #18363d; color: white; padding: 13px 16px; box-shadow: var(--shadow); font-size: 13px; }

@media (max-width: 980px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .split-view { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bulk-assignment-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .security-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .security-metrics > div:nth-child(2) { border-right: 0; }
  .security-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 720px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: -250px; width: 236px; transition: left .2s ease; }
  .workspace.menu-open .sidebar { left: 0; }
  .icon-button { display: inline-block; }
  .topbar { padding: 0 16px; }
  .local-badge { display: none; }
  .global-search { width: 100%; }
  .page { padding: 20px 16px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .demo-accounts { grid-template-columns: 1fr; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .contact-grid, .email-layout, .field-grid, .field-pairs { grid-template-columns: 1fr; }
  .channel-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bulk-assignment-bar { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .card-grid { grid-template-columns: 1fr; }
  .detail-header { flex-direction: column; }
  .detail-actions { justify-content: flex-start; }
}

@media (max-width: 440px) {
  .metric-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 22px; }
  .admin-action-grid { grid-template-columns: 1fr; }
  .channel-choice-grid { grid-template-columns: 1fr; }
  .security-metrics { grid-template-columns: 1fr; }
  .security-metrics > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .security-metrics > div:last-child { border-bottom: 0; }
}
