:root {
  --brand: #94167a;
  --brand-dark: #4b075d;
  --brand-bright: #e91e8f;
  --brand-soft: #fae8f4;
  --ink: #201b21;
  --muted: #716973;
  --faint: #9e969f;
  --line: #e8e2e7;
  --surface: #fff;
  --surface-2: #f8f6f8;
  --background: #f3f1f3;
  --danger: #c0354a;
  --danger-soft: #fdecef;
  --success: #23835b;
  --shadow: 0 16px 45px rgba(61, 22, 55, .11);
  --shadow-sm: 0 6px 20px rgba(61, 22, 55, .07);
  --sidebar: 250px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { width: 100%; min-height: 100%; overflow-x: hidden; overscroll-behavior-x: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { width: 100%; min-width: 0; max-width: 100%; min-height: 100vh; margin: 0; overflow-x: hidden; overscroll-behavior-x: none; background: var(--background); }
html.modal-open, html.modal-open body { overflow: hidden !important; overscroll-behavior: none; }
img, svg { max-width: 100%; }
img { image-orientation: from-image; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select, label { touch-action: manipulation; }
button { color: inherit; -webkit-tap-highlight-color: transparent; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; z-index: 1000; top: 10px; left: 10px; transform: translateY(-150%); padding: 9px 12px; border-radius: 8px; background: var(--ink); color: #fff; }
.skip-link:focus { transform: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.eyebrow { display: block; margin-bottom: 8px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.light { color: #ffb6df; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 750; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: default; opacity: .5; transform: none; box-shadow: none; }
.button.primary { background: linear-gradient(135deg, var(--brand), #a91b82); color: #fff; box-shadow: 0 8px 20px rgba(148, 22, 122, .22); }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button.danger { background: var(--danger); color: #fff; }
.button.small { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.button svg { width: 17px; height: 17px; }
.icon-button { display: inline-grid; width: 40px; height: 40px; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.close-button span { display: block; font-family: Arial, sans-serif; font-size: 29px; font-weight: 300; line-height: 1; transform: translateY(-1px); }

/* Login */
.login-screen { position: fixed; z-index: 100; inset: 0; display: grid; grid-template-columns: minmax(460px, 1.1fr) minmax(420px, .9fr); min-height: 100vh; background: #fff; }
.login-brand-panel { position: relative; display: grid; place-items: center; overflow: hidden; padding: 8vw; background: radial-gradient(circle at 15% 10%, #b82c8e, #671062 47%, #33043f 100%); color: #fff; }
.login-brand-panel::before { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 48px 48px; content: ""; mask-image: linear-gradient(135deg, #000, transparent 75%); }
.login-brand-panel::after { position: absolute; width: 550px; height: 550px; top: -260px; right: -210px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; content: ""; box-shadow: inset 0 0 90px rgba(233, 30, 143, .22); }
.login-brand-content { position: relative; z-index: 1; max-width: 670px; }
.login-brand-content > img { width: min(430px, 78%); margin-bottom: 55px; padding: 14px 22px; border-radius: 17px; background: #fff; box-shadow: 0 22px 48px rgba(0,0,0,.2); }
.login-brand-content h1 { max-width: 650px; margin: 0; font-size: clamp(40px, 4.3vw, 66px); letter-spacing: -.055em; line-height: 1.02; }
.login-brand-content p { max-width: 560px; margin: 22px 0 0; color: rgba(255,255,255,.73); font-size: 16px; line-height: 1.7; }
.login-form-panel { display: grid; place-items: center; padding: 50px; }
.login-card { width: min(410px, 100%); }
.login-mobile-logo { display: none; }
.login-card h2 { margin: 0; font-size: 32px; letter-spacing: -.04em; }
.login-card > p { margin: 10px 0 28px; color: var(--muted); font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 15px; }
.field > span:first-child { color: var(--muted); font-size: 12px; font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; min-height: 45px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: var(--surface-2); color: var(--ink); font-size: 14px; }
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(148, 22, 122, .1); }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 50px; }
.password-wrap button { position: absolute; top: 3px; right: 3px; display: grid; width: 39px; height: 39px; place-items: center; border: 0; background: transparent; color: var(--faint); cursor: pointer; }
.password-wrap svg { width: 18px; }
.form-error { margin: 0 0 13px !important; padding: 10px 12px; border-radius: 9px; background: var(--danger-soft); color: var(--danger) !important; font-size: 12px !important; }
.login-button { width: 100%; justify-content: space-between; margin-top: 4px; }
.login-security { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11px; }
.login-security svg { width: 15px; color: var(--brand); }
.pwa-install-login { width: 100%; margin-top: 12px; }

/* Estrutura */
.app-shell { width: 100%; min-width: 0; max-width: 100%; min-height: 100vh; overflow-x: hidden; }
.sidebar { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; display: flex; width: var(--sidebar); flex-direction: column; padding: 14px; background: linear-gradient(180deg, #30043d, #21022b); color: #fff; }
.sidebar-brand { display: grid; min-height: 65px; place-items: center; margin-bottom: 18px; border-radius: 13px; background: #fff; }
.sidebar-brand img { width: 190px; max-width: 82%; }
.main-nav { display: flex; flex: 1; flex-direction: column; gap: 6px; }
.main-nav button { display: flex; min-height: 46px; align-items: center; gap: 12px; padding: 10px 13px; border: 0; border-radius: 10px; background: transparent; color: rgba(255,255,255,.68); cursor: pointer; font-size: 14px; text-align: left; }
.main-nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.main-nav button.active { background: #fff; color: var(--brand-dark); font-weight: 800; }
.main-nav svg { width: 19px; }
.sidebar-user { display: grid; grid-template-columns: 38px 1fr 34px; align-items: center; gap: 9px; padding: 12px 7px 3px; border-top: 1px solid rgba(255,255,255,.09); }
.avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: #f6cae5; color: var(--brand-dark); font-size: 11px; font-weight: 850; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { font-size: 11px; }
.sidebar-user small { margin-top: 3px; color: rgba(255,255,255,.5); font-size: 9px; }
.sidebar-user .icon-button { width: 34px; height: 34px; border: 0; background: rgba(255,255,255,.06); color: rgba(255,255,255,.7); }
.workspace { min-width: 0; max-width: 100%; min-height: 100vh; margin-left: var(--sidebar); overflow-x: hidden; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; height: 70px; align-items: center; gap: 12px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); backdrop-filter: blur(14px); }
.topbar > div { display: flex; flex-direction: column; }
.topbar-kicker { color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.topbar strong { margin-top: 2px; font-size: 15px; }
.database-badge { margin-left: auto; padding: 6px 9px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.database-badge::before { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--success); content: ""; }
.pwa-install-topbar { min-height: 34px; margin-left: auto; padding: 6px 10px; font-size: 11px; }
.pwa-install-topbar:not([hidden]) + .database-badge { margin-left: 0; }
#main-content { max-width: 1450px; margin: 0 auto; padding: 34px 30px 70px; outline: 0; }
.mobile-only, .mobile-nav { display: none; }

/* Páginas */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-header h1 { margin: 0; font-size: clamp(28px, 3vw, 38px); letter-spacing: -.05em; }
.page-header p { max-width: 680px; margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.page-actions { display: flex; gap: 8px; }
.action-count { display: inline-grid; min-width: 20px; height: 20px; place-items: center; padding: 0 5px; border-radius: 7px; background: var(--brand-soft); color: var(--brand); font-size: 9px; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.metric-card { position: relative; min-height: 108px; padding: 13px 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.metric-card::after { position: absolute; right: -30px; bottom: -42px; width: 120px; height: 120px; border-radius: 50%; background: var(--brand-soft); content: ""; opacity: .65; }
.metric-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.metric-icon svg { width: 17px; }
.metric-card > .metric-icon { margin-top: 0; }
.metric-card span { display: block; margin-top: 9px; color: var(--muted); font-size: 10px; }
.metric-card strong { position: relative; z-index: 1; display: block; margin-top: 3px; font-size: 20px; letter-spacing: -.04em; }
.metric-card small { font-size: 9px; }
.welcome-panel { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; margin-bottom: 16px; padding: 20px 22px; overflow: hidden; border-radius: 15px; background: linear-gradient(135deg, #5b0a64, #94167a); color: #fff; box-shadow: var(--shadow); }
.welcome-panel::after { position: absolute; width: 300px; height: 300px; top: -160px; right: -80px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; content: ""; }
.welcome-panel h2 { margin: 0; font-size: 20px; letter-spacing: -.04em; }
.welcome-panel p { max-width: 680px; margin: 6px 0 0; color: rgba(255,255,255,.7); font-size: 12px; line-height: 1.5; }
.welcome-panel .button { position: relative; z-index: 1; background: #fff; color: var(--brand-dark); }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.quick-card { display: flex; min-height: 120px; flex-direction: column; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; box-shadow: var(--shadow-sm); transition: transform .16s ease, border-color .16s ease; }
.quick-card:hover { transform: translateY(-2px); border-color: rgba(148,22,122,.35); }
.quick-card .metric-icon { margin-bottom: 10px; }
.quick-card h3 { margin: 0; font-size: 14px; }
.quick-card p { margin: 5px 0 9px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.quick-card b { margin-top: auto; color: var(--brand); font-size: 11px; }

.system-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.system-filters button { display: inline-flex; min-height: 32px; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--muted); cursor: pointer; font: inherit; font-size: 10px; font-weight: 750; }
.system-filters button b { display: inline-grid; min-width: 19px; height: 18px; place-items: center; padding: 0 4px; border-radius: 6px; background: var(--surface-2); color: var(--faint); font-size: 8px; }
.system-filters button.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.system-filters button.active b { background: rgba(255,255,255,.18); color: #fff; }
.expense-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.expense-overview .metric-card { min-height: 95px; }
.expense-filter-bar { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.expense-filter-bar .system-filters { min-width: 0; flex: 1; margin-bottom: 0; }
.expense-city-filter { display: flex; flex: 0 0 190px; flex-direction: column; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 800; }
.expense-city-filter > span { display: flex; align-items: center; gap: 4px; }
.expense-city-filter svg { width: 12px; height: 12px; color: var(--brand); }
.expense-city-filter select { width: 100%; min-height: 32px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: var(--surface); color: var(--ink); font-size: 10px; }

/* Clientes por cidade */
.customer-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.customer-overview .metric-card { min-height: 95px; }
.customer-city-list { display: grid; min-width: 0; gap: 7px; }
.customer-city-row { display: grid; min-width: 0; grid-template-columns: 34px minmax(170px, 1fr) minmax(165px, .72fr) minmax(120px, .5fr) 75px; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.customer-city-rank { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 850; }
.customer-city-name { display: flex; min-width: 0; align-items: center; gap: 9px; }
.customer-city-name > span { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--surface-2); color: var(--brand); }
.customer-city-name svg { width: 16px; height: 16px; }
.customer-city-name div { min-width: 0; }
.customer-city-name h3 { margin: 0; overflow: hidden; font-size: 13px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.customer-city-name small, .customer-city-value small, .customer-city-ticket small { display: block; color: var(--faint); font-size: 9px; }
.customer-city-name small { margin-top: 3px; }
.customer-city-value, .customer-city-ticket { min-width: 0; }
.customer-city-value strong, .customer-city-ticket strong { display: block; margin-top: 2px; color: var(--brand-dark); font-size: 14px; letter-spacing: -.02em; white-space: nowrap; }
.customer-city-ticket strong { color: var(--ink); }
.customer-revenue-bar { display: block; height: 3px; margin-top: 5px; overflow: hidden; border-radius: 9px; background: var(--brand-soft); }
.customer-revenue-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-bright)); }
.customer-city-actions { display: flex; justify-content: flex-end; gap: 5px; }
.customer-form-note { margin: 0; padding: 10px 12px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-dark); font-size: 10px; line-height: 1.45; }
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; }
.entity-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.entity-photo { position: relative; display: grid; height: 80px; place-items: center; overflow: hidden; background: linear-gradient(135deg, #f6edf4, #eee7ed); color: var(--brand); }
.photo-open { width: 100%; padding: 0; border: 0; color: inherit; cursor: zoom-in; font: inherit; text-align: inherit; }
.photo-loading-shell::after { position: absolute; z-index: 1; inset: 0; background: linear-gradient(105deg, #eee7ed 20%, #faf7f9 38%, #eee7ed 56%); background-size: 220% 100%; content: ""; animation: photo-shimmer 1.15s linear infinite; pointer-events: none; }
.photo-loading-shell.photo-ready::after { display: none; }
.photo-loading-shell img { opacity: 0; transition: opacity .2s ease; }
.photo-loading-shell.photo-ready img { opacity: 1; }
.photo-loading-shell.photo-error { background: var(--brand-soft); }
.entity-photo img { width: 100%; height: 100%; object-fit: cover; }
.entity-photo.official-logo { background: #fff; }
.entity-photo.official-logo img { padding: 12px; object-fit: contain; }
.entity-photo.official-logo.logo-interede { background: #315d4e; }
.entity-photo.official-logo.logo-smartolt { background: #111b28; }
.entity-photo.official-logo.logo-mw-solutions { background: #47008b; }
.entity-photo > svg { width: 32px; height: 32px; opacity: .55; }
.photo-count { position: absolute; z-index: 2; right: 7px; bottom: 7px; display: inline-grid; min-width: 24px; height: 22px; place-items: center; padding: 0 6px; border-radius: 7px; background: rgba(35,5,31,.82); color: #fff; font-size: 10px; font-weight: 800; box-shadow: 0 3px 10px rgba(0,0,0,.2); }
.entity-card-body { padding: 10px; }
.expense-category { display: flex; align-items: center; gap: 4px; margin-bottom: 5px; color: var(--brand); font-size: 8px; font-weight: 850; letter-spacing: .025em; text-transform: uppercase; }
.expense-category svg { width: 11px; height: 11px; }
.expense-items-preview { display: grid; gap: 3px; margin: 7px 0; padding: 6px 7px; border-radius: 8px; background: var(--surface-2); }
.expense-items-preview > div { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 7px; }
.expense-items-preview > div > span { min-width: 0; }
.expense-items-preview strong, .expense-items-preview small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expense-items-preview strong { font-size: 9px; }
.expense-items-preview small { margin-top: 1px; color: var(--faint); font-size: 7px; }
.expense-items-preview b { flex: 0 0 auto; color: var(--brand-dark); font-size: 9px; white-space: nowrap; }
.expense-items-preview b small { display: inline; color: var(--faint); font-size: 7px; font-weight: 700; }
.expense-items-preview > em { color: var(--brand); font-size: 8px; font-style: normal; font-weight: 800; }
.entity-card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.entity-card h3 { margin: 0; font-size: 14px; letter-spacing: -.025em; }
.entity-card p { display: -webkit-box; min-height: 31px; margin: 5px 0 9px; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.system-profile { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.system-profile span { padding: 3px 5px; border-radius: 5px; background: var(--brand-soft); color: var(--brand-dark); font-size: 8px; font-weight: 750; }
.entity-value { display: block; color: var(--brand-dark); font-size: 16px; letter-spacing: -.03em; }
.entity-meta { display: flex; gap: 7px; margin-top: 5px; color: var(--faint); font-size: 10px; }
.system-clients-summary { margin-top: 8px; padding: 7px 8px; border-radius: 8px; background: var(--surface-2); }
.system-clients-summary > strong { display: inline; color: var(--ink); font-size: 11px; }
.system-clients-summary > small { margin-left: 4px; color: var(--faint); font-size: 9px; }
.system-clients-summary.empty { padding: 6px 8px; color: var(--faint); font-size: 9px; }
.system-city-chips { display: flex; gap: 4px; margin-top: 5px; overflow: hidden; }
.system-city-chip { max-width: 105px; padding: 3px 5px; overflow: hidden; border-radius: 5px; background: var(--brand-soft); color: var(--brand-dark); font-size: 8px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.system-city-chip.more { flex: 0 0 auto; }
.card-actions { display: flex; gap: 5px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); }
.card-actions .button:first-child { flex: 1; }
.entity-card .button.small { min-height: 32px; padding: 5px 7px; font-size: 11px; }
.card-icon-action { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; }
.entity-card .card-icon-action { width: 32px; height: 32px; }
.card-icon-action.danger { color: var(--danger); }
.card-icon-action svg { width: 15px; }
.empty-state { display: grid; min-height: 260px; place-items: center; padding: 30px; border: 1px dashed #d9cfd7; border-radius: 14px; background: rgba(255,255,255,.45); text-align: center; }
.empty-state .empty-icon { display: grid; width: 62px; height: 62px; margin: 0 auto 17px; place-items: center; border-radius: 18px; background: var(--brand-soft); color: var(--brand); }
.empty-state .empty-icon svg { width: 28px; height: 28px; }
.empty-state h2 { margin: 0; font-size: 20px; }
.empty-state p { max-width: 420px; margin: 9px auto 18px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.room-hero { display: grid; grid-template-columns: 210px 1fr; gap: 22px; margin-bottom: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.room-hero .entity-photo { height: 150px; border-radius: 12px; }
.room-hero-content { display: flex; min-width: 0; flex-direction: column; }
.room-hero h2 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.room-hero p { margin: 8px 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.room-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.summary-chip { padding: 8px 10px; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.summary-chip strong { margin-left: 4px; color: var(--ink); }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 25px 0 12px; }
.section-header h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.item-list { display: flex; flex-direction: column; gap: 10px; }
.item-row { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.item-photo { display: grid; width: 78px; height: 68px; place-items: center; overflow: hidden; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.item-photo.photo-open { position: relative; flex: 0 0 auto; }
.item-photo img { width: 100%; height: 100%; object-fit: cover; }
.item-photo svg { width: 25px; }
.item-info { min-width: 0; }
.item-info strong { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.item-info p { margin: 5px 0 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.item-value { min-width: 145px; text-align: right; }
.item-value strong { display: block; font-size: 15px; }
.item-value small { color: var(--faint); font-size: 10px; }
.item-actions { display: flex; gap: 5px; }

.finance-list { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.finance-row { display: grid; grid-template-columns: 150px minmax(220px, 1fr) 110px 140px 80px; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.finance-row:last-child { border-bottom: 0; }
.category-pill { display: inline-flex; width: fit-content; padding: 6px 8px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 800; }
.finance-description { min-width: 0; }
.finance-description strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.finance-description small { display: block; margin-top: 4px; color: var(--faint); font-size: 10px; }
.finance-photo-button { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: var(--brand); cursor: zoom-in; font: inherit; font-weight: 750; }
.finance-photo-button svg { width: 13px; height: 13px; }
.finance-amount { font-size: 14px; text-align: right; }
.recurring-badge { display: inline-flex; padding: 5px 7px; border-radius: 8px; background: #edf7f2; color: var(--success); font-size: 9px; font-weight: 800; }
.finance-actions { display: flex; justify-content: flex-end; gap: 4px; }

/* Diálogos */
.dialog { width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(34, 5, 31, .28); }
.dialog::backdrop { background: rgba(26, 8, 24, .55); backdrop-filter: blur(3px); }
.dialog form { position: relative; display: flex; max-height: calc(100vh - 24px); flex-direction: column; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.dialog-body { overflow-y: auto; padding: 20px 22px 10px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.submit-overlay { position: absolute; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(255,255,255,.86); backdrop-filter: blur(5px); }
.submit-overlay[hidden] { display: none; }
.submit-overlay-card { display: grid; width: min(330px, 100%); place-items: center; padding: 25px 23px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: center; box-shadow: var(--shadow); }
.submit-spinner { width: 42px; height: 42px; margin-bottom: 14px; border: 4px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .75s linear infinite; }
.submit-overlay-card strong { font-size: 16px; }
.submit-overlay-card small { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.submit-progress { width: 100%; height: 7px; margin-top: 17px; overflow: hidden; border-radius: 999px; background: var(--brand-soft); }
.submit-progress span { display: block; width: 5%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-dark), var(--brand-bright)); transition: width .18s ease; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field-span-2 { grid-column: span 2; }
.expense-items-section { margin: 2px 0 18px; padding: 12px; border: 1px solid rgba(148,22,122,.2); border-radius: 13px; background: linear-gradient(145deg, #fff, #fbf6fa); }
.expense-items-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.expense-items-header strong, .expense-items-header small { display: block; }
.expense-items-header strong { font-size: 13px; }
.expense-items-header small { max-width: 430px; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.expense-items-header .button { flex: 0 0 auto; min-height: 34px; padding: 6px 9px; font-size: 10px; }
.expense-item-list { display: grid; gap: 9px; }
.expense-item-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 4px 13px rgba(45,8,39,.04); }
.expense-item-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px 7px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.expense-item-card > header > div { display: flex; align-items: center; gap: 7px; }
.expense-item-card > header strong { font-size: 10px; }
.expense-item-number { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 7px; background: var(--brand); color: #fff; font-size: 9px; font-weight: 850; }
.expense-item-card > header .card-icon-action { width: 30px; height: 30px; background: #fff; }
.expense-item-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; padding: 10px 10px 0; }
.expense-item-grid .field { margin-bottom: 9px; }
.expense-item-grid .field > span { font-size: 9px; }
.expense-item-grid input, .expense-item-grid select { min-height: 38px; padding: 8px 9px; font-size: 11px; }
.expense-item-grid textarea { min-height: 60px; padding: 8px 9px; font-size: 11px; }
.city-clients-section { margin: 2px 0 18px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.city-section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.city-section-header strong, .city-section-header small { display: block; }
.city-section-header strong { font-size: 12px; }
.city-section-header small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.city-section-header .button { flex: 0 0 auto; min-height: 34px; padding: 6px 9px; font-size: 10px; }
.system-city-list { display: flex; flex-direction: column; gap: 7px; }
.system-city-row { display: grid; grid-template-columns: minmax(0, 1fr) 145px 34px; align-items: end; gap: 7px; }
.system-city-row .field { min-width: 0; margin-bottom: 0; }
.system-city-row .field > span { font-size: 9px; }
.system-city-row input { min-width: 0; height: 38px; padding: 8px 9px; }
.system-city-remove { margin-bottom: 2px; }
.money-wrap { position: relative; }
.money-wrap::before { position: absolute; top: 50%; left: 12px; z-index: 1; transform: translateY(-50%); color: var(--faint); font-size: 12px; content: "R$"; }
.money-wrap input { padding-left: 39px; }
.check-field { display: flex; align-items: center; gap: 9px; min-height: 45px; margin-bottom: 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.check-field input { width: 17px; height: 17px; accent-color: var(--brand); }
.photo-picker { position: relative; display: grid; min-height: 160px; place-items: center; overflow: hidden; margin-bottom: 16px; border: 1px dashed #d2c4cf; border-radius: 12px; background: var(--surface-2); text-align: center; }
.photo-picker.file-selected { border-color: var(--brand); background: var(--brand-soft); }
.photo-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-picker-content { position: relative; z-index: 1; width: 100%; padding: 18px; }
.photo-picker.has-image .photo-picker-content { padding: 9px 12px; border-radius: 9px; background: rgba(255,255,255,.9); box-shadow: var(--shadow-sm); }
.photo-picker-content > svg { width: 28px; height: 28px; margin-bottom: 6px; color: var(--brand); }
.photo-picker strong, .photo-picker small { display: block; }
.photo-picker strong { font-size: 12px; }
.photo-picker small { margin-top: 4px; color: var(--faint); font-size: 10px; }
.photo-picker-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: min(390px, 100%); margin: 15px auto 0; }
.photo-source-button { position: relative; display: flex; min-height: 43px; align-items: center; justify-content: center; gap: 7px; padding: 9px 11px; border: 1px solid var(--brand); border-radius: 10px; background: var(--brand); color: #fff; cursor: pointer; font-size: 11px; font-weight: 800; }
.photo-source-button.gallery { border-color: var(--line); background: #fff; color: var(--brand); }
.photo-source-button svg { width: 17px; height: 17px; margin: 0; }
.remove-photo { margin: -8px 0 15px; }
.photo-selection { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 9px; margin: -6px 0 17px; }
.photo-selection-card { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.photo-selection-thumb { position: relative; display: grid; width: 100%; height: 88px; place-items: center; overflow: hidden; padding: 0; border: 0; background: var(--brand-soft); cursor: zoom-in; }
.photo-selection-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-selection-thumb.heic-photo { cursor: default; color: var(--brand); }
.photo-selection-thumb.heic-photo svg { width: 25px; height: 25px; }
.photo-selection-thumb.heic-photo span { font-size: 9px; font-weight: 850; }
.cropped-photo-badge { position: absolute; right: 5px; bottom: 5px; padding: 3px 6px; border-radius: 99px; background: rgba(35,131,91,.92); color: #fff; font-size: 8px; font-weight: 850; letter-spacing: .02em; }
.photo-selection-card label { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 31px; padding: 5px; color: var(--danger); cursor: pointer; font-size: 10px; font-weight: 750; }
.photo-selection-card label input { width: 14px; height: 14px; accent-color: var(--danger); }
.photo-selection-card figcaption { min-height: 31px; padding: 7px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.pending-photo-remove { width: 100%; min-height: 31px; padding: 5px; border: 0; border-top: 1px solid var(--line); background: var(--surface-2); color: var(--danger); cursor: pointer; font-size: 10px; font-weight: 750; }
.pending-photo-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.pending-photo-actions button { display: flex; min-width: 0; min-height: 34px; align-items: center; justify-content: center; gap: 4px; padding: 5px; border: 0; background: var(--surface-2); color: var(--brand); cursor: pointer; font-size: 9px; font-weight: 800; }
.pending-photo-actions button + button { border-left: 1px solid var(--line); color: var(--danger); }
.pending-photo-actions svg { width: 13px; height: 13px; }
.crop-dialog { width: min(820px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: #170713; color: #fff; border-color: rgba(255,255,255,.15); }
.crop-dialog::backdrop { background: rgba(8,2,7,.82); backdrop-filter: blur(5px); }
.crop-editor { display: flex; max-height: calc(100dvh - 24px); flex-direction: column; }
.crop-dialog-header { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 16px 18px 13px; border-bottom: 1px solid rgba(255,255,255,.12); }
.crop-dialog-header .eyebrow { margin-bottom: 4px; color: #ff8dcc; font-size: 9px; }
.crop-dialog-header h2 { max-width: 620px; margin: 0; overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.crop-dialog-header small { display: block; margin-top: 4px; color: rgba(255,255,255,.62); font-size: 10px; }
.crop-dialog-header .close-button { flex: 0 0 auto; border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.09); color: #fff; }
.crop-loading { display: grid; min-height: 390px; flex: 1 1 auto; place-items: center; align-content: center; gap: 5px; color: rgba(255,255,255,.82); }
.crop-loading .submit-spinner { margin-bottom: 8px; border-color: rgba(255,255,255,.2); border-top-color: #ff58b4; }
.crop-loading strong { font-size: 13px; }
.crop-workspace { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
.crop-stage { position: relative; width: 100%; height: min(54dvh, 520px); min-height: 300px; overflow: hidden; background: #10030d; cursor: grab; touch-action: none; user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.crop-frame { position: absolute; pointer-events: none; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(8,2,7,.56), 0 0 0 1px rgba(0,0,0,.25); }
.crop-frame::before, .crop-frame::after { position: absolute; width: 21px; height: 21px; border-color: #ff58b4; content: ""; }
.crop-frame::before { top: -3px; left: -3px; border-top: 4px solid #ff58b4; border-left: 4px solid #ff58b4; }
.crop-frame::after { right: -3px; bottom: -3px; border-right: 4px solid #ff58b4; border-bottom: 4px solid #ff58b4; }
.crop-frame span { position: absolute; inset: 33.333% 0; border-top: 1px solid rgba(255,255,255,.42); border-bottom: 1px solid rgba(255,255,255,.42); }
.crop-frame span::before, .crop-frame span::after { position: absolute; top: -50%; bottom: -50%; border-left: 1px solid rgba(255,255,255,.42); content: ""; }
.crop-frame span::before { left: 33.333%; }
.crop-frame span::after { right: 33.333%; }
.crop-frame i { position: absolute; z-index: 3; width: 34px; height: 34px; pointer-events: auto; touch-action: none; }
.crop-frame i::after { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px #ff58b4, 0 2px 8px rgba(0,0,0,.42); content: ""; }
.crop-frame i[data-crop-handle="nw"] { top: -17px; left: -17px; cursor: nwse-resize; }
.crop-frame i[data-crop-handle="nw"]::after { top: 11px; left: 11px; }
.crop-frame i[data-crop-handle="ne"] { top: -17px; right: -17px; cursor: nesw-resize; }
.crop-frame i[data-crop-handle="ne"]::after { top: 11px; right: 11px; }
.crop-frame i[data-crop-handle="sw"] { bottom: -17px; left: -17px; cursor: nesw-resize; }
.crop-frame i[data-crop-handle="sw"]::after { bottom: 11px; left: 11px; }
.crop-frame i[data-crop-handle="se"] { right: -17px; bottom: -17px; cursor: nwse-resize; }
.crop-frame i[data-crop-handle="se"]::after { right: 11px; bottom: 11px; }
.crop-controls { display: grid; gap: 12px; padding: 13px 18px 15px; background: #23091d; }
.crop-aspects { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.crop-aspects button { min-height: 34px; padding: 6px; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; background: rgba(255,255,255,.06); color: rgba(255,255,255,.72); cursor: pointer; font-size: 10px; font-weight: 750; }
.crop-aspects button.active { border-color: #ff58b4; background: rgba(233,30,143,.22); color: #fff; }
.crop-adjust-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 15px; }
.crop-adjust-row .button { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #fff; }
.crop-zoom { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; color: rgba(255,255,255,.7); font-size: 10px; font-weight: 700; }
.crop-zoom input { width: 100%; accent-color: #ff58b4; touch-action: manipulation; }
.crop-error { margin: 22px; padding: 13px; border: 1px solid rgba(255,141,204,.35); border-radius: 10px; background: rgba(233,30,143,.14); color: #ffd3ec; font-size: 11px; line-height: 1.5; }
.crop-footer { grid-template-columns: auto 1fr auto auto; flex: 0 0 auto; background: #170713; border-color: rgba(255,255,255,.12); }
.crop-footer .button.secondary { border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.07); color: #fff; }
.button-spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.confirm-dialog { width: min(430px, calc(100vw - 24px)); padding: 27px 27px 0; text-align: center; }
.confirm-dialog .confirm-icon { display: grid; width: 50px; height: 50px; margin: 0 auto 15px; place-items: center; border-radius: 15px; background: var(--danger-soft); color: var(--danger); }
.confirm-dialog h2 { margin: 0; font-size: 20px; }
.confirm-dialog p { margin: 9px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.confirm-dialog .dialog-footer { margin: 0 -27px; }
.install-dialog { width: min(430px, calc(100vw - 24px)); padding: 27px 27px 0; }
.install-icon { display: grid; width: 76px; height: 76px; margin: 0 auto 17px; place-items: center; overflow: hidden; border-radius: 18px; box-shadow: var(--shadow-sm); }
.install-icon img { width: 100%; height: 100%; object-fit: cover; }
.install-dialog h2 { margin: 0; text-align: center; font-size: 21px; }
.install-dialog > p { margin: 8px 0 18px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.5; }
.install-dialog ol { margin: 0 0 24px; padding-left: 22px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.install-dialog li + li { margin-top: 7px; }
.install-dialog .dialog-footer { margin: 0 -27px; }
.value-dialog { width: min(790px, calc(100vw - 24px)); }
.value-dialog .dialog-header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.value-dialog-body { max-height: min(66dvh, 650px); padding-bottom: 20px; }
.value-queue { display: flex; flex-direction: column; gap: 7px; }
.value-queue-row { display: grid; grid-template-columns: 52px minmax(135px, 1fr) minmax(220px, .9fr) auto; align-items: center; gap: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); transition: opacity .2s ease, transform .2s ease, max-height .2s ease, padding .2s ease; }
.value-queue-row.saved { opacity: 0; transform: translateX(24px); }
.value-queue-row.saving { opacity: .68; }
.value-queue-photo { display: grid; width: 52px; height: 44px; place-items: center; overflow: hidden; border-radius: 8px; background: #fff; color: var(--brand); }
.value-queue-photo img { width: 100%; height: 100%; padding: 5px; object-fit: contain; }
.value-queue-photo svg { width: 21px; }
.value-queue-info { min-width: 0; }
.value-queue-info strong, .value-queue-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.value-queue-info strong { font-size: 12px; }
.value-queue-info small { margin-top: 3px; color: var(--faint); font-size: 9px; }
.value-queue-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.value-queue-form label { min-width: 0; }
.value-queue-form input { width: 100%; min-width: 0; height: 36px; padding: 7px 8px 7px 39px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #fff; color: var(--ink); }
.value-queue-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(148,22,122,.1); }
.value-queue-form .button { min-height: 36px; }
.value-free-button { padding: 5px 3px; border: 0; background: transparent; color: var(--brand); cursor: pointer; font-size: 9px; font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.value-row-error { grid-column: 2 / -1; margin-top: -3px; color: var(--danger); font-size: 9px; }
.value-queue-complete { display: grid; min-height: 220px; place-items: center; align-content: center; text-align: center; }
.value-queue-complete > svg { width: 42px; height: 42px; margin-bottom: 10px; padding: 9px; border-radius: 13px; background: #e8f5ee; color: var(--success); }
.value-queue-complete strong { font-size: 17px; }
.value-queue-complete p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.pending-values-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-bottom: 15px; }
.pending-values-summary article { display: flex; min-width: 0; align-items: center; gap: 11px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.pending-values-summary article > span { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.pending-values-summary article > span svg { width: 17px; }
.pending-values-summary strong, .pending-values-summary small { display: block; }
.pending-values-summary strong { font-size: 20px; color: var(--brand-dark); line-height: 1; }
.pending-values-summary small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.pending-values-summary article.total { border-color: rgba(148,22,122,.28); background: linear-gradient(135deg, #fff, var(--brand-soft)); }
.pending-values-section { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.section-header.compact { margin-bottom: 10px; }
.section-header.compact h2 { font-size: 15px; }
.section-header.compact p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.pending-values-list { gap: 6px; }
.pending-value-row { grid-template-columns: 52px minmax(145px, 1fr) minmax(220px, .8fr) auto; background: #fff; }
.pending-system-value-form { grid-template-columns: minmax(145px, 1fr) minmax(115px, .72fr) auto; }
.pending-billing-fields { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) 72px; gap: 5px; }
.pending-billing-fields label { min-width: 0; }
.pending-billing-fields select, .pending-billing-fields input { width: 100%; min-width: 0; height: 36px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #fff; color: var(--ink); font-size: 10px; }
.pending-billing-fields select:focus, .pending-billing-fields input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(148,22,122,.1); }
.pending-billing-fields .pending-custom-interval[hidden] { display: none; }
.value-type-pill { display: inline-flex !important; width: max-content; margin: 0 0 3px !important; padding: 2px 5px; border-radius: 99px; background: var(--brand-soft); color: var(--brand) !important; font-size: 7px !important; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.value-type-pill.item { background: #e8f3fb; color: #22668e !important; }
.value-page-complete { display: grid; min-height: 390px; place-items: center; align-content: center; padding: 30px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); text-align: center; box-shadow: var(--shadow-sm); }
.value-page-complete > svg { width: 52px; height: 52px; margin-bottom: 13px; padding: 12px; border-radius: 15px; background: #e8f5ee; color: var(--success); }
.value-page-complete h2 { margin: 0; font-size: 21px; }
.value-page-complete p { margin: 7px 0 18px; color: var(--muted); font-size: 11px; }
.value-page-complete div { display: flex; gap: 7px; }
/* Mapeamento da rede FTTH */
.mapping-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.mapping-metric { display: grid; min-width: 0; min-height: 88px; grid-template-columns: 31px minmax(0, 1fr); align-content: start; align-items: center; gap: 0 9px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.mapping-metric > span:first-child { display: grid; width: 31px; height: 31px; grid-row: 1 / span 2; place-items: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.mapping-metric > span:first-child svg { width: 16px; }
.mapping-metric > span:nth-child(2) { overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.mapping-metric strong { overflow: hidden; color: var(--brand-dark); font-size: 16px; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.mapping-metric small { grid-column: 1 / -1; margin-top: 7px; overflow: hidden; color: var(--faint); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.mapping-cable-chart { margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.mapping-cable-chart > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.mapping-cable-chart h3 { margin: 0; font-size: 12px; }
.mapping-cable-chart p { margin: 3px 0 0; color: var(--faint); font-size: 8px; }
.mapping-cable-chart > header > strong { color: var(--brand-dark); font-size: 16px; white-space: nowrap; }
.mapping-cable-chart > header > strong small { color: var(--faint); font-size: 8px; font-weight: 700; }
.mapping-chart-rows { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.mapping-chart-row { display: grid; min-width: 0; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 4px 6px; }
.mapping-chart-row b { color: var(--muted); font-size: 8px; }
.mapping-chart-row > div { height: 7px; overflow: hidden; border-radius: 99px; background: #eee8ed; }
.mapping-chart-row > div span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-bright), var(--brand-dark)); }
.mapping-chart-row > strong { grid-column: 2; overflow: hidden; color: var(--brand-dark); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.mapping-layout { display: grid; min-width: 0; grid-template-columns: 205px minmax(0, 1fr); gap: 10px; align-items: start; }
.mapping-city-panel, .mapping-main-panel { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.mapping-city-panel { position: sticky; top: 82px; overflow: hidden; }
.mapping-city-panel > header { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.mapping-city-panel > header strong { font-size: 11px; }
.mapping-city-panel > header small { color: var(--faint); font-size: 8px; }
.mapping-city-list { display: flex; max-height: calc(100dvh - 150px); flex-direction: column; gap: 3px; overflow-y: auto; padding: 5px; }
.mapping-city-list button { display: grid; width: 100%; min-width: 0; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; }
.mapping-city-list button > span:first-child { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: var(--surface-2); color: var(--brand); }
.mapping-city-list button svg { width: 14px; }
.mapping-city-list button strong, .mapping-city-list button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping-city-list button strong { color: var(--ink); font-size: 10px; }
.mapping-city-list button small { margin-top: 2px; color: var(--faint); font-size: 7px; }
.mapping-city-list button b { display: grid; min-width: 20px; height: 20px; place-items: center; padding: 0 4px; border-radius: 7px; background: var(--surface-2); font-size: 8px; }
.mapping-city-list button.active { border-color: rgba(148,22,122,.24); background: var(--brand-soft); }
.mapping-city-list button.active > span:first-child, .mapping-city-list button.active b { background: #fff; color: var(--brand-dark); }
.mapping-main-panel { overflow: hidden; }
.mapping-city-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 15px 16px 12px; }
.mapping-city-header h2 { margin: 0; font-size: 21px; letter-spacing: -.04em; }
.mapping-city-header p { max-width: 690px; margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.mapping-city-header > div:last-child, .mapping-neighborhood-header > div:last-child { display: flex; flex: 0 0 auto; gap: 5px; }
.mapping-city-header .eyebrow { margin-bottom: 5px; font-size: 8px; }
.mapping-neighborhood-bar { display: flex; min-width: 0; align-items: center; gap: 7px; padding: 8px 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.mapping-neighborhood-tabs { display: flex; min-width: 0; flex: 1; flex-wrap: wrap; gap: 4px; }
.mapping-neighborhood-tabs button { display: inline-flex; min-width: 0; min-height: 29px; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); cursor: pointer; font-size: 9px; }
.mapping-neighborhood-tabs button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping-neighborhood-tabs button b { display: grid; min-width: 17px; height: 17px; place-items: center; padding: 0 3px; border-radius: 5px; background: var(--surface-2); color: var(--faint); font-size: 7px; }
.mapping-neighborhood-tabs button.active { border-color: var(--brand); background: var(--brand); color: #fff; font-weight: 800; }
.mapping-neighborhood-tabs button.active b { background: rgba(255,255,255,.18); color: #fff; }
.mapping-inner-empty { display: grid; min-height: 270px; place-items: center; align-content: center; padding: 25px; text-align: center; }
.mapping-inner-empty > svg { width: 38px; height: 38px; margin-bottom: 9px; padding: 8px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.mapping-inner-empty h3 { margin: 0; font-size: 16px; }
.mapping-inner-empty p { margin: 5px 0 13px; color: var(--muted); font-size: 10px; }
.mapping-neighborhood-detail { min-width: 0; padding: 13px; }
.mapping-neighborhood-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.mapping-neighborhood-header h3 { display: inline; margin: 0 0 0 7px; font-size: 17px; letter-spacing: -.03em; }
.mapping-neighborhood-header p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.mapping-area-badge { display: inline-flex; padding: 3px 6px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-dark); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.mapping-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.mapping-summary-card { display: grid; min-width: 0; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 0 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.mapping-summary-card > span { display: grid; width: 30px; height: 30px; grid-row: 1 / span 2; place-items: center; border-radius: 8px; background: #fff; color: var(--brand); }
.mapping-summary-card svg { width: 15px; }
.mapping-summary-card small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.mapping-summary-card strong { overflow: hidden; color: var(--brand-dark); font-size: 15px; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.mapping-summary-card em { grid-column: 2; margin-top: 2px; overflow: hidden; color: var(--faint); font-size: 7px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.mapping-neighborhood-notes { margin-top: 8px; padding: 10px; border-radius: 9px; background: var(--surface-2); }
.mapping-neighborhood-notes strong { font-size: 9px; }
.mapping-neighborhood-notes p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; white-space: pre-line; }
.mapping-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.mapping-block { min-width: 0; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.mapping-section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.mapping-section-title h4 { margin: 0; font-size: 12px; }
.mapping-section-title h4 span { display: inline-grid; min-width: 19px; height: 18px; margin-left: 3px; place-items: center; padding: 0 4px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 8px; }
.mapping-section-title p { margin: 3px 0 0; color: var(--faint); font-size: 8px; }
.mapping-section-title > strong { color: var(--brand-dark); font-size: 10px; }
.mapping-empty-line { margin: 0; padding: 11px; border-radius: 9px; background: var(--surface-2); color: var(--faint); font-size: 9px; text-align: center; }
.mapping-street-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 5px; }
.mapping-street-list article { display: grid; min-width: 0; grid-template-columns: 27px minmax(0, 1fr) 30px 30px; align-items: center; gap: 5px; padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.mapping-street-list article > span { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 7px; background: var(--surface-2); color: var(--brand); }
.mapping-street-list article > span svg { width: 13px; }
.mapping-street-list strong, .mapping-street-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mapping-street-list strong { font-size: 9px; }
.mapping-street-list small { margin-top: 2px; color: var(--faint); font-size: 7px; }
.mapping-street-list .card-icon-action { width: 30px; height: 30px; }
.mapping-cable-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 7px; }
.mapping-cable-card { display: grid; min-width: 0; grid-template-columns: 72px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mapping-card-photo { position: relative; display: grid; width: 72px; height: 100%; min-height: 166px; place-items: center; overflow: hidden; padding: 0; border: 0; background: linear-gradient(145deg, #f7eaf3, #eae2e9); color: var(--brand); }
.mapping-card-photo img, .mapping-cto-photo img { width: 100%; height: 100%; object-fit: cover; }
.mapping-card-photo svg, .mapping-cto-photo svg { width: 24px; opacity: .65; }
.mapping-card-content { min-width: 0; padding: 9px; }
.mapping-card-heading { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 6px; color: var(--faint); font-size: 7px; }
.network-status { display: inline-flex; padding: 3px 5px; border-radius: 5px; background: #eef1f2; color: #596467; font-size: 7px; font-weight: 850; text-transform: uppercase; }
.network-status.active { background: #e6f5ed; color: #19744d; }
.network-status.planned { background: #e8f1fb; color: #22668e; }
.network-status.installing { background: #fff4d9; color: #906400; }
.network-status.full, .network-status.damaged { background: var(--danger-soft); color: var(--danger); }
.network-status.maintenance { background: #fff0df; color: #9a5611; }
.mapping-card-content h5, .mapping-cto-body h5 { margin: 6px 0 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.mapping-card-content > p, .mapping-cto-body > p { margin: 3px 0 7px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.mapping-cable-numbers { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; }
.mapping-cable-numbers strong { color: var(--brand-dark); font-size: 13px; }
.mapping-cable-numbers span { color: var(--muted); font-size: 8px; }
.capacity-bar { height: 5px; margin: 6px 0 4px; overflow: hidden; border-radius: 99px; background: #eee9ed; }
.capacity-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-bright), var(--brand-dark)); }
.mapping-card-content > small, .mapping-cto-body > small { display: block; overflow: hidden; color: var(--faint); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.mapping-card-actions { display: flex; gap: 5px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); }
.mapping-card-actions .button { min-height: 30px; flex: 1; }
.mapping-card-actions .card-icon-action { width: 30px; height: 30px; }
.mapping-cto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 7px; }
.mapping-cto-card { display: grid; min-width: 0; grid-template-columns: 68px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mapping-cto-photo { position: relative; display: grid; width: 68px; height: 100%; min-height: 190px; place-items: center; overflow: hidden; padding: 0; border: 0; background: linear-gradient(145deg, #f7eaf3, #eae2e9); color: var(--brand); }
.mapping-cto-body { min-width: 0; padding: 9px; }
.cto-port-summary { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 5px; }
.cto-port-summary strong { color: var(--brand-dark); font-size: 18px; line-height: 1; }
.cto-port-summary span { color: var(--muted); font-size: 8px; }
.cto-port-summary em { grid-column: 1 / -1; margin-top: 3px; color: var(--faint); font-size: 7px; font-style: normal; }
.mapping-location-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 6px; margin-top: 7px; color: var(--faint); font-size: 7px; }
.mapping-map-link { display: inline-flex; min-width: 0; align-items: center; gap: 3px; color: var(--brand); font-weight: 750; text-decoration: none; }
.mapping-map-link svg { width: 11px; }
.mapping-no-location { color: var(--faint); }
.mapping-form-section { margin-bottom: 12px; padding: 11px 12px 1px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-2); }
.mapping-form-section > h3 { margin: 0 0 11px; color: var(--brand-dark); font-size: 12px; }
.mapping-cable-input-header { margin: 3px 0 7px; padding-top: 9px; border-top: 1px solid var(--line); }
.mapping-cable-input-header strong, .mapping-cable-input-header small { display: block; }
.mapping-cable-input-header strong { font-size: 10px; }
.mapping-cable-input-header small { margin-top: 2px; color: var(--faint); font-size: 8px; }
.mapping-cable-input-table { overflow: hidden; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mapping-cable-input-labels, .mapping-cable-input-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: center; gap: 7px; }
.mapping-cable-input-labels { padding: 6px 8px; background: var(--brand-soft); color: var(--brand-dark); font-size: 7px; font-weight: 850; text-transform: uppercase; }
.mapping-cable-input-row { padding: 6px 8px; border-top: 1px solid var(--line); }
.mapping-cable-input-row > strong { color: var(--brand-dark); font-size: 10px; }
.mapping-cable-input-row label { min-width: 0; }
.mapping-cable-input-row input { width: 100%; min-width: 0; height: 38px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: var(--surface-2); color: var(--ink); font-size: 13px; }
.mapping-cable-input-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(148,22,122,.1); }
.mapping-form-location { margin-bottom: 12px; padding: 10px; border: 1px dashed #dacbd7; border-radius: 10px; background: #fff; }
.mapping-form-location > div:first-child { margin-bottom: 8px; }
.mapping-form-location strong, .mapping-form-location small { display: block; }
.mapping-form-location strong { font-size: 10px; }
.mapping-form-location small { margin-top: 2px; color: var(--faint); font-size: 8px; line-height: 1.4; }
.mapping-coordinate-grid { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 7px; }
.mapping-coordinate-grid .field { margin-bottom: 0; }
.mapping-gps-button { min-height: 45px; white-space: nowrap; }
.mapping-location-feedback { min-height: 12px; color: var(--brand) !important; }
.unit-wrap { position: relative; }
.unit-wrap input { padding-right: 34px; }
.unit-wrap > span { position: absolute; top: 50%; right: 11px; transform: translateY(-50%); color: var(--faint); font-size: 10px; font-weight: 800; }

.photo-dialog { --photo-dismiss-y: 0px; --photo-dismiss-opacity: 1; width: min(980px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border-color: rgba(255,255,255,.15); background: #160512; color: #fff; opacity: var(--photo-dismiss-opacity); transform: translate3d(0, var(--photo-dismiss-y), 0); }
.photo-dialog::backdrop { background: rgba(8,2,7,.86); backdrop-filter: blur(6px); }
.photo-dialog.photo-dragging { transition: none; }
.photo-dialog.photo-settling { transition: transform .18s ease-out, opacity .18s ease-out; }
.photo-dialog.photo-dismissing { opacity: 0; transform: translate3d(0, 105dvh, 0); transition: transform .19s ease-in, opacity .19s ease-in; }
.photo-dialog-header { position: relative; display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 13px 10px 18px; background: rgba(255,255,255,.05); }
.photo-drag-handle { position: absolute; top: 5px; left: 50%; width: 38px; height: 4px; transform: translateX(-50%); border-radius: 99px; background: rgba(255,255,255,.32); touch-action: none; }
.photo-dialog-header strong, .photo-dialog-header small { display: block; }
.photo-dialog-header strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.photo-dialog-header small { margin-top: 3px; color: rgba(255,255,255,.6); font-size: 10px; }
.photo-dialog-header .icon-button { color: #fff; }
.photo-dialog-header .close-button { border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.1); color: #fff; }
.photo-viewer-stage { position: relative; height: min(76dvh, 720px); overflow: hidden; background: #0c020a; }
.photo-carousel { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; touch-action: pan-x; -webkit-overflow-scrolling: touch; }
.photo-carousel::-webkit-scrollbar { display: none; }
.photo-slide { position: relative; display: grid; min-width: 100%; flex: 0 0 100%; place-items: center; scroll-snap-align: center; scroll-snap-stop: always; }
.photo-slide img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.photo-slide.loading-full::after { position: absolute; right: 14px; bottom: 14px; width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.28); border-top-color: #fff; border-radius: 50%; content: ""; animation: spin .7s linear infinite; }
.photo-nav { position: absolute; z-index: 2; top: 50%; display: grid; width: 44px; height: 58px; place-items: center; transform: translateY(-50%); border: 1px solid rgba(255,255,255,.15); border-radius: 12px; background: rgba(12,2,10,.65); color: #fff; cursor: pointer; font-size: 34px; line-height: 1; backdrop-filter: blur(5px); }
.photo-nav.previous { left: 12px; }
.photo-nav.next { right: 12px; }
.toast-region { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: flex; width: min(360px, calc(100vw - 36px)); flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); animation: toast-in .2s ease both; }
.toast > span:first-child { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: #e8f5ee; color: var(--success); }
.toast svg { width: 15px; }
.toast strong, .toast small { display: block; }
.toast strong { font-size: 12px; }
.toast small { margin-top: 2px; color: var(--muted); font-size: 10px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.loading { display: grid; min-height: 360px; place-items: center; color: var(--muted); font-size: 13px; }
.spinner { width: 32px; height: 32px; margin: 0 auto 12px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes photo-shimmer { to { background-position-x: -220%; } }

@media (max-width: 1150px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .expense-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mapping-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-row { grid-template-columns: 135px minmax(190px,1fr) 95px 130px 75px; }
}

@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-form-panel { min-height: 100vh; background: radial-gradient(circle at 50% 0, var(--brand-soft), #fff 50%); }
  .login-mobile-logo { display: block; width: min(300px, 80%); margin: 0 auto 42px; padding: 10px 14px; border-radius: 12px; background: #fff; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; }
  .workspace { margin-left: 0; }
  .mobile-only { display: inline-grid; }
  .scrim { position: fixed; z-index: 25; inset: 0; background: rgba(20,4,19,.5); }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .mapping-layout { grid-template-columns: 1fr; }
  .mapping-city-panel { position: static; }
  .mapping-city-list { display: grid; max-height: none; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); }
  .finance-list { display: flex; overflow: visible; flex-direction: column; gap: 9px; border: 0; background: transparent; box-shadow: none; }
  .finance-row { grid-template-areas: "category amount" "description description" "competence actions"; grid-template-columns: minmax(0, 1fr) auto; min-width: 0; max-width: 100%; gap: 9px 12px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
  .finance-row .category-pill { grid-area: category; max-width: 100%; }
  .finance-row .finance-description { grid-area: description; }
  .finance-row > span:nth-child(3) { grid-area: competence; color: var(--muted); font-size: 11px; }
  .finance-row .finance-amount { grid-area: amount; }
  .finance-row .finance-actions { grid-area: actions; align-items: center; }
}

@media (max-width: 680px) {
  html, body, .login-screen, .app-shell, .workspace, #main-content { touch-action: pan-y; }
  html, body { overscroll-behavior-y: contain; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  input, textarea, select { font-size: 16px !important; }
  .login-screen, .login-form-panel, .app-shell, .workspace, #main-content { width: 100%; min-width: 0; max-width: 100%; }
  .login-screen { min-height: 100dvh; }
  .login-form-panel { min-height: 100dvh; padding-right: max(20px, env(safe-area-inset-right)); padding-left: max(20px, env(safe-area-inset-left)); }
  .topbar { height: calc(62px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); }
  .database-badge { font-size: 0; }
  .database-badge::before { margin: 0; }
  .pwa-install-topbar { width: 40px; min-width: 40px; height: 40px; margin-left: auto; padding: 0; }
  .pwa-install-topbar span { display: none; }
  #main-content { overflow-x: hidden; padding: 23px max(14px, env(safe-area-inset-right)) 40px max(14px, env(safe-area-inset-left)); }
  #main-content > *, .page-header > *, .page-actions, .entity-grid, .metrics-grid, .expense-overview, .customer-overview, .customer-city-list, .quick-grid, .item-list, .finance-list, .mapping-metrics, .mapping-layout { min-width: 0; max-width: 100%; }
  .page-header { align-items: flex-start; margin-bottom: 18px; }
  .page-header > div:first-child { min-width: 0; }
  .page-header h1 { font-size: 28px; }
  .page-header p { display: none; }
  .page-actions .button span { display: none; }
  .page-actions .button { width: 42px; padding: 0; }
  .page-actions .button .action-count { position: absolute; top: -5px; right: -5px; display: inline-grid; min-width: 18px; height: 18px; padding: 0 4px; border: 2px solid var(--background); font-size: 8px; }
  .page-actions .button { position: relative; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { display: grid; min-height: 88px; grid-template-columns: 27px minmax(0, 1fr); align-content: start; align-items: center; gap: 0 8px; padding: 10px; }
  .metric-card > .metric-icon { grid-column: 1; grid-row: 1; width: 27px; height: 27px; }
  .metric-card > span:not(.metric-icon) { grid-column: 2; grid-row: 1; margin-top: 0; }
  .metric-card > strong { grid-column: 1 / -1; grid-row: 2; margin-top: 6px; }
  .metric-card > small { grid-column: 1 / -1; grid-row: 3; margin-top: 1px; }
  .metric-card strong { font-size: 18px; }
  .metric-card span { font-size: 10px; }
  .welcome-panel { grid-template-columns: 1fr; padding: 17px; }
  .welcome-panel .button { width: fit-content; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-card { display: grid; min-height: 0; grid-template-columns: 31px minmax(0, 1fr); gap: 0 10px; padding: 12px; }
  .quick-card .metric-icon { grid-column: 1; grid-row: 1 / span 3; margin: 0; }
  .quick-card h3, .quick-card p, .quick-card b { grid-column: 2; }
  .quick-card p { margin: 3px 0 5px; }
  .mapping-metrics { grid-template-columns: 1fr 1fr; gap: 7px; }
  .mapping-metric { min-height: 82px; padding: 9px; }
  .mapping-cable-chart { padding: 10px; }
  .mapping-chart-rows { grid-template-columns: 1fr; gap: 6px; }
  .mapping-chart-row { grid-template-columns: 38px minmax(0, 1fr) 62px; }
  .mapping-chart-row > strong { grid-column: 3; grid-row: 1; text-align: right; }
  .mapping-city-panel > header { padding: 9px 10px; }
  .mapping-city-list { grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; }
  .mapping-city-list button { grid-template-columns: 26px minmax(0, 1fr) auto; padding: 6px; }
  .mapping-city-list button > span:first-child { width: 26px; height: 26px; }
  .mapping-city-header { padding: 13px 12px 10px; }
  .mapping-city-header h2 { font-size: 20px; }
  .mapping-city-header p { display: block; }
  .mapping-neighborhood-bar { align-items: stretch; }
  .mapping-neighborhood-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mapping-neighborhood-tabs button { justify-content: space-between; }
  .mapping-neighborhood-bar > .button { width: 36px; flex: 0 0 36px; padding: 0; font-size: 0; }
  .mapping-neighborhood-detail { padding: 10px; }
  .mapping-summary-grid { grid-template-columns: 1fr 1fr; }
  .mapping-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .mapping-actions .button:first-child { grid-column: 1 / -1; }
  .mapping-street-list, .mapping-cable-list, .mapping-cto-grid { grid-template-columns: 1fr; }
  .mapping-section-title { align-items: flex-start; }
  .mapping-section-title p { max-width: 230px; }
  .mapping-cable-card { grid-template-columns: 70px minmax(0, 1fr); }
  .mapping-card-photo { width: 70px; }
  .mapping-cto-card { grid-template-columns: 68px minmax(0, 1fr); }
  .mapping-coordinate-grid { grid-template-columns: 1fr 1fr; }
  .mapping-gps-button { grid-column: 1 / -1; width: 100%; }
  .mapping-form-section { padding: 10px 9px 1px; }
  .mapping-cable-input-labels, .mapping-cable-input-row { grid-template-columns: 52px minmax(0, 1fr); gap: 5px; padding-right: 6px; padding-left: 6px; }
  .mapping-cable-input-row input { padding-right: 7px; padding-left: 7px; }
  .system-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .system-filters button { min-width: 0; justify-content: center; padding: 5px 6px; }
  .system-filters button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .expense-overview { grid-template-columns: 1fr 1fr; gap: 7px; }
  .expense-overview .metric-card { min-height: 88px; }
  .customer-overview { grid-template-columns: 1fr 1fr; gap: 7px; }
  .customer-overview .metric-card { min-height: 88px; }
  .customer-city-row { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; padding: 9px; }
  .customer-city-rank { grid-column: 1; grid-row: 1 / span 2; align-self: start; width: 28px; height: 28px; }
  .customer-city-name { grid-column: 2; grid-row: 1; }
  .customer-city-name > span { display: none; }
  .customer-city-actions { grid-column: 3; grid-row: 1; }
  .customer-city-actions .card-icon-action { width: 31px; height: 31px; }
  .customer-city-value { grid-column: 2; grid-row: 2; }
  .customer-city-ticket { grid-column: 3; grid-row: 2; min-width: 94px; }
  .customer-city-value strong, .customer-city-ticket strong { font-size: 12px; }
  .expense-filter-bar { flex-direction: column; }
  .expense-filter-bar .system-filters { width: 100%; }
  .expense-city-filter { width: 100%; flex-basis: auto; }
  .expense-city-filter select { min-height: 40px; }
  .entity-grid { grid-template-columns: 1fr; }
  .entity-card { display: grid; grid-template-columns: 94px minmax(0, 1fr); }
  .entity-photo { height: 100%; min-height: 148px; }
  .entity-card p { min-height: 0; margin: 4px 0 6px; -webkit-line-clamp: 1; }
  .entity-card .entity-meta { margin-top: 3px; }
  .system-clients-summary { margin-top: 6px; padding: 6px; }
  .entity-card .card-actions { margin-top: 6px; padding-top: 6px; }
  .room-hero { min-width: 0; grid-template-columns: minmax(0, 1fr); }
  .room-hero .entity-photo { height: 180px; }
  .item-row { grid-template-columns: 62px minmax(0,1fr) auto; gap: 10px; }
  .item-photo { width: 62px; height: 58px; }
  .item-value { min-width: 0; }
  .item-actions { grid-column: 2 / -1; justify-content: flex-end; }
  .form-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: span 1; }
  .city-clients-section { padding: 10px; }
  .expense-items-section { padding: 9px; }
  .expense-items-header { align-items: flex-start; }
  .expense-items-header small { max-width: 205px; }
  .expense-items-header .button { width: 36px; min-width: 36px; padding: 0; font-size: 0; }
  .expense-items-header .button svg { width: 16px; }
  .expense-item-grid { grid-template-columns: minmax(0, 1fr); padding: 9px 9px 0; }
  .expense-item-grid .field-span-2 { grid-column: span 1; }
  .expense-item-grid input, .expense-item-grid select, .expense-item-grid textarea { max-width: 100%; font-size: 16px; }
  .city-section-header { align-items: flex-start; }
  .city-section-header small { max-width: 190px; }
  .city-section-header .button { width: 36px; min-width: 36px; padding: 0; font-size: 0; }
  .city-section-header .button svg { width: 16px; }
  .system-city-row { grid-template-columns: minmax(0, 1fr) 112px 34px; gap: 6px; }
  .dialog.form-dialog { width: 100%; max-width: 100%; max-height: calc(92dvh - env(safe-area-inset-top)); margin: auto 0 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 18px 18px 0 0; }
  .dialog.form-dialog form { max-height: calc(92dvh - env(safe-area-inset-top)); }
  .dialog.value-dialog { width: 100%; max-width: 100%; max-height: calc(92dvh - env(safe-area-inset-top)); margin: auto 0 0; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 18px 18px 0 0; }
  .dialog.crop-dialog { width: 100%; max-width: 100%; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .crop-editor { height: 100dvh; max-height: 100dvh; }
  .crop-dialog-header { padding-top: max(14px, env(safe-area-inset-top)); padding-right: max(13px, env(safe-area-inset-right)); padding-left: max(16px, env(safe-area-inset-left)); }
  .crop-dialog-header h2 { max-width: calc(100vw - 105px); font-size: 16px; }
  .crop-dialog-header small { max-width: calc(100vw - 95px); }
  .crop-workspace { display: flex; flex-direction: column; }
  .crop-stage { min-height: 260px; flex: 1 1 auto; height: auto; }
  .crop-controls { flex: 0 0 auto; padding-right: max(14px, env(safe-area-inset-right)); padding-left: max(14px, env(safe-area-inset-left)); }
  .crop-footer { padding-right: max(12px, env(safe-area-inset-right)); padding-bottom: max(12px, env(safe-area-inset-bottom)); padding-left: max(12px, env(safe-area-inset-left)); }
  .crop-footer .button { min-height: 39px; padding: 8px 11px; font-size: 11px; }
  .value-dialog-body { max-height: calc(92dvh - 154px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .value-queue-row { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 7px; }
  .value-queue-photo { width: 46px; height: 42px; }
  .value-queue-info { grid-column: 2 / -1; }
  .value-queue-form { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) 86px; }
  .pending-system-value-form { grid-template-columns: minmax(0, 1fr) 86px; }
  .pending-system-value-form .pending-billing-fields { grid-column: 1 / -1; grid-row: 1; }
  .pending-system-value-form .pending-value-field { grid-column: 1; grid-row: 2; }
  .pending-system-value-form > button { grid-column: 2; grid-row: 2; }
  .pending-billing-fields { grid-template-columns: minmax(0, 1fr) 88px; }
  .pending-billing-fields select, .pending-billing-fields input { height: 40px; font-size: 16px; }
  .value-free-button { grid-column: 1 / -1; justify-self: end; }
  .value-row-error { grid-column: 1 / -1; }
  .pending-values-summary { grid-template-columns: 1fr 1fr; gap: 7px; }
  .pending-values-summary article { gap: 8px; padding: 10px; }
  .pending-values-summary article.total { grid-column: 1 / -1; }
  .pending-values-summary article > span { width: 32px; height: 32px; }
  .pending-values-summary strong { font-size: 17px; }
  .pending-values-section { padding: 9px; }
  .pending-value-row { grid-template-columns: 46px minmax(0, 1fr); }
  .dialog-header, .dialog-body { padding-right: max(16px, env(safe-area-inset-right)); padding-left: max(16px, env(safe-area-inset-left)); }
  .dialog-body { -webkit-overflow-scrolling: touch; }
  .dialog-footer { padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: max(14px, env(safe-area-inset-bottom)); padding-left: max(16px, env(safe-area-inset-left)); }
  .photo-selection { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .photo-dialog { width: 100%; max-width: 100%; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .photo-dialog-header { padding-top: max(10px, env(safe-area-inset-top)); padding-right: max(13px, env(safe-area-inset-right)); padding-left: max(18px, env(safe-area-inset-left)); }
  .photo-viewer-stage { height: calc(100dvh - 58px - env(safe-area-inset-top)); }
  .photo-nav { width: 39px; height: 52px; }
  .photo-nav.previous { left: max(8px, env(safe-area-inset-left)); }
  .photo-nav.next { right: max(8px, env(safe-area-inset-right)); }
  .mobile-nav { position: fixed; z-index: 23; right: max(8px, env(safe-area-inset-right)); bottom: max(8px, env(safe-area-inset-bottom)); left: max(8px, env(safe-area-inset-left)); display: grid; height: 61px; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 5px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.94); box-shadow: 0 16px 40px rgba(40,8,36,.16); backdrop-filter: blur(14px); }
  .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 8px; }
  .mobile-nav button.active { background: var(--brand-soft); color: var(--brand); font-weight: 800; }
  .mobile-nav svg { width: 17px; height: 17px; }
  .toast-region { bottom: 82px; }
}

@media (display-mode: standalone) {
  [data-install-app] { display: none !important; }
}

@media (max-width: 420px) {
  .login-form-panel { padding: 26px 20px; }
  .login-card h2 { font-size: 27px; }
  .login-mobile-logo { margin-bottom: 35px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 88px; }
  .metric-icon { width: 31px; height: 31px; }
  .entity-card { grid-template-columns: 82px minmax(0, 1fr); }
  .item-row { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; }
  .item-photo { width: 52px; height: 52px; }
  .item-info strong, .finance-description strong, .entity-card h3 { overflow-wrap: anywhere; }
}
