:root {
    --bg: #f5f7f9;
    --panel: #fff;
    --text: #17212b;
    --muted: #6b7785;
    --line: #e5eaef;
    --primary: #175d52;
    --primary-2: #0f463e;
    --soft: #e9f3f0;
    --gold: #e5b861;
    --danger: #b53b3b;
    --shadow: 0 8px 30px rgba(28, 45, 55, .06);
    --radius: 16px;
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
body { margin: 0; font-size: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
code { color: var(--primary); background: var(--soft); border-radius: 6px; padding: 2px 6px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 256px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; background: #132a2d; color: #dce9e7; padding: 24px 16px 16px; display: flex; flex-direction: column; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 24px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--gold); color: #17212b; font-weight: 800; font-size: 18px; }
.brand-logo { width: 40px; height: 40px; border-radius: 12px; object-fit: contain; background: #fff; flex: 0 0 auto; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: .01em; }
.brand small { font-size: 11px; color: #91aaa7; margin-top: 2px; }
.nav-main { overflow-y: auto; padding-right: 3px; scrollbar-width: thin; }
.nav-label { padding: 22px 12px 7px; font-size: 10px; color: #78918e; text-transform: uppercase; letter-spacing: .12em; }
.nav-item { display: flex; align-items: center; gap: 11px; border-radius: 10px; padding: 10px 12px; color: #bbcecb; margin: 2px 0; transition: .18s; }
.nav-item:hover, .nav-item.is-active { background: rgba(255, 255, 255, .09); color: #fff; }
.nav-item.is-active { box-shadow: inset 3px 0 var(--gold); }
.nav-item span { width: 18px; text-align: center; color: #94b5b0; }
.nav-item.is-hidden { display: none; }
.sidebar-user { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; align-items: center; gap: 10px; }
.sidebar-user > span:nth-child(2) { min-width: 0; flex: 1; }
.sidebar-user strong, .sidebar-user small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user small { font-size: 11px; color: #8aa39f; margin-top: 2px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: #17212b; display: grid; place-items: center; font-weight: 800; }
.icon-button { border: 0; background: transparent; color: #9bb1ae; cursor: pointer; font-size: 18px; }

.main-area { min-width: 0; }
.topbar { height: 72px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding: 0 32px; display: flex; align-items: center; gap: 18px; position: sticky; top: 0; z-index: 10; }
.menu-button { display: none; border: 0; background: transparent; font-size: 22px; }
.global-search { max-width: 460px; flex: 1; display: flex; align-items: center; gap: 9px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 13px; color: var(--muted); }
.global-search input { width: 100%; border: 0; outline: 0; background: transparent; }
.quick-actions, .head-actions { display: flex; gap: 10px; margin-left: auto; }
.content { padding: 30px 32px 48px; max-width: 1700px; margin: 0 auto; }
.page-head { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.page-head h1 { margin: 2px 0 5px; font-size: 26px; letter-spacing: -.025em; }
.page-head p { margin: 0; color: var(--muted); }
.eyebrow { font-size: 11px !important; color: var(--primary) !important; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }

.button { border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; font-weight: 650; cursor: pointer; white-space: nowrap; }
.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-2); }
.button-ghost { background: #fff; border-color: var(--line); color: var(--text); }
.button-danger { border-color: #f0caca; background: #fff4f4; color: var(--danger); }
.button-deal { background: #fff8e9; border-color: #f0d99f; color: #72521d; }
.button-wide { width: 100%; padding: 12px; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 132px; }
.metric-card span { color: var(--muted); font-size: 12px; }
.metric-card strong { font-size: 29px; margin: 10px 0; }
.metric-card small { color: var(--primary); margin-top: auto; }
.dashboard-grid { display: grid; grid-template-columns: minmax(420px, 1.4fr) minmax(320px, 1fr); gap: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; border-bottom: 1px solid var(--line); padding-bottom: 15px; margin-bottom: 10px; }
.panel-head h2 { font-size: 16px; margin: 0 0 4px; }
.panel-head p { font-size: 12px; color: var(--muted); margin: 0; }
.panel-head a:not(.button) { font-size: 12px; color: var(--primary); font-weight: 650; }
.empty-state { text-align: center; color: var(--muted); padding: 35px 15px; }

.property-row { display: flex; align-items: center; gap: 12px; padding: 13px 5px; border-bottom: 1px solid var(--line); }
.property-row:last-child { border: 0; }
.property-thumb { width: 42px; height: 42px; border-radius: 11px; background: var(--soft); color: var(--primary); display: grid; place-items: center; font-size: 20px; }
.property-row > span:nth-child(2) { min-width: 0; flex: 1; }
.property-row strong, .property-row small { display: block; }
.property-row strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.property-row small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.property-price { text-align: right; font-weight: 750; }
.timeline-list a { display: flex; gap: 13px; border-bottom: 1px solid var(--line); padding: 13px 2px; }
.timeline-list a:last-child { border: 0; }
.timeline-list time { font-size: 12px; font-weight: 750; color: var(--primary); padding-top: 2px; }
.timeline-list strong, .timeline-list small { display: block; }
.timeline-list small { font-size: 11px; color: var(--muted); margin-top: 4px; }

.list-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.search-field { display: flex; align-items: center; gap: 8px; flex: 1; max-width: 520px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; color: var(--muted); }
.search-field input { border: 0; outline: 0; width: 100%; }
.list-toolbar select { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 9px 11px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .065em; padding: 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: #fafcfc; }
.actions-col { text-align: right; }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions a { color: var(--primary); font-size: 12px; font-weight: 650; margin-left: 10px; }
.table-sub { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; font-weight: 400; }
.pagination { display: flex; justify-content: flex-end; gap: 18px; align-items: center; padding-top: 17px; color: var(--muted); font-size: 12px; }
.pagination a { color: var(--primary); font-weight: 650; }

.form-panel { padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field > span:first-child { font-size: 12px; color: #3f4b56; font-weight: 650; }
.field input:not(.toggle), .field select, .field textarea, .stack-form input { border: 1px solid #dbe2e7; border-radius: 10px; background: #fff; padding: 10px 12px; width: 100%; outline: 0; }
.field input:focus, .field select:focus, .field textarea:focus, .stack-form input:focus { border-color: #6d9d95; box-shadow: 0 0 0 3px rgba(23, 93, 82, .08); }
.field textarea { resize: vertical; min-height: 110px; }
.field > span:not(:first-child), .stack-form label > span { color: var(--danger); font-size: 11px; }
.field-help { color: var(--muted) !important; font-size: 11px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: #d78181; }
.toggle { appearance: none; width: 42px; height: 24px; border: 0; border-radius: 20px; background: #d7dee2; position: relative; cursor: pointer; }
.toggle::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.toggle:checked { background: var(--primary); }
.toggle:checked::after { transform: translateX(18px); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; }
.form-actions .button-danger { margin-right: auto; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; }
.detail-grid > div { padding: 14px; border-bottom: 1px solid var(--line); }
.detail-wide { grid-column: 1 / -1; }
.detail-grid dt { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.detail-grid dd { margin: 0; line-height: 1.55; white-space: pre-wrap; }
.danger-zone { margin-top: 20px; padding: 18px 20px; background: #fffafa; border: 1px solid #f2d6d6; border-radius: var(--radius); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.danger-zone p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }

.alert { padding: 12px 15px; border-radius: 10px; margin-bottom: 16px; }
.alert-success { background: #e8f5f1; color: var(--primary); }
.alert-error { background: #fff0f0; color: #9f3030; }
.validation-summary:empty, .validation-summary-valid { display: none; }
.error-page { max-width: 600px; margin: 10vh auto; text-align: center; }
.error-page > span { font-size: 70px; font-weight: 850; color: #dce7e4; }
.error-page h1 { font-size: 28px; }
.error-page p { color: var(--muted); margin-bottom: 25px; }

.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top right, #dcebe7, transparent 40%), #f6f8f8; padding: 25px; }
.login-card { width: min(430px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 20px 70px rgba(23, 45, 49, .1); padding: 34px; }
.brand-login { padding: 0 0 28px; }
.brand-login strong { color: var(--text); }
.brand-login small { color: var(--muted); }
.login-copy h1 { margin: 0 0 7px; font-size: 25px; }
.login-copy p { margin: 0 0 23px; color: var(--muted); }
.stack-form { display: flex; flex-direction: column; gap: 16px; }
.stack-form label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; font-weight: 650; }
.login-foot { display: block; text-align: center; color: var(--muted); margin-top: 22px; }

.setup-page { min-height: 100vh; background: radial-gradient(circle at top right, #dcebe7, transparent 38%), #f6f8f8; padding: 38px 24px; }
.setup-card { width: min(860px, 100%); margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 20px 70px rgba(23, 45, 49, .1); padding: 34px; }
.setup-head { margin-bottom: 24px; }
.setup-head h1 { margin: 7px 0; font-size: 28px; letter-spacing: -.025em; }
.setup-head p { margin: 0; color: var(--muted); line-height: 1.6; }
.setup-step { color: var(--primary); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.setup-form { display: flex; flex-direction: column; gap: 20px; }
.setup-section { border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.setup-section-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.setup-section-title > span { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--soft); color: var(--primary); font-weight: 800; }
.setup-section-title strong, .setup-section-title small { display: block; }
.setup-section-title small { color: var(--muted); margin-top: 4px; line-height: 1.4; }
.setup-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.setup-actions small { color: var(--muted); line-height: 1.5; }

.calendar-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); }
.calendar-weekdays { background: #f8fafb; border-bottom: 1px solid var(--line); }
.calendar-weekdays span { padding: 11px 12px; font-size: 10px; color: var(--muted); font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.calendar-day { min-height: 145px; padding: 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.is-muted { background: #fafbfc; color: #9ba5ad; }
.calendar-day.is-today { box-shadow: inset 0 0 0 2px var(--primary); }
.calendar-date { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 750; }
.calendar-date a { color: var(--primary); font-size: 16px; }
.calendar-events { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.calendar-event { display: flex; gap: 6px; padding: 5px 7px; border-radius: 7px; background: var(--soft); border-left: 3px solid var(--primary); font-size: 10px; min-width: 0; }
.calendar-event time { font-weight: 800; }
.calendar-event span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-event.priority-high, .calendar-event.priority-urgent { background: #fff0f0; border-color: var(--danger); }

.builder-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.builder-summary div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 17px 19px; box-shadow: var(--shadow); }
.builder-summary span, .builder-summary strong { display: block; }
.builder-summary span { color: var(--muted); font-size: 11px; }
.builder-summary strong { margin-top: 7px; font-size: 24px; }
.status-pill { display: inline-flex; align-items: center; border-radius: 20px; background: #f0f2f4; color: var(--muted); padding: 5px 9px; font-size: 10px; font-weight: 750; }
.status-pill.is-active { background: var(--soft); color: var(--primary); }
.status-pill.is-system { background: #fff4d9; color: #83611b; }
.builder-layout { display: grid; grid-template-columns: minmax(520px, 1.5fr) minmax(300px, .8fr); gap: 20px; align-items: start; }
.builder-preview { position: sticky; top: 92px; }
.preview-sidebar { background: #132a2d; color: #fff; border-radius: 13px; padding: 18px; min-height: 220px; }
.preview-brand { display: flex; gap: 10px; align-items: center; padding-bottom: 34px; }
.preview-brand span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--gold); color: var(--text); font-weight: 800; }
.preview-brand strong { font-size: 12px; }
.preview-sidebar > small { display: block; color: #78918e; text-transform: uppercase; letter-spacing: .1em; font-size: 9px; margin: 0 10px 7px; }
.preview-nav { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 9px; background: rgba(255, 255, 255, .09); box-shadow: inset 3px 0 var(--gold); }
.preview-nav strong { font-size: 12px; }
.preview-note { margin-top: 16px; border-radius: 11px; padding: 13px; color: var(--muted); font-size: 11px; line-height: 1.6; background: #f8fafb; }
.fields-panel { margin-top: 20px; }
.field-builder-list { display: flex; flex-direction: column; }
.field-builder-row { display: flex; align-items: center; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); }
.field-builder-row:last-child { border-bottom: 0; }
.field-builder-row.is-muted { opacity: .55; }
.drag-handle { color: #b4bec5; cursor: grab; letter-spacing: -3px; }
.field-type-icon { width: 34px; height: 34px; display: grid; place-items: center; background: var(--soft); color: var(--primary); border-radius: 9px; font-weight: 800; }
.field-builder-main { min-width: 0; flex: 1; }
.field-builder-main strong, .field-builder-main small { display: block; }
.field-builder-main small { color: var(--muted); font-size: 10px; margin-top: 4px; }
.field-flags { color: var(--muted); font-size: 10px; }
.field-builder-row > a { color: var(--primary); font-size: 11px; font-weight: 700; }
.option-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 17px; background: #f8fafb; border: 1px solid var(--line); border-radius: 12px; margin-top: 22px; }
.option-grid label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 650; }
.option-grid input { accent-color: var(--primary); }

.property-category-panel { max-width: 920px; }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.category-grid > a { min-height: 190px; border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; align-items: flex-start; transition: .18s; }
.category-grid > a:hover { border-color: #75a39b; transform: translateY(-2px); box-shadow: var(--shadow); }
.category-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--soft); color: var(--primary); font-size: 27px; }
.category-grid strong { font-size: 17px; margin: 16px 0 5px; }
.category-grid small { color: var(--muted); line-height: 1.5; }
.category-grid b { color: var(--primary); font-size: 12px; margin-top: auto; padding-top: 14px; }

.record-editor { display: flex; flex-direction: column; gap: 14px; }
.form-section { padding: 0; overflow: hidden; }
.form-section-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.form-section-head h2 { margin: 0; color: var(--primary); font-size: 15px; }
.form-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.section-toggle { border: 0; background: transparent; color: var(--primary); font-size: 18px; cursor: pointer; transition: .2s; }
.form-section-body { padding: 20px; }
.form-section.is-collapsed .form-section-body { display: none; }
.form-section.is-collapsed .section-toggle { transform: rotate(180deg); }
.transaction-section { border: 1px solid #c7ded9; background: linear-gradient(110deg, #fff, #f2f8f6); }
.transaction-section .form-section-head { border: 0; padding-bottom: 4px; }
.transaction-section .form-section-body { padding-top: 8px; }
.transaction-field { grid-column: 1 / -1; align-items: center; }
.transaction-switch { display: inline-flex; gap: 8px; padding: 5px; border: 1px solid var(--line); background: #fff; border-radius: 12px; }
.transaction-switch button { min-width: 160px; border: 0; border-radius: 8px; padding: 11px 20px; background: transparent; color: var(--muted); font-weight: 750; cursor: pointer; }
.transaction-switch button.is-selected { background: var(--primary); color: #fff; box-shadow: 0 5px 18px rgba(23, 93, 82, .18); }
.chip-options { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { border: 1px solid #dce8e5; background: #f3f8f7; color: #58716d; border-radius: 20px; padding: 6px 10px; cursor: pointer; font-size: 11px; }
.chip:hover, .chip.is-selected { color: #fff; background: var(--primary); border-color: var(--primary); }
.map-preview { margin-top: 20px; min-height: 100px; border: 1px dashed #a9c6c0; border-radius: 13px; background: linear-gradient(135deg, #edf5f3, #f9fbfb); padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.map-preview strong, .map-preview small { display: block; }
.map-preview small { color: var(--muted); margin-top: 5px; }
.is-disabled { opacity: .45; pointer-events: none; }
.sticky-form-actions { position: sticky; bottom: 14px; z-index: 5; align-self: flex-end; display: flex; gap: 10px; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(20,40,45,.12); border-radius: 13px; padding: 9px; }

.upload-zone { min-height: 125px; border: 1.5px dashed #9ebbb6; background: #f7fbfa; border-radius: 14px; display: grid; place-items: center; align-content: center; gap: 5px; cursor: pointer; text-align: center; }
.upload-zone:hover { border-color: var(--primary); background: var(--soft); }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-zone span { color: var(--primary); font-weight: 750; }
.upload-zone small { color: var(--muted); }
.upload-selection { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.upload-selection > span { background: var(--soft); border-radius: 8px; padding: 7px 9px; font-size: 11px; }
.upload-selection small { color: var(--muted); margin-left: 5px; }
.detail-section { margin-bottom: 14px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 13px; }
.media-grid.compact { margin-top: 16px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.media-card { border: 1px solid var(--line); border-radius: 13px; padding: 10px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.media-card img, .media-card video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 9px; background: #eef2f3; }
.media-card strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-card small { color: var(--muted); font-size: 10px; }
.media-file-icon { aspect-ratio: 4 / 3; display: grid; place-items: center; border-radius: 9px; background: #f4f7f7; color: var(--primary); font-size: 25px; font-weight: 850; }
.media-actions { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 3px; }
.media-actions a, .media-actions button { border: 0; background: transparent; padding: 0; color: var(--primary); font-size: 10px; cursor: pointer; }
.media-actions button { color: var(--danger); }
.dial-button { margin-left: 10px; border: 1px solid #b8d4cf; color: var(--primary); background: var(--soft); border-radius: 8px; padding: 5px 8px; cursor: pointer; }

.deal-filter { max-width: 1050px; }
.deal-options, .source-picker { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.deal-options label, .source-picker label { display: flex; align-items: center; gap: 7px; padding: 8px 11px; background: #f7f9fa; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; }
.deal-options input, .source-picker input { accent-color: var(--primary); }
.source-picker { border: 0; padding: 0; }
.source-picker legend { width: 100%; font-size: 12px; color: var(--muted); padding: 0 0 7px; }
.deal-results { margin-top: 24px; }
.panel-head.no-panel { padding: 0 0 14px; }
.deal-channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 13px; }
.deal-channel { display: flex; flex-direction: column; min-height: 180px; transition: .18s; }
.deal-channel:hover { transform: translateY(-2px); border-color: #87aaa4; }
.deal-channel > span { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--soft); color: var(--primary); font-weight: 850; }
.deal-channel strong { margin: 15px 0 5px; }
.deal-channel small { color: var(--muted); line-height: 1.5; }
.deal-channel b { margin-top: auto; padding-top: 14px; color: var(--primary); font-size: 11px; }
.deal-note { margin-top: 15px; background: #fff9ea; color: #72521d; }

.call-agent-layout { display: grid; grid-template-columns: minmax(450px, 1.2fr) minmax(320px, .8fr); gap: 20px; align-items: start; }
.call-flow ol { padding: 0; margin: 0; list-style: none; display: flex; flex-direction: column; gap: 17px; }
.call-flow li { display: flex; gap: 12px; }
.call-flow li > span { width: 30px; height: 30px; border-radius: 9px; background: var(--soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; }
.call-flow strong, .call-flow small { display: block; }
.call-flow small { color: var(--muted); margin-top: 4px; line-height: 1.5; }
.incoming-call-notice { position: fixed; right: 22px; top: 90px; z-index: 100; width: min(380px, calc(100vw - 44px)); background: #fff; color: var(--text); border: 2px solid var(--gold); border-radius: 14px; box-shadow: 0 15px 60px rgba(0,0,0,.2); padding: 16px; animation: notice-in .25s ease-out; }
.incoming-call-notice strong, .incoming-call-notice small { display: block; }
.incoming-call-notice small { margin-top: 5px; color: var(--muted); line-height: 1.45; }
@keyframes notice-in { from { transform: translateY(-10px); opacity: 0; } }

.branding-layout { display: grid; grid-template-columns: 260px minmax(440px, 720px); gap: 20px; align-items: start; }
.branding-preview { text-align: center; display: flex; flex-direction: column; align-items: center; }
.logo-preview { width: 130px; height: 130px; display: grid; place-items: center; border-radius: 24px; background: #f4f7f7; margin-bottom: 16px; }
.logo-preview img { max-width: 105px; max-height: 105px; object-fit: contain; }
.branding-preview small { color: var(--muted); margin-top: 5px; }
.global-antiforgery { display: none; }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(3, 1fr); }
    .detail-grid { grid-template-columns: repeat(2, 1fr); }
    .builder-layout { grid-template-columns: 1fr; }
    .builder-preview { position: static; }
}

@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: -270px; transition: .25s; width: 256px; }
    .sidebar.is-open { left: 0; box-shadow: 20px 0 60px rgba(0, 0, 0, .2); }
    .menu-button { display: block; }
    .topbar { padding: 0 18px; }
    .content { padding: 24px 18px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-wide { grid-column: auto; }
    .calendar-panel { overflow: auto; }
    .calendar-weekdays, .calendar-grid { min-width: 900px; }
    .call-agent-layout, .branding-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .page-head { flex-direction: column; }
    .head-actions { margin-left: 0; flex-wrap: wrap; }
    .quick-actions .button-ghost { display: none; }
    .quick-actions .button-deal { display: none; }
    .list-toolbar { flex-wrap: wrap; }
    .search-field { min-width: 100%; }
    .panel { padding: 15px; }
    .builder-summary { grid-template-columns: repeat(2, 1fr); }
    .option-grid { grid-template-columns: repeat(2, 1fr); }
    .field-flags { display: none; }
    .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; }
    .table-wrap thead { display: none; }
    .table-wrap tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
    .table-wrap td { border: 0; padding: 6px 8px; display: flex; justify-content: space-between; gap: 15px; }
    .table-wrap td::before { content: attr(data-label); color: var(--muted); font-size: 11px; }
    .row-actions { justify-content: flex-end !important; }
    .danger-zone { align-items: flex-start; flex-direction: column; }
    .setup-page { padding: 0; }
    .setup-card { border: 0; border-radius: 0; min-height: 100vh; padding: 25px 18px; }
    .setup-section { padding: 17px; }
    .setup-actions { align-items: stretch; flex-direction: column; }
    .category-grid { grid-template-columns: 1fr; }
    .transaction-switch { width: 100%; }
    .transaction-switch button { min-width: 0; flex: 1; }
}
