@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Nunito:wght@700;800;900&display=swap');

:root {
    --bg: #f8f7fc;
    --surface: #ffffff;
    --ink: #171529;
    --muted: #858291;
    --line: #ebe9f2;
    --navy: #7134e8;
    --navy-dark: #4a1daa;
    --blue-soft: #f0e9ff;
    --coral: #7c3aed;
    --coral-soft: #f2ebff;
    --green: #26b77a;
    --green-soft: #eafbf4;
    --sand: #d89a28;
    --shadow: 0 16px 42px rgba(43, 28, 86, .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: 'DM Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.logout-form { margin: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(113,52,232,.25); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.site-header { min-height: 86px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; padding: 14px clamp(22px, 3vw, 58px); background: rgba(255,255,255,.97); border-bottom: 1px solid #eeecf4; box-shadow: 0 5px 22px rgba(42,25,82,.04); }
.brand { justify-self: start; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; color: #fff; border-radius: 15px; background: linear-gradient(145deg, #8138f5, #5c22dc); box-shadow: 0 10px 24px rgba(105,43,224,.26); font: 900 15px 'Nunito', sans-serif; letter-spacing: -.5px; }
.brand > span:last-child { display: flex; flex-direction: column; }
.brand strong { font: 900 17px 'Nunito', sans-serif; letter-spacing: -.3px; }
.brand small { margin-top: -1px; color: #8b969b; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.1px; }
.top-nav { align-self: stretch; display: flex; align-items: center; gap: 32px; }
.top-nav a { position: relative; height: 100%; display: flex; align-items: center; color: #8a9499; text-decoration: none; font-size: 13px; font-weight: 700; }
.top-nav a:hover, .top-nav a.active { color: var(--ink); }
.top-nav a.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -15px; height: 3px; background: var(--coral); border-radius: 5px 5px 0 0; }
.header-actions { justify-self: end; display: flex; gap: 9px; }
.header-actions [data-open-import] { color: #fff; background: linear-gradient(135deg, #7f35f3, #6426df); border-color: transparent; box-shadow: 0 9px 22px rgba(104,42,224,.2); }
.header-actions [data-open-import]:hover { color: #fff; background: linear-gradient(135deg, #7130dc, #5520c5); }
.inbox-shortcut, .settings-shortcut { display: none; }

.primary-button, .secondary-button, .filter-button { min-height: 42px; border: 0; border-radius: 11px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-size: 12px; font-weight: 800; transition: .18s ease; }
.primary-button { padding: 11px 18px; color: #fff; background: linear-gradient(135deg, #7f35f3, #6426df); box-shadow: 0 9px 22px rgba(104,42,224,.23); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(104,42,224,.3); }
.primary-button:disabled { opacity: .6; cursor: wait; transform: none; }
.primary-button span { font-size: 18px; line-height: 1; }
.primary-button.full { width: 100%; margin-top: 18px; }
.secondary-button { padding: 10px 15px; color: #635d70; background: #f7f5fb; border: 1px solid #ebe8f2; }
.secondary-button:hover { color: var(--navy); background: var(--blue-soft); }
.filter-button { padding: 10px 16px; color: #fff; background: #756d80; box-shadow: 0 5px 12px rgba(51,38,73,.1); }
.filter-button:hover { background: var(--navy); }

.main-content { max-width: 1620px; margin: 0 auto; padding: 58px clamp(22px, 4vw, 64px) 76px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 30px; }
.eyebrow { margin: 0; color: var(--coral); font-size: 10px; font-weight: 900; letter-spacing: 1.35px; }
.hero h1 { margin: 11px 0 7px; color: #151323; font: 900 clamp(34px, 3.2vw, 48px)/1.03 'Nunito', sans-serif; letter-spacing: -1.9px; }
.hero > div:first-child > p:last-child { margin: 0; color: #748087; font-size: 15px; }
.privacy-note { max-width: 330px; display: flex; align-items: center; gap: 11px; padding: 12px 14px; color: #557062; background: #f1faf5; border: 1px solid #dceddf; border-radius: 13px; }
.privacy-note > span { width: 32px; height: 32px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 10px; font-size: 17px; }
.privacy-note div { display: flex; flex-direction: column; }
.privacy-note strong { font-size: 10px; }
.privacy-note small { margin-top: 2px; color: #779083; font-size: 8px; line-height: 1.4; }

.alert { margin-bottom: 18px; padding: 12px 15px; border-radius: 11px; font-size: 12px; animation: slideDown .3s ease; }
.alert.success { color: #1e704e; background: #eaf8f1; border: 1px solid #cfeadd; }
.alert.error { color: #a34943; background: #fff0ed; border: 1px solid #f2d5ce; }
.alert.info { color: #315f74; background: #eef7fa; border: 1px solid #d3e6ec; }
.alert.info strong { margin-right: 4px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 17px; margin-bottom: 24px; }
.metric-card { min-height: 134px; display: flex; align-items: center; gap: 18px; padding: 24px 25px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); text-decoration: none; transition: .2s ease; }
.metric-card:hover { transform: translateY(-2px); border-color: #d9ddd9; }
.metric-card.featured { background: linear-gradient(120deg, #f1fbf6, #fff 70%); border-color: #d4eadf; }
.metric-icon { flex: 0 0 49px; width: 49px; height: 49px; display: grid; place-items: center; border-radius: 14px; font: 900 22px 'Nunito'; }
.metric-icon.sand { color: #b2772e; background: #fff3df; }
.metric-icon.blue { color: #6840d7; background: #eeeaff; }
.metric-icon.coral { color: #7640df; background: var(--coral-soft); }
.metric-icon.green { color: #25885f; background: var(--green-soft); }
.metric-card > span:last-child { display: flex; flex-direction: column; }
.metric-card small { color: #8a9498; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; }
.metric-card strong { margin: 3px 0 1px; font: 900 29px/1 'Nunito', sans-serif; }
.metric-card em { color: #a0a8ab; font-size: 9px; font-style: normal; }

.daily-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; overflow: hidden; margin: -8px 0 24px; background: var(--line); border: 1px solid var(--line); border-radius: 13px; }
.daily-stats > * { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; background: #fff; text-decoration: none; }
.daily-stats span { color: #7c888e; font-size: 10px; font-weight: 700; }
.daily-stats strong { color: var(--navy); font: 900 18px 'Nunito', sans-serif; }
.daily-stats a:hover { background: #f7fbfc; }

.workflow-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 14px; padding: 2px; scrollbar-width: thin; }
.workflow-tabs a { flex: 0 0 auto; min-height: 39px; display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; color: #69777e; background: #fff; border: 1px solid var(--line); border-radius: 11px; font-size: 11px; font-weight: 800; text-decoration: none; }
.workflow-tabs a:hover, .workflow-tabs a.active { color: #fff; background: linear-gradient(135deg, #7b35ef, #5f27cf); border-color: transparent; box-shadow: 0 7px 18px rgba(102,42,215,.18); }
.workflow-tabs a span { min-width: 20px; padding: 2px 5px; color: inherit; background: rgba(49,91,114,.09); border-radius: 6px; text-align: center; font-size: 9px; }
.workflow-tabs a.active span, .workflow-tabs a:hover span { background: rgba(255,255,255,.15); }

.status-overview { margin: 0 0 24px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.status-overview-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.status-overview-heading > div { display: flex; flex-direction: column; gap: 2px; }
.status-overview-heading span { color: var(--navy); font-size: 8px; font-weight: 900; letter-spacing: 1.2px; }
.status-overview-heading h2 { margin: 0; font: 900 19px 'Nunito', sans-serif; }
.status-overview-heading > a { color: #746d7f; font-size: 9px; font-weight: 800; text-decoration: none; }
.status-overview-heading > a strong { margin-left: 4px; color: var(--navy); }
.status-overview-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(135px,1fr)); gap: 9px; }
.status-summary { min-width: 0; min-height: 72px; display: flex; align-items: center; gap: 11px; padding: 12px; color: #5f5969; background: #fbfafe; border: 1px solid #ece9f2; border-radius: 13px; text-decoration: none; transition: .18s ease; }
.status-summary:hover, .status-summary.active { transform: translateY(-1px); background: #f7f2ff; border-color: #bfa6f1; box-shadow: 0 8px 20px rgba(74,29,170,.09); }
.status-summary > span { flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; color: #7440da; background: #eee6ff; border-radius: 10px; font-weight: 900; }
.status-summary > div { min-width: 0; display: flex; flex-direction: column; }
.status-summary strong { color: #211b2c; font: 900 20px/1 'Nunito', sans-serif; }
.status-summary small { margin-top: 4px; overflow: hidden; color: #87818f; font-size: 8px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.status-summary[data-tone="orange"] > span, .status-summary[data-tone="yellow"] > span { color: #a46d11; background: #fff3d8; }
.status-summary[data-tone="green"] > span, .status-summary[data-tone="success"] > span { color: #18865b; background: #e3f8ee; }
.status-summary[data-tone="gray"] > span { color: #6f6c76; background: #eeedf0; }
.status-summary[data-tone="danger"] > span { color: #b5534b; background: #fff0ee; }

.followup-banner { min-height: 78px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; margin: 0 0 25px; padding: 16px 20px; color: #fff; background: linear-gradient(110deg, #25134b, #3b206f); border: 1px solid #3d2370; border-radius: 16px; box-shadow: 0 14px 30px rgba(38,20,77,.14); text-decoration: none; }
.followup-banner > span { width: 40px; height: 40px; display: grid; place-items: center; color: #d8c5ff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12); border-radius: 11px; font-size: 20px; }
.followup-banner div { display: flex; flex-direction: column; }
.followup-banner strong { font-size: 12px; }
.followup-banner small { margin-top: 2px; color: #c9bbe3; font-size: 9px; }
.followup-banner b { font-size: 10px; }

.leads-panel { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 19px; box-shadow: var(--shadow); }
.panel-heading { min-height: 102px; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0 0 3px; font: 900 20px 'Nunito', sans-serif; }
.panel-heading h2 span { display: inline-grid; min-width: 22px; height: 20px; margin-left: 5px; padding: 0 6px; place-items: center; color: var(--navy); background: var(--blue-soft); border-radius: 7px; font: 900 8px 'DM Sans'; vertical-align: 3px; }
.panel-heading p { margin: 0; color: #979fa3; font-size: 10px; }
.filters { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box { position: relative; }
.search-box span { position: absolute; left: 13px; top: 50%; transform: translateY(-55%); color: #9ca4a8; font-size: 20px; }
.search-box input { width: min(260px, 22vw); padding: 11px 13px 11px 39px; }
.filter-select select { width: 170px; padding: 11px 32px 11px 12px; }
.per-page-select select { width: 128px; }
.search-box input, .filter-select select { height: 43px; color: #5c5865; background: #fff; border: 1px solid #e5e2eb; border-radius: 11px; outline: 0; font-size: 10px; }
.order-select select { width: 170px; }
.contact-date-filter { width: 142px; height: 43px; display: flex; align-items: center; gap: 6px; padding: 0 9px; color: #8d8795; background: #fff; border: 1px solid #e5e2eb; border-radius: 11px; }
.contact-date-filter span { flex: 0 0 auto; font-size: 7px; font-weight: 900; text-transform: uppercase; white-space: nowrap; }
.contact-date-filter input { min-width: 0; width: 100%; padding: 0; color: #5c5865; background: transparent; border: 0; outline: 0; font-size: 9px; }
.search-box input:focus, .filter-select select:focus, .form-grid input:focus, .form-grid select:focus, textarea:focus { border-color: #9569ed; box-shadow: 0 0 0 3px rgba(113,52,232,.1); }
.clear-filter { padding: 6px; color: var(--coral); font-size: 9px; font-weight: 800; text-decoration: none; }

.bulk-bar { display: flex; align-items: center; gap: 9px; padding: 12px 18px; color: #5b2eb7; background: #f4efff; border-bottom: 1px solid #e5dafa; }
.bulk-bar[hidden] { display: none; }
.bulk-bar strong { margin-right: auto; font-size: 11px; }
.bulk-bar select, .bulk-bar input { min-height: 37px; padding: 8px 10px; color: #50636c; background: #fff; border: 1px solid #d5e2e6; border-radius: 9px; font-size: 10px; }
.bulk-delete { min-height: 37px; padding: 8px 12px; color: #fff; background: #cf5d51; border: 0; border-radius: 9px; cursor: pointer; font-size: 10px; font-weight: 900; }
.bulk-delete:hover { background: #b94c42; }
.bulk-delete:disabled { opacity: .55; cursor: wait; }
.bulk-cancel { min-height: 37px; padding: 7px 9px; color: #78868c; background: transparent; border: 0; cursor: pointer; font-size: 10px; font-weight: 800; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 1120px; border-collapse: collapse; }
th { padding: 14px 12px; color: #9994a5; background: #fcfbfe; text-align: left; text-transform: uppercase; font-size: 8px; font-weight: 900; letter-spacing: .9px; }
td { padding: 15px 12px; border-top: 1px solid #f0edf5; vertical-align: middle; font-size: 10px; }
tbody tr { transition: .15s ease; }
tbody tr:hover { background: #fbf9ff; }
.person-cell { min-width: 200px; display: flex; align-items: center; gap: 11px; }
.avatar { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; color: var(--navy); background: var(--blue-soft); border: 1px solid #e2d7fa; border-radius: 12px; font: 900 11px 'Nunito'; }
.person-cell div, .source-cell { display: flex; flex-direction: column; }
.person-cell strong { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.person-cell a { margin-top: 2px; color: #7041d4; text-decoration: none; font-size: 9px; font-weight: 700; }
.person-cell small, .source-cell small { margin-top: 3px; color: #a0a8ab; font-size: 8px; }
.source-cell { min-width: 150px; }
.source-cell strong { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.select-heading, .select-cell { width: 38px; padding-right: 4px; text-align: center; }
.select-heading input, .select-cell input { width: 17px; height: 17px; accent-color: var(--navy); cursor: pointer; }
.priority-badge { min-width: 72px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 6px 8px; border-radius: 999px; font-size: 9px; font-weight: 900; }
.priority-badge[data-tone="hot"] { color: #ad493b; background: #fff0ec; }
.priority-badge[data-tone="warm"] { color: #966818; background: #fff7e4; }
.priority-badge[data-tone="cold"] { color: #587784; background: #edf5f7; }
.context-cell { width: 140px; display: flex; flex-direction: column; gap: 4px; }
.context-cell span { color: #6f7d84; font-size: 10px; font-weight: 700; }
.context-cell small { max-width: 140px; overflow: hidden; color: #97a0a4; font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.last-contact-date { color: #655e6e; font-size: 9px; font-weight: 700; white-space: nowrap; }

.status-select { position: relative; width: 160px; }
.status-select select { appearance: none; width: 100%; height: 37px; padding: 8px 28px 8px 24px; color: #697279; background: #f8f8f7; border: 1px solid #e3e4e1; border-radius: 9px; outline: 0; cursor: pointer; font-size: 9px; font-weight: 800; }
.status-select i { position: absolute; z-index: 1; left: 10px; top: 50%; width: 6px; height: 6px; transform: translateY(-50%); background: #8a9295; border-radius: 50%; pointer-events: none; }
.status-select > span { position: absolute; right: 9px; top: 46%; transform: translateY(-50%); color: #929a9d; pointer-events: none; }
.status-select[data-tone="blue"] i, .status-select[data-tone="purple"] i { background: #7944db; }
.status-select[data-tone="blue"] select, .status-select[data-tone="purple"] select { color: #6232bd; background: #f5f0ff; border-color: #e5daf9; }
.status-select[data-tone="orange"] i, .status-select[data-tone="yellow"] i { background: #dda547; }
.status-select[data-tone="orange"] select, .status-select[data-tone="yellow"] select { color: #92691e; background: #fff9ed; border-color: #efdfba; }
.status-select[data-tone="green"] i, .status-select[data-tone="success"] i { background: #35a174; }
.status-select[data-tone="green"] select, .status-select[data-tone="success"] select { color: #247654; background: #effaf4; border-color: #d2ebde; }
.status-select[data-tone="gray"] i { background: #92999c; }
.status-select[data-tone="danger"] i { background: #db6257; }
.status-select[data-tone="danger"] select { color: #a64d45; background: #fff3f1; border-color: #f0d5d0; }
.status-select.saving { opacity: .55; }
.followup-date { min-width: 92px; padding: 0; color: #758086; background: none; border: 0; cursor: pointer; text-align: left; font-size: 9px; }
.followup-date span { display: block; }
.followup-date:hover { color: var(--navy); }
.followup-date.due b { display: block; margin-bottom: 2px; color: #b07821; font-size: 8px; }
.updated-at { color: #939ca0; font-size: 8px; white-space: nowrap; }
.actions-heading { text-align: right; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.icon-button { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; color: #65747b; background: #fff; border: 1px solid #dde2e3; border-radius: 9px; cursor: pointer; text-decoration: none; font-size: 14px; font-weight: 900; transition: .17s ease; }
.icon-button:hover { transform: translateY(-1px); box-shadow: 0 6px 15px rgba(39,67,79,.11); }
.icon-button.whatsapp { color: #fff; background: #31ae73; border-color: #31ae73; font-size: 10px; }
.icon-button.edit { color: var(--navy); background: #f8f5ff; border-color: #e4daf8; }
.icon-button.copy-phone { color: #6c44c4; background: #f8f5ff; border-color: #e4daf8; }
.icon-button.copy-phone:hover { color: var(--navy); background: var(--blue-soft); }
.icon-button.result { color: #95691f; background: #fff9eb; border-color: #eadbb7; }
.icon-button.delete { color: #b35e54; background: #fffafa; }
.icon-button.delete:hover { color: #fff; background: #d9675a; border-color: #d9675a; }
.icon-button.disabled { color: #b8bdbf; background: #f4f4f3; cursor: not-allowed; }
.empty-state { padding: 70px 20px 76px; text-align: center; }
.empty-state > span { width: 65px; height: 65px; display: grid; place-items: center; margin: 0 auto 16px; color: var(--coral); background: var(--coral-soft); border-radius: 20px 20px 20px 8px; font-size: 25px; }
.empty-state h3 { margin: 0 0 6px; font: 900 18px 'Nunito'; }
.empty-state p { max-width: 420px; margin: 0 auto 19px; color: var(--muted); font-size: 11px; line-height: 1.6; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(25,43,52,.66); backdrop-filter: blur(5px); animation: fadeIn .2s ease; }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; width: min(570px,100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 29px; background: #fff; border-radius: 21px 21px 21px 8px; box-shadow: 0 30px 90px rgba(15,35,43,.28); animation: modalIn .28s cubic-bezier(.22,1,.36,1); }
.modal-close { position: absolute; top: 14px; right: 15px; width: 33px; height: 33px; color: #738087; background: #f1f3f3; border: 0; border-radius: 50%; cursor: pointer; font-size: 20px; }
.modal-kicker { color: var(--coral); font-size: 9px; font-weight: 900; letter-spacing: 1.2px; }
.modal h2 { margin: 5px 0 5px; font: 900 24px 'Nunito'; letter-spacing: -.6px; }
.modal > p { margin: 0 0 20px; color: #879196; font-size: 11px; line-height: 1.55; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; color: #56656c; font-size: 9px; font-weight: 800; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid input, .form-grid select, textarea { width: 100%; min-height: 42px; padding: 10px 11px; color: var(--ink); background: #fff; border: 1px solid #dfe4e5; border-radius: 10px; outline: 0; font-size: 11px; font-weight: 500; }
textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.dropzone { position: relative; min-height: 155px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f8fbfc; border: 1.5px dashed #b9d0d8; border-radius: 15px; cursor: pointer; }
.dropzone:hover, .dropzone.dragging { background: #eff7f9; border-color: var(--navy); }
.dropzone input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.dropzone > span { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 9px; color: #fff; background: var(--navy); border-radius: 12px; font-size: 20px; }
.dropzone strong { font-size: 12px; }
.dropzone small { margin-top: 3px; color: #9aa5aa; font-size: 9px; }
.import-help { margin-top: 11px; padding: 10px 12px; color: #3c755c; background: #eef8f3; border-radius: 9px; font-size: 9px; }
.import-help span { margin-right: 5px; color: var(--green); font-weight: 900; }
.model-link { display: inline-block; margin-top: 11px; color: var(--navy); font-size: 9px; font-weight: 800; }
.history-modal { width: min(500px,100%); }
.contact-modal { width: min(760px,100%); }
.contact-summary { display: flex; align-items: center; gap: 12px; margin: 18px 0; padding: 13px 15px; background: #f5f9fa; border: 1px solid #e0eaed; border-radius: 14px; }
.contact-summary > div { min-width: 0; display: flex; flex-direction: column; }
.contact-summary strong { font-size: 13px; }
.contact-summary div > span { margin-top: 2px; color: #6f7e85; font-size: 10px; }
.contact-summary small { max-width: 100%; overflow: hidden; margin-top: 4px; color: #929da2; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.api-connection { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; padding: 11px 13px; background: #f5f7f7; border: 1px solid #e1e6e7; border-radius: 11px; }
.api-connection > span { flex: 0 0 9px; width: 9px; height: 9px; background: #9ca5a9; border-radius: 50%; }
.api-connection > div { display: flex; flex-direction: column; }
.api-connection strong { font-size: 10px; }
.api-connection small { margin-top: 2px; color: #818e94; font-size: 9px; }
.api-connection[data-api-state="ready"] { color: #236f51; background: #eff9f4; border-color: #d1eadc; }
.api-connection[data-api-state="ready"] > span { background: #32a173; box-shadow: 0 0 0 4px rgba(50,161,115,.12); }
.api-connection[data-api-state="incomplete"] { color: #97671b; background: #fff9eb; border-color: #ebddb8; }
.api-connection[data-api-state="incomplete"] > span { background: #dda547; }
.contact-section { margin-top: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; }
.contact-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.contact-section-heading > div { display: flex; align-items: center; gap: 8px; }
.contact-section-heading > div > span { width: 25px; height: 25px; display: grid; place-items: center; color: #fff; background: var(--navy); border-radius: 8px; font-size: 10px; font-weight: 900; }
.contact-section-heading strong { font-size: 12px; }
.contact-section-heading small { color: #929ca1; font-size: 9px; }
.contact-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.contact-grid label { display: flex; flex-direction: column; gap: 6px; color: #56656c; font-size: 10px; font-weight: 800; }
.contact-grid .span-2 { grid-column: span 2; }
.contact-grid input, .contact-grid select, .contact-grid textarea { width: 100%; min-height: 41px; padding: 9px 10px; color: var(--ink); background: #fff; border: 1px solid #dce3e5; border-radius: 9px; outline: 0; font-size: 11px; }
.contact-grid textarea { line-height: 1.5; }
.contact-grid textarea[readonly] { color: #64747b; background: #f5f7f7; cursor: not-allowed; }
.api-template-hint { margin: 8px 0 0; color: #7d8a90; font-size: 9px; line-height: 1.45; }
.date-presets { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 9px; }
.date-presets button { padding: 6px 9px; color: #60747e; background: #f3f7f8; border: 1px solid #dde8eb; border-radius: 8px; cursor: pointer; font-size: 9px; font-weight: 800; }
.whatsapp-send { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; color: #fff; background: #2aaa6e; border: 0; border-radius: 11px; cursor: pointer; font-size: 11px; font-weight: 900; }
.whatsapp-send:disabled { opacity: .6; cursor: wait; }
.whatsapp-send span { width: 23px; height: 23px; display: grid; place-items: center; background: rgba(255,255,255,.17); border-radius: 7px; font-size: 9px; }
.result-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin-bottom: 13px; }
.result-options button { min-height: 37px; padding: 7px; color: #64747b; background: #fafbfb; border: 1px solid #dfe4e5; border-radius: 9px; cursor: pointer; font-size: 9px; font-weight: 800; }
.result-options button:hover, .result-options button.active { color: #fff; background: var(--navy); border-color: var(--navy); }
.timeline { position: relative; display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding-bottom: 18px; }
.timeline-item::before { content: ''; position: absolute; left: 13px; top: 25px; bottom: 0; width: 1px; background: #dfe6e6; }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 28px; height: 28px; display: grid; place-items: center; color: var(--navy); background: var(--blue-soft); border-radius: 9px; font-size: 11px; font-weight: 900; }
.timeline-copy { padding-top: 1px; }
.timeline-copy strong { display: block; font-size: 10px; }
.timeline-copy small { display: block; margin-top: 3px; color: #98a1a5; font-size: 8px; }
.timeline-loading, .timeline-empty { padding: 30px 10px; color: #98a1a5; text-align: center; font-size: 10px; }
.toast { position: fixed; z-index: 200; right: 24px; bottom: 24px; max-width: 360px; padding: 12px 16px; color: #fff; background: #321764; border-radius: 11px; box-shadow: 0 15px 40px rgba(38,20,77,.24); font-size: 11px; font-weight: 700; animation: toastIn .25s ease; }
.toast.error { background: #b75249; }

.pagination { min-height: 66px; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 14px 20px; border-top: 1px solid var(--line); color: #748087; font-size: 12px; }
.pagination-link { min-height: 38px; display: inline-flex; align-items: center; padding: 8px 13px; color: var(--navy); background: #f5f9fa; border: 1px solid #dce8eb; border-radius: 10px; font-weight: 800; text-decoration: none; }
.pagination-link:hover { background: var(--blue-soft); }
.pagination-link.disabled { opacity: .42; pointer-events: none; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 30px 18px; background: radial-gradient(circle at top left, #eef7f8, transparent 42%), var(--bg); }
.auth-shell { width: min(460px, 100%); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px; }
.auth-brand > div { display: flex; flex-direction: column; }
.auth-brand strong { font: 900 17px 'Nunito', sans-serif; }
.auth-brand small { color: #899499; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.auth-card { padding: 34px; background: #fff; border: 1px solid var(--line); border-radius: 22px 22px 22px 8px; box-shadow: 0 24px 70px rgba(30,55,66,.13); }
.auth-card h1 { margin: 6px 0 7px; font: 900 27px/1.12 'Nunito', sans-serif; letter-spacing: -.7px; }
.auth-card > p { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 7px; color: #53636b; font-size: 12px; font-weight: 800; }
.auth-form input { width: 100%; min-height: 46px; padding: 11px 12px; color: var(--ink); background: #fff; border: 1px solid #dce3e5; border-radius: 11px; outline: 0; }
.auth-form input:focus { border-color: #6e99aa; box-shadow: 0 0 0 3px rgba(49,91,114,.09); }
.password-hint { margin-top: -7px; color: #8d989d; font-size: 11px; }
.auth-note { margin: 16px 0 0; color: #8c979b; text-align: center; font-size: 11px; }

th { font-size: 10px; }
td { font-size: 12px; }
.person-cell strong { font-size: 13px; }
.person-cell a, .person-cell small, .source-cell small { font-size: 10px; }
.source-cell strong, .panel-heading p { font-size: 11px; }
.status-select select, .followup-date { font-size: 11px; }
.updated-at { font-size: 10px; }
.form-grid label { font-size: 11px; }
.form-grid input, .form-grid select, textarea { font-size: 12px; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-7px); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 1100px) {
    .site-header { grid-template-columns: 1fr auto; }
    .top-nav { display: none; }
    .inbox-shortcut, .settings-shortcut { display: inline-flex; }
    .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .panel-heading { align-items: flex-start; flex-direction: column; }
    .filters { width: 100%; justify-content: flex-start; }
    .search-box { flex: 1; }
    .search-box input { width: 100%; }
    .daily-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .bulk-bar { flex-wrap: wrap; }
    .bulk-bar strong { width: 100%; }
}

@media (max-width: 700px) {
    .site-header { min-height: 72px; gap: 12px; padding: 12px 16px; }
    .brand-mark { width: 40px; height: 40px; }
    .brand strong { font-size: 14px; }
    .header-actions > [data-open-import] { display: none; }
    .header-actions .primary-button { padding: 10px 12px; font-size: 10px; }
    .main-content { padding: 31px 15px 50px; }
    .hero { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
    .hero h1 { font-size: 32px; }
    .privacy-note { width: 100%; max-width: none; }
    .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
    .metric-card { min-height: 105px; gap: 11px; padding: 15px; }
    .metric-icon { width: 40px; height: 40px; flex-basis: 40px; font-size: 18px; }
    .metric-card strong { font-size: 24px; }
    .panel-heading { padding: 20px 17px; }
    .daily-stats { margin-top: -12px; }
    .filters { display: grid; grid-template-columns: 1fr 1fr; }
    .search-box { grid-column: span 2; }
    .filter-select select { width: 100%; }
    .contact-date-filter { width: 100%; }
    .order-select { grid-column: span 2; }
    .per-page-select { grid-column: span 2; }
    .filter-button { grid-column: span 2; }
    .status-overview { padding: 16px; }
    .status-overview-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
    .status-overview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .status-summary { min-height: 66px; padding: 10px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: span 1; }
    .modal { padding: 26px 20px; }
    .followup-banner { grid-template-columns: auto 1fr; }
    .followup-banner > b { display: none; }
    .toast { left: 15px; right: 15px; bottom: 15px; max-width: none; }
    .table-wrap { overflow: visible; padding: 12px; background: var(--bg); }
    table { min-width: 0; }
    thead { display: none; }
    tbody { display: grid; gap: 12px; }
    tbody tr[data-lead-row] { position: relative; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 8px 24px rgba(42,63,74,.06); }
    tbody tr[data-lead-row] > td { min-width: 0; display: flex; flex-direction: column; gap: 7px; padding: 12px 14px; border: 0; }
    tbody tr[data-lead-row] > td::before { content: attr(data-label); color: #929da2; font-size: 9px; font-weight: 900; letter-spacing: .7px; text-transform: uppercase; }
    tbody tr[data-lead-row] > td[data-label="Lead"] { grid-column: span 2; padding: 15px 14px; border-bottom: 1px solid #eff0ec; }
    tbody tr[data-lead-row] > td[data-label="Lead"]::before { display: none; }
    tbody tr[data-lead-row] > td[data-label="Ações"] { grid-column: span 2; border-top: 1px solid #eff0ec; }
    tbody tr[data-lead-row] > td[data-label="Observações"] { grid-column: span 2; }
    tbody tr[data-lead-row] > td.select-cell { position: absolute; z-index: 2; top: 12px; right: 10px; width: auto; padding: 4px; }
    tbody tr[data-lead-row] > td.select-cell::before { display: none; }
    .person-cell, .source-cell { min-width: 0; }
    .status-select { width: 100%; }
    .row-actions { justify-content: flex-start; }
    .context-cell, .context-cell small { width: 100%; max-width: none; }
    .bulk-bar { display: grid; grid-template-columns: 1fr 1fr; padding: 12px; }
    .bulk-bar strong, .bulk-bar label:first-of-type { grid-column: span 2; }
    .bulk-bar select, .bulk-bar input, .bulk-bar .filter-button { width: 100%; }
    .contact-section { padding: 14px; }
    .contact-section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
    .contact-grid { grid-template-columns: 1fr; }
    .contact-grid .span-2 { grid-column: span 1; }
    .result-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .pagination { justify-content: space-between; gap: 8px; padding: 13px 12px; }
    .pagination-link { padding: 8px 10px; font-size: 10px; }
    .pagination > span { font-size: 10px; }
    .auth-card { padding: 27px 21px; }
}

@media (max-width: 420px) {
    .brand > span:last-child { display: none; }
    .header-actions { gap: 6px; }
    .logout-button { padding: 9px 11px; }
}

/* Caixa de entrada do WhatsApp */
.nav-unread { min-width: 18px; height: 18px; display: inline-grid; margin-left: 5px; padding: 0 5px; place-items: center; color: #fff; background: var(--coral); border-radius: 9px; font-size: 8px; }
.inbox-page { min-height: 100vh; background: #f4f7f7; }
.inbox-content { width: min(1440px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 44px; }
.inbox-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.inbox-heading h1 { margin: 3px 0; color: #233f4d; font: 900 clamp(25px, 3vw, 36px) 'Nunito', sans-serif; }
.inbox-heading > div > p:last-child { margin: 0; color: #7f8d93; font-size: 12px; }
.inbox-api-status { display: inline-flex; align-items: center; gap: 7px; color: #68777e; font-size: 10px; font-weight: 800; }
.inbox-api-status i { width: 8px; height: 8px; background: #a7b0b4; border-radius: 50%; }
.inbox-api-status[data-ready="1"] { color: #257451; }
.inbox-api-status[data-ready="1"] i { background: #37a874; box-shadow: 0 0 0 4px rgba(55,168,116,.12); }
.webhook-health { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border: 1px solid #e0e7e8; border-radius: 12px; box-shadow: 0 7px 22px rgba(38,65,75,.05); }
.webhook-health > span { width: 9px; height: 9px; background: #36a474; border-radius: 50%; box-shadow: 0 0 0 4px rgba(54,164,116,.12); }
.webhook-health > div { display: flex; flex-direction: column; }
.webhook-health strong { color: #3a505b; font-size: 10px; }
.webhook-health small { margin-top: 2px; color: #909da2; font-size: 8px; }
.inbox-shell { height: min(720px, calc(100vh - 205px)); min-height: 540px; display: grid; grid-template-columns: 350px minmax(0, 1fr); overflow: hidden; background: #fff; border: 1px solid #dde6e8; border-radius: 18px; box-shadow: 0 18px 45px rgba(42,71,82,.08); }
.conversation-sidebar { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid #e3eaeb; background: #fbfcfc; }
.conversation-sidebar-head { padding: 18px 16px 13px; border-bottom: 1px solid #e6ecee; }
.conversation-sidebar-head > div { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.conversation-sidebar-head strong { color: #314d5a; font: 900 14px 'Nunito', sans-serif; }
.conversation-sidebar-head > div > span { min-width: 25px; height: 21px; display: grid; place-items: center; color: var(--navy); background: var(--blue-soft); border-radius: 8px; font-size: 9px; font-weight: 900; }
.inbox-search { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 11px; background: #fff; border: 1px solid #dfe7e9; border-radius: 10px; }
.inbox-search span { color: #8f9da2; font-size: 16px; }
.inbox-search input { min-width: 0; flex: 1; padding: 0; border: 0; outline: 0; background: transparent; font-size: 10px; }
.conversation-list { min-height: 0; flex: 1; overflow-y: auto; }
.conversation-item { position: relative; width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; padding: 13px 15px; text-align: left; background: transparent; border: 0; border-bottom: 1px solid #edf1f2; cursor: pointer; transition: background .15s ease; }
.conversation-item:hover { background: #f3f8f9; }
.conversation-item.active { background: #eaf4f6; box-shadow: inset 3px 0 var(--coral); }
.conversation-item.unread { background: #f3f9f8; }
.conversation-item .avatar { width: 42px; height: 42px; }
.conversation-copy { min-width: 0; display: flex; flex-direction: column; }
.conversation-title { min-width: 0; display: flex; justify-content: space-between; gap: 8px; }
.conversation-title strong { overflow: hidden; color: #304b57; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-title time { flex: 0 0 auto; color: #9aa5a9; font-size: 8px; }
.conversation-preview { margin-top: 4px; overflow: hidden; color: #65767d; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy small { margin-top: 4px; overflow: hidden; color: #9aa6aa; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-unread { position: absolute; right: 14px; bottom: 10px; min-width: 18px; height: 18px; display: grid; padding: 0 5px; place-items: center; color: #fff; background: #38a977; border-radius: 9px; font-size: 8px; }
.conversation-list-empty { padding: 35px 22px; color: #8b999e; font-size: 10px; line-height: 1.6; text-align: center; }
.chat-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #f2f6f5; }
.chat-header { min-height: 70px; display: flex; align-items: center; gap: 11px; padding: 13px 19px; background: #fff; border-bottom: 1px solid #e3eaeb; }
.chat-header > div { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.chat-header strong { color: #2e4a57; font-size: 11px; }
.chat-header span { margin-top: 3px; overflow: hidden; color: #87959a; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.chat-header-actions { min-width: auto !important; display: flex !important; flex: 0 0 auto !important; flex-direction: row !important; gap: 7px; }
.chat-header-actions a,
.chat-header-actions button { flex: 0 0 auto; padding: 8px 11px; color: var(--navy); background: #f0f6f7; border: 0; border-radius: 9px; font: inherit; font-size: 9px; font-weight: 800; text-decoration: none; cursor: pointer; }
.chat-header-actions button:hover,
.chat-header-actions a:hover { background: #e2eff1; }
.chat-header-actions button:disabled { opacity: .5; cursor: not-allowed; }
.message-list { min-height: 0; overflow-y: auto; padding: 22px clamp(18px, 4vw, 55px); background-color: #f1f5f4; background-image: radial-gradient(rgba(49,91,114,.055) .8px, transparent .8px); background-size: 17px 17px; }
.message-day { width: max-content; margin: 2px auto 15px; padding: 5px 10px; color: #7b8a90; background: rgba(255,255,255,.85); border: 1px solid #e0e7e7; border-radius: 9px; font-size: 8px; font-weight: 700; }
.message-bubble { width: fit-content; max-width: min(72%, 670px); margin: 7px 0; padding: 10px 12px 7px; background: #fff; border: 1px solid #e0e7e7; border-radius: 13px 13px 13px 4px; box-shadow: 0 3px 10px rgba(44,68,77,.05); }
.message-bubble.outbound { margin-left: auto; background: #dcf5e8; border-color: #c8e9d8; border-radius: 13px 13px 4px 13px; }
.message-bubble p { margin: 0; color: #334b55; font-size: 11px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-bubble footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; color: #8b989d; font-size: 7px; }
.message-type { display: block; margin-bottom: 4px; color: #5b8173; font-size: 7px; font-weight: 900; text-transform: uppercase; }
.message-status.status-read { color: #2588b6; }
.message-status.status-failed { color: #bd4e4e; font-weight: 800; }
.message-composer { padding: 13px 16px 14px; background: #fff; border-top: 1px solid #e0e8e9; }
.composer-options { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 9px; }
.composer-options label { display: flex; flex-direction: column; gap: 4px; color: #77868c; font-size: 8px; font-weight: 800; }
.composer-options select { min-height: 31px; padding: 4px 28px 4px 9px; color: #415a65; background: #f7f9f9; border: 1px solid #dce5e6; border-radius: 8px; font-size: 9px; }
.service-window { color: #a16f20; font-size: 8px; font-weight: 800; }
.service-window[data-open="1"] { color: #247a56; }
.composer-row { display: flex; align-items: flex-end; gap: 10px; }
.composer-row textarea { min-height: 48px; max-height: 130px; flex: 1; resize: vertical; padding: 11px 12px; color: #344d58; border: 1px solid #dbe4e6; border-radius: 11px; outline: 0; font: 10px/1.45 'DM Sans', sans-serif; }
.composer-row textarea:focus { border-color: #8bb3c2; box-shadow: 0 0 0 3px rgba(80,139,162,.1); }
.composer-row textarea[readonly] { color: #667a82; background: #f6f8f8; }
.composer-row button { min-height: 48px; flex: 0 0 auto; }
.message-composer > small { display: block; margin-top: 6px; color: #929da1; font-size: 7px; }
.chat-empty { grid-row: 1 / -1; align-self: center; justify-self: center; max-width: 330px; padding: 35px; color: #829096; text-align: center; }
.chat-empty > span { width: 48px; height: 48px; display: grid; margin: 0 auto 12px; place-items: center; color: var(--navy); background: var(--blue-soft); border-radius: 15px; font-size: 21px; }
.chat-empty h2 { margin: 0; color: #3d5661; font: 900 17px 'Nunito', sans-serif; }
.chat-empty p { margin: 7px 0 0; font-size: 10px; line-height: 1.6; }

@media (max-width: 900px) {
    .inbox-content { width: min(100% - 24px, 760px); padding-top: 22px; }
    .inbox-heading { align-items: flex-start; }
    .webhook-health { display: none; }
    .inbox-shell { height: calc(100vh - 175px); min-height: 500px; grid-template-columns: 285px minmax(0, 1fr); }
    .message-bubble { max-width: 86%; }
}

@media (max-width: 650px) {
    .inbox-page .site-header { padding-inline: 12px; }
    .inbox-page .header-actions .inbox-api-status, .inbox-page .header-actions > a { display: none; }
    .inbox-content { width: 100%; padding: 14px 0 0; }
    .inbox-heading { padding: 0 15px; }
    .inbox-heading > div > p:last-child { display: none; }
    .inbox-shell { height: calc(100vh - 125px); min-height: 500px; grid-template-columns: 105px minmax(0, 1fr); border-right: 0; border-left: 0; border-radius: 0; }
    .conversation-sidebar-head { padding: 12px 8px; }
    .conversation-sidebar-head > div strong { font-size: 10px; }
    .conversation-sidebar-head > div > span { min-width: 20px; height: 18px; }
    .inbox-search span { display: none; }
    .inbox-search { min-height: 33px; padding: 0 6px; }
    .inbox-search input { width: 100%; font-size: 8px; }
    .conversation-item { display: flex; align-items: center; justify-content: center; padding: 11px 7px; }
    .conversation-item .conversation-copy { display: none; }
    .conversation-item .avatar { width: 40px; height: 40px; }
    .conversation-unread { right: 13px; bottom: 8px; }
    .chat-header { min-height: 61px; padding: 9px 11px; }
    .chat-header .avatar { display: none; }
    .chat-header-actions { gap: 4px; }
    .chat-header-actions a,
    .chat-header-actions button { padding: 7px; font-size: 8px; }
    .message-list { padding: 15px 10px; }
    .message-bubble { max-width: 93%; }
    .message-bubble p { font-size: 10px; }
    .message-composer { padding: 9px; }
    .composer-options { align-items: stretch; flex-direction: column; gap: 5px; }
    .composer-options label { width: 100%; }
    .service-window { align-self: flex-end; }
    .composer-row { gap: 6px; }
    .composer-row button { min-height: 45px; padding-inline: 11px; font-size: 9px; }
}

/* Configurações do sistema */
.settings-page { background: #f5f7f6; }
.settings-content { width: min(1320px, calc(100% - 42px)); margin: 0 auto; padding: 38px 0 70px; }
.settings-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 24px; }
.settings-hero h1 { margin: 6px 0 3px; color: #284653; font: 900 clamp(27px, 3vw, 38px) 'Nunito', sans-serif; }
.settings-hero p:last-child { margin: 0; color: #7c898f; font-size: 12px; }
.settings-score { min-width: 100px; display: flex; flex-direction: column; align-items: center; padding: 13px 17px; background: #fff; border: 1px solid #e0e7e7; border-radius: 13px; box-shadow: var(--shadow); }
.settings-score strong { color: var(--navy); font: 900 20px 'Nunito', sans-serif; }
.settings-score span { color: #87949a; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.settings-layout { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { position: sticky; top: 18px; display: flex; flex-direction: column; overflow: hidden; padding: 7px; background: #fff; border: 1px solid #e0e7e7; border-radius: 14px; box-shadow: 0 8px 25px rgba(41,66,76,.05); }
.settings-nav a { padding: 10px 11px; color: #718087; border-radius: 9px; font-size: 10px; font-weight: 800; text-decoration: none; }
.settings-nav a:hover, .settings-nav a.active { color: var(--navy); background: var(--blue-soft); }
.settings-sections { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.settings-card { scroll-margin-top: 18px; padding: 23px 25px; background: #fff; border: 1px solid #e1e7e7; border-radius: 16px; box-shadow: 0 10px 30px rgba(41,66,76,.055); }
.settings-card > header { display: flex; align-items: center; gap: 11px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #edf0f0; }
.settings-card > header > span { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; color: #fff; background: var(--navy); border-radius: 9px; font-size: 9px; font-weight: 900; }
.settings-card > header > div { flex: 1; }
.settings-card h2 { margin: 0; color: #314d59; font: 900 16px 'Nunito', sans-serif; }
.settings-card > header p { margin: 2px 0 0; color: #8b979c; font-size: 9px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 15px; margin-bottom: 17px; }
.settings-grid label, .meta-template-grid label { min-width: 0; display: flex; flex-direction: column; gap: 5px; color: #61727a; font-size: 9px; font-weight: 800; }
.settings-grid label.wide { grid-column: span 2; }
.settings-grid input, .settings-grid select, .settings-grid textarea, .meta-template-grid input { width: 100%; min-height: 40px; padding: 9px 10px; color: #344e59; background: #fbfcfc; border: 1px solid #dce4e5; border-radius: 9px; outline: 0; font-size: 10px; }
.settings-grid textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.settings-grid input:focus, .settings-grid select:focus, .settings-grid textarea:focus, .meta-template-grid input:focus { border-color: #8bb2c1; box-shadow: 0 0 0 3px rgba(80,139,162,.09); }
.settings-grid label > small { color: #929da2; font-size: 7px; font-weight: 500; }
.template-settings { display: flex; flex-direction: column; gap: 9px; margin-bottom: 17px; }
.template-settings details { overflow: hidden; background: #fafcfc; border: 1px solid #e2e8e9; border-radius: 11px; }
.template-settings summary { display: flex; justify-content: space-between; padding: 12px 14px; color: #415c67; cursor: pointer; list-style: none; }
.template-settings summary::-webkit-details-marker { display: none; }
.template-settings summary strong { font-size: 10px; }
.template-settings summary span { color: #99a4a8; font-size: 8px; }
.template-settings details .settings-grid { padding: 3px 14px 14px; }
.settings-toggle { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; padding: 12px 13px; background: #f6f9f9; border: 1px solid #e1e8e9; border-radius: 11px; cursor: pointer; }
.settings-toggle > input { position: absolute; opacity: 0; pointer-events: none; }
.settings-toggle > span { position: relative; width: 38px; height: 21px; flex: 0 0 38px; background: #b9c2c5; border-radius: 11px; transition: .2s; }
.settings-toggle > span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.settings-toggle > input:checked + span { background: var(--green); }
.settings-toggle > input:checked + span::after { transform: translateX(17px); }
.settings-toggle > div { display: flex; flex-direction: column; }
.settings-toggle strong { color: #3b5661; font-size: 10px; }
.settings-toggle small { margin-top: 2px; color: #88969b; font-size: 8px; }
.secret-field > small > label { display: inline-flex; flex-direction: row; align-items: center; gap: 5px; font-weight: 600; }
.secret-field > small input { width: 13px; min-height: 13px; padding: 0; }
.input-action { display: flex; gap: 7px; }
.input-action input { flex: 1; }
.input-action button, .webhook-address button { flex: 0 0 auto; padding: 7px 11px; color: var(--navy); background: var(--blue-soft); border: 0; border-radius: 8px; font-size: 9px; font-weight: 800; cursor: pointer; }
.connection-pill { padding: 6px 9px; color: #9a6b22; background: #fff5df; border-radius: 8px; font-size: 8px; }
.connection-pill[data-ready="1"] { color: #267451; background: #e9f8f0; }
.settings-subtitle { margin: 22px 0 10px; color: #435d68; font: 900 11px 'Nunito', sans-serif; }
.meta-template-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; margin-bottom: 18px; }
.webhook-address { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; padding: 11px 12px; background: #f4f8f9; border: 1px solid #dde7e9; border-radius: 10px; }
.webhook-address code { min-width: 0; flex: 1; overflow: hidden; color: #355767; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.webhook-address button:disabled { opacity: .45; cursor: not-allowed; }
.settings-checklist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.settings-checklist > div { display: flex; gap: 9px; padding: 11px; background: #fff7e8; border: 1px solid #f0dfbb; border-radius: 10px; }
.settings-checklist > div[data-ok="1"] { background: #eef9f3; border-color: #d5ebdf; }
.settings-checklist > div > span { width: 9px; height: 9px; margin-top: 2px; background: #d6a34e; border-radius: 50%; }
.settings-checklist > div[data-ok="1"] > span { background: #3ca776; }
.settings-checklist p { display: flex; flex-direction: column; margin: 0; }
.settings-checklist strong { color: #4a6069; font-size: 9px; }
.settings-checklist small { margin-top: 3px; color: #89969a; font-size: 7px; line-height: 1.45; }
.hosting-card > header > b { color: var(--navy); font: 900 15px 'Nunito', sans-serif; }
.diagnostic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 21px; }
.diagnostic-grid > div { display: flex; align-items: center; gap: 9px; padding: 10px; background: #fff4f0; border: 1px solid #f1d9d1; border-radius: 10px; }
.diagnostic-grid > div[data-ok="1"] { background: #eef9f3; border-color: #d7eade; }
.diagnostic-grid > div > span { width: 23px; height: 23px; flex: 0 0 23px; display: grid; place-items: center; color: #fff; background: #d57a67; border-radius: 7px; font-size: 9px; font-weight: 900; }
.diagnostic-grid > div[data-ok="1"] > span { background: #43a779; }
.diagnostic-grid p { min-width: 0; display: flex; flex-direction: column; margin: 0; }
.diagnostic-grid strong { color: #52676f; font-size: 8px; }
.diagnostic-grid small { margin-top: 2px; overflow: hidden; color: #89969a; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.hosting-steps { padding: 16px 18px; background: #f7f9f9; border: 1px solid #e2e8e9; border-radius: 11px; }
.hosting-steps h3 { margin: 0 0 9px; color: #3e5964; font: 900 12px 'Nunito', sans-serif; }
.hosting-steps ol { margin: 0; padding-left: 18px; color: #607178; font-size: 9px; line-height: 1.8; }
.hosting-steps code { color: #365e70; background: #eaf2f4; border-radius: 4px; }
.hosting-warning { margin: 11px 0 0; padding-top: 10px; color: #9a642f; border-top: 1px solid #e0e5e5; font-size: 8px; }

@media (max-width: 900px) {
    .settings-content { width: min(100% - 24px, 760px); padding-top: 25px; }
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav { position: sticky; z-index: 5; top: 0; flex-direction: row; overflow-x: auto; white-space: nowrap; }
    .settings-checklist, .diagnostic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .settings-page .site-header { padding-inline: 12px; }
    .settings-page .header-actions > a { display: none; }
    .settings-content { width: 100%; padding: 18px 11px 45px; }
    .settings-hero { align-items: flex-start; }
    .settings-score { display: none; }
    .settings-card { padding: 18px 14px; }
    .settings-grid, .meta-template-grid, .settings-checklist, .diagnostic-grid { grid-template-columns: 1fr; }
    .settings-grid label.wide { grid-column: span 1; }
    .settings-grid > span { display: none; }
    .settings-card > header { align-items: flex-start; }
    .webhook-address { align-items: stretch; flex-direction: column; }
}
