:root {
  --ink: #172033;
  --ink-soft: #667085;
  --muted: #98a2b3;
  --line: #e6e9ef;
  --canvas: #f7f8fa;
  --surface: #ffffff;
  --navy: #111827;
  --navy-soft: #1f2937;
  --orange: #ee7b45;
  --orange-soft: #fff2eb;
  --green: #1f9d72;
  --green-soft: #eaf8f2;
  --blue: #3678d6;
  --blue-soft: #edf4ff;
  --yellow: #b7811b;
  --yellow-soft: #fff8e7;
  --red: #d55353;
  --red-soft: #fff0f0;
  --shadow: 0 12px 28px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }

.is-hidden { display: none !important; }
.auth-shell { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: linear-gradient(135deg, #f7f8fa 0%, #fff7f1 100%); }
.auth-panel { width: min(100%, 430px); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin: 0 auto 20px; width: fit-content; }
.auth-brand .brand-mark { width: 40px; height: 40px; }
.auth-brand strong, .auth-brand span { display: block; }
.auth-brand strong { color: var(--ink); font-size: 17px; }
.auth-brand span { margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
.auth-card { padding: 28px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 18px 55px rgba(16,24,40,.08); }
.auth-card h1 { margin: 8px 0 8px; color: var(--ink); font-size: 25px; }
.auth-description { margin: 0 0 25px; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-error { min-height: 18px; margin: -2px 0 10px; color: var(--red); font-size: 11px; line-height: 1.5; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px;
  background: var(--navy);
  color: #d6dbe5;
  display: flex;
  flex-direction: column;
  flex: 0 0 244px;
  padding: 22px 14px 16px;
}
.brand { display: flex; gap: 11px; align-items: center; padding: 0 10px 28px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: #fff; background: var(--orange); border-radius: 9px; }
.brand-mark svg { width: 19px; height: 19px; }
.brand strong { display: block; color: #fff; font-size: 15px; letter-spacing: 0; }
.brand span { display: block; margin-top: 3px; color: #8994a7; font-size: 11px; }
.workspace-switcher { padding: 0 8px 22px; }
.eyebrow { color: #8994a7; font-size: 10px; font-weight: 700; letter-spacing: .08em; line-height: 1.4; text-transform: uppercase; }
.workspace-button { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 1px solid #303a4b; background: #192131; color: #f4f6f8; border-radius: 7px; padding: 10px; margin-top: 8px; font-size: 12px; }
.workspace-button svg { width: 14px; color: #9aa6b8; }
.workspace-dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; background: #50c995; border-radius: 50%; }
.main-nav { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 42px; border: 0; border-radius: 7px; background: transparent; color: #aeb8c7; padding: 0 12px; text-align: left; }
.nav-item svg { width: 17px; height: 17px; stroke-width: 1.8; }
.nav-item span { flex: 1; }
.nav-item b { color: #8490a3; font-size: 11px; font-weight: 500; }
.nav-item:hover { color: #fff; background: #1d2738; }
.nav-item.active { color: #fff; background: #283447; box-shadow: inset 3px 0 0 var(--orange); }
.nav-item.active b { color: #f9b08e; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #273244; padding-top: 14px; }
.user-profile { display: flex; align-items: center; gap: 9px; border-top: 1px solid #273244; margin-top: 12px; padding: 16px 8px 0; }
.user-meta { min-width: 0; flex: 1; }
.user-meta strong, .user-meta span { display: block; }
.user-meta strong { color: #f4f6f8; font-size: 12px; font-weight: 600; }
.user-meta span { color: #8994a7; font-size: 11px; margin-top: 3px; }

.avatar, .mini-avatar { display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; }
.avatar { width: 29px; height: 29px; font-size: 11px; }
.mini-avatar { width: 31px; height: 31px; font-size: 11px; }
.avatar-indigo { background: #5666b0; }
.avatar-orange { background: #d5794e; }
.avatar-green { background: #4a9d7b; }
.avatar-blue { background: #4b83c9; }
.avatar-rose { background: #b66c82; }

.main-content { min-width: 0; flex: 1; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 67px; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); }
.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; }
.breadcrumb svg { width: 14px; color: #c1c7d0; }
.breadcrumb strong { color: var(--ink); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.sync-status { color: #7d8798; font-size: 11px; }
.status-pulse { display: inline-block; width: 6px; height: 6px; margin-right: 5px; background: #43b98a; border-radius: 50%; vertical-align: 1px; }
.topbar-divider { height: 22px; width: 1px; background: var(--line); }
.icon-button { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #667085; }
.icon-button:hover { color: var(--ink); border-color: #c9cfd9; background: #fbfcfd; }
.icon-button svg { width: 16px; height: 16px; }
.icon-button.subtle { border-color: transparent; background: transparent; color: #778297; }
.notification-dot { position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; border: 1px solid #fff; background: var(--orange); border-radius: 50%; }

.view-container { max-width: 1480px; margin: 0 auto; padding: 30px 34px 54px; }
.view-panel { display: none; }
.view-panel.active { display: block; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.page-heading h1 { margin: 7px 0 5px; color: var(--ink); font-size: 28px; letter-spacing: 0; line-height: 1.15; }
.heading-description { margin: 0; color: var(--ink-soft); font-size: 13px; }
.heading-actions { display: flex; gap: 9px; }
.compact-heading { margin-bottom: 25px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 37px; padding: 0 14px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.button svg { width: 15px; height: 15px; }
.button-primary { background: var(--orange); color: #fff; box-shadow: 0 3px 8px rgba(238, 123, 69, .18); }
.button-primary:hover { background: #d96935; }
.button-secondary { border-color: var(--line); color: #475467; background: #fff; }
.button-secondary:hover { border-color: #c5ccd6; background: #fafbfc; }
.text-button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--orange); font-size: 12px; font-weight: 600; padding: 4px 0; }
.text-button:hover { color: #c86232; }
.text-button svg { width: 14px; height: 14px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { min-height: 127px; padding: 19px 20px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.metric-top { display: flex; align-items: center; justify-content: space-between; }
.metric-label { color: var(--ink-soft); font-size: 12px; }
.metric-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; }
.metric-icon svg { width: 16px; height: 16px; }
.metric-icon.orange { color: var(--orange); background: var(--orange-soft); }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.metric-icon.yellow { color: var(--yellow); background: var(--yellow-soft); }
.metric-value { margin-top: 12px; font-size: 27px; line-height: 1; font-weight: 700; letter-spacing: 0; }
.metric-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--ink-soft); font-size: 11px; }
.metric-trend { display: inline-flex; align-items: center; gap: 2px; color: var(--green); font-weight: 600; }
.metric-trend svg { width: 12px; height: 12px; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, 1fr); gap: 18px; margin-bottom: 18px; }
.surface { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.chart-surface, .team-surface { min-height: 325px; padding: 20px 22px; }
.surface-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.surface-heading h2 { margin: 0; font-size: 15px; line-height: 1.25; }
.surface-heading p { margin: 5px 0 0; color: var(--ink-soft); font-size: 11px; }
.select-like { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #667085; padding: 7px 9px; font-size: 11px; }
.select-like svg { width: 13px; }
.progress-overview { display: flex; align-items: center; gap: 28px; margin: 25px 0 16px; }
.donut { display: grid; place-items: center; width: 116px; height: 116px; border-radius: 50%; background: conic-gradient(var(--orange) 0 42%, #f0f1f3 42% 100%); position: relative; flex: 0 0 116px; }
.donut::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: #fff; }
.donut > div { position: relative; z-index: 1; text-align: center; }
.donut strong { display: block; font-size: 23px; line-height: 1; }
.donut span { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 10px; }
.legend-list { display: grid; gap: 11px; flex: 1; }
.legend-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--ink-soft); font-size: 11px; }
.legend-label { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-item strong { color: var(--ink); font-size: 12px; }
.bar-chart { display: grid; grid-template-columns: repeat(6, 1fr); align-items: end; gap: 17px; height: 76px; border-bottom: 1px solid #edf0f3; padding: 0 7px; background: repeating-linear-gradient(to bottom, transparent, transparent 24px, #f0f2f5 25px); }
.bar-group { display: flex; align-items: end; justify-content: center; gap: 4px; height: 100%; }
.bar { width: 8px; min-height: 4px; border-radius: 3px 3px 0 0; background: var(--orange); }
.bar.secondary { background: #b8c9e5; }
.chart-axis { display: flex; justify-content: space-between; padding: 7px 3px 0; color: #a5adba; font-size: 9px; }
.team-list { display: grid; gap: 17px; margin-top: 24px; }
.team-row { display: grid; grid-template-columns: 29px 1fr auto; align-items: center; gap: 9px; }
.team-row-info { min-width: 0; }
.team-row-info strong { display: block; font-size: 12px; font-weight: 600; }
.team-row-info span { display: block; color: var(--ink-soft); font-size: 10px; margin-top: 3px; }
.team-count { color: var(--ink); font-size: 12px; font-weight: 700; }
.team-progress { grid-column: 2 / 4; height: 5px; margin-top: -3px; background: #f0f2f5; border-radius: 99px; overflow: hidden; }
.team-progress span { display: block; height: 100%; border-radius: inherit; background: var(--orange); }

.table-surface { overflow: hidden; }
.table-heading { padding: 20px 22px 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { height: 37px; padding: 0 16px; color: #8994a7; background: #fbfcfd; border-top: 1px solid #f0f1f3; border-bottom: 1px solid #f0f1f3; font-size: 10px; font-weight: 600; white-space: nowrap; }
td { height: 65px; padding: 0 16px; border-bottom: 1px solid #f0f1f3; color: #475467; font-size: 11px; white-space: nowrap; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: #fcfdfd; }
tbody tr:last-child td { border-bottom: 0; }
.customer-cell { display: flex; align-items: center; gap: 9px; }
.customer-cell strong { display: block; color: var(--ink); font-size: 12px; font-weight: 600; }
.customer-cell span { display: block; margin-top: 4px; color: #9aa3b1; font-size: 10px; }
.plan-cell { color: #475467; }
.amount-cell { color: var(--ink); font-size: 12px; font-weight: 700; }
.money-prefix { color: #98a2b3; font-size: 10px; font-weight: 500; margin-right: 2px; }
.money-empty { color: #b0b7c2; font-size: 11px; font-weight: 500; }
.agent-cell { display: flex; align-items: center; gap: 7px; }
.agent-cell span { color: #667085; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 0 8px; border-radius: 5px; font-size: 10px; font-weight: 600; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-contact { color: var(--blue); background: var(--blue-soft); }
.status-progress { color: var(--yellow); background: var(--yellow-soft); }
.status-paid { color: var(--green); background: var(--green-soft); }
.status-pending { color: #7c8494; background: #f1f3f5; }
.status-refused { color: var(--red); background: var(--red-soft); }
.status-unreachable { color: #8d6e54; background: #f8f1eb; }
.pay-paid { color: var(--green); }
.pay-waiting { color: var(--yellow); }
.pay-none { color: #98a2b3; }
.pay-failed { color: var(--red); }
.row-action { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--orange); font-size: 11px; font-weight: 600; }
.row-action:hover { color: #c86232; }
.row-action svg { width: 14px; height: 14px; }
.checkbox-col { width: 38px; padding-right: 0; }
input[type="checkbox"] { accent-color: var(--orange); }

.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.search-field { display: flex; align-items: center; gap: 7px; height: 36px; flex: 1; max-width: 320px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #98a2b3; padding: 0 10px; }
.search-field svg { width: 15px; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.filter-select { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #98a2b3; font-size: 11px; }
.filter-select select { border: 0; outline: 0; color: #475467; background: transparent; font-size: 11px; }
.filter-reset { margin-left: auto; border: 0; color: #667085; background: transparent; font-size: 11px; }
.filter-reset:hover { color: var(--orange); }
.full-table-surface { min-height: 430px; }
.bulk-toolbar, .table-footer { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; color: #8b95a5; font-size: 11px; }
.bulk-toolbar { border-bottom: 1px solid #f0f1f3; }
.bulk-toolbar > div { display: flex; gap: 6px; }
.table-footer { border-top: 1px solid #f0f1f3; }
.pagination { display: flex; align-items: center; gap: 7px; }
.pagination .icon-button { width: 27px; height: 27px; }
.page-current { display: grid; place-items: center; width: 27px; height: 27px; color: #fff; background: var(--orange); border-radius: 5px; font-size: 11px; }

.date-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #667085; font-size: 11px; }
.date-pill svg { width: 15px; color: var(--orange); }
.followup-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
.followup-list { padding: 3px 22px 11px; }
.followup-item { display: grid; grid-template-columns: 70px 1fr auto; gap: 17px; align-items: center; min-height: 84px; border-bottom: 1px solid #f0f1f3; }
.followup-item:last-child { border-bottom: 0; }
.followup-time { color: var(--orange); font-size: 12px; font-weight: 700; }
.followup-time span { display: block; margin-top: 4px; color: #a2aab7; font-size: 10px; font-weight: 400; }
.followup-customer { display: flex; align-items: center; gap: 9px; }
.followup-customer strong { display: block; color: var(--ink); font-size: 12px; }
.followup-customer p { margin: 4px 0 0; color: var(--ink-soft); font-size: 10px; }
.followup-action { color: #667085; font-size: 11px; }
.followup-tip { align-self: start; padding: 22px; background: #fffaf6; border-color: #f5e4d9; }
.tip-icon { display: grid; place-items: center; width: 34px; height: 34px; color: var(--orange); background: #ffeadf; border-radius: 8px; }
.tip-icon svg { width: 18px; }
.followup-tip h3 { margin: 19px 0 8px; font-size: 14px; }
.followup-tip p { margin: 0; color: #806e63; font-size: 11px; line-height: 1.8; }
.tip-stat { display: flex; align-items: end; justify-content: space-between; margin-top: 26px; padding-top: 15px; border-top: 1px solid #f2ddd0; color: #9b8273; font-size: 11px; }
.tip-stat strong { color: var(--orange); font-size: 26px; line-height: 1; }

.team-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.summary-item { display: flex; align-items: center; justify-content: space-between; min-height: 84px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.summary-item span { color: var(--ink-soft); font-size: 12px; }
.summary-item strong { color: var(--ink); font-size: 24px; }
.team-table-surface { padding-bottom: 23px; }
.team-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; padding: 4px 22px 0; }
.agent-card { padding: 17px; border: 1px solid #edf0f3; border-radius: 8px; }
.agent-card-top { display: flex; align-items: center; gap: 10px; }
.agent-card-top > div:nth-child(2) { flex: 1; }
.agent-card-top strong { display: block; font-size: 13px; }
.agent-card-top span { display: block; margin-top: 4px; color: #8c96a6; font-size: 10px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #46b98b; box-shadow: 0 0 0 3px #eaf8f2; }
.agent-card-stats { display: flex; justify-content: space-between; margin-top: 20px; padding-top: 13px; border-top: 1px solid #f0f1f3; }
.agent-card-stats span { display: block; color: #8c96a6; font-size: 10px; }
.agent-card-stats strong { display: block; margin-top: 5px; color: var(--ink); font-size: 16px; }
.agent-card .team-progress { margin-top: 15px; }
.agent-card-disabled { background: #fafafa; }
.agent-card-disabled strong { color: #8c96a6; }
.agent-card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid #f0f1f3; }
.agent-card-actions .text-button { padding: 0; color: #667085; font-size: 10px; }
.agent-card-actions .text-button:hover { color: var(--orange); }
.agent-card-actions .text-button svg { width: 13px; height: 13px; }
.agent-card-actions .danger-text { color: #c75d5d; }
.agent-card-actions .danger-text:hover { color: #a83f3f; }

.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.tenant-banner { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; padding: 16px 18px; border: 1px solid #dfe8f5; border-radius: 9px; background: #f5f9ff; }
.tenant-banner-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 8px; color: var(--blue); background: #e5efff; }
.tenant-banner-icon svg { width: 18px; height: 18px; }
.tenant-banner-copy { min-width: 0; flex: 1; }
.tenant-banner-copy .eyebrow { display: block; color: #7890b4; }
.tenant-banner-copy strong { display: block; margin-top: 3px; color: var(--ink); font-size: 13px; }
.tenant-banner-copy p { margin: 4px 0 0; color: #6e7f99; font-size: 11px; line-height: 1.5; }
.tenant-plan { flex: 0 0 auto; padding-left: 18px; border-left: 1px solid #dbe5f2; text-align: right; }
.tenant-plan span, .tenant-plan strong { display: block; }
.tenant-plan span { color: #7890b4; font-size: 10px; }
.tenant-plan strong { margin-top: 4px; color: var(--blue); font-size: 12px; }
.settings-section { padding: 21px; }
.settings-title { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 22px; }
.settings-title > div:nth-child(2) { flex: 1; }
.settings-title h2 { margin: 1px 0 5px; font-size: 14px; }
.settings-title p { margin: 0; color: var(--ink-soft); font-size: 11px; }
.settings-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 8px; }
.settings-icon svg { width: 17px; }
.settings-icon.orange { color: var(--orange); background: var(--orange-soft); }
.settings-icon.green { color: var(--green); background: var(--green-soft); }
.settings-icon.blue { color: var(--blue); background: var(--blue-soft); }
.setting-status { padding: 4px 6px; border-radius: 4px; font-size: 9px; }
.setting-status.ready { color: var(--green); background: var(--green-soft); }
.setting-status.pending { color: var(--yellow); background: var(--yellow-soft); }
.setting-row { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-top: 1px solid #f0f1f3; color: #8b95a5; font-size: 11px; }
.setting-row strong { color: #475467; font-weight: 600; text-align: right; }
.full-width { width: 100%; margin-top: 18px; }

.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; visibility: hidden; opacity: 0; background: rgba(17,24,39,.33); transition: opacity .2s, visibility .2s; z-index: 20; }
.drawer-backdrop.open, .modal-backdrop.open { visibility: visible; opacity: 1; }
.detail-drawer { position: fixed; z-index: 21; top: 0; right: 0; width: min(480px, 100%); height: 100vh; visibility: hidden; transform: translateX(100%); background: #fff; box-shadow: -10px 0 35px rgba(16,24,40,.12); transition: transform .25s, visibility .25s; }
.detail-drawer.open { visibility: visible; transform: translateX(0); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 25px 25px 20px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 6px 0 0; font-size: 18px; }
.drawer-body { height: calc(100vh - 102px); overflow-y: auto; padding: 23px 25px 40px; }
.detail-head { display: flex; align-items: center; gap: 13px; }
.detail-head > div:nth-child(2) { flex: 1; }
.detail-head strong { display: block; font-size: 16px; }
.detail-head span { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 11px; }
.detail-amount { text-align: right; }
.detail-amount span { display: block; color: #98a2b3; font-size: 10px; }
.detail-amount strong { display: block; margin-top: 4px; color: var(--orange); font-size: 21px; }
.detail-statuses { display: flex; gap: 7px; margin: 19px 0; }
.detail-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 19px 0 26px; }
.detail-info { padding: 12px 13px; border: 1px solid #edf0f3; border-radius: 7px; }
.detail-info span { display: block; color: #98a2b3; font-size: 10px; }
.detail-info strong { display: block; margin-top: 6px; color: #475467; font-size: 12px; }
.detail-info-wide { grid-column: 1 / -1; }
.drawer-actions { display: flex; gap: 8px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.drawer-actions .button { flex: 1; }
.section-label { display: flex; align-items: center; justify-content: space-between; margin: 25px 0 12px; font-size: 12px; font-weight: 700; }
.timeline { position: relative; display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 20px 23px; }
.timeline-item::before { content: ""; position: absolute; top: 3px; left: 3px; width: 7px; height: 7px; border: 2px solid var(--orange); border-radius: 50%; background: #fff; }
.timeline-item::after { content: ""; position: absolute; top: 13px; bottom: 0; left: 7px; width: 1px; background: #f0d4c5; }
.timeline-item:last-child::after { display: none; }
.timeline-meta { display: flex; justify-content: space-between; gap: 10px; color: #98a2b3; font-size: 10px; }
.timeline-meta strong { color: #667085; font-weight: 600; }
.timeline-item p { margin: 7px 0 0; color: #475467; font-size: 11px; line-height: 1.65; }
.payment-box { padding: 14px; border: 1px solid #f4dfd3; border-radius: 7px; background: #fffaf6; }
.payment-box-empty { border-style: dashed; }
.payment-box-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.payment-box strong { font-size: 12px; }
.payment-box-subtitle { display: block; margin-top: 5px; color: #9b8273; font-size: 10px; line-height: 1.5; }
.payment-link { display: block; margin-top: 9px; color: var(--orange); overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.payment-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 11px; color: #9b8273; font-size: 10px; }
.payment-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 13px; padding: 10px 0; border-top: 1px solid #f5e0d5; border-bottom: 1px solid #f5e0d5; }
.payment-summary span { display: block; color: #a48d80; font-size: 10px; }
.payment-summary strong { display: block; margin-top: 5px; color: var(--orange); font-size: 15px; }
.payment-box-actions { display: flex; gap: 7px; margin-top: 13px; }
.payment-box-actions .button { flex: 1; min-height: 32px; padding: 0 9px; font-size: 10px; }
.empty-state { padding: 35px 10px; text-align: center; color: #98a2b3; font-size: 12px; }

.modal { position: fixed; z-index: 31; top: 50%; left: 50%; width: min(420px, calc(100% - 30px)); visibility: hidden; opacity: 0; transform: translate(-50%, -47%); border-radius: 10px; background: #fff; box-shadow: 0 18px 55px rgba(16,24,40,.18); transition: opacity .2s, transform .2s, visibility .2s; }
.modal.open { visibility: visible; opacity: 1; transform: translate(-50%, -50%); }
.modal-wide { width: min(550px, calc(100% - 30px)); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 23px 16px; border-bottom: 1px solid #f0f1f3; }
.modal-header h2 { margin: 6px 0 0; font-size: 17px; }
.modal-body { padding: 20px 23px; }
.modal-description { margin: -2px 0 17px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 23px 20px; border-top: 1px solid #f0f1f3; }
.form-label { display: block; margin-bottom: 16px; color: #667085; font-size: 11px; font-weight: 600; }
.form-label select, .form-label input, .form-label textarea { display: block; width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 6px; outline: 0; background: #fff; color: var(--ink); padding: 10px; font-size: 12px; }
.form-label select:focus, .form-label input:focus, .form-label textarea:focus { border-color: #ef9a71; box-shadow: 0 0 0 3px #fff1eb; }
.form-label textarea { resize: vertical; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.link-customer-summary { display: flex; align-items: center; gap: 10px; margin: -2px 0 19px; padding: 12px; border: 1px solid #f0f1f3; border-radius: 7px; background: #fbfcfd; }
.link-customer-summary > div:nth-child(2) { min-width: 0; flex: 1; }
.link-customer-summary strong, .link-customer-summary span { display: block; }
.link-customer-summary strong { color: var(--ink); font-size: 13px; }
.link-customer-summary span { margin-top: 4px; color: var(--ink-soft); overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.link-summary-order { color: #98a2b3; font-size: 10px; }
.payment-link-note { display: flex; gap: 7px; margin-top: 2px; padding: 10px 11px; border-radius: 6px; background: #f7f9fc; color: #7d8798; font-size: 10px; line-height: 1.6; }
.payment-link-note svg { width: 14px; flex: 0 0 14px; color: var(--blue); }
.assignment-capacity { padding: 11px 12px; border-radius: 6px; background: #f7f8fa; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.assignment-capacity strong { color: var(--ink); }
.toggle-field { display: flex; align-items: center; gap: 9px; align-self: start; margin-top: 21px; cursor: pointer; color: var(--ink); }
.toggle-field > input { position: absolute; opacity: 0; }
.toggle-track { position: relative; width: 31px; height: 18px; flex: 0 0 31px; border-radius: 20px; background: #d5dae2; transition: background .15s; }
.toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle-field input:checked + .toggle-track { background: var(--orange); }
.toggle-field input:checked + .toggle-track::after { transform: translateX(13px); }
.toggle-field strong, .toggle-field small { display: block; }
.toggle-field strong { font-size: 11px; }
.toggle-field small { margin-top: 4px; color: #98a2b3; font-size: 10px; font-weight: 400; }
.agent-toggle-grid { margin-top: 2px; }
.agent-toggle-grid .toggle-field { margin-top: 4px; }
.permission-section { margin: 2px 0 16px; padding: 12px; border: 1px solid #edf0f3; border-radius: 7px; background: #fbfcfd; }
.permission-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.permission-heading strong { color: var(--ink); font-size: 11px; }
.permission-heading span { color: #98a2b3; font-size: 10px; }
.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; }
.permission-option { display: flex; align-items: center; gap: 7px; color: #667085; font-size: 11px; cursor: pointer; }
.permission-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--orange); }
.permission-option input:disabled { opacity: .65; }
.import-dropzone { display: grid; place-items: center; gap: 9px; min-height: 150px; border: 1px dashed #e6b398; border-radius: 8px; background: #fffaf6; color: #9b8273; text-align: center; }
.import-dropzone svg { width: 27px; color: var(--orange); }
.import-dropzone strong { color: #68564c; font-size: 13px; }
.import-dropzone span { font-size: 11px; }
.import-info { display: flex; gap: 7px; margin-top: 15px; color: #8b95a5; font-size: 10px; line-height: 1.6; }
.import-info svg { width: 14px; flex: 0 0 14px; color: var(--blue); }

.toast { position: fixed; z-index: 50; right: 28px; bottom: 25px; display: flex; align-items: center; gap: 8px; visibility: hidden; opacity: 0; padding: 12px 15px; border: 1px solid #cdeade; border-radius: 7px; background: #f3fcf7; color: #247653; box-shadow: var(--shadow); font-size: 12px; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s; }
.toast.show { visibility: visible; opacity: 1; transform: translateY(0); }
.toast svg { width: 16px; }

@media (max-width: 1080px) {
  .sidebar { width: 210px; flex-basis: 210px; }
  .view-container { padding-left: 22px; padding-right: 22px; }
  .content-grid { grid-template-columns: 1fr; }
  .settings-grid, .team-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .sidebar { width: 62px; flex-basis: 62px; padding: 15px 8px; }
  .brand { justify-content: center; padding: 0 0 22px; }
  .brand > div:last-child, .workspace-switcher, .nav-item span, .nav-item b, .user-meta, .user-profile .icon-button { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item.active { box-shadow: inset 0 -3px 0 var(--orange); }
  .user-profile { justify-content: center; padding: 14px 0 0; }
  .topbar { height: 59px; padding: 0 15px; }
  .sync-status, .topbar-divider { display: none; }
  .view-container { padding: 22px 15px 40px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  .page-heading h1 { font-size: 24px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 114px; padding: 14px; }
  .metric-value { font-size: 23px; }
  .filter-bar { align-items: stretch; flex-wrap: wrap; }
  .search-field { max-width: none; flex-basis: 100%; }
  .filter-select { flex: 1; }
  .filter-reset { margin-left: 0; padding: 0 8px; }
  .followup-layout { grid-template-columns: 1fr; }
  .team-summary, .settings-grid, .team-cards { grid-template-columns: 1fr; }
  .tenant-banner { align-items: flex-start; }
  .tenant-plan { margin-left: auto; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .payment-box-actions { flex-direction: column; }
  .toggle-field { margin: 0 0 10px; }
  .followup-item { grid-template-columns: 55px 1fr; gap: 10px; padding: 14px 0; }
  .followup-action { grid-column: 2; justify-self: start; }
  .chart-surface, .team-surface { padding: 17px 15px; }
  .table-heading { padding-left: 15px; padding-right: 15px; }
  th, td { padding-left: 10px; padding-right: 10px; }
}
