/* Identidade visual Bambuí — paleta e tipografia do Guia Técnico da marca. */
@font-face { font-family: 'Montserrat'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/montserrat-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/montserrat-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/montserrat-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/lato-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/lato-latin-700-normal.woff2') format('woff2'); }

:root {
  /* Paleta primária */
  --bg: #F3F2ED;
  --ink: #333333;
  /* Paleta secundária */
  --moss: #313826;
  --sage: #808B7A;
  --water: #B4E1DB;
  --sand: #E3D6C3;
  --olive: #786A47;
  --terra: #784431;
  /* Derivados para interface */
  --surface: #FBFAF7;
  --field: #FFFFFF;
  --muted: #6B6962;
  --placeholder: #8C897F;
  --line: #E0DDD3;
  --line-soft: #EBE8E0;
  --moss-soft: #434C38;
  --moss-hover: #262C1D;
  --hover: #EFEDE5;
  --chip: #ECEAE2;
  /* Status (subtonalidades) */
  --review-bg: #EEE5D4; --review-fg: #6B5B35;
  --failed-bg: #F0E0D8; --failed-fg: #784431;
  --progress-bg: #DDF0EC; --progress-fg: #2E5E57; --progress-dot: #5FA79C;
  --processed-bg: #E3E7DE; --processed-fg: #4A5544;

  --font-head: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Lato', 'Helvetica Neue', Arial, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--moss); text-underline-offset: 3px; }
a:hover { color: var(--terra); }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0; }
code { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 13px; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; }
[hidden] { display: none !important; }

.icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 20px; height: 20px; }
.logo { display: block; fill: currentColor; }

.eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-family: var(--font-head); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0; }
.eyebrow .sep { opacity: 0.6; }
.muted { color: var(--muted); }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: var(--radius); border: 1px solid transparent; font-family: var(--font-head); font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none; transition: background-color 0.15s, border-color 0.15s; }
.btn-primary { background: var(--moss); border-color: var(--moss); color: var(--bg); }
.btn-primary:hover { background: var(--moss-hover); border-color: var(--moss-hover); color: var(--bg); }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { background: var(--hover); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--hover); color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-lg { height: 46px; font-size: 14px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--field); color: var(--ink); }
.icon-btn:hover { background: var(--hover); }
.icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.icon-btn.bare { border-color: transparent; background: transparent; color: var(--muted); }
.link-action { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; font-family: var(--font-head); font-size: 13px; font-weight: 600; color: var(--moss); }
.link-action:hover { color: var(--terra); }

/* Campos */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-family: var(--font-head); font-size: 12px; font-weight: 600; color: var(--ink); }
.field-hint { font-size: 12.5px; color: var(--muted); }
.input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); font-size: 14px; color: var(--ink); }
.input::placeholder { color: var(--placeholder); }
.input:focus { outline: 2px solid var(--sage); outline-offset: 0; border-color: var(--sage); }
.input.sm { width: 64px; height: 38px; }
.input.md { width: 96px; height: 38px; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .icon { position: absolute; left: 14px; color: var(--placeholder); pointer-events: none; }
.input-wrap .input { padding-left: 40px; }
.input-wrap.trailing .icon { left: auto; right: 12px; }
.input-wrap.trailing .input { padding-left: 12px; padding-right: 38px; }
textarea.input { height: auto; padding: 12px; font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12.5px; line-height: 1.5; resize: vertical; }
.form-message { min-height: 1.2em; font-size: 13px; color: var(--muted); }
.form-message.error { color: var(--terra); }
.form-message.success { color: var(--processed-fg); }

/* Status */
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 9px; border-radius: 999px; font-family: var(--font-head); font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.badge.review { background: var(--review-bg); color: var(--review-fg); }
.badge.review::before { background: var(--olive); }
.badge.failed { background: var(--failed-bg); color: var(--failed-fg); }
.badge.progress { background: var(--progress-bg); color: var(--progress-fg); }
.badge.progress::before { background: var(--progress-dot); }
.badge.processed { background: var(--processed-bg); color: var(--processed-fg); }
.badge.processed::before { background: var(--sage); }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 6px; background: var(--chip); font-family: var(--font-head); font-size: 12px; font-weight: 600; color: var(--ink); }

