/* Shared geometry. Theme-dependent colors remain in themes/theme-base.css. */
:root {
    --aw-font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --aw-font-mono: "FiraCodeMono", monospace;
    --aw-font-size: 13px;
    --aw-radius-control: 8px;
    --aw-radius-panel: 14px;
    --aw-control-height: 38px;
}
html { scrollbar-gutter: stable; }
body { margin: 0; font: var(--aw-font-size)/1.5 var(--aw-font-ui); }
body div#index { min-height: 100vh; height: auto; }
body div#index-wrapper {
    box-sizing: border-box;
    width: 100%; max-width: 1600px; min-width: 0;
    margin: 0 auto; padding: 24px 20px 48px; top: 48px;
    font: inherit;
}
body div#footer-wrapper { display: none; }
body div#menu-wrapper, .aw-topbar, .aw-menu-drawer { font-family: var(--aw-font-ui); }
body:not(:has(.wrp-tui)) :is(input, select, textarea, button, .dt-container) { font-family: var(--aw-font-ui); }
body:not(:has(.wrp-tui)) :is(input, select, textarea) { border-radius: var(--aw-radius-control); font-size: 13px; box-sizing: border-box; max-width: 100%; }
body:not(:has(.wrp-tui)) :is(input, select):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]) { min-height: 34px; }
body:not(:has(.wrp-tui)) :is(button, .aw-btn, .aw-mini-btn, .dt-button) {
    border-radius: var(--aw-radius-control); font: 600 13px/1.3 var(--aw-font-ui);
    min-height: 34px; padding: 8px 12px; cursor: pointer;
}
body:not(:has(.wrp-tui)) .aw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
body :is(button, input, select, textarea, a, summary):focus-visible { outline: 2px solid var(--aw-input-focus); outline-offset: 3px; }
body :is(button, input, select, textarea):disabled { cursor: default; }
body :is(.aw-page, .aw-edit-page, .client-page, .contract-page, .financial-title-page, .faturamento-stats-page, .vendas-stats-page) { width: 100%; max-width: 1440px; min-width: 0; margin-inline: auto; box-sizing: border-box; }
body :is(.user-page, .billing-page, .people-list-page, .people-analysis-page, .agendor-page, .files-page, .commercial, .purchase-page) { padding: 0; font-family: var(--aw-font-ui); }
body :is(.purchases, .purchase-recommendation-page) { width: 100%; max-width: 1440px; padding: 0; margin-inline: auto; min-width: 0; }
body:not(:has(.wrp-tui)) h1 { font: 700 clamp(22px, 2.5vw, 28px)/1.2 var(--aw-font-ui); }
body :is(.aw-page-head, .user-page-head, .billing-head, .people-page-head, .commercial-head, .contract-titlebar, .inventory-head) { gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
body :is(.aw-page-head, .inventory-head) > div { min-width: 0; max-width: 100%; }
body .aw-actions { flex-wrap: wrap; }
body .inventory-count { overflow-wrap: anywhere; }
body :is(.aw-page-head, .contract-titlebar) { border-radius: var(--aw-radius-panel); }
body :is(.aw-page-head h1, .user-page h1, .billing-page h1, .people-list-page h1, .people-analysis-page h1, .commercial h1, .agendor-page h1, .inventory-head h1, .header-name, .header-title) {
    font-family: var(--aw-font-ui); font-size: clamp(22px, 2.5vw, 28px); line-height: 1.2; letter-spacing: -.02em; text-transform: none;
}
body :is(.header-name, .header-title, .header-subtitle) { border-radius: var(--aw-radius-control); padding: 14px 16px; box-sizing: border-box; overflow-wrap: anywhere; }
body :is(.aw-panel, .user-panel, .billing-panel, .purchase-panel, .purchase-head, .purchase-metric, .agendor-panel, .commercial-card, .contract-step, .aw-metric, .billing-total, .billing-metric, .product-stock-card) { border-radius: var(--aw-radius-panel); min-width: 0; }
body .aw-panel-head { border-radius: var(--aw-radius-panel) var(--aw-radius-panel) 0 0; padding: 14px 16px; gap: 12px; flex-wrap: wrap; }
body .aw-panel-head :is(h2, h3) { font: 650 16px/1.3 var(--aw-font-ui); text-transform: none; }
body :is(.aw-metric-value, .billing-metric strong, .billing-total > strong) { font-size: clamp(22px, 2.5vw, 28px); font-variant-numeric: tabular-nums; }
body :is(.aw-metric-label, .aw-metric-note, .financial-title-fields dt, .purchase-table td small, .purchase-series-item small) { font-size: 11px; line-height: 1.4; }
body :is(.aw-metric-grid, .aw-info-grid, .aw-chart-grid, .analysis-overview, .financial-title-grid, .billing-grid, .commercial-grid) > * { min-width: 0; }
body :is(.aw-info-value, .aw-page-head p) { overflow-wrap: anywhere; }
body table { font-family: var(--aw-font-ui); font-size: 12px; }
body table :is(td, th) { line-height: 1.45; }
body :is(table.awd, table.aw-data-table, table.inventory-table, table.product-price-table, table.purchase-table) :is(td, th) { font-size: 12px; }
body :is(table.awd, table.aw-data-table, table.inventory-table, table.product-price-table) th { font-weight: 650; letter-spacing: 0; text-transform: none; }
body :is(.dt-money, .dt-num, .num, .inventory-num, .purchase-number) { font-variant-numeric: tabular-nums; }
body :is(.people-curve, .people-recency, .finance-status, .billing-badge, .sales-doc-badge) { border-radius: 6px; }
body :is(dialog, .user-dialog, #billing-note-dialog) { border-radius: var(--aw-radius-panel); max-width: calc(100vw - 24px); }
body .inventory-page { max-width: 100%; margin-inline: auto; }
body .product-stock-card .product-stock-main strong { font-size: 28px; }
body .inventory-page :is(button, input, select) { border-radius: var(--aw-radius-control); }
body .inventory-table :is(input, button) { min-height: 28px; font-size: 12px; padding: 4px 8px; }
body .aw-panel > :is(table, .dt-container), body .aw-table-scroll { max-width: 100%; overflow-x: auto; }
body .aw-table-scroll { width: 100%; min-width: 0; }
body .aw-panel { max-width: 100%; }
body :is(.aw-page, .client-page, .product-stock-page) .aw-panel { overflow-x: auto; }
body :is(.aw-chart-box, .chart-view) { overflow: hidden; }
body .purchase-series-item small { line-height: 1.4 !important; font-size: 11px !important; }
body .purchase-table td > strong { font-size: 12px; }
body .aw-menu-link { border-radius: 8px; font-size: 13px; }
body .aw-menu-drawer[aria-hidden=true] { visibility: hidden; }
body .aw-menu-drawer[aria-hidden=false] { visibility: visible; }
body:has(.wrp-tui) div#index-wrapper { padding: 0; max-width: none; }
body:has(.wrp-tui) :is(.wrp-tui, .wrp-tui input, .wrp-tui textarea) { font-family: var(--aw-font-mono); }
body .runtime-report pre, body code { font-family: var(--aw-font-mono); }
.aw-notification-center { position: relative; height: auto; min-width: 0; }
.aw-notification-center > summary { display: flex; align-items: center; gap: 10px; padding: 6px 10px; cursor: pointer; list-style: none; }
.aw-notification-center > summary::-webkit-details-marker { display: none; }
.aw-notification-popover { position: absolute; left: 0; top: calc(100% + 8px); width: min(390px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; padding: 16px; border: 1px solid var(--aw-line); border-radius: var(--aw-radius-panel); background: var(--aw-surface); color: var(--aw-text); box-shadow: var(--aw-shadow); }
.aw-notification-popover [data-alert-results] { display: grid; gap: 12px; margin-bottom: 12px; font-size: 13px; }
body .aw-notification-count[hidden] { display: none; }
@media (max-width: 760px) {
    body div#index-wrapper { padding: 18px 12px 32px; }
    body :is(.aw-page-head, .user-page-head, .billing-head, .commercial-head) { align-items: flex-start; flex-direction: column; }
    body :is(.aw-metric-grid, .aw-info-grid, .aw-chart-grid, .financial-title-grid, .analysis-overview) { grid-template-columns: minmax(0, 1fr); }
    body .aw-info-wide { grid-column: auto; }
    body .aw-panel-head { padding: 12px; }
    body .inventory-toolbar { grid-template-columns: minmax(0, 1fr); }
    body .inventory-head-actions { flex-wrap: wrap; }
    body .finance-head-actions { flex-wrap: wrap; justify-content: flex-start; }
    body :is(.header-name, .header-title, .header-subtitle) { max-width: 100%; margin-inline: 0; }
    body:not(:has(.wrp-tui)) :is(.aw-btn, button) { min-height: 38px; }
}
