/* Estrutura do console. Provisória até a chegada dos conceitos visuais definitivos. */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--ippi-night); color: var(--ippi-white); padding: var(--space-4); border-right: 4px solid var(--ippi-yellow); }
.side .brand { font-weight: 600; font-size: 17px; margin-bottom: 2px; }
.side .tenant { font-size: 12px; color: var(--ippi-silver); margin-bottom: var(--space-5); }
.side nav a { display: block; padding: 8px 10px; margin: 2px 0; border-radius: 6px; color: var(--ippi-silver); text-decoration: none; }
.side nav a.active, .side nav a:hover { background: var(--ippi-steel); color: var(--ippi-white); }
.side .who { margin-top: var(--space-5); font-size: 13px; color: var(--ippi-silver); }
.side .who button { margin-top: var(--space-2); color: var(--ippi-white); border-color: var(--ippi-silver); background: none; }
.main { padding: var(--space-5) var(--space-6); max-width: 1180px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-4); flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: var(--space-4); flex-wrap: wrap; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--ink-soft); border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a.active { color: var(--ippi-night); border-bottom-color: var(--ippi-yellow); }
.login { max-width: 380px; margin: 12vh auto; }
.login .card { border-top: 4px solid var(--ippi-yellow); }
.stat { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.builder { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.q-list { list-style: none; margin: 0; padding: 0; }
.q-list li { display: flex; gap: var(--space-2); align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; background: var(--surface); cursor: pointer; }
.q-list li.active { border-color: var(--ippi-night); box-shadow: inset 4px 0 0 var(--ippi-yellow); }
.q-list .q-main { flex: 1; min-width: 0; background: none; border: 0; color: inherit; text-align: left; padding: 4px; cursor: pointer; }
.q-list .q-main span { display: block; }
.q-list .q-main .mono { display: inline; }
.q-list .q-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forms-inspector > h2, .forms-list-title { margin: 0 0 12px; }
.form-structured { margin: 14px 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-inline-size: 0; }
.form-structured legend { font-weight: 700; }
.form-rows { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 7px; }
.form-row { padding: 9px; border: 1px solid var(--line); border-radius: 6px; }
.form-row-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: 8px; }
.form-row-fields label { margin: 0; }
.form-row-fields .form-check { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 5px; }
.form-check input { width: auto; margin: 0; }
.form-order { display: flex; align-items: center; gap: 3px; }
.form-grip { color: var(--muted); cursor: grab; padding: 5px; font-weight: 700; }
.forms-inspector .grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.forms-inspector .forms-checkline { align-self: center; }
.forms-checkline input { margin-inline: 0 6px; }
.forms-application { padding: 10px 12px; background: var(--warn-soft); border-radius: 6px; border-left: 3px solid var(--ippi-yellow); }
.forms-application .field { margin-bottom: 6px; }
.forms-application p { margin: 0; }
.forms-details { margin-block: 12px; }
.forms-details > summary { cursor: pointer; font-weight: 600; color: var(--ippi-steel); }
.forms-details[open] > summary { margin-bottom: 10px; }
.forms-quotas { max-width: 52rem; }
.quota-fields { gap: 8px 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.quota-fields > [hidden] { display: none; }
.quota-criterion { margin: 5px 0 10px; overflow-wrap: anywhere; }
.quota-guide { padding: 10px 12px; background: var(--canvas); border-radius: 6px; }
.quota-guide [hidden] { display: none; }
.quota-rule-list { display: grid; gap: 10px; margin-bottom: 12px; }
.quota-rule { margin: 0; padding: 8px 10px; min-inline-size: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.quota-rule legend { padding-inline: 4px; font-weight: 600; }
.quota-rule .field { margin-bottom: 8px; }
.quota-feedback { margin: 6px 0 0; }
.quota-feedback:empty { display: none; }
.forms-preview { max-width: 42rem; }
.forms-preview-modes { margin-bottom: 12px; }
.forms-preview-modes [aria-pressed=true] { background: var(--ippi-night); color: var(--ippi-white); }
.preview { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); background: var(--surface); }
.preview h3 { font-size: 20px; margin: 8px 0 12px; }
.preview .opt, .quota-test .opt { display: flex; min-height: 44px; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; margin: 6px 0; cursor: pointer; overflow-wrap: anywhere; }
.preview .opt:has(input:checked), .quota-test .opt:has(input:checked) { border-color: var(--ippi-night); background: var(--warn-soft); }
.forms-preview-actions { margin-top: 14px; }
.forms-preview-actions .btn { min-height: 44px; }
.forms-preview-answers { white-space: pre-wrap; overflow-wrap: anywhere; }
.scale-row { display: flex; gap: 4px; flex-wrap: wrap; }
.scale-row button { min-width: 36px; }
.scale-row button[aria-pressed=true] { background: var(--ippi-night); color: var(--ippi-white); }
.timeline { max-height: 320px; overflow: auto; font-size: 13px; }
.map { width: 100%; height: 260px; background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px var(--space-4); margin: 0; }
dl.kv dt { color: var(--ink-soft); } dl.kv dd { margin: 0; }
@media (max-width: 860px) { .shell { grid-template-columns: 1fr; } .side { border-right: 0; border-bottom: 4px solid var(--ippi-yellow); } .main { padding: var(--space-4); } .builder { grid-template-columns: 1fr; } }

.q-list li[draggable=true] { cursor: grab; }
.q-list li.dragging { opacity: .45; }

@media (max-width: 860px) { .shell { min-height: 0; } .side { padding-bottom: var(--space-3); } }
.q-list li.drop-target, .form-row.drop-target { border-color: var(--ippi-night); box-shadow: inset 0 3px 0 var(--ippi-yellow); }
.forms-dialog { width: min(28rem, calc(100% - 2rem)); }
.forms-dialog::backdrop { background: rgb(15 23 42 / 56%); }
.forms-dialog .row { justify-content: flex-end; }
.quota-test { width: min(36rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; }
.quota-test .row.between { justify-content: space-between; }
.quota-test .quota-test-actions { justify-content: flex-start; }
.quota-test .btn { min-height: 44px; }
.quota-test .quota-rule { margin-bottom: 10px; }
.quota-test legend, .quota-test-result { overflow-wrap: anywhere; }
.quota-test-result:not(:empty) { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); scroll-margin-bottom: 12px; }
.quota-test-list { list-style: none; padding: 0; margin: 0; }
.quota-test-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.quota-test-list li span { font-size: .875rem; color: var(--ink-soft); }
.quota-test-list li.matched { background: var(--warn-soft); }

.audit-filters { grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr)); margin-block: 8px; }
.audit-only { display: flex; align-items: center; gap: 8px; min-height: 2.75rem; align-self: end; }
.audit-only input { width: auto; margin: 0; }
.audit-figure { margin: 8px 0 0; }
.audit-map { display: block; width: 100%; max-height: 22rem; background: #eaf2f8; border: 1px solid var(--line); border-radius: 8px; }
.audit-boundary { fill: #f8fafc; stroke: #869bae; stroke-width: .75; }
.audit-point { fill: #805c00; stroke: #fff; stroke-width: .8; }
.audit-point.outside { fill: #aa3327; }
.audit-legend { color: #86261e; }
.audit-metric { min-width: 0; }
.audit-metrics { grid-template-columns: minmax(0, 1fr); }
.audit-metric table.data th { white-space: normal; }
.audit-metric table.data th[scope=row] { text-transform: none; letter-spacing: normal; overflow-wrap: anywhere; }
.audit-metric h3 { margin-bottom: 6px; }
.audit-pagination { margin-top: 10px; }
.social-heading { background: var(--ippi-night); color: var(--ippi-white); border-radius: var(--radius); border-bottom: 4px solid var(--ippi-yellow); padding: var(--space-4); margin-bottom: var(--space-4); }
.social-heading a { color: var(--ippi-yellow); }
.social-heading p { margin: 6px 0 0; }
.social-panel { margin-bottom: var(--space-4); }
.social-panel h2, .social-panel summary { margin-bottom: 10px; }
.social-panel summary { cursor: pointer; font-weight: 600; }
.social-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 8px 16px; }
.social-stats > div { background: var(--canvas); border-radius: var(--radius); padding: 12px; }
.social-stats p { margin: 6px 0 0; }
.social-link input { width: 100%; }
.social-link img { display: block; margin: 10px 0 4px; }