/* Login */
.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px; }
.login { width: min(100%, 380px); display: flex; flex-direction: column; gap: 40px; }
.login-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; color: var(--ink); }
.login-brand .logo { width: 168px; height: 42px; }
.login-intro { display: flex; flex-direction: column; gap: 10px; }
.login-intro h1 { font-size: 24px; letter-spacing: -0.01em; }
.login-intro p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.login form { display: flex; flex-direction: column; gap: 16px; }
.login-footer { margin-top: 48px; font-size: 12.5px; color: var(--muted); }

/* Estrutura do painel */
.app { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; width: 248px; flex-shrink: 0; background: var(--moss); display: flex; flex-direction: column; padding: 32px 20px 24px; }
.sidebar-brand { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 36px; color: var(--water); }
.sidebar-brand .logo { width: 112px; height: 28px; }
.sidebar-brand span { font-family: var(--font-head); font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sand); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 12px; border: 0; border-radius: var(--radius); background: transparent; color: #D6D3C8; font-family: var(--font-head); font-size: 13.5px; font-weight: 500; text-align: left; }
.nav-item .icon { color: #A9AE9F; }
.nav-item:hover { background: rgba(243, 242, 237, 0.06); color: var(--bg); }
.nav-item.active { background: var(--moss-soft); color: var(--bg); font-weight: 600; }
.nav-item.active .icon { color: var(--water); }
.nav-item .label { flex-grow: 1; }
.nav-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--water); color: var(--moss); font-size: 11.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.sidebar .logout { margin-top: auto; }

.content { flex-grow: 1; min-width: 0; padding: 40px 48px; display: flex; flex-direction: column; gap: 28px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-title { display: flex; flex-direction: column; gap: 10px; }
.page-title h1 { font-size: 26px; letter-spacing: -0.01em; }
.page-actions { display: flex; align-items: center; gap: 12px; }
.view { display: flex; flex-direction: column; gap: 28px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 24px 16px; }
.panel-head > div { display: flex; flex-direction: column; gap: 4px; }
.panel-head h2 { font-size: 15px; }
.panel-head p { margin: 0; font-size: 13px; color: var(--muted); text-wrap: pretty; }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 24px; font-size: 13px; color: var(--muted); }

/* Visão geral */
.summary { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 16px; }
.summary-card { grid-column: span 3; display: flex; flex-direction: column; gap: 18px; padding: 24px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
button.summary-card:hover { border-color: #CFCBBF; background: #FDFCFA; }
.summary-card.minor { grid-column: span 2; }
.summary-label { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 13px; font-weight: 600; color: var(--muted); }
.summary-icon { width: 32px; height: 32px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; }
.summary-card.review .summary-label { color: var(--review-fg); }
.summary-card.review .summary-icon { background: var(--review-bg); }
.summary-card.failed .summary-label { color: var(--failed-fg); }
.summary-card.failed .summary-icon { background: var(--failed-bg); }
.summary-card.progress .summary-label .icon { color: var(--progress-dot); }
.summary-card.processed .summary-label .icon { color: var(--sage); }
.summary-value { display: flex; flex-direction: column; gap: 8px; }
.summary-value strong { font-family: var(--font-head); font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.summary-card.minor .summary-value strong { font-size: 30px; }
.summary-value span { font-size: 14px; color: var(--muted); text-wrap: pretty; }
.summary-card.minor .summary-value span { font-size: 13px; }
.summary-cta { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-size: 13px; font-weight: 600; color: var(--moss); }

/* Tabela de leads */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 860px; }
.table th { text-align: left; padding: 0 16px; height: 44px; font-family: var(--font-head); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 16px; height: 60px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 20px; width: 40px; }
.table.clickable tbody tr { cursor: pointer; }
.table.clickable tbody tr:hover, .table tbody tr.selected { background: var(--hover); }
.lead-name { display: flex; flex-direction: column; gap: 3px; }
.lead-name strong { font-family: var(--font-head); font-size: 13.5px; font-weight: 600; }
.lead-name .unnamed { color: var(--muted); font-weight: 500; }
.lead-name small { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.lead-name strong { white-space: nowrap; }
.cell-note { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-note.quiet { color: var(--muted); }
.cell-date { color: var(--muted); white-space: nowrap; }
.row-chevron { color: #9A978E; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tabs { display: flex; align-items: center; gap: 4px; padding: 4px; background: #E9E7DF; border-radius: 10px; overflow-x: auto; max-width: 100%; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; font-family: var(--font-head); font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(51, 51, 51, 0.08); }
.tab .count { font-weight: 500; color: var(--muted); }
.search { width: min(100%, 380px); }
.search .input { height: 44px; border-radius: 10px; }
.pager { display: flex; align-items: center; gap: 8px; }
.pager span { font-family: var(--font-head); font-size: 12.5px; font-weight: 600; color: var(--ink); padding: 0 6px; }

/* Detalhe do lead (painel lateral) */
.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; width: min(540px, 100vw); max-width: 100vw; height: 100vh; max-height: 100vh; border: 0; background: var(--surface); color: var(--ink); box-shadow: -24px 0 60px rgba(49, 56, 38, 0.18); }
.drawer::backdrop { background: rgba(49, 56, 38, 0.32); }
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in 0.2s ease-out; }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 32px 18px; border-bottom: 1px solid var(--line); }
.drawer-head > div { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.drawer-title { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.drawer-title h2 { font-size: 22px; letter-spacing: -0.01em; }
.drawer-body { flex-grow: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; padding: 20px 32px 28px; }
.notice { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; border-radius: 10px; border: 1px solid; }
.notice-main { display: flex; gap: 12px; }
.notice-main > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.notice strong { font-family: var(--font-head); font-size: 14px; font-weight: 600; }
.notice p { margin: 0; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; text-wrap: pretty; }
.notice .form-message:empty { display: none; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-left: 32px; }
.notice.review { background: #F1EADD; border-color: var(--sand); color: #5A4C2B; }
.notice.failed { background: #F5E8E2; border-color: #E8CFC4; color: #653826; }
.notice.progress { background: #E8F5F2; border-color: #C9E7E1; color: var(--progress-fg); }
.notice.processed { background: #EDF0E9; border-color: #D8DDD2; color: var(--processed-fg); }
.section { display: flex; flex-direction: column; gap: 6px; }
.section h3 { margin-bottom: 4px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.section dl { margin: 0; }
.info-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.info-row dt { font-size: 13.5px; color: var(--muted); }
.info-row dd { grid-column: span 2; margin: 0; overflow-wrap: anywhere; }
.timeline { display: flex; flex-direction: column; padding-top: 6px; margin: 0; list-style: none; padding-left: 0; }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 0 0 12px 26px; }
.timeline li::before { content: ''; position: absolute; left: 1px; top: 5px; width: 10px; height: 10px; border-radius: 999px; background: var(--sage); }
.timeline li::after { content: ''; position: absolute; left: 5.5px; top: 19px; bottom: 2px; width: 1px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li.review::before { background: var(--olive); }
.timeline li.failed::before { background: var(--terra); }
.timeline li.progress::before { background: var(--progress-dot); }
.timeline small { font-size: 12.5px; color: var(--muted); }
.technical { border-top: 1px solid var(--line); }
.technical summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 32px; font-family: var(--font-head); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.technical summary::-webkit-details-marker { display: none; }
.technical summary span { display: flex; align-items: center; gap: 10px; }
.technical summary .icon { color: var(--muted); }
.technical[open] summary .chevron { transform: rotate(180deg); }
.technical-body { max-height: 40vh; overflow-y: auto; padding: 0 32px 24px; display: flex; flex-direction: column; gap: 12px; }
.technical-body h4 { margin: 0; font-family: var(--font-head); font-size: 12px; font-weight: 600; color: var(--muted); }
.technical-body pre { margin: 0; padding: 12px; border-radius: var(--radius); background: #F0EEE7; border: 1px solid var(--line-soft); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Configuração */
.subtabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.subtab { padding: 0 2px 14px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; font-family: var(--font-head); font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.subtab:hover { color: var(--ink); }
.subtab.active { border-bottom-color: var(--moss); color: var(--ink); }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { flex-grow: 1; min-width: 0; background: #F7F6F2; color: var(--muted); font-size: 13px; }
.connect-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 2px; }
.connect-row .form-message { flex-basis: 100%; margin: 0; font-size: 13.5px; }
.manual-token { border-top: 1px solid var(--line-soft); padding-top: 14px; }
.manual-token summary { cursor: pointer; font-family: var(--font-head); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.manual-token summary:hover { color: var(--ink); }
.manual-token[open] summary { margin-bottom: 14px; }
.integrations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 28px 20px; border-bottom: 1px solid var(--line-soft); }
.card-head > div { display: flex; flex-direction: column; gap: 6px; }
.card-head h2 { font-size: 16px; }
.card-head p { margin: 0; font-size: 13.5px; color: var(--muted); text-wrap: pretty; }
.card-body { display: flex; flex-direction: column; gap: 18px; padding: 24px 28px 28px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.form-actions.split { justify-content: space-between; }
.form-actions .group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.rules-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 24px 28px 18px; }
.rules-head > div:first-child { display: flex; flex-direction: column; gap: 6px; }
.rules-head h2 { font-size: 16px; }
.rules-head p { margin: 0; font-size: 13.5px; color: var(--muted); text-wrap: pretty; }
.rules-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.rules-table th { text-align: left; padding: 0 16px; height: 44px; font-family: var(--font-head); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.rules-table td { padding: 10px 16px; height: 60px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.rules-table th:first-child, .rules-table td:first-child { padding-left: 28px; }
.rules-table th:last-child, .rules-table td:last-child { padding-right: 24px; }
.rules-table .input { height: 38px; }
.inline-sentence { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.inline-field { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); }
.rules-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 28px 22px; font-size: 13px; color: var(--muted); }
.rules-foot strong { color: var(--ink); }
.rules-head.sub { padding-top: 12px; border-top: 1px solid var(--line-soft); }
.rules-head h3 { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.toggle { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: 13.5px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .track { position: relative; width: 36px; height: 20px; border-radius: 999px; background: #D5D2C8; flex-shrink: 0; transition: background-color 0.15s; }
.toggle .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 999px; background: var(--field); transition: transform 0.15s; }
.toggle input:checked + .track { background: var(--moss); }
.toggle input:checked + .track::after { transform: translateX(16px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--sage); outline-offset: 2px; }
.sources { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0 28px 26px; }
.source { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 46px; padding: 0 6px 0 14px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--field); min-width: 0; }
.source .name { flex-grow: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source .input { height: 30px; padding: 0 8px; }
.source .code { width: 48px; text-align: center; font-family: var(--font-head); font-size: 12px; font-weight: 600; background: var(--chip); border-color: transparent; }
.source .label-input { flex-grow: 1; min-width: 0; }
.remove { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: #9A978E; flex-shrink: 0; }
.remove:hover { background: var(--hover); color: var(--terra); }
.key { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--chip); }

@media (max-width: 1100px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card, .summary-card.minor { grid-column: span 1; }
  .sources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar { position: static; height: auto; width: 100%; flex-direction: row; align-items: center; gap: 12px; padding: 12px 16px; }
  .sidebar-brand { padding: 0; margin-right: auto; }
  .sidebar-brand span { display: none; }
  .sidebar-brand .logo { width: 92px; height: 23px; }
  .nav { flex-direction: row; }
  .nav-item { width: auto; height: 40px; }
  .nav-item .label { display: none; }
  .sidebar .logout { margin-top: 0; width: auto; }
  .sidebar .logout .label { display: none; }
  .content { padding: 24px 16px; gap: 22px; }
  .integrations { grid-template-columns: minmax(0, 1fr); }
  .search { width: 100%; }
}
@media (max-width: 520px) {
  .summary { grid-template-columns: minmax(0, 1fr); }
  .sources { grid-template-columns: minmax(0, 1fr); }
  .page-title h1 { font-size: 22px; }
  .drawer-head, .drawer-body { padding-left: 20px; padding-right: 20px; }
  .technical summary, .technical-body { padding-left: 20px; padding-right: 20px; }
  .notice-actions { padding-left: 0; }
}
