:root {
  --navy: #176f9f;
  --navy-soft: #1882bd;
  --aqua: #35c1df;
  --aqua-dark: #248fbf;
  --mint: #d8f2f7;
  --sand: #edf7fa;
  --paper: #ffffff;
  --ink: #123f58;
  --muted: #5f8193;
  --line: #cde5ee;
  --warning: #a86b18;
  --danger: #b84a48;
  --shadow: 0 22px 60px rgba(24, 130, 189, 0.12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding-top: 132px;
  color: var(--ink);
  background: linear-gradient(180deg, #e1f4f8 0, #f2f9fb 420px, #e7f4f8 100%);
  font-family: "DM Sans", sans-serif;
}
body.auth-pending { overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
button, select, input:not([type="checkbox"]):not([type="radio"]) { min-height: 44px; }
.access-screen { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); min-height: 100dvh; background: #eef9fc; }
.access-brand-panel { position: relative; min-height: 100dvh; overflow: hidden; background: #e1f4f8; }
.access-brand-panel::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(238,249,252,0) 70%, rgba(238,249,252,.9) 100%); }
.access-brand-panel img, .access-brand-panel p { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.access-card { align-self: center; width: min(480px, calc(100% - 64px)); margin: 32px auto; padding: 42px 38px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 24px 70px rgba(23,111,159,.16); }
.access-card h1 { margin: 14px 0 12px; font: 800 32px Manrope, sans-serif; color: #083f60; }
.access-card > p { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }
.access-card form { display: grid; gap: 17px; }
.access-card label { display: grid; gap: 7px; color: #083f60; font-size: 13px; font-weight: 700; }
.access-card input { width: 100%; height: 49px; padding: 0 14px; border: 1px solid #9acbea; border-radius: 10px; color: var(--ink); background: #fbfdfe; outline: none; }
.access-card input:focus { border-color: var(--navy-soft); box-shadow: 0 0 0 3px rgba(53,193,223,.16); }
.access-card button[type="submit"] { display: flex; justify-content: space-between; align-items: center; height: 51px; padding: 0 18px; border: 0; border-radius: 10px; color: white; background: var(--navy); font-weight: 700; }
.access-link { justify-self: start; padding: 0; border: 0; color: #0870ad; background: transparent; font-weight: 700; }
.access-card form[hidden] { display: none; }
.access-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.access-feedback { min-height: 20px; margin: 18px 0 0 !important; color: var(--danger) !important; font-size: 13px; }
.authenticated .access-screen { display: none; }
.auth-pending > .topbar, .auth-pending > .main-nav, .auth-pending > main, .auth-pending > footer { visibility: hidden; }

@media (min-width: 821px) and (max-width: 1280px) {
  .access-brand-panel { background: #e1f4f8 image-set(url("assets/login/acquanalise-login-1280.avif") type("image/avif"), url("assets/login/acquanalise-login-1280.webp") type("image/webp")) left center / cover no-repeat; }
}

@media (min-width: 1281px) and (max-width: 1799px) {
  .access-brand-panel { background: #e1f4f8 image-set(url("assets/login/acquanalise-login-1600.avif") type("image/avif"), url("assets/login/acquanalise-login-1600.webp") type("image/webp")) left center / cover no-repeat; }
}

@media (min-width: 1800px) {
  .access-brand-panel { background: #e1f4f8 image-set(url("assets/login/acquanalise-login-1920.avif") type("image/avif"), url("assets/login/acquanalise-login-1920.webp") type("image/webp")) left center / cover no-repeat; }
}

@media (max-width: 820px) {
  body.auth-pending { overflow: auto; }
  .access-screen { display: block; min-height: 100dvh; background: radial-gradient(circle at top left, rgba(35,199,207,.12), transparent 38%), #eef9fc; }
  .access-brand-panel { display: none; }
  .access-card { width: min(480px, calc(100% - 40px)); min-height: 100dvh; margin: 0 auto; padding: 56px 0 32px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
}

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  width: 100%; height: 78px;
  margin: 0;
  padding: 16px max(28px, calc((100vw - 1184px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #e1f4f8;
}
.brand { display: flex; align-items: center; color: var(--navy); text-decoration: none; }
.brand-logo { width: 226px; height: auto; display: block; object-fit: contain; }
.work-context { display: flex; align-items: center; gap: 18px; }
.connection-status { padding: 5px 8px; border-radius: 999px; color: #76531c; background: #fff1c9; font-size: 9px; font-weight: 700; }
.connection-status.online { color: #176b50; background: #dff5ec; }
.database-login { padding: 7px 10px; border: 1px solid #91c3e1; border-radius: 7px; color: var(--navy); background: white; font-size: 10px; font-weight: 700; }
.database-auth { margin: 8px 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: var(--shadow); }
.database-auth[hidden] { display: none; }
.database-auth form { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto auto; gap: 10px; align-items: center; }
.database-auth strong, .database-auth small { display: block; }
.database-auth small { color: var(--muted); font-size: 9px; }
.database-auth input, .database-auth button { height: 38px; padding: 0 10px; border: 1px solid #a8d1e8; border-radius: 7px; }
.database-auth button { color: white; background: var(--navy); font-weight: 700; }
.database-auth button:last-child { color: var(--navy); background: white; }
.work-context label, .work-context div { display: grid; gap: 2px; color: var(--muted); font-size: 10px; }
.work-context select { min-width: 180px; padding: 8px 10px; border: 1px solid #91c3e1; border-radius: 8px; color: var(--navy); background: white; font-weight: 700; }
.work-context strong { color: var(--navy); font-size: 12px; }
.work-context small { font-size: 9px; }
.organization-context { min-width: 150px; padding-right: 14px; border-right: 1px solid #b9dce9; }
.linked-client-context { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid #a8d1e8; border-radius: 10px; background: #eaf7fa; }
.linked-client-context small { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.linked-client-context strong { color: var(--navy); font: 700 15px Manrope,sans-serif; }
.analysis-fixed-context select:disabled { color: var(--navy); background: #eaf7fa; opacity: 1; }
.report-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.report-home-button { padding: 10px 14px; border: 1px solid #91c3e1; border-radius: 8px; color: var(--navy); background: white; font-weight: 700; }
.brand-mark {
  width: 46px; height: 46px; display: block;
}
.brand strong, .brand small { display: block; }
.brand strong { font: 800 18px Manrope, sans-serif; letter-spacing: -0.4px; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 1.3px; }
.ghost-button { padding: 10px 16px; border: 1px solid #91c3e1; border-radius: 9px; color: var(--navy); background: white; font-weight: 700; }
.ghost-button[hidden] { display: none; }
.ghost-button:disabled { opacity: .45; cursor: not-allowed; }
.ghost-button:hover { background: white; }

main { max-width: 1240px; margin: 0 auto; padding: 10px 28px 70px; }
.main-nav {
  position: fixed; top: 78px; left: 0; right: 0; z-index: 49;
  width: 100%; height: 54px; margin: 0; padding: 0 max(28px, calc((100vw - 1184px) / 2)) 10px;
  display: flex; gap: 6px; border-bottom: 1px solid rgba(90, 168, 214, .45);
  align-items: center; background: #e1f4f8;
}
.nav-button { padding: 10px 14px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 600; }
.nav-button:hover, .nav-button.active { color: var(--navy); background: rgba(255, 255, 255, .7); }
.nav-button.active { box-shadow: inset 0 -2px var(--aqua); }
.platform-admin-mode .main-nav { justify-content: center; }
.platform-admin-mode #activeOrganizationField { display: none; }
.platform-admin-mode main { max-width: 1180px; }
.app-view { display: none; }
.app-view.active { display: block; animation: view-in .25s ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; padding: 24px 0 30px; }
.page-heading h1 { max-width: 760px; margin: 8px 0 0; font-size: clamp(24px, 3.1vw, 38px); line-height: 1.08; letter-spacing: -1.5px; }
.page-heading p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.primary-button.compact { flex: 0 0 auto; min-width: 190px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 24px; }
.metric-card, .flow-card, .recent-card, .backup-card, .list-panel, .context-card {
  border: 1px solid rgba(168, 209, 232, .9); border-radius: 18px; background: rgba(255, 255, 255, .96); box-shadow: var(--shadow);
}
.metric-card { padding: 25px; }
.metric-card small { color: var(--muted); font-weight: 600; }
.metric-card strong { display: block; margin: 8px 0 14px; color: var(--navy); font: 800 38px Manrope, sans-serif; }
.metric-card button, .text-link { padding: 0; border: 0; color: var(--aqua-dark); background: none; font-size: 12px; font-weight: 700; }
.flow-card, .recent-card { margin-bottom: 24px; padding: 30px; }
.backup-card { margin-bottom: 24px; padding: 30px; }
.backup-card > p { margin: -14px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.backup-card > small { display: block; margin-top: 12px; color: var(--muted); }
.backup-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.backup-actions .primary-button { flex: 0 0 auto; }
.import-button { display: inline-flex; align-items: center; padding: 14px 18px; border: 1px solid var(--aqua-dark); border-radius: 10px; color: var(--aqua-dark); background: white; font-size: 13px; font-weight: 700; cursor: pointer; }
.import-button:hover { background: var(--sand); }
.import-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.flow-options { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.flow-options article { padding: 24px; border-radius: 13px; background: #edf7fa; }
.flow-options article > span { color: var(--aqua-dark); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.flow-options h3 { margin: 13px 0; color: var(--navy); font: 700 15px Manrope, sans-serif; }
.flow-options i { display: block; width: 1px; height: 13px; margin-left: 7px; background: #91c3e1; }
.management-grid { display: grid; grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr); gap: 24px; align-items: start; }
.administration-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 24px; align-items: start; }
.admin-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 24px; }
.admin-metrics[hidden] { display: none; }
.admin-metric { padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow); }
.admin-metric small { color: var(--muted); font-size: 10px; }
.admin-metric strong { display: block; margin-top: 5px; color: var(--navy); font: 800 25px Manrope,sans-serif; }
.admin-structure-panel { grid-column: 1 / -1; }
.admin-group { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f6fbfd; }
.admin-group + .admin-group { margin-top: 12px; }
.admin-group-header, .admin-store-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.admin-store-row { margin-top: 10px; padding: 12px; border-radius: 9px; background: white; }
.admin-section-tabs { display: flex; gap: 6px; margin: 0 0 22px; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.72); }
.admin-section-tabs button { padding: 10px 18px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-weight: 700; }
.admin-section-tabs button.active { color: white; background: var(--navy); }
.admin-linear-section { grid-column: 1 / -1; }
.admin-linear-section[hidden] { display: none; }
.admin-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.admin-section-heading h2 { margin: 0 0 4px; font: 800 22px Manrope,sans-serif; }
.admin-section-heading p { margin: 0; color: var(--muted); }
.delivery-sync-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: -8px 0 20px; }
.delivery-sync-panel article { padding: 15px 16px; border: 1px solid #b9dce8; border-radius: 12px; background: rgba(255,255,255,.78); box-shadow: 0 8px 24px rgba(23,111,159,.06); }
.delivery-sync-panel small { display: block; color: var(--aqua-dark); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .9px; }
.delivery-sync-panel strong { display: block; margin: 4px 0; color: var(--navy); font: 800 14px Manrope,sans-serif; }
.delivery-sync-panel span { display: block; color: var(--muted); font-size: 11px; line-height: 1.45; }
.admin-inline-form { max-width: none; margin: 0 0 22px; display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 14px 18px; align-items: end; }
.admin-inline-form .section-heading,
.admin-inline-form .field-wide,
.admin-inline-form > small { grid-column: 1 / -1; }
.admin-inline-form .primary-button { min-width: 0; }
.admin-inline-form .text-button { justify-self: start; }
.admin-entity-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; margin-bottom: 10px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 8px 24px rgba(23,111,159,.06); }
.admin-entity-row h3 { margin: 3px 0; }
.admin-entity-row p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.admin-entity-row small { color: var(--navy-soft); font-weight: 700; }
.product-base-row { align-items: flex-start; }
.product-rule-list { display: grid; gap: 8px; margin-top: 12px; }
.product-rule-item { padding: 10px 12px; border: 1px solid #d9edf4; border-radius: 10px; background: #f7fcfe; }
.product-rule-item > div { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.product-rule-item strong { color: var(--navy); font-size: 12px; }
.product-rule-item span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.product-rule-item p { margin-top: 4px; }
.admin-organization-tree { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: white; box-shadow: 0 8px 24px rgba(23,111,159,.06); }
.admin-organization-tree > .admin-entity-row { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.admin-tree-content { padding: 0 18px 18px; border-top: 1px solid var(--line); background: #f6fbfd; }
.admin-tree-content[hidden] { display: none; }
.admin-tree-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0 10px; }
.admin-tree-toolbar h4 { margin: 0; color: var(--navy); font: 700 14px Manrope,sans-serif; }
.admin-store-tree { margin-top: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.admin-store-tree-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.admin-manager-list { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.admin-manager-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.admin-manager-row + .admin-manager-row { border-top: 1px solid #e8f2f5; }
.status-badge { display: inline-block; padding: 4px 7px; border-radius: 999px; color: #176b50; background: #dff5ec; font-size: 9px; font-weight: 700; }
.status-badge.inactive { color: #8a3f3d; background: #f8dedd; }
.danger-button { padding: 7px 9px; border: 1px solid #e2b4b2; border-radius: 7px; color: var(--danger); background: white; font-size: 9px; font-weight: 700; }
.manager-store-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.manager-store-tabs[hidden] { display: none; }
.manager-store-tabs button { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; font-weight: 700; }
.manager-store-tabs button.active { color: var(--navy); border-color: var(--aqua); background: var(--sand); }
.small-panel { display: grid; gap: 17px; }
.small-panel .section-heading { margin-bottom: 4px; }
.small-panel .field input, .small-panel .field select { margin-top: 7px; }
.field input[readonly] { color: #56798c; background: #e1f4f8; cursor: default; }
.edit-cancel { justify-self: center; }
.list-panel { padding: 30px; min-height: 420px; }
.search-field { display: block; margin-bottom: 20px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.search-field input, .search-field select { width: 100%; height: 45px; margin-top: 7px; padding: 0 13px; border: 1px solid #a8d1e8; border-radius: 9px; color: var(--navy); background: white; outline: none; }
.search-field select:disabled { color: var(--navy); background: #e1f4f8; opacity: 1; cursor: default; }
.record-list, .history-list { display: grid; gap: 10px; }
.record-card, .history-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 11px; background: #f6fbfd; }
.record-card small, .history-card small { color: var(--aqua-dark); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; }
.record-card h3, .history-card h3 { margin: 4px 0; color: var(--navy); font: 700 15px Manrope, sans-serif; }
.record-card p, .history-card p { margin: 0; color: var(--muted); font-size: 11px; }
.record-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.record-actions button, .history-card button { padding: 8px 10px; border: 1px solid #c9dcda; border-radius: 7px; color: var(--navy); background: white; font-size: 10px; font-weight: 700; white-space: nowrap; }
.record-actions button:hover, .history-card button:hover { border-color: var(--aqua); }
.no-records { min-height: 150px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.no-records span { color: var(--aqua); font: 40px serif; }
.no-records p { margin: 5px; font-size: 12px; }
.context-card { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 18px; align-items: end; margin-bottom: 24px; padding: 22px; }
.consultation-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; padding: 13px 16px; border: 1px solid #91c3e1; border-radius: 10px; background: #e1f4f8; }
.consultation-banner[hidden] { display: none; }
.consultation-banner strong, .consultation-banner span { display: block; }
.consultation-banner strong { color: var(--navy); font-size: 13px; }
.consultation-banner span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.consultation-banner button { padding: 8px 11px; border: 1px solid var(--aqua-dark); border-radius: 7px; color: var(--aqua-dark); background: white; font-size: 10px; font-weight: 700; white-space: nowrap; }
.consultation-mode .field input:disabled, .consultation-mode .field select:disabled { color: #456b80; background: #edf7fa; opacity: 1; cursor: default; }

/* History mode: hide new-analysis UI, expand summary to full width */
#analysisView.history-mode .new-analysis-only,
#analysisView.history-mode .ops-page-header { display: none !important; }
#analysisView.history-mode .atd-layout { grid-template-columns: 1fr; }
#analysisView.history-mode .ops-card.analysis-summary-card {
  position: static;
  max-height: none;
  width: 100%;
  box-shadow: none;
  border: none;
}
.pool-context { min-height: 47px; padding: 9px 13px; border-radius: 9px; color: var(--muted); background: var(--mint); font-size: 12px; }
.pool-context strong, .pool-context span { display: block; }
.pool-context strong { color: var(--navy); font-size: 13px; }
.pool-context span { margin-top: 2px; }
.history-panel { min-height: 500px; }
.history-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.searchable-select { display: grid; gap: 10px; }
.history-select-field { margin-bottom: 0; }
.admin-product-filters { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)) auto; gap: 12px; align-items: end; margin: 0 0 18px; padding: 14px; border: 1px solid #cdebf2; border-radius: 8px; background: #f7fcfd; }
.admin-product-filters .field { margin: 0; }
.admin-product-filters .text-button { min-height: 46px; justify-content: center; }
.b2b2b-dashboard { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.b2b2b-dashboard:empty { display: none; }
.filter-summary { margin: 0 0 10px; color: #60767a; font-size: 12px; font-weight: 700; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 20; max-width: 330px; padding: 13px 17px; border-radius: 9px; color: white; background: var(--navy); box-shadow: var(--shadow); font-size: 12px; transform: translateY(25px); opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { transform: none; opacity: 1; }
.hero { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 70px; align-items: end; padding: 48px 0 62px; }
.eyebrow { color: var(--aqua-dark); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; }
h1 { max-width: 780px; margin: 14px 0 18px; color: var(--navy); font: 800 clamp(36px, 5vw, 62px)/1.04 Manrope, sans-serif; letter-spacing: -2.8px; }
.hero > div > p { max-width: 670px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.65; }
.hero-stat { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding-bottom: 8px; }
.hero-stat span { color: var(--aqua-dark); font: 700 12px Manrope, sans-serif; }
.hero-stat p { margin: 0; font: 700 14px Manrope, sans-serif; }
.hero-stat i { grid-column: 1; width: 1px; height: 18px; margin: 3px auto; background: #a9d9d4; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr); gap: 24px; align-items: start; }
.form-panel, .summary-panel { border: 1px solid rgba(168, 209, 232, 0.9); border-radius: 18px; background: rgba(255, 255, 255, 0.96); box-shadow: var(--shadow); }
.form-panel { padding: 34px; }
.summary-panel { position: sticky; top: 20px; min-height: 500px; overflow: hidden; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.section-heading > div { display: flex; align-items: center; gap: 12px; }
.step { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: white; background: var(--navy); font-size: 11px; font-weight: 700; }
h2 { margin: 0; color: var(--navy); font: 750 22px Manrope, sans-serif; letter-spacing: -0.6px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
fieldset { margin: 0 0 30px; padding: 0; border: 0; }
legend { width: 100%; margin-bottom: 17px; padding-bottom: 9px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.measurements { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-wide { grid-column: span 2; }
.measurements .field-wide { grid-column: span 2; }
.field { color: var(--ink); font-size: 13px; font-weight: 600; display: grid; gap: 0.35rem; }
.field-toggle { grid-template-columns: minmax(0, 1fr); }
.field-inline-control { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.78rem; color: #6d8798; margin-bottom: 0.15rem; font-weight: 500; }
.field-inline-control input[type="checkbox"] { transform: scale(0.9); accent-color: #8fb8d9; }
.field input, .field select {
  width: 100%; height: 47px; margin-top: 8px; padding: 0 13px;
  border: 1px solid #a8d1e8; border-radius: 9px; outline: none; color: var(--navy); background: white;
}
.field input:focus, .field select:focus { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(53, 193, 223, 0.16); }
.field textarea { width: 100%; margin-top: 8px; padding: 12px 13px; border: 1px solid #a8d1e8; border-radius: 9px; outline: none; color: var(--navy); background: white; resize: vertical; }
.field textarea:focus { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(53, 193, 223, 0.16); }
.technical-record { margin-top: 8px; padding-top: 4px; }
.technical-record .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.equipment-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.equipment-options label { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #f6fbfd; font-size: 11px; font-weight: 600; }
.equipment-options input { width: auto; height: auto; margin: 0 5px 0 0; }
.checkbox-field { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f6fbfd; }
.checkbox-field input { width: auto; height: auto; margin: 0; }
.technical-summary { margin-top: 5px; color: var(--muted); font-size: 10px; }
.validation-note { margin: 14px 0; padding: 11px 13px; border-left: 3px solid var(--warning); border-radius: 6px; background: #fff8e8; color: #76531c; font-size: 11px; }
.field select:disabled { color: #7190a0; background: #edf7fa; cursor: not-allowed; }
.field small { display: block; margin-top: 5px; color: #8a9b9f; font-weight: 400; }
.input-unit { position: relative; display: block; }
.input-unit input { padding-right: 48px; }
.input-unit > span { position: absolute; right: 13px; top: 23px; color: #87999c; font-size: 11px; font-weight: 600; }
.input-unit.measurement-select select { padding-right: 76px; }
.input-unit.measurement-select > span { right: 38px; pointer-events: none; }
.analysis-parameter-grid { align-items: stretch; }
.analysis-parameter-card {
  min-width: 0;
  min-height: 126px;
  padding: 15px;
  border: 1px solid #c3e0ec;
  border-radius: 12px;
  background: #f9fdfe;
}
.analysis-primary-grid .analysis-parameter-card { min-height: 142px; }
.analysis-parameter-card > select,
.analysis-parameter-card > .input-unit { margin-top: auto; }
.analysis-parameter-card > small { margin-top: 7px; }
.analysis-primary-grid .analysis-parameter-card > select,
.analysis-primary-grid .analysis-parameter-card > .input-unit { margin-top: 8px; }
.analysis-parameter-title { color: var(--ink); font-weight: 600; }
.analysis-parameter-card .field-inline-control {
  justify-content: space-between;
  flex-direction: row-reverse;
  width: 100%;
  margin: 3px 0 11px;
  color: var(--muted);
  font-size: 10px;
}
.analysis-parameter-card .field-inline-control input[type="checkbox"] {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 34px;
  margin: 0;
  appearance: none;
  transform: none;
  border: 1px solid #a8d1e8;
  border-radius: 999px;
  background: #e7f3f7;
  cursor: pointer;
}
.analysis-parameter-card .field-inline-control input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(23,111,159,.22);
  transition: transform .16s ease;
}
.analysis-parameter-card .field-inline-control input[type="checkbox"]:checked { border-color: var(--aqua-dark); background: var(--aqua-dark); }
.analysis-parameter-card .field-inline-control input[type="checkbox"]:checked::after { transform: translateX(14px); }
.analysis-parameter-card .field-inline-control input[type="checkbox"]:focus-visible { outline: 3px solid rgba(53,193,223,.2); outline-offset: 2px; }
.analysis-parameter-card .field-inline-control input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .55; }
.analysis-parameter-card.is-not-measured { min-height: 102px; }
.analysis-parameter-card.is-not-measured .input-unit { display: none; }
.analysis-parameter-card .field-inline-control > span { font-size: 0; }
.analysis-parameter-card .field-inline-control > span::before {
  content: "Não medido";
  font-size: 10px;
}
.analysis-parameter-card.is-measured .field-inline-control > span::before {
  content: "Medição adicionada";
}
.analysis-primary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.analysis-complementary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.analysis-primary-section,
.analysis-complementary-section { margin-bottom: 28px; }
.form-actions { display: flex; align-items: center; gap: 20px; padding-top: 4px; }
.form-actions[hidden] { display: none; }
.primary-button { flex: 1; display: flex; justify-content: space-between; padding: 15px 18px; border: 0; border-radius: 10px; color: white; background: var(--navy); font-weight: 700; transition: transform .2s, background .2s; }
.primary-button:hover { background: var(--navy-soft); transform: translateY(-1px); }
.primary-button span { color: #a8e5f1; font-size: 20px; line-height: 15px; }
.text-button { border: 0; border-bottom: 1px solid #a5b5b8; color: var(--muted); background: none; font-size: 12px; }

.empty-state { min-height: 500px; padding: 60px 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.water-icon { display: grid; place-items: center; width: 70px; height: 70px; margin-bottom: 25px; border-radius: 50%; color: var(--aqua); background: var(--mint); font: 500 42px/1 serif; }
.empty-state h2 { max-width: 260px; font-size: 20px; }
.empty-state p { max-width: 280px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.result-header { padding: 28px; color: white; background: var(--navy); }
.client-report-header { background: linear-gradient(135deg, var(--report-primary, var(--navy)), var(--report-secondary, var(--aqua-dark))); }
.client-report-brand { display: flex; align-items: center; gap: 14px; }
.client-report-brand img { max-width: 132px; max-height: 52px; object-fit: contain; padding: 6px; border-radius: 6px; background: white; }
.client-report-brand.without-logo { gap: 0; }
.result-header .eyebrow { color: #a8e5f1; }
.client-report-header .eyebrow { color: color-mix(in srgb, var(--report-accent, #35C1DF) 65%, white); }
.result-header h2 { margin: 7px 0 4px; color: white; font-size: 26px; }
.result-header p { margin: 0; color: #d8f2f7; font-size: 12px; }
.client-report-header h2 { color: #ffffff !important; text-shadow: 0 1px 2px rgba(0,0,0,.18); }
.client-report-header p { color: #eefaff !important; }
.client-report-header .eyebrow { font-weight: 800; }
.result-body { padding: 25px 28px 30px; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 24px; }
.decision-summary { display: grid; gap: 8px; margin-bottom: 18px; }
.decision-summary > div { padding: 11px 13px; border-left: 3px solid var(--aqua); border-radius: 5px 9px 9px 5px; background: #edf7fa; }
.decision-summary small, .decision-summary span { display: block; color: var(--muted); font-size: 9px; }
.decision-summary small { text-transform: uppercase; letter-spacing: .8px; }
.decision-summary strong { display: block; margin: 2px 0; color: var(--navy); font-size: 12px; }
.status { padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #f6fbfd; }
.status small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .7px; }
.status strong { display: block; margin-top: 3px; font-size: 13px; }
.status.ideal strong { color: var(--aqua-dark); }
.status.alert strong { color: var(--warning); }
.lsi-card { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding: 15px; border-radius: 10px; background: var(--mint); }
.lsi-card small, .lsi-card span { display: block; color: #527876; font-size: 10px; }
.lsi-card strong { color: var(--navy); font: 800 27px Manrope, sans-serif; }
.lsi-card .lsi-label { max-width: 150px; text-align: right; font-weight: 600; }
.treatment h3 { margin: 0 0 14px; color: var(--navy); font: 750 15px Manrope, sans-serif; }
.treatment ol { list-style: none; margin: 0; padding: 0; counter-reset: treatment; }
.treatment li { position: relative; min-height: 40px; padding: 0 0 18px 42px; color: #496168; font-size: 12px; line-height: 1.5; counter-increment: treatment; }
.treatment li::before { content: counter(treatment); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; color: var(--navy); background: var(--mint); font-size: 10px; font-weight: 700; }
.treatment li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 28px; bottom: 2px; width: 1px; background: #c8e4e1; }
.treatment li.plan-info { min-height: 0; margin: -6px 0 14px 42px; padding: 9px 11px; border-left: 3px solid #91c3e1; border-radius: 7px; color: #456b80; background: #edf7fa; counter-increment: none; }
.treatment li.plan-info::before { content: "Info"; position: static; display: inline-block; width: auto; height: auto; margin: 0 6px 0 0; padding: 2px 6px; border-radius: 999px; color: var(--aqua-dark); background: white; font-size: 8px; text-transform: uppercase; }
.treatment li.plan-info::after { display: none; }
.plan-info-note { display: block; margin-top: 6px; padding: 7px 9px; border-left: 3px solid #91c3e1; border-radius: 5px; color: #456b80; background: #edf7fa; font-size: 11px; line-height: 1.4; }
.plan-info-note::before { content: "Info"; display: inline-block; margin: 0 6px 0 0; padding: 2px 5px; border-radius: 999px; color: var(--aqua-dark); background: white; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.plan-commercial-note { display: block; margin-top: 6px; padding: 7px 9px; border-left: 3px solid var(--aqua); border-radius: 5px; color: #2d5668; background: #f0fafd; font-size: 11px; line-height: 1.4; }
.plan-commercial-note::before { content: "Produto"; display: inline-block; margin: 0 6px 0 0; padding: 2px 5px; border-radius: 999px; color: white; background: var(--aqua-dark); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.plan-commercial-note strong { display: block; font-size: 11px; color: var(--navy); margin-bottom: 1px; }
.plan-commercial-note span { display: block; color: #496168; }
.plan-commercial-note .commercial-substitute-button { display: inline-block; margin-top: 4px; font-size: 10px; }
.plan-commercial-pending { border-left-color: #b0bec5; background: #f5f7f8; }
.plan-commercial-pending::before { background: #78909c; }
.plan-commercial-pending strong { color: #455a64; }
.salt-recommendation { margin-top: 10px; padding: 12px 13px; border: 1px solid #a8d1e8; border-left: 3px solid var(--aqua-dark); border-radius: 8px; background: #edf7fa; color: #496168; font-size: 11px; line-height: 1.45; }
.salt-recommendation h3 { margin: 0 0 6px; color: var(--navy); font: 750 13px Manrope, sans-serif; }
.salt-recommendation p { margin: 0; }
.salt-recommendation p + p { margin-top: 5px; }
.commercial-recommendations { margin-top: 10px; padding: 12px 13px; border: 1px solid #b9dce8; border-left: 3px solid var(--aqua); border-radius: 8px; background: #f5fbfd; color: #496168; font-size: 11px; line-height: 1.45; }
.commercial-recommendations h3 { margin: 0 0 6px; color: var(--navy); font: 750 13px Manrope, sans-serif; }
.commercial-recommendations p { margin: 0 0 8px; }
.commercial-recommendations .commercial-missing { margin: 0 0 8px; padding: 8px 10px; border: 1px solid #f0c27b; border-left: 3px solid #d39a4c; border-radius: 7px; background: #fff8e9; color: #76582f; }
.commercial-recommendations ol { margin: 0; padding-left: 18px; }
.commercial-recommendations li { margin: 0 0 7px; }
.commercial-recommendations li:last-child { margin-bottom: 0; }
.commercial-recommendations strong, .commercial-recommendations span, .commercial-recommendations small { display: block; }
.commercial-recommendations small { color: #668088; }
/* Lista de produtos comerciais selecionados (cr = commercial recommendations) */
.cr-list { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; }
.cr-item { color: #496168; font-size: 11px; line-height: 1.5; }
.cr-item:not(:last-child) { padding-bottom: 14px; border-bottom: 1px solid #d5eaf3; }
.cr-action-name { display: block; font: 700 12px Manrope, sans-serif; color: var(--navy); margin-bottom: 2px; }
.cr-product-name { margin: 0 0 3px; font-size: 11.5px; color: #1c4a5a; }
.cr-row { margin: 2px 0; color: #496168; }
.cr-dosage-highlight { color: var(--aqua-dark); margin-top: 4px; }
.commercial-substitute-button { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--aqua-dark); background: none; border: none; cursor: pointer; padding: 0; text-decoration: underline; }
.commercial-substitute-button:hover { color: var(--navy); }
/* Tela 1: diálogo de orientação técnica */
.technical-diagnosis-overview { margin: 16px 0; padding: 16px; border: 1px solid #a8d1e8; border-left: 4px solid var(--aqua-dark); border-radius: 8px; background: #f8fbfd; }
.technical-diagnosis-overview h3 { margin: 0 0 10px; font: 700 14px Manrope, sans-serif; color: var(--navy); }
.ta-overview-intro { font-size: 12px; color: #344f56; margin: 0 0 12px; line-height: 1.5; }
.ta-overview-list { margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ta-overview-item { list-style: none; padding: 10px 12px; background: white; border-radius: 6px; border: 1px solid #daedf7; }
.ta-overview-action { display: block; font-size: 12px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.ta-overview-problem { display: block; font-size: 11px; color: #456b80; margin-bottom: 3px; }
.ta-overview-justification { display: block; font-size: 11px; color: #668088; font-style: italic; margin-bottom: 3px; }
.ta-overview-step { display: block; font-size: 10px; color: #8aacb5; margin-top: 4px; }
.ta-overview-note { font-size: 11px; color: #668088; margin: 0 0 14px; line-height: 1.45; padding: 8px; background: #eef7fb; border-radius: 4px; }
.ta-overview-actions { display: flex; justify-content: flex-end; }
.ta-advance-button { padding: 8px 18px; font: 600 13px Manrope, sans-serif; background: var(--aqua-dark); color: white; border: none; border-radius: 6px; cursor: pointer; }
.ta-advance-button:hover { opacity: 0.9; }
.technical-action-card { list-style: none; }
.technical-action-card .technical-action { padding: 12px; border: 1px solid #a8d1e8; border-radius: 8px; background: #f8fbfd; }
.technical-action-card.with-product .technical-action { border-color: #6bb6d6; background: #f0f9fc; }
/* Estado 1: aguardando seleção */
.technical-action-card.state-pending .technical-action { border-color: #a8d1e8; background: #f8fbfd; }
/* Estado 1b: sem produto no portfólio */
.technical-action-card.state-unavailable .technical-action { border-color: #e0c9a0; background: #fdfaf5; }
/* Estado 3+4: produto selecionado */
.technical-action-card.state-selected .technical-action { border-color: #6bb6d6; background: #f0f9fc; border-left: 3px solid var(--aqua-dark); }
/* Estrutura interna do card */
.technical-actions-list { padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.ta-header { margin-bottom: 10px; }
.ta-action-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: #668088; margin-bottom: 2px; }
.ta-action-name { display: block; font-size: 13px; font-weight: 700; color: var(--navy); }
.ta-row { margin: 4px 0; font-size: 11px; color: #456b80; }
.ta-label { font-weight: 600; color: #344f56; }
.ta-value { color: #1c4a5a; }
.ta-highlight { color: #1b5e20; background: #e8f5e9; padding: 4px 8px; border-radius: 4px; }
.ta-highlight .ta-label { color: #2e7d32; }
.ta-product { color: #1c4a5a; font-size: 12px; }
.ta-pending-hint { font-size: 11px; color: #668088; font-style: italic; margin: 10px 0 8px; }
.ta-select-btn { display: inline-block; margin-top: 4px; padding: 6px 12px; font-size: 12px; font-weight: 600; background: var(--aqua-dark); color: white; border: none; border-radius: 6px; cursor: pointer; }
.ta-select-btn:hover { opacity: 0.9; }
.commercial-select-button { margin-top: 8px; }
.commercial-substitute-button { margin-left: 8px; }
.actions-summary { margin: 16px 0; padding: 12px; border: 1px solid #d1e5f0; border-left: 3px solid var(--aqua); border-radius: 8px; background: #f8fbfd; }
.actions-summary h4 { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--navy); }
.actions-summary-list { display: flex; flex-direction: column; gap: 8px; }
.action-summary-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; background: white; border-radius: 6px; border: 1px solid #e8f2f7; font-size: 12px; }
.action-summary-item strong { color: var(--navy); flex: 1; }
.action-status { display: inline-block; font-size: 11px; padding: 4px 8px; border-radius: 4px; white-space: nowrap; margin-left: 12px; }
.status-with-product { background: #e8f5e9; color: #2e7d32; }
.status-without-product { background: #fff3e0; color: #e65100; }
.commercial-substitute-button { margin-top: 4px; padding: 0; font-size: 10px; }
.client-report-note { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--aqua-dark); border-radius: 8px; background: #f5fbfd; color: #496168; font-size: 10px; line-height: 1.45; }
.client-report-note p { margin: 0; }
.client-report-note p + p { margin-top: 5px; }
.result-warning { margin-top: 7px; padding: 12px; border-left: 3px solid #d39a4c; color: #76582f; background: #fff8e9; font-size: 11px; line-height: 1.5; }
.report-disclaimer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.report-disclaimer h3 { margin: 0 0 8px; color: var(--navy); font: 750 13px Manrope, sans-serif; }
.report-disclaimer ul { display: grid; gap: 5px; margin: 0; padding-left: 17px; }
.report-disclaimer li { color: #60757a; font-size: 9px; line-height: 1.4; }
.report-disclaimer strong { color: #344f56; }
.report-verification-block { margin-top: 12px; }
.report-verification { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border: 1px solid #91c3e1; border-radius: 8px 8px 0 0; color: #456b80; background: #e1f4f8; font-size: 10px; line-height: 1.4; cursor: pointer; }
.report-verification input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--aqua-dark); }
.report-verification strong { display: block; color: var(--navy); }
.report-print-button { width: 100%; padding: 12px 16px; border: 0; border-radius: 0 0 8px 8px; color: white; background: linear-gradient(90deg, #1882bd, #35c1df); font-weight: 700; transition: opacity .2s, filter .2s; }
.report-print-button:not(:disabled):hover { filter: brightness(.95); }
.report-print-button:disabled { opacity: .42; }
.thermal-report-button { padding: 12px 16px; border: 1px solid #1882bd; border-radius: 8px; color: #176f9f; background: white; font-weight: 700; transition: background .2s, color .2s; }
.thermal-report-button:not(:disabled):hover { color: white; background: #1882bd; }
.thermal-report-button:disabled { opacity: .42; cursor: not-allowed; }
.print-confirmation { display: none; }
.technical-note { max-width: 720px; margin: 24px auto 0; color: #788b8e; text-align: center; font-size: 11px; line-height: 1.5; }
footer { display: flex; justify-content: space-between; padding: 25px max(28px, calc((100vw - 1184px)/2)); color: #b9ced1; background: var(--navy); font-size: 11px; }
footer span { color: white; font: 700 14px Manrope, sans-serif; }
footer p { margin: 0; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 30px; }
  .hero-stat { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .summary-panel { position: static; }
  .management-grid { grid-template-columns: 1fr; }
  .administration-grid { grid-template-columns: 1fr; }
  .delivery-sync-panel { grid-template-columns: 1fr; }
  .admin-metrics { grid-template-columns: 1fr 1fr; }
  .context-card { grid-template-columns: 1fr 1fr; }
  .pool-context { grid-column: span 2; }
}
@media (max-width: 620px) {
  .admin-section-tabs { overflow-x: auto; }
  .admin-section-tabs button { white-space: nowrap; }
  .admin-section-heading, .admin-entity-row { align-items: stretch; grid-template-columns: 1fr; flex-direction: column; }
  .admin-section-heading .primary-button { width: 100%; }
  .admin-inline-form { grid-template-columns: 1fr; }
  body { padding-top: 120px; }
  .topbar { height: 68px; padding: 11px 16px; }
  .brand-logo { width: 155px; }
  .work-context { gap: 8px; }
  .work-context select { min-width: 120px; max-width: 145px; font-size: 10px; }
  .work-context div { display: none; }
  .connection-status { display: none; }
  .database-auth form { grid-template-columns: 1fr; }
  .ghost-button { padding: 8px 10px; font-size: 10px; }
  .main-nav { top: 68px; height: 52px; padding: 0 16px 8px; overflow-x: auto; }
  .nav-button { white-space: nowrap; }
  main { padding: 8px 16px 50px; }
  .page-heading { align-items: stretch; flex-direction: column; padding: 20px 0 24px; }
  .page-heading h1 { font-size: 26px; letter-spacing: -.8px; }
  .metric-grid, .flow-options, .history-filters, .admin-product-filters, .b2b2b-dashboard, .context-card { grid-template-columns: 1fr; }
  .pool-context { grid-column: auto; }
  .record-card, .history-card { align-items: stretch; flex-direction: column; }
  .consultation-banner { align-items: stretch; flex-direction: column; }
  .record-actions { justify-content: start; }
  .list-panel, .flow-card, .recent-card { padding: 22px 18px; }
  .hero { padding: 35px 0 42px; }
  h1 { font-size: 38px; letter-spacing: -1.8px; }
  .form-panel { padding: 24px 18px; }
  .section-heading { align-items: flex-start; }
  .section-heading > p { display: none; }
  .field-grid, .measurements { grid-template-columns: 1fr; }
  .field-wide, .measurements .field-wide { grid-column: auto; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .text-button { align-self: center; }
}
/* UX/UI refinement layer */
:root {
  --shadow-sm: 0 8px 24px rgba(23,111,159,.08);
  --shadow-md: 0 16px 42px rgba(23,111,159,.13);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 20px;
}
button, input, select, textarea { transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease, transform .18s ease; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(53,193,223,.35); outline-offset: 2px; }
.topbar { border-bottom: 1px solid rgba(168,209,232,.55); background: rgba(225,244,248,.94); backdrop-filter: blur(16px); }
.work-context { gap: 14px; }
main { padding-top: 18px; }
.page-heading { padding: 26px 0 28px; }
.metric-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.metric-card:hover { transform: translateY(-2px); border-color: #92cae4; box-shadow: var(--shadow-md); }
.form-panel:focus-within { border-color: rgba(53,193,223,.8); box-shadow: var(--shadow-md); }
.field input, .field select, .field textarea { border-radius: 10px; background: #fcfeff; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #82bfdd; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy-soft); box-shadow: 0 0 0 3px rgba(53,193,223,.13); }
.record-card, .history-card { padding: 18px 20px; border-radius: 13px; background: #f8fcfd; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.record-card:hover, .history-card:hover { transform: translateY(-1px); border-color: #9bcde5; background: white; box-shadow: var(--shadow-sm); }
.primary-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(23,111,159,.2); }
.ghost-button:hover:not(:disabled), .record-actions button:hover:not(:disabled) { border-color: var(--navy-soft); background: #f3fbfd; }
.toast { min-width: 260px; border-left: 4px solid var(--aqua); border-radius: 12px; box-shadow: var(--shadow-md); }
@media (max-width: 800px) {
  .organization-context { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Aqua Futuristic Analytics */
:root {
  --aqua-bg: #061923;
  --aqua-bg-2: #071f2a;
  --aqua-surface: rgba(255,255,255,0.06);
  --aqua-surface-strong: rgba(255,255,255,0.1);
  --aqua-border: rgba(120,255,235,0.18);
  --aqua-primary: #20e7d6;
  --aqua-secondary: #3a8dff;
  --aqua-warning: #ffb84d;
  --aqua-danger: #ff5f6d;
  --aqua-text: #eafbff;
  --aqua-text-soft: #8fb6c1;
  --aqua-glow: 0 18px 50px rgba(32,231,214,.12);
}

body:not(.auth-pending) {
  padding-top: 0;
  padding-left: 260px;
  color: var(--aqua-text);
  background:
    radial-gradient(circle at 18% 0%, rgba(32,231,214,.14), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(58,141,255,.18), transparent 30%),
    linear-gradient(135deg, var(--aqua-bg), var(--aqua-bg-2) 48%, #031117);
}

body:not(.auth-pending)::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(120,255,235,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,255,235,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.75), transparent 75%);
}

body:not(.auth-pending) .topbar {
  left: 260px;
  right: 0;
  width: auto;
  height: 82px;
  padding: 14px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, max-content);
  gap: 14px;
  overflow: hidden;
  border-bottom: 1px solid var(--aqua-border);
  background: rgba(6,25,35,.78);
  backdrop-filter: blur(18px);
}

body:not(.auth-pending) .brand { display: none; }
.aqua-topbar-tools { min-width: 0; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(132px, auto); gap: 12px; align-items: center; }
.aqua-page-title small, .aqua-period span { display: block; color: var(--aqua-text-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .9px; }
.aqua-page-title strong { display: block; margin-top: 2px; color: var(--aqua-text); font: 800 20px Manrope,sans-serif; }
.aqua-search input, .aqua-period select {
  width: 100%; height: 42px; margin-top: 4px; padding: 0 13px;
  border: 1px solid var(--aqua-border); border-radius: 10px;
  color: var(--aqua-text); background: rgba(255,255,255,.07); outline: none;
}
.aqua-search input::placeholder { color: rgba(143,182,193,.74); }
.aqua-search input:focus, .aqua-period select:focus { border-color: var(--aqua-primary); box-shadow: 0 0 0 3px rgba(32,231,214,.16); }
.aqua-notification {
  width: 42px; height: 42px; border: 1px solid var(--aqua-border); border-radius: 12px;
  color: var(--aqua-primary); background: rgba(255,255,255,.07); font-size: 26px; line-height: 1;
}
.aqua-new-analysis { min-width: 152px; background: linear-gradient(135deg, var(--aqua-primary), var(--aqua-secondary)); color: #021114; }

body:not(.auth-pending) .work-context { min-width: 0; display: flex; justify-content: flex-end; color: var(--aqua-text-soft); overflow: hidden; }
body:not(.auth-pending) .work-context label,
body:not(.auth-pending) .work-context div { color: var(--aqua-text-soft); }
body:not(.auth-pending) .work-context strong { color: var(--aqua-text); }
body:not(.auth-pending) .work-context select,
body:not(.auth-pending) .database-login {
  border-color: var(--aqua-border); color: var(--aqua-text); background: rgba(255,255,255,.07);
}
body:not(.auth-pending) #activeStoreField {
  display: grid;
  min-width: 220px;
  order: -1;
}
body:not(.auth-pending) #activeStoreSelect {
  width: 260px;
  min-width: 220px;
  max-width: 260px;
}
body:not(.auth-pending) .connection-status.online { color: #07251f; background: var(--aqua-primary); }

body:not(.auth-pending) .main-nav {
  top: 0; right: auto; bottom: 0; left: 0;
  width: 260px; height: 100vh; padding: 24px 18px;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  border-right: 1px solid var(--aqua-border); border-bottom: 0;
  background: linear-gradient(180deg, rgba(3,17,23,.96), rgba(6,25,35,.88));
  box-shadow: 18px 0 60px rgba(0,0,0,.18);
}
body:not(.auth-pending) .main-nav::before {
  content: "Acquanalise";
  display: block; margin: 0 0 18px; color: var(--aqua-text);
  font: 800 25px Manrope,sans-serif; letter-spacing: -.5px;
}
.sidebar-toggle {
  align-self: flex-end; display: inline-grid; place-items: center; width: 30px; height: 30px;
  margin: -8px -4px 4px 0; border: 1px solid #a8d1e8; border-radius: 8px;
  color: var(--navy); background: rgba(255,255,255,.8); font-size: 16px; font-weight: 800; cursor: pointer;
}
.sidebar-toggle:hover, .sidebar-toggle:focus-visible { color: white; background: var(--aqua-dark); outline: 0; box-shadow: 0 0 0 3px rgba(24,130,189,.18); }
.sidebar-logo { display: block; width: 185px; height: auto; max-height: 42px; margin: 0 0 16px; object-fit: contain; object-position: left center; }
.nav-system-status {
  display: flex; align-items: center; gap: 9px; margin-bottom: 16px; padding: 10px 12px;
  border: 1px solid var(--aqua-border); border-radius: 12px; color: var(--aqua-text-soft); background: rgba(255,255,255,.055);
}
.nav-system-status span, .status-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--aqua-primary); box-shadow: 0 0 15px rgba(32,231,214,.8);
}
.nav-system-status strong { color: var(--aqua-text); font-size: 12px; }
body:not(.auth-pending) .nav-button {
  width: 100%; min-height: 44px; padding: 0 14px; text-align: left;
  border: 1px solid transparent; border-radius: 12px; color: var(--aqua-text-soft); background: transparent;
}
body:not(.auth-pending) .nav-button:hover:not(:disabled),
body:not(.auth-pending) .nav-button.active {
  color: var(--aqua-text); border-color: var(--aqua-border); background: linear-gradient(135deg, rgba(32,231,214,.13), rgba(58,141,255,.08)); box-shadow: var(--aqua-glow);
}
body:not(.auth-pending) .nav-button.active { box-shadow: inset 3px 0 var(--aqua-primary), var(--aqua-glow); }
.nav-muted { opacity: .58; }
.nav-user-card {
  margin-top: auto; padding: 14px; border: 1px solid var(--aqua-border); border-radius: 14px;
  background: rgba(255,255,255,.055); color: var(--aqua-text-soft);
}
.nav-user-card small, .nav-user-card span { display: block; font-size: 10px; }
.nav-user-card strong { display: block; margin: 3px 0; color: var(--aqua-text); font-size: 13px; }
.sidebar-logout {
  width: 100%;
  min-height: 38px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid #91c3e1;
  border-radius: 9px;
  color: var(--navy);
  background: #ffffff;
  font-size: 11px;
  font-weight: 800;
}
.sidebar-logout:hover {
  border-color: var(--aqua);
  background: #edf7fa;
}

body:not(.auth-pending) main { max-width: none; padding: 106px 30px 70px; }
body:not(.auth-pending) footer { display: none; }
body:not(.auth-pending) .page-heading h1,
body:not(.auth-pending) h1,
body:not(.auth-pending) h2,
body:not(.auth-pending) h3 { color: var(--aqua-text); letter-spacing: 0; }
body:not(.auth-pending) .page-heading p,
body:not(.auth-pending) .technical-note,
body:not(.auth-pending) .field small { color: var(--aqua-text-soft); }

body.sidebar-collapsed:not(.auth-pending) { padding-left: 78px; }
body.sidebar-collapsed:not(.auth-pending) .topbar { left: 78px; }
body.sidebar-collapsed:not(.auth-pending) .main-nav { width: 78px; padding: 18px 10px; }
body.sidebar-collapsed:not(.auth-pending) .main-nav::before { content: none; }
body.sidebar-collapsed:not(.auth-pending) .sidebar-logo { width: 42px; height: 42px; margin: 0 auto 16px; object-fit: contain; object-position: center; }
body.sidebar-collapsed:not(.auth-pending) .sidebar-toggle { align-self: center; margin: -2px 0 8px; }
body.sidebar-collapsed:not(.auth-pending) .nav-system-status { justify-content: center; padding: 10px 0; }
body.sidebar-collapsed:not(.auth-pending) .nav-system-status strong,
body.sidebar-collapsed:not(.auth-pending) .nav-user-card small,
body.sidebar-collapsed:not(.auth-pending) .nav-user-card strong,
body.sidebar-collapsed:not(.auth-pending) .nav-user-card span { display: none; }
body.sidebar-collapsed:not(.auth-pending) .nav-button { padding: 0; text-align: center; font-size: 0; }
body.sidebar-collapsed:not(.auth-pending) .nav-button::before { content: attr(data-icon); font-size: 18px; font-weight: 800; }
body.sidebar-collapsed:not(.auth-pending) .nav-user-card { padding: 10px 8px; text-align: center; }
body.sidebar-collapsed:not(.auth-pending) .sidebar-logout { margin-top: 0; padding: 8px 0; font-size: 0; }
body.sidebar-collapsed:not(.auth-pending) .sidebar-logout::before { content: "↪"; font-size: 16px; }

@media (max-width: 1100px) {
  .sidebar-toggle { display: none; }
  body.sidebar-collapsed:not(.auth-pending) { padding-left: 0; }
  body.sidebar-collapsed:not(.auth-pending) .topbar { left: 0; }
  body.sidebar-collapsed:not(.auth-pending) .main-nav { width: 100%; padding: 10px 16px; }
  body.sidebar-collapsed:not(.auth-pending) .main-nav::before { display: none; }
  .sidebar-logo { display: none; }
  body.sidebar-collapsed:not(.auth-pending) .nav-button { padding: 10px 14px; text-align: center; font-size: 13px; }
  body.sidebar-collapsed:not(.auth-pending) .nav-button::before { display: none; }
}

@media (max-width: 700px) {
  body:not(.auth-pending) .topbar {
    position: sticky; left: 0; height: auto; min-height: 0; padding: 10px 14px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; overflow: visible;
  }
  .aqua-topbar-tools { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
  .aqua-page-title small { font-size: 8px; white-space: nowrap; }
  .aqua-page-title strong { margin-top: 1px; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .aqua-new-analysis { min-width: 142px; width: auto; min-height: 42px; padding: 0 14px; }
  body:not(.auth-pending) .work-context { grid-column: 1 / -1; display: block; overflow: visible; }
  body:not(.auth-pending) #activeStoreField { display: grid; min-width: 0; width: 100%; order: 0; }
  body:not(.auth-pending) #activeStoreSelect { width: 100%; min-width: 0; max-width: none; height: 40px; }
  body:not(.auth-pending) .connection-status,
  body:not(.auth-pending) #activeOrganizationField,
  body:not(.auth-pending) .work-context > div:last-child { display: none; }
  body:not(.auth-pending) .main-nav { position: sticky; top: 0; z-index: 49; }
}
body:not(.auth-pending) .eyebrow { color: var(--aqua-primary); }

body:not(.auth-pending) .metric-card,
body:not(.auth-pending) .flow-card,
body:not(.auth-pending) .recent-card,
body:not(.auth-pending) .backup-card,
body:not(.auth-pending) .list-panel,
body:not(.auth-pending) .context-card,
body:not(.auth-pending) .form-panel,
body:not(.auth-pending) .summary-panel,
body:not(.auth-pending) .admin-group,
body:not(.auth-pending) .admin-entity-row,
body:not(.auth-pending) .admin-organization-tree,
body:not(.auth-pending) .admin-store-tree {
  border-color: var(--aqua-border);
  background: var(--aqua-surface);
  box-shadow: var(--aqua-glow);
  backdrop-filter: blur(16px);
}
body:not(.auth-pending) .metric-card:hover,
body:not(.auth-pending) .record-card:hover,
body:not(.auth-pending) .history-card:hover { border-color: rgba(32,231,214,.45); box-shadow: 0 20px 60px rgba(32,231,214,.16); }
body:not(.auth-pending) .metric-card strong,
body:not(.auth-pending) .record-card h3,
body:not(.auth-pending) .history-card h3,
body:not(.auth-pending) .section-heading h2 { color: var(--aqua-text); }
body:not(.auth-pending) .metric-card small,
body:not(.auth-pending) .record-card p,
body:not(.auth-pending) .history-card p { color: var(--aqua-text-soft); }
body:not(.auth-pending) .record-card,
body:not(.auth-pending) .history-card,
body:not(.auth-pending) .flow-options article,
body:not(.auth-pending) .decision-summary > div,
body:not(.auth-pending) .status,
body:not(.auth-pending) .pool-context,
body:not(.auth-pending) .linked-client-context {
  border-color: var(--aqua-border);
  background: rgba(255,255,255,.055);
}
body:not(.auth-pending) .field { color: var(--aqua-text); }
body:not(.auth-pending) .field input,
body:not(.auth-pending) .field select,
body:not(.auth-pending) .field textarea,
body:not(.auth-pending) .search-field input,
body:not(.auth-pending) .search-field select {
  border-color: var(--aqua-border);
  color: var(--aqua-text);
  background: rgba(255,255,255,.075);
}
body:not(.auth-pending) .field input:focus,
body:not(.auth-pending) .field select:focus,
body:not(.auth-pending) .field textarea:focus {
  border-color: var(--aqua-primary); box-shadow: 0 0 0 3px rgba(32,231,214,.16);
}
body:not(.auth-pending) .primary-button { background: linear-gradient(135deg, #159fd7, var(--aqua-primary)); color: #021114; }
body:not(.auth-pending) .ghost-button,
body:not(.auth-pending) .record-actions button,
body:not(.auth-pending) .history-card button,
body:not(.auth-pending) .import-button {
  border-color: var(--aqua-border); color: var(--aqua-text); background: rgba(255,255,255,.06);
}

.aqua-analytics-grid { display: grid; grid-template-columns: 1.25fr repeat(2, minmax(150px, .55fr)); gap: 16px; margin: 0 0 24px; }
.water-score-card, .quality-card, .analytics-chart-panel, .zones-panel, .ai-insights-panel {
  border: 1px solid var(--aqua-border); border-radius: 18px; background: var(--aqua-surface);
  box-shadow: var(--aqua-glow); backdrop-filter: blur(16px);
}
.water-score-card { grid-row: span 2; min-height: 230px; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 26px; }
.water-score-card h2 { margin: 8px 0; font-size: 28px; }
.water-score-card p { max-width: 360px; color: var(--aqua-text-soft); line-height: 1.55; }
.score-orbit { flex: 0 0 150px; height: 150px; display: grid; place-content: center; text-align: center; border-radius: 50%; border: 1px solid rgba(32,231,214,.48); background: radial-gradient(circle, rgba(32,231,214,.18), rgba(58,141,255,.08) 62%, transparent 64%); box-shadow: inset 0 0 30px rgba(32,231,214,.18), 0 0 40px rgba(32,231,214,.18); }
.score-orbit strong { color: var(--aqua-text); font: 800 42px Manrope,sans-serif; }
.score-orbit span { color: var(--aqua-text-soft); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.quality-card { padding: 18px; transition: transform .18s ease, border-color .18s ease; }
.quality-card:hover { transform: translateY(-2px); border-color: rgba(32,231,214,.5); }
.quality-card small { color: var(--aqua-text-soft); font-weight: 800; text-transform: uppercase; letter-spacing: .8px; }
.quality-card strong { display: block; margin: 8px 0 4px; color: var(--aqua-text); font: 800 24px Manrope,sans-serif; }
.quality-card span { color: var(--aqua-text-soft); font-size: 12px; }
.quality-card.normal { border-left: 3px solid var(--aqua-primary); }
.quality-card.attention { border-left: 3px solid var(--aqua-warning); }
.quality-card.critical { border-left: 3px solid var(--aqua-danger); }
.analytics-chart-panel { grid-column: span 2; padding: 22px; }
.mock-chart { height: 180px; display: flex; align-items: end; gap: 12px; padding: 18px; border-radius: 14px; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025)); }
.mock-chart span { flex: 1; min-width: 18px; border-radius: 999px 999px 4px 4px; background: linear-gradient(180deg, var(--aqua-primary), var(--aqua-secondary)); box-shadow: 0 0 18px rgba(32,231,214,.22); }
.zones-panel, .ai-insights-panel { padding: 20px; }
.zones-panel h3, .ai-insights-panel h3 { margin: 0 0 10px; }
.zones-panel p, .ai-insights-panel p { color: var(--aqua-text-soft); line-height: 1.55; }
.zones-panel div { display: flex; align-items: center; gap: 8px; margin-top: 9px; color: var(--aqua-text-soft); }
.status-dot.attention { background: var(--aqua-warning); box-shadow: 0 0 12px rgba(255,184,77,.7); }
.status-dot.critical { background: var(--aqua-danger); box-shadow: 0 0 12px rgba(255,95,109,.7); }

@media (max-width: 1100px) {
  body:not(.auth-pending) { padding-left: 0; }
  body:not(.auth-pending) .topbar { left: 0; height: auto; position: sticky; }
  body:not(.auth-pending) .main-nav { position: sticky; top: 0; width: 100%; height: auto; flex-direction: row; overflow-x: auto; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--aqua-border); }
  body:not(.auth-pending) .main-nav::before, .nav-system-status, .nav-user-card { display: none; }
  body:not(.auth-pending) .nav-button { width: auto; white-space: nowrap; }
  body:not(.auth-pending) main { padding: 24px 18px 60px; }
  .aqua-topbar-tools { grid-template-columns: 1fr 1fr auto; }
  .aqua-period, .aqua-notification { display: none; }
  .aqua-analytics-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .water-score-card, .analytics-chart-panel { grid-column: 1 / -1; }
}

@media (max-width: 1500px) {
  body:not(.auth-pending) .topbar {
    align-items: start;
    grid-template-columns: minmax(0, 1fr) minmax(280px, max-content);
  }
  .aqua-topbar-tools {
    grid-template-columns: minmax(180px, .8fr) minmax(180px, 1fr) minmax(132px, auto);
  }
  body:not(.auth-pending) .work-context {
    min-width: 0;
  }
}

@media (max-width: 1320px) {
  .aqua-search {
    display: none;
  }
  .aqua-topbar-tools {
    grid-template-columns: minmax(180px, 1fr) minmax(132px, auto);
  }
  body:not(.auth-pending) .work-context {
    min-width: 0;
  }
  body:not(.auth-pending) #activeOrganizationField,
  body:not(.auth-pending) #activeUserName,
  body:not(.auth-pending) #activeUserRole {
    display: none;
  }
}

@media (max-width: 1220px) {
  .aqua-topbar-tools {
    grid-template-columns: minmax(170px, 1fr) minmax(132px, auto);
  }
  .aqua-search {
    display: none;
  }
  body:not(.auth-pending) .connection-status {
    display: none;
  }
  body:not(.auth-pending) .topbar {
    grid-template-columns: minmax(0, 1fr) 270px;
  }
}

@media (max-width: 700px) {
  .aqua-topbar-tools { grid-template-columns: 1fr; }
  .aqua-new-analysis { width: 100%; }
  .aqua-search { display: none; }
  .aqua-analytics-grid, .metric-grid { grid-template-columns: 1fr; }
  .water-score-card { align-items: flex-start; flex-direction: column; }
  .score-orbit { width: 132px; height: 132px; flex-basis: 132px; }
}

/* Aqua contrast tuning */
body:not(.auth-pending) {
  --aqua-text: #f3fdff;
  --aqua-text-soft: #b8d9e4;
  --aqua-muted-strong: #d3edf4;
  --aqua-panel: rgba(9, 42, 56, .82);
  --aqua-panel-soft: rgba(13, 53, 70, .78);
  --aqua-field-bg: #eaf7fb;
  --aqua-field-text: #244f65;
  --aqua-field-border: #8bd3e6;
}

body:not(.auth-pending) .topbar {
  background: rgba(3, 18, 26, .94);
}

body:not(.auth-pending) .main-nav {
  background: linear-gradient(180deg, rgba(2, 13, 19, .98), rgba(5, 25, 34, .96));
}

body:not(.auth-pending) .page-heading h1,
body:not(.auth-pending) .aqua-page-title strong,
body:not(.auth-pending) .water-score-card h2,
body:not(.auth-pending) .section-heading h2,
body:not(.auth-pending) .form-panel legend,
body:not(.auth-pending) .summary-panel h2,
body:not(.auth-pending) .summary-panel h3 {
  color: var(--aqua-text);
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
}

body:not(.auth-pending) .page-heading p,
body:not(.auth-pending) .aqua-page-title small,
body:not(.auth-pending) .aqua-search span,
body:not(.auth-pending) .aqua-period span,
body:not(.auth-pending) .field small,
body:not(.auth-pending) .technical-note,
body:not(.auth-pending) .empty-state p,
body:not(.auth-pending) .flow-options article > span,
body:not(.auth-pending) .decision-summary small,
body:not(.auth-pending) .decision-summary span,
body:not(.auth-pending) .status small,
body:not(.auth-pending) .commercial-recommendations small,
body:not(.auth-pending) .report-disclaimer li {
  color: var(--aqua-text-soft);
}

body:not(.auth-pending) .field,
body:not(.auth-pending) .search-field,
body:not(.auth-pending) .work-context strong,
body:not(.auth-pending) .pool-context strong,
body:not(.auth-pending) .linked-client-context strong,
body:not(.auth-pending) .status strong,
body:not(.auth-pending) .decision-summary strong,
body:not(.auth-pending) .record-card h3,
body:not(.auth-pending) .history-card h3 {
  color: var(--aqua-muted-strong);
}

body:not(.auth-pending) .metric-card,
body:not(.auth-pending) .flow-card,
body:not(.auth-pending) .recent-card,
body:not(.auth-pending) .backup-card,
body:not(.auth-pending) .list-panel,
body:not(.auth-pending) .context-card,
body:not(.auth-pending) .form-panel,
body:not(.auth-pending) .summary-panel,
body:not(.auth-pending) .water-score-card,
body:not(.auth-pending) .quality-card,
body:not(.auth-pending) .analytics-chart-panel,
body:not(.auth-pending) .zones-panel,
body:not(.auth-pending) .ai-insights-panel {
  background: linear-gradient(135deg, var(--aqua-panel), rgba(20, 61, 83, .76));
  border-color: rgba(129, 233, 255, .28);
}

body:not(.auth-pending) .context-card,
body:not(.auth-pending) .record-card,
body:not(.auth-pending) .history-card,
body:not(.auth-pending) .flow-options article,
body:not(.auth-pending) .decision-summary > div,
body:not(.auth-pending) .status,
body:not(.auth-pending) .pool-context,
body:not(.auth-pending) .linked-client-context,
body:not(.auth-pending) .admin-group,
body:not(.auth-pending) .admin-store-row,
body:not(.auth-pending) .admin-tree-content {
  background: var(--aqua-panel-soft);
  border-color: rgba(129, 233, 255, .24);
}

body:not(.auth-pending) .field input,
body:not(.auth-pending) .field select,
body:not(.auth-pending) .field textarea,
body:not(.auth-pending) .search-field input,
body:not(.auth-pending) .search-field select,
body:not(.auth-pending) .work-context select {
  color: var(--aqua-field-text);
  background: var(--aqua-field-bg);
  border-color: var(--aqua-field-border);
  font-weight: 700;
}

body:not(.auth-pending) .field input::placeholder,
body:not(.auth-pending) .search-field input::placeholder,
body:not(.auth-pending) .aqua-search input::placeholder {
  color: #5c8190;
}

body:not(.auth-pending) .aqua-search input,
body:not(.auth-pending) .aqua-period select {
  color: var(--aqua-text);
  background: rgba(255,255,255,.1);
  border-color: rgba(129, 233, 255, .35);
}

body:not(.auth-pending) .consultation-banner {
  color: #123f58;
  background: #ddf6fb;
  border-color: #8bd3e6;
}

body:not(.auth-pending) .consultation-banner strong {
  color: #0b6f9d;
}

body:not(.auth-pending) .consultation-banner span {
  color: #416879;
}

body:not(.auth-pending) .result-header {
  background: linear-gradient(135deg, #0f7bad, #146a94);
}

body:not(.auth-pending) .result-body {
  background: #17384d;
}

body:not(.auth-pending) .validation-note,
body:not(.auth-pending) .result-warning {
  color: #6a4a12;
  background: #fff4d7;
  border-left-color: var(--aqua-warning);
}

body:not(.auth-pending) .commercial-recommendations,
body:not(.auth-pending) .salt-recommendation,
body:not(.auth-pending) .client-report-note {
  color: #d7edf4;
  background: rgba(15, 56, 76, .95);
  border-color: rgba(129, 233, 255, .32);
}

body:not(.auth-pending) .commercial-recommendations h3,
body:not(.auth-pending) .salt-recommendation h3,
body:not(.auth-pending) .client-report-note strong {
  color: #f3fdff;
}

body:not(.auth-pending) .commercial-recommendations .commercial-missing {
  color: #573e10;
  background: #fff1c9;
  border-color: #f1c26b;
}

body:not(.auth-pending) .report-disclaimer {
  border-top-color: rgba(129, 233, 255, .24);
}

body:not(.auth-pending) .nav-button {
  color: #aacbd5;
}

body:not(.auth-pending) .nav-button:disabled {
  color: #6e929e;
  opacity: 1;
}

body:not(.auth-pending) .nav-user-card,
body:not(.auth-pending) .nav-system-status {
  background: rgba(13, 53, 70, .72);
  border-color: rgba(129, 233, 255, .26);
}

/* Classic Acquanalise colors on the modern layout */
body:not(.auth-pending) {
  --aqua-text: #123f58;
  --aqua-text-soft: #5f8193;
  --aqua-muted-strong: #176f9f;
  --aqua-panel: rgba(255, 255, 255, .96);
  --aqua-panel-soft: #f6fbfd;
  --aqua-field-bg: #ffffff;
  --aqua-field-text: #176f9f;
  --aqua-field-border: #a8d1e8;
  color: var(--ink);
  background: linear-gradient(180deg, #e1f4f8 0, #f2f9fb 420px, #e7f4f8 100%);
}

body:not(.auth-pending)::before {
  display: none;
}

body:not(.auth-pending) .topbar {
  border-bottom: 1px solid rgba(168,209,232,.65);
  background: rgba(225,244,248,.96);
  box-shadow: 0 10px 26px rgba(23,111,159,.08);
}

body:not(.auth-pending) .main-nav {
  border-right: 1px solid #b9dce9;
  background: linear-gradient(180deg, #e1f4f8, #f2f9fb);
  box-shadow: 12px 0 32px rgba(23,111,159,.08);
}

body:not(.auth-pending) .main-nav::before {
  color: var(--navy);
}

body:not(.auth-pending) .nav-button {
  color: var(--muted);
}

body:not(.auth-pending) .nav-button:hover:not(:disabled),
body:not(.auth-pending) .nav-button.active {
  color: var(--navy);
  border-color: #a8d1e8;
  background: rgba(255,255,255,.82);
  box-shadow: 0 8px 24px rgba(23,111,159,.08);
}

body:not(.auth-pending) .nav-button.active {
  box-shadow: inset 3px 0 var(--aqua), 0 8px 24px rgba(23,111,159,.08);
}

body:not(.auth-pending) .nav-button:disabled {
  color: #8ba6b3;
}

body:not(.auth-pending) .nav-system-status,
body:not(.auth-pending) .nav-user-card {
  color: var(--muted);
  border-color: #b9dce9;
  background: rgba(255,255,255,.76);
}

body:not(.auth-pending) .nav-system-status strong,
body:not(.auth-pending) .nav-user-card strong {
  color: var(--navy);
}

body:not(.auth-pending) .page-heading h1,
body:not(.auth-pending) .aqua-page-title strong,
body:not(.auth-pending) .water-score-card h2,
body:not(.auth-pending) .section-heading h2,
body:not(.auth-pending) .form-panel legend,
body:not(.auth-pending) .summary-panel h2,
body:not(.auth-pending) .summary-panel h3,
body:not(.auth-pending) h1,
body:not(.auth-pending) h2,
body:not(.auth-pending) h3 {
  color: var(--navy);
  text-shadow: none;
}

body:not(.auth-pending) .page-heading p,
body:not(.auth-pending) .aqua-page-title small,
body:not(.auth-pending) .aqua-search span,
body:not(.auth-pending) .aqua-period span,
body:not(.auth-pending) .field small,
body:not(.auth-pending) .technical-note,
body:not(.auth-pending) .empty-state p,
body:not(.auth-pending) .flow-options article > span,
body:not(.auth-pending) .decision-summary small,
body:not(.auth-pending) .decision-summary span,
body:not(.auth-pending) .status small,
body:not(.auth-pending) .commercial-recommendations small,
body:not(.auth-pending) .report-disclaimer li {
  color: var(--muted);
}

body:not(.auth-pending) .metric-card,
body:not(.auth-pending) .flow-card,
body:not(.auth-pending) .recent-card,
body:not(.auth-pending) .backup-card,
body:not(.auth-pending) .list-panel,
body:not(.auth-pending) .context-card,
body:not(.auth-pending) .form-panel,
body:not(.auth-pending) .summary-panel,
body:not(.auth-pending) .water-score-card,
body:not(.auth-pending) .quality-card,
body:not(.auth-pending) .analytics-chart-panel,
body:not(.auth-pending) .zones-panel,
body:not(.auth-pending) .ai-insights-panel {
  border-color: rgba(168, 209, 232, .9);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

body:not(.auth-pending) .context-card,
body:not(.auth-pending) .record-card,
body:not(.auth-pending) .history-card,
body:not(.auth-pending) .flow-options article,
body:not(.auth-pending) .decision-summary > div,
body:not(.auth-pending) .status,
body:not(.auth-pending) .pool-context,
body:not(.auth-pending) .linked-client-context,
body:not(.auth-pending) .admin-group,
body:not(.auth-pending) .admin-store-row,
body:not(.auth-pending) .admin-tree-content {
  color: var(--ink);
  border-color: var(--line);
  background: #f6fbfd;
}

body:not(.auth-pending) .field,
body:not(.auth-pending) .search-field,
body:not(.auth-pending) .work-context strong,
body:not(.auth-pending) .pool-context strong,
body:not(.auth-pending) .linked-client-context strong,
body:not(.auth-pending) .status strong,
body:not(.auth-pending) .decision-summary strong,
body:not(.auth-pending) .record-card h3,
body:not(.auth-pending) .history-card h3 {
  color: var(--navy);
}

body:not(.auth-pending) .field input,
body:not(.auth-pending) .field select,
body:not(.auth-pending) .field textarea,
body:not(.auth-pending) .search-field input,
body:not(.auth-pending) .search-field select,
body:not(.auth-pending) .work-context select,
body:not(.auth-pending) .aqua-period select {
  color: var(--navy);
  background: #ffffff;
  border-color: #a8d1e8;
}

body:not(.auth-pending) .field input::placeholder,
body:not(.auth-pending) .search-field input::placeholder {
  color: #7f9dad;
}

.selection-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(13, 42, 58, 0.45);
  backdrop-filter: blur(4px);
}

.selection-modal {
  width: min(100%, 720px);
  padding: 28px;
  border: 1px solid rgba(168, 209, 232, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
}

.commercial-selection-context {
  display: grid;
  gap: 6px;
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid #cfe4ed;
  border-radius: 14px;
  background: #f3f9fc;
}

.commercial-selection-context > small {
  color: #70899b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.commercial-selection-context > strong {
  color: #07577f;
  font-size: 17px;
}

.commercial-selection-context-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 3px;
}

.commercial-selection-context-meta span {
  padding: 5px 8px;
  border-radius: 8px;
  background: #e8f4f8;
  color: #54748a;
  font-size: 11px;
}

.selection-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

#commercialSelectionReasonField {
  margin-top: 16px;
}

body:not(.auth-pending) .aqua-notification,
body:not(.auth-pending) .database-login,
body:not(.auth-pending) .ghost-button,
body:not(.auth-pending) .record-actions button,
body:not(.auth-pending) .history-card button,
body:not(.auth-pending) .import-button {
  color: var(--navy);
  border-color: #91c3e1;
  background: #ffffff;
}

body:not(.auth-pending) .primary-button,
body:not(.auth-pending) .aqua-new-analysis {
  color: #ffffff;
  background: linear-gradient(90deg, #176f9f, #35c1df);
}

body:not(.auth-pending) .primary-button span,
body:not(.auth-pending) .aqua-new-analysis span {
  color: #d8f2f7;
}

body:not(.auth-pending) .result-header {
  background: linear-gradient(135deg, var(--report-primary, var(--navy)), var(--report-secondary, var(--aqua-dark)));
}

body:not(.auth-pending) .result-body {
  background: #ffffff;
}

body:not(.auth-pending) .validation-note,
body:not(.auth-pending) .result-warning {
  color: #76531c;
  background: #fff8e8;
  border-left-color: #d39a4c;
}

body:not(.auth-pending) .commercial-recommendations,
body:not(.auth-pending) .salt-recommendation,
body:not(.auth-pending) .client-report-note {
  color: #496168;
  background: #f5fbfd;
  border-color: #b9dce8;
}

body:not(.auth-pending) .commercial-recommendations h3,
body:not(.auth-pending) .salt-recommendation h3,
body:not(.auth-pending) .client-report-note strong {
  color: var(--navy);
}

body:not(.auth-pending) .commercial-recommendations .commercial-missing {
  color: #76582f;
  background: #fff8e9;
  border-color: #f0c27b;
}

.follow-up-note {
  border: 1px solid rgba(168, 209, 232, 0.6);
  background: #f4fafd;
  border-radius: 14px;
  padding: 14px 18px;
  margin: 16px 0 4px;
  color: #1a3a4f;
  font-size: 13px;
  line-height: 1.65;
}

#technicalOrientationModal .attendant-rule-explanation {
  border: 1px solid #d8e9f2;
  background: #f0f8fc;
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
#technicalOrientationModal .attendant-rule-explanation h3 {
  margin: 0 0 10px;
  color: #0b4d72;
  font-size: 14px;
  font-family: Manrope, sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
#technicalOrientationModal .attendant-rule-explanation p {
  margin: 0 0 8px;
  color: #17384d;
  font-size: 13px;
  line-height: 1.6;
}
#technicalOrientationModal .attendant-rule-explanation p:last-of-type { margin-bottom: 0; }
#technicalOrientationModal .attendant-rule-explanation small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #d8e9f2;
}

/* Refinamento visual do relatório: somente apresentação em tela.
   O conteúdo, a ordem das etapas e os avisos técnicos permanecem inalterados. */
@media screen {
  .analysis-summary-card .summary-panel {
    background: #ffffff;
  }

  .client-report-header {
    position: relative;
    overflow: hidden;
    padding: 24px 28px 22px;
    border-bottom: 4px solid var(--report-accent, var(--aqua));
  }

  .client-report-header::after {
    content: "";
    position: absolute;
    top: -86px;
    right: -52px;
    width: 220px;
    height: 220px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    pointer-events: none;
  }

  .client-report-brand,
  .client-report-header > p {
    position: relative;
    z-index: 1;
  }

  .client-report-header h2 {
    max-width: 620px;
    font-size: clamp(22px, 2.2vw, 29px);
  }

  .result-body {
    padding: 22px 26px 28px;
  }

  .validation-note {
    margin: 10px 0;
    padding: 11px 13px;
    border-radius: 8px;
  }

  .decision-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 12px;
  }

  .decision-summary > div {
    min-height: 82px;
    padding: 13px 14px;
    border: 1px solid #d5eaf3;
    border-left: 4px solid var(--report-accent, var(--aqua));
    border-radius: 9px;
    background: linear-gradient(180deg, #fafeff, #f0f9fc);
  }

  .decision-summary strong {
    font-size: 12px;
    line-height: 1.28;
  }

  .decision-summary span {
    line-height: 1.35;
  }

  .status-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
  }

  .status {
    min-height: 68px;
    padding: 12px 13px;
    border-color: #cde5f0;
    border-radius: 9px;
    background: #fbfeff;
  }

  .status strong {
    font-size: 13px;
  }

  .lsi-card {
    margin-bottom: 16px;
    border: 1px solid #b8dfe2;
    border-left: 4px solid var(--report-accent, var(--aqua));
    border-radius: 9px;
    background: #effafa;
  }

  .treatment {
    margin-top: 20px;
    padding-top: 17px;
    border-top: 1px solid #d9ebf2;
  }

  .treatment h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 17px;
  }

  .treatment h3::before {
    content: "";
    width: 24px;
    height: 3px;
    border-radius: 999px;
    background: var(--report-accent, var(--aqua));
  }

  .treatment li {
    padding-bottom: 20px;
  }

  .treatment li::before {
    box-shadow: 0 0 0 4px #f5fcfe;
  }

  .plan-commercial-note {
    padding: 9px 11px;
    border-radius: 7px;
    background: #eefaff;
  }

  .plan-commercial-note strong {
    font-size: 11.5px;
  }

  .plan-commercial-pending {
    background: #f5f7f8;
  }

  .follow-up-note,
  .client-report-note,
  .result-warning {
    border-radius: 9px;
  }

  .report-disclaimer {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #d6e9f1;
    border-radius: 9px;
    background: #fbfdfe;
  }

  .report-disclaimer h3 {
    padding-bottom: 8px;
    border-bottom: 1px solid #dcecf3;
  }

  .report-disclaimer ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 24px;
  }

  .report-verification-block {
    margin-top: 16px;
  }
}

@media screen and (max-width: 720px) {
  .client-report-header,
  .result-body { padding-left: 18px; padding-right: 18px; }
  .decision-summary { grid-template-columns: 1fr; }
  .decision-summary > div { min-height: 0; }
  .report-disclaimer ul { grid-template-columns: 1fr; }
}

@media print {
  @page { size: A4 portrait; margin: 10mm 12mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html, body { width: 100%; padding-top: 0; background: white; }
  .topbar, .main-nav, .page-heading, .ops-page-header, .consultation-banner, .context-card, .analysis-context-card, .atd-sidebar, .form-panel, .analysis-form-card, .pool-client-banner, .technical-note, footer, .report-verification-block, .ta-advance-button { display: none; }
  .internal-only, .attendant-rule-explanation { display: none !important; }
  main { max-width: none; margin: 0; padding: 0; }
  .app-view { display: none !important; }
  #analysisView.active { display: block !important; }
  .workspace, .analysis-page-layout { display: block; }
  .atd-layout { display: block; }
  .atd-center { display: none; }
  .ops-card.analysis-summary-card { display: block; box-shadow: none; border: none; position: static; max-height: none; }
  .summary-panel {
    position: static; min-height: 0; overflow: visible;
    border: 1px solid #cfdedd; border-radius: 8px; box-shadow: none;
  }
  .result-header { padding: 11px 15px; }
  .client-report-brand { gap: 7px; }
  .client-report-brand img { max-width: 70px; max-height: 28px; padding: 3px; border-radius: 3px; }
  .result-header .eyebrow { font-size: 7px; letter-spacing: 1.2px; }
  .result-header h2 { margin: 2px 0 1px; font-size: 17px; line-height: 1.1; }
  .result-header p { font-size: 8px; }
  .result-body { padding: 10px 14px 12px; }
  .decision-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px; margin-bottom: 8px;
  }
  .decision-summary > div {
    min-width: 0; padding: 6px 8px;
    border-left-width: 2px; border-radius: 3px 6px 6px 3px;
  }
  .decision-summary small, .decision-summary span { font-size: 6.5px; line-height: 1.25; }
  .decision-summary small { letter-spacing: .5px; }
  .decision-summary strong { margin: 1px 0; font-size: 9px; line-height: 1.2; }
  .status-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px; margin-bottom: 8px;
  }
  .status { padding: 5px 7px; border-radius: 5px; }
  .status small { font-size: 6.5px; letter-spacing: .4px; }
  .status strong { margin-top: 1px; font-size: 8px; line-height: 1.2; }
  .lsi-card { margin-bottom: 9px; padding: 6px 9px; border-radius: 5px; }
  .lsi-card small, .lsi-card span { font-size: 6.5px; }
  .lsi-card strong { font-size: 16px; line-height: 1; }
  .lsi-card .lsi-label { max-width: none; font-size: 7px; }
  .treatment h3 { margin-bottom: 6px; font-size: 10px; }
  .treatment ol { columns: 2; column-gap: 14px; }
  .treatment li {
    min-height: 0; break-inside: avoid; page-break-inside: avoid;
    padding: 0 0 6px 22px; font-size: 7.5px; line-height: 1.28;
  }
  .treatment li::before { top: -1px; width: 15px; height: 15px; font-size: 6.5px; }
  .treatment li:not(:last-child)::after { display: none; }
  .treatment li.plan-info {
    margin: 0 0 5px 22px; padding: 4px 5px; border-left-width: 2px;
    font-size: 6.8px; line-height: 1.25;
  }
  .treatment li.plan-info::before { padding: 1px 4px; font-size: 5.5px; }
  .salt-recommendation {
    break-inside: avoid; page-break-inside: avoid;
    margin-top: 5px; padding: 6px 8px; border-left-width: 2px;
    font-size: 6.8px; line-height: 1.3;
  }
  .salt-recommendation h3 { margin-bottom: 3px; font-size: 8px; }
  .salt-recommendation p + p { margin-top: 3px; }
  .commercial-recommendations { display: none; }
  .plan-info-note {
    margin-top: 3px; padding: 3px 5px; border-left-width: 2px;
    font-size: 6.5px; line-height: 1.25;
  }
  .plan-info-note::before { font-size: 5.5px; padding: 1px 3px; margin-right: 4px; }
  .plan-commercial-note {
    margin-top: 3px; padding: 3px 5px; border-left-width: 2px;
    font-size: 6.5px; line-height: 1.25;
  }
  .plan-commercial-note::before { font-size: 5.5px; padding: 1px 3px; margin-right: 4px; }
  .plan-commercial-note strong { font-size: 6.5px; }
  .plan-commercial-note span { font-size: 6px; }
  .plan-commercial-note .commercial-substitute-button { display: none; }
  .actions-summary {
    break-inside: avoid; page-break-inside: avoid;
    margin-top: 5px; padding: 5px 7px; border-left-width: 2px;
    font-size: 6.8px; line-height: 1.3; background: #fafbfc;
  }
  .actions-summary h4 { margin: 0 0 4px; font-size: 7px; }
  .actions-summary-list { display: flex; flex-direction: column; gap: 3px; }
  .action-summary-item { padding: 3px 4px; border: none; background: transparent; }
  .action-summary-item strong { font-size: 6.5px; }
  .action-status { font-size: 6px; padding: 2px 4px; margin-left: 6px; }
  .technical-diagnosis-overview { display: none; }
  .ta-advance-button { display: none; }
  .technical-action-card { page-break-inside: avoid; margin-bottom: 3px; }
  .technical-action-card .technical-action { padding: 6px 8px; border-left-width: 2px; font-size: 6.8px; }
  .technical-action-card strong { font-size: 7px; display: inline; margin-right: 2px; }
  .technical-action-card small { display: inline; margin-right: 4px; font-size: 6px; }
  .client-report-note {
    break-inside: avoid; page-break-inside: avoid;
    margin-top: 5px; padding: 5px 7px; border-left-width: 2px;
    font-size: 6.5px; line-height: 1.25;
  }
  .client-report-note p + p { margin-top: 3px; }
  .result-warning {
    break-inside: avoid; page-break-inside: avoid;
    margin-top: 3px; padding: 6px 8px; border-left-width: 2px;
    font-size: 6.8px; line-height: 1.3;
  }
  .report-disclaimer {
    break-inside: avoid; page-break-inside: avoid;
    margin-top: 6px; padding-top: 5px;
  }
  .report-disclaimer h3 { margin-bottom: 4px; font-size: 8px; }
  .report-disclaimer ul {
    grid-template-columns: 1fr 1fr;
    gap: 3px 16px; padding-left: 12px;
  }
  .report-disclaimer li { font-size: 5.8px; line-height: 1.25; }
  .print-confirmation { display: none; }
}
.checkbox-group { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.checkbox-group label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.checkbox-group input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.bulk-products-table { width: 100%; border-collapse: collapse; margin-top: 16px; background: white; border: 1px solid #a8d1e8; border-radius: 8px; overflow: hidden; }
.bulk-products-table thead { background: #e1f4f8; font-weight: 600; font-size: 13px; color: var(--navy); }
.bulk-products-table th { padding: 12px; text-align: left; border-bottom: 1px solid #a8d1e8; }
.bulk-products-table td { padding: 12px; border-bottom: 1px solid #e8f2f7; font-size: 13px; }
.bulk-products-table tbody tr:hover { background: #f5fbfd; }
.bulk-products-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.bulk-brands-table { width: 100%; border-collapse: collapse; margin-top: 16px; background: white; border: 1px solid #a8d1e8; border-radius: 8px; overflow: hidden; }
.bulk-brands-table thead { background: #e1f4f8; font-weight: 600; font-size: 13px; color: var(--navy); }
.bulk-brands-table th { padding: 14px 12px; text-align: left; border-bottom: 1px solid #a8d1e8; white-space: nowrap; }
.bulk-brands-table td { padding: 14px 12px; border-bottom: 1px solid #e8f2f7; font-size: 13px; }
.bulk-brands-table tbody tr.brand-row { cursor: pointer; }
.bulk-brands-table tbody tr.brand-row:hover { background: #f5fbfd; }
.bulk-brands-table tbody tr.brand-row.expanded { background: #f0f9fc; }
.bulk-brands-table tbody tr.brand-row.expanded td { border-bottom: 0; }
.bulk-brands-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--navy); }
.brand-status-badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.brand-status-badge.active { background: #d1f0e0; color: #0b6e35; }
.brand-status-badge.partial { background: #fff3e0; color: #e65100; }
.brand-status-badge.inactive { background: #f5f5f5; color: #616161; }
.brand-actions { white-space: nowrap; }
.brand-actions button { padding: 6px 12px; font-size: 12px; border: 1px solid #a8d1e8; border-radius: 6px; background: white; color: var(--navy); cursor: pointer; }
.brand-actions button:hover { background: #e1f4f8; }
.bulk-brand-products { display: none; }
.bulk-brand-products.show { display: table-row; }
.bulk-brand-products td { padding: 0; border-bottom: 0; }
.bulk-brand-products-inner { padding: 16px 12px; background: #f8fbfd; }
.bulk-brand-products-table { width: 100%; border-collapse: collapse; margin: 0; }
.bulk-brand-products-table thead { display: none; }
.bulk-brand-products-table tbody tr { border-bottom: 1px solid #e8f2f7; }
.bulk-brand-products-table tbody tr:last-child { border-bottom: 0; }
.bulk-brand-products-table td { padding: 10px 12px; font-size: 12px; }
.bulk-brand-products-table td:first-child { width: 24px; }
.bulk-brand-products-table tbody tr:hover { background: #f5fbfd; }
.bulk-products-table .status-badge { font-size: 11px; padding: 4px 8px; border-radius: 4px; }

/* ============================================================
   OPS LAYOUT — Clientes, Piscinas, Análise
   ============================================================ */

/* Page header */
.ops-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 24px 0 28px;
}
.ops-page-header h1 {
  margin: 6px 0 0;
  font-size: clamp(22px, 2.8vw, 34px);
  letter-spacing: -1px;
}
.ops-page-header p {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 14px;
}
.ops-page-header .header-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Two-column layout used by Clientes and Piscinas */
.ops-two-col {
  display: grid;
  grid-template-columns: minmax(280px, .68fr) minmax(0, 1.32fr);
  gap: 22px;
  align-items: start;
}

/* Card base */
.ops-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  overflow: hidden;
}

/* Card header bar */
.ops-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}
.ops-card-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.ops-card-header-note {
  margin: 0 0 0 auto;
  color: #6b7280;
  font-size: 12px;
}

/* Card body */
.ops-card-body {
  padding: 22px;
}

/* Form card: keep small-panel vertical flow */
.ops-form-card .ops-card-body {
  display: grid;
  gap: 16px;
}
.ops-form-card .ops-card-body .section-heading { display: none; } /* heading moved to ops-card-header */

/* List card */
.ops-list-card .ops-card-body {
  padding: 18px 22px 22px;
}

/* Toolbar: search + action buttons */
.ops-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}
.ops-toolbar .ops-search {
  flex: 1;
  margin-bottom: 0;
}
.ops-toolbar .ops-search input,
.ops-toolbar .ops-search select {
  margin-top: 5px;
}

/* List section inside card */
.ops-list-section {
  min-height: 200px;
}

/* record-card refinement: cleaner row style */
.ops-list-section .record-card {
  border-radius: 8px;
  border-color: #e5e7eb;
  background: #f9fafb;
  padding: 14px 16px;
}
.ops-list-section .record-card:hover {
  border-color: var(--aqua-dark);
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.ops-list-section .record-card small {
  font-size: 9px;
  letter-spacing: .6px;
}
.ops-list-section .record-card h3 {
  font-size: 14px;
  margin: 3px 0 2px;
}
.ops-list-section .record-card p {
  font-size: 11px;
}

/* ============================================================
   ANALYSIS PAGE — single-column centred layout
   ============================================================ */
.analysis-page-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 860px;
}

/* Context card: override grid to 2-col inside the card body */
.analysis-context-body {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 16px !important;
  align-items: end !important;
  padding: 20px 22px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.analysis-context-body .pool-context {
  grid-column: span 2;
}

/* Analysis form card: remove default form-panel chrome */
.analysis-form-card .analysis-form-inner {
  display: block;
}
.analysis-form-card .analysis-form-inner fieldset {
  margin-bottom: 24px;
}

/* Summary card: no extra padding — summary-panel handles it */
.analysis-summary-card {
  border-radius: 10px;
  overflow: hidden;
}
.analysis-summary-card .summary-panel {
  position: static;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  min-height: 0;
}

/* Dark theme overrides for ops classes */
body:not(.auth-pending) .ops-card {
  border-color: var(--aqua-border);
  background: var(--aqua-panel, rgba(255,255,255,.96));
  box-shadow: var(--aqua-glow);
}
body:not(.auth-pending) .ops-card-header {
  border-bottom-color: var(--aqua-border);
  background: rgba(255,255,255,.04);
}
body:not(.auth-pending) .ops-card-header h2 {
  color: var(--aqua-text);
}
body:not(.auth-pending) .ops-list-section .record-card {
  border-color: var(--aqua-border);
  background: rgba(255,255,255,.055);
}
body:not(.auth-pending) .ops-list-section .record-card:hover {
  border-color: rgba(32,231,214,.45);
  background: rgba(255,255,255,.09);
}

/* Responsive */
@media (max-width: 900px) {
  .ops-two-col {
    grid-template-columns: 1fr;
  }
  .analysis-page-layout {
    max-width: none;
  }
}
@media (max-width: 620px) {
  .ops-page-header {
    flex-direction: column;
    align-items: stretch;
    padding: 18px 0 20px;
  }
  .ops-page-header .header-actions {
    justify-content: flex-start;
  }
  .analysis-context-body {
    grid-template-columns: 1fr !important;
  }
  .analysis-context-body .pool-context {
    grid-column: auto;
  }
}

/* ============================================================
   CLIENTES — table-style layout matching reference
   ============================================================ */
.cl-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 24px 0 20px;
  gap: 20px;
}
.cl-page-header h1 { margin: 6px 0 0; font-size: clamp(22px, 2.8vw, 34px); letter-spacing: -1px; }
.cl-page-header p { margin: 6px 0 0; color: #6b7280; font-size: 14px; }
.cl-header-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

/* Metric cards */
.cl-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.cl-metric-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 4px 14px rgba(15,116,168,.06);
}
.cl-metric-card small { display: block; font-size: 12px; font-weight: 700; color: #6c8494; text-transform: uppercase; letter-spacing: .06em; }
.cl-metric-card strong { display: block; margin-top: 8px; font-size: 32px; font-weight: 800; color: #0f74a8; }

/* Form panel (hidden by default, shown with .cl-form-open on #clientsView) */
.cl-form-panel { display: none; background: #fff; border: 1px solid #d0e8f5; border-radius: 16px; padding: 24px 28px; margin-bottom: 16px; box-shadow: 0 4px 18px rgba(15,116,168,.1); }
.cl-form-open .cl-form-panel { display: block; }
.cl-form-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.cl-form-panel-header h2 { margin: 0; font-size: 18px; color: #0b4d72; }
.cl-form-inner { display: grid; grid-template-columns: 160px 1fr auto; gap: 16px; align-items: end; }
.cl-form-actions { display: flex; gap: 10px; align-items: center; }

/* Table card */
.cl-table-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; box-shadow: 0 6px 22px rgba(15,116,168,.07); overflow: hidden; }
.cl-table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 22px; background: #fbfdff; border-bottom: 1px solid #e5e7eb; }
.cl-table-toolbar input { flex: 1; max-width: 400px; height: 40px; border: 1px solid #bddceb; border-radius: 10px; padding: 0 14px; font-size: 14px; background: #fff; outline: none; }
.cl-table-toolbar input:focus { border-color: #0f74a8; box-shadow: 0 0 0 3px rgba(15,116,168,.1); }

.cl-table-header, .cl-row { display: grid; grid-template-columns: 2fr 1fr 1fr 210px; padding: 0 22px; align-items: center; }
.cl-table-header { background: #fbfdff; border-bottom: 1px solid #e5e7eb; }
.cl-th { padding: 13px 0; font-size: 11px; font-weight: 800; color: #6c8494; text-transform: uppercase; letter-spacing: .08em; }
.cl-row { border-top: 1px solid #edf4f8; min-height: 62px; }
.cl-row:hover { background: #f8fbfd; }
.cl-td { padding: 10px 0; }
.cl-td-name strong { display: block; font-size: 14px; font-weight: 700; color: #0b4d72; }
.cl-td-name span { display: block; font-size: 12px; color: #6c8494; margin-top: 2px; }
.cl-td-stat { font-size: 14px; color: #17384d; }
.cl-td-actions { display: flex; gap: 8px; justify-content: flex-end; }
.cl-action-btn { height: 34px; padding: 0 12px; border: 1px solid #bddceb; border-radius: 8px; background: #fff; color: #0f74a8; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.cl-action-btn:hover { background: #e9f7fc; border-color: #0f74a8; }
.cl-action-primary { background: #0f74a8 !important; color: #fff !important; border-color: #0f74a8 !important; }
.cl-action-primary:hover { background: #0b4d72 !important; border-color: #0b4d72 !important; }
.cl-empty { padding: 40px 22px; color: #6c8494; text-align: center; }

/* Dark theme */
body:not(.auth-pending) .cl-metric-card,
body:not(.auth-pending) .cl-table-card,
body:not(.auth-pending) .cl-form-panel {
  background: var(--aqua-panel, rgba(255,255,255,.96));
  border-color: var(--aqua-border, #d8e9f2);
  box-shadow: var(--aqua-glow);
}

/* Responsive */
@media (max-width: 900px) {
  .cl-metrics { grid-template-columns: 1fr 1fr; }
  .cl-table-header { display: none; }
  .cl-row { grid-template-columns: 1fr; gap: 4px; }
  .cl-td-actions { justify-content: flex-start; margin-top: 4px; }
  .cl-form-inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cl-metrics { grid-template-columns: 1fr; }
}

/* ============================================================
   POOL CLIENT BANNER — gradient context header for Piscinas
   ============================================================ */
.pool-client-banner {
  background: linear-gradient(135deg, #0f74a8, #1594bc);
  color: #fff;
  border-radius: 18px;
  padding: 20px 28px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 10px 28px rgba(15, 116, 168, .2);
  min-height: 64px;
}
.pool-client-banner small {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .8;
  margin-bottom: 4px;
}
.pool-client-banner strong {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}
.pool-client-banner span {
  font-size: 14px;
  opacity: .88;
  margin-left: 12px;
}
.pool-banner-actions { display: flex; gap: 10px; flex-shrink: 0; }
.pool-banner-btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.pool-banner-btn.ghost { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.4); }
.pool-banner-btn.ghost:hover { background: rgba(255,255,255,.25); }
.pool-banner-btn.primary { background: #fff; color: #0f74a8; border: none; }
.pool-banner-btn.primary:hover { background: #e9f7fc; }

/* Pool table */
.pl-table-header, .pl-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr 100px auto;
  padding: 0 22px;
  align-items: center;
  column-gap: 8px;
}
.pl-table-header { background: #fbfdff; border-bottom: 1px solid #e5e7eb; }
.pl-row { border-top: 1px solid #edf4f8; min-height: 62px; }
.pl-row:hover { background: #f8fbfd; }
.pl-td-pool strong { display: block; font-size: 14px; font-weight: 700; color: #0b4d72; }
.pl-td-pool span { display: block; font-size: 12px; color: #6c8494; margin-top: 2px; }
.pl-td-vol, .pl-td-surface, .pl-td-stat { font-size: 13px; color: #17384d; }
.pl-status { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.pl-ok { background: #e6f9f0; color: #1a7a4a; }
.pl-warn { background: #fff4dd; color: #9a6500; }

/* Pool form layout inside modal */
.pl-form-row { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 16px; margin-bottom: 20px; }
.pl-form-footer { display: flex; gap: 12px; align-items: center; margin-top: 24px; padding-top: 18px; border-top: 1px solid #e5e7eb; }

/* ============================================================
   POOL MODAL
   ============================================================ */
.pool-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 56, 77, .45);
  z-index: 1000;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.pool-modal-open { display: flex !important; }
.pool-modal {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15,56,77,.25);
  width: 100%;
  max-width: 720px;
  overflow: hidden;
  flex-shrink: 0;
}
.pool-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: linear-gradient(135deg, #0f74a8, #1594bc);
  color: #fff;
}
.pool-modal-header h2 { margin: 0; font-size: 20px; color: #fff; }
.pool-modal-close {
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: #fff; font-size: 16px;
  cursor: pointer; display: grid; place-items: center;
}
.pool-modal-close:hover { background: rgba(255,255,255,.35); }
.pool-modal-body { padding: 28px; max-height: calc(100vh - 200px); overflow-y: auto; }

/* Dark theme for modal */
body:not(.auth-pending) .pool-modal { background: var(--aqua-panel, rgba(255,255,255,.98)); }

/* Responsive */
@media (max-width: 900px) {
  .pl-table-header { display: none; }
  .pl-row { grid-template-columns: 1fr; gap: 4px; padding: 12px 16px; }
  .pl-row .cl-td-actions { justify-content: flex-start; }
  .pl-form-row { grid-template-columns: 1fr; }
  .pool-modal { margin: 0; border-radius: 16px 16px 0 0; }
  .pool-modal-backdrop { align-items: flex-end; padding: 0; }
}

/* ============================================================
   ATD LAYOUT — 3-column attendance view
   ============================================================ */
.atd-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.button-processing-indicator {
  width: 15px;
  height: 15px;
  display: inline-block;
  margin-right: 8px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: button-processing-spin .75s linear infinite;
  vertical-align: -2px;
}

@keyframes button-processing-spin {
  to { transform: rotate(360deg); }
}

.analysis-help { position: relative; display: inline-flex; }
.help-button {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--aqua-dark); border-radius: 50%; color: var(--aqua-dark);
  background: white; font: 800 16px Manrope, sans-serif; cursor: pointer;
}
.help-button:hover, .help-button:focus-visible { color: white; background: var(--aqua-dark); outline: 0; box-shadow: 0 0 0 3px rgba(24,130,189,.18); }
.analysis-help-popover {
  position: absolute; z-index: 20; top: calc(100% + 10px); right: 0; width: min(310px, calc(100vw - 40px));
  padding: 16px; border: 1px solid #a8d1e8; border-radius: 12px; color: var(--navy);
  background: white; box-shadow: 0 14px 34px rgba(23,111,159,.18);
}
.analysis-help-popover strong { display: block; margin-bottom: 7px; font: 700 13px Manrope, sans-serif; }
.analysis-help-popover p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.analysis-help-popover[hidden] { display: none; }
.backup-card[hidden] { display: none; }
body:not(.auth-pending) .topbar-system-meta,
body:not(.auth-pending) .topbar-user-meta { display: none !important; }

#analysisView.new-analysis-mode .atd-layout { grid-template-columns: minmax(0, 1fr); }
#analysisView.new-analysis-mode .analysis-summary-card { display: none; }

/* Atendimento: organize as acoes mais frequentes sem alterar o fluxo existente. */
.service-actions {
  margin: 0 0 24px;
  padding: 24px 26px 26px;
  border: 1px solid rgba(168, 209, 232, .9);
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
}
.service-actions-heading { margin-bottom: 16px; }
.service-actions-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.service-actions-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.service-action {
  min-height: 88px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #f6fbfd;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.service-action:hover, .service-action:focus-visible {
  border-color: var(--aqua);
  box-shadow: 0 8px 22px rgba(23,111,159,.1);
  transform: translateY(-1px);
  outline: 0;
}
.service-action-primary { border-color: rgba(53,193,223,.75); background: linear-gradient(135deg, #edfafd, #e2f5f8); }
.service-action-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: white; background: var(--navy); font-size: 19px; font-weight: 700; }
.service-action strong, .service-action small { display: block; }
.service-action strong { color: var(--navy); font: 700 13px Manrope, sans-serif; }
.service-action small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.service-action b { color: var(--aqua-dark); font-size: 18px; }
.metric-grid { gap: 14px; margin-bottom: 24px; }
.metric-card { padding: 19px 22px; }
.metric-card strong { margin: 5px 0 9px; font-size: 32px; }
.sidebar-logo-symbol { display: none; }
body:not(.auth-pending) .sidebar-logo-horizontal { display: block; }
body.sidebar-collapsed:not(.auth-pending) .sidebar-logo-horizontal { display: none; }
body.sidebar-collapsed:not(.auth-pending) .sidebar-logo-symbol { display: block; width: 42px; height: 42px; margin: 0 auto 16px; }

@media (max-width: 980px) {
  .service-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .service-actions { padding: 20px 16px; }
  .service-actions-heading { align-items: flex-start; }
  .service-actions-heading p { display: none; }
  .service-actions-grid { grid-template-columns: 1fr; }
  .service-action { min-height: 74px; }
  .page-heading p { font-size: 13px; }
}

/* Guided verification: visual controls are projections of the existing selects. */
.analysis-step-indicator {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.analysis-step-indicator li {
  position: relative;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.analysis-step-indicator li:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 24px;
  left: calc(50% + 22px);
  right: calc(-50% + 22px);
  border-top: 1px solid #d7e5ec;
}
.analysis-step-indicator li button {
  width: 100%;
  min-height: 48px;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 4px 9px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
}
.analysis-step-indicator li button:not(:disabled) { cursor: pointer; }
.analysis-step-indicator li button:not(:disabled):focus-visible {
  border-radius: 8px;
  outline: 3px solid rgba(53,193,223,.22);
  outline-offset: 2px;
}
.analysis-step-indicator li button:disabled { cursor: default; opacity: .72; }
.analysis-step-indicator li span {
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: var(--muted);
  background: #edf7fa;
  font-size: 10px;
}
.analysis-step-indicator li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analysis-step-indicator li.is-current { color: var(--navy); }
.analysis-step-indicator li.is-current span { color: white; background: var(--navy); }
.analysis-step-indicator li.is-complete { color: #27775e; }
.analysis-step-indicator li.is-complete span { color: #27775e; background: #dff5ec; }
.analysis-step-indicator li.is-complete span { font-size: 0; }
.analysis-step-indicator li.is-complete span::before { content: "✓"; font-size: 11px; }
.analysis-stage-panel[hidden],
.analysis-form-stage[hidden],
.analysis-progressive-field[hidden],
.analysis-flow-context[hidden] { display: none !important; }
.analysis-stage-heading { margin-bottom: 24px; }
.analysis-stage-heading .eyebrow { display: block; margin-bottom: 5px; }
.analysis-stage-heading h2 { margin: 0; color: var(--navy); font: 700 24px Manrope, sans-serif; }
.analysis-stage-heading p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.analysis-condition-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  margin: 0 0 18px;
  padding: 16px 22px;
  border-radius: 16px;
  color: white;
  background: linear-gradient(105deg, #0f6097 0%, #177eb7 46%, #35c1df 100%);
  overflow: hidden;
}
.analysis-condition-hero::after {
  content: "";
  width: 170px;
  height: 170px;
  margin-left: auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.34), rgba(255,255,255,0) 65%);
  opacity: .75;
}
.analysis-condition-hero-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  color: white;
  font: 700 28px Manrope, sans-serif;
  background: rgba(255,255,255,.12);
}
.analysis-condition-hero strong { display: block; font: 700 15px Manrope, sans-serif; }
.analysis-condition-hero p { max-width: 430px; margin: 7px 0 0; color: rgba(255,255,255,.9); font-size: 12px; line-height: 1.5; }
.analysis-choice-prompt { margin: 0 0 12px; padding-left: 12px; border-left: 3px solid var(--aqua); color: var(--navy); font: 700 14px Manrope, sans-serif; }
.analysis-form-stage fieldset legend span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 6px;
  border-radius: 50%;
  color: white;
  background: var(--navy);
  font-size: 9px;
}
.analysis-stage-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px -24px -24px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  background: #fbfdfe;
}
.analysis-stage-actions-end { justify-content: flex-end; margin: 0; }
.analysis-stage-actions .text-button { margin-left: auto; }
.analysis-flow-context {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow);
}
.analysis-flow-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.analysis-flow-progress > span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border: 6px solid #dceef4;
  border-top-color: var(--aqua-dark);
  border-radius: 50%;
  color: var(--navy);
  font: 700 13px Manrope, sans-serif;
}
.analysis-flow-progress small,
.analysis-flow-progress strong { display: block; }
.analysis-flow-progress small { color: var(--muted); font-size: 10px; }
.analysis-flow-progress strong { margin-top: 3px; color: var(--navy); font: 700 12px Manrope, sans-serif; }
.analysis-flow-context-details { display: grid; gap: 12px; padding-top: 16px; }
.analysis-flow-context-details > div { min-width: 0; }
.analysis-flow-context-details small,
.analysis-flow-context-details strong { display: block; }
.analysis-flow-context-details small { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .45px; }
.analysis-flow-context-details strong { margin-top: 3px; overflow-wrap: anywhere; color: var(--ink); font-size: 11px; line-height: 1.4; }
.analysis-choice-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.analysis-choice-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.field-wide .analysis-choice-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.analysis-choice-card {
  position: relative;
  min-height: 66px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 12px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: #f8fcfd;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.analysis-choice-card:hover:not(:disabled), .analysis-choice-card:focus-visible {
  border-color: var(--aqua);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(53,193,223,.14);
}
.analysis-choice-card.is-selected { border-color: var(--navy); background: #edf8fb; box-shadow: inset 3px 0 var(--aqua); }
.analysis-choice-card:disabled { cursor: not-allowed; opacity: .48; }
.analysis-choice-check {
  display: grid;
  place-items: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1px solid #9fc8db;
  border-radius: 50%;
  color: transparent;
  background: white;
  font-size: 11px;
  font-weight: 800;
}
.analysis-choice-card.is-selected .analysis-choice-check { border-color: var(--navy); color: white; background: var(--navy); }
.analysis-choice-card strong, .analysis-choice-card small { display: block; }
.analysis-choice-card strong { color: var(--navy); font: 700 12px Manrope, sans-serif; line-height: 1.25; }
.analysis-choice-card small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.analysis-condition-options,
.field-wide .analysis-condition-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.analysis-condition-card {
  min-height: 136px;
  display: block;
  overflow: hidden;
  padding: 0;
  border-color: #b9ddeb;
  color: white;
  background: #115e8d;
  text-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.analysis-condition-card > img,
.analysis-condition-card > .analysis-choice-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.analysis-condition-card > img { object-fit: cover; }
.analysis-condition-card > .analysis-choice-overlay {
  background: linear-gradient(90deg, rgba(5,61,102,.94) 0%, rgba(9,82,131,.78) 35%, rgba(7,67,105,.08) 74%, rgba(7,67,105,.08) 100%);
}
.analysis-condition-card .analysis-choice-content {
  position: absolute;
  z-index: 1;
  left: 16px;
  right: 48px;
  bottom: 16px;
  display: block;
  text-align: left;
}
.analysis-condition-card .analysis-choice-content strong,
.analysis-condition-card .analysis-choice-content small { display: block; color: white; }
.analysis-condition-card .analysis-choice-content strong { font-size: 14px; }
.analysis-condition-card .analysis-choice-content small { margin-top: 5px; font-size: 11px; line-height: 1.4; }
.analysis-condition-card .analysis-choice-check {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 14px;
  margin: 0;
  border-color: rgba(255,255,255,.75);
  color: transparent;
  background: rgba(255,255,255,.15);
}
.analysis-condition-card.is-selected { border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(53,193,223,.18), 0 8px 18px rgba(23,111,159,.14); }
.analysis-condition-card.is-selected .analysis-choice-check { border-color: white; color: var(--navy); background: white; }
.analysis-condition-card:disabled { opacity: .48; }
.analysis-condition-card:disabled .analysis-choice-content { filter: grayscale(.2); }
.analysis-review-card { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.analysis-review-card h3 { margin: 4px 0 12px; color: var(--navy); font: 700 15px Manrope, sans-serif; }
.analysis-review-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.analysis-review-grid > div { min-width: 0; padding: 9px 10px; border: 1px solid #d7eaf0; border-radius: 8px; background: white; }
.analysis-review-grid small, .analysis-review-grid strong { display: block; }
.analysis-review-grid small { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .35px; }
.analysis-review-grid strong { margin-top: 3px; overflow: hidden; color: var(--ink); font-size: 11px; line-height: 1.35; text-overflow: ellipsis; }
.analysis-review-edit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.analysis-review-edit-actions button {
  padding: 8px 11px;
  border: 1px solid #acd4e6;
  border-radius: 8px;
  color: var(--navy);
  background: white;
  font-size: 10px;
  font-weight: 700;
}
.analysis-review-edit-actions button:hover,
.analysis-review-edit-actions button:focus-visible { border-color: var(--aqua-dark); outline: 0; box-shadow: 0 0 0 3px rgba(53,193,223,.14); }

#analysisView.new-analysis-mode .atd-center {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: start;
}
#analysisView.new-analysis-mode .analysis-stage-panel { grid-column: 1; grid-row: 1; }
#analysisView.new-analysis-mode[data-analysis-flow-stage="context"] .analysis-context-card { grid-column: 1 / -1; }
#analysisView.new-analysis-mode[data-analysis-flow-stage="diagnosis"] .atd-center { display: none; }
#analysisView.new-analysis-mode[data-analysis-flow-stage="diagnosis"] .analysis-summary-card {
  display: block;
  position: static;
  max-height: none;
  overflow: visible;
}
@media (max-width: 760px) {
  .analysis-step-indicator { grid-template-columns: repeat(5, minmax(74px, 1fr)); overflow-x: auto; padding-bottom: 3px; }
  .analysis-step-indicator li button { padding-inline: 6px; }
  .analysis-step-indicator li strong { font-size: 10px; }
  .field-wide .analysis-choice-options, .analysis-choice-options { grid-template-columns: 1fr; }
  .analysis-review-grid { grid-template-columns: 1fr 1fr; }
  #analysisView.new-analysis-mode .atd-center { grid-template-columns: 1fr; }
  .analysis-flow-context {
    grid-column: 1;
    grid-row: 1;
    position: static;
    display: grid;
    grid-template-columns: minmax(190px, .8fr) minmax(0, 1.2fr);
    gap: 16px;
  }
  .analysis-flow-context-details { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 0; }
  #analysisView.new-analysis-mode .analysis-stage-panel { grid-row: 2; }
  .analysis-stage-actions { margin-inline: -16px; padding-inline: 16px; }
  .analysis-condition-hero { min-height: 82px; padding: 14px 18px; }
  .analysis-condition-hero::after { width: 120px; height: 120px; margin-right: -35px; }
}
@media (max-width: 430px) {
  .analysis-step-indicator { grid-template-columns: repeat(5, 44px); justify-content: space-between; overflow: visible; }
  .analysis-step-indicator li button { min-height: 44px; padding: 5px; }
  .analysis-step-indicator li strong { display: none; }
  .analysis-step-indicator li span { margin: 0 auto; }
  .analysis-review-grid { grid-template-columns: 1fr; }
  .analysis-flow-context { display: block; padding: 14px; }
  .analysis-flow-context-details { grid-template-columns: 1fr; }
  .analysis-flow-context-details > div:nth-child(n+4) { display: none; }
  .analysis-stage-heading h2 { font-size: 20px; }
  .analysis-condition-hero { align-items: flex-start; padding: 14px; }
  .analysis-condition-hero::after { display: none; }
  .analysis-condition-hero-icon { width: 40px; height: 40px; flex-basis: 40px; font-size: 23px; }
  .analysis-stage-actions { flex-direction: column-reverse; align-items: stretch; }
  .analysis-stage-actions button { width: 100%; }
  .analysis-stage-actions .text-button { margin-left: 0; }
}

/* Tablet navigation: keep the sidebar available for maximum workspace area. */
@media (min-width: 701px) and (max-width: 1100px) {
  body:not(.auth-pending) { padding-left: 260px; }
  body:not(.auth-pending) .topbar { left: 260px; position: sticky; top: 0; min-height: 82px; }
  body:not(.auth-pending) .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    width: 260px;
    height: 100vh;
    flex-direction: column;
    overflow: visible;
    padding: 24px 18px;
    border-right: 1px solid var(--aqua-border);
    border-bottom: 0;
  }
  body:not(.auth-pending) .main-nav::before { content: none; }
  body:not(.auth-pending) .sidebar-toggle { display: inline-grid; }
  body:not(.auth-pending) .nav-system-status,
  body:not(.auth-pending) .nav-user-card { display: block; }
  body:not(.auth-pending) .nav-button { width: 100%; white-space: normal; }
  body.sidebar-collapsed:not(.auth-pending) { padding-left: 78px; }
  body.sidebar-collapsed:not(.auth-pending) .topbar { left: 78px; }
  body.sidebar-collapsed:not(.auth-pending) .main-nav { width: 78px; padding: 18px 10px; }
  body.sidebar-collapsed:not(.auth-pending) .nav-system-status,
  body.sidebar-collapsed:not(.auth-pending) .nav-user-card { display: block; }
}

/* The image mark is the only brand element in the expanded sidebar. */
body:not(.auth-pending) .main-nav::before { content: none; }
body:not(.auth-pending) .sidebar-logo-horizontal { display: block; }

/* New verification has no empty diagnostic rail before a result exists. */
#analysisView.new-analysis-mode:not([data-analysis-flow-stage="diagnosis"]) .analysis-summary-card { display: none !important; }

@media (max-width: 700px) {
  body:not(.auth-pending) .topbar {
    left: 0;
    right: 0;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 14px;
  }
  body:not(.auth-pending) .aqua-topbar-tools {
    grid-column: 1;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  body:not(.auth-pending) .aqua-new-analysis { min-width: 132px; }
  body:not(.auth-pending) .work-context { grid-column: 1; }
  body:not(.auth-pending) #activeStoreSelect { height: 38px; }
  body:not(.auth-pending) main { padding-top: 20px; }
}

@media (min-width: 701px) and (max-width: 900px) {
  .analysis-primary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .analysis-primary-grid,
  .analysis-complementary-grid { grid-template-columns: 1fr; }
  .analysis-parameter-card,
  .analysis-primary-grid .analysis-parameter-card { min-height: 0; }
}

/* Left sidebar */
.atd-sidebar {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 22px 20px;
  box-shadow: 0 4px 16px rgba(15, 116, 168, .07);
  position: sticky;
  top: 20px;
}
.atd-sidebar h3 {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #0b4d72;
}

/* Flow steps */
.atd-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  margin-bottom: 18px;
  position: relative;
}
.atd-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 36px;
  height: 14px;
  border-left: 1px dashed #a8d2e5;
}
.atd-step-num {
  width: 32px;
  height: 32px;
  background: #e9f7fc;
  color: #0f74a8;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}
.atd-step-active .atd-step-num {
  background: #0f74a8;
  color: #fff;
}
.atd-step strong {
  display: block;
  font-size: 13px;
  color: #0b4d72;
  margin-bottom: 3px;
}
.atd-step small {
  color: #6c8494;
  font-size: 11px;
  line-height: 1.4;
}

/* Center column */
.atd-center {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Right column: summary card fills height */
.atd-layout > .analysis-summary-card {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

/* Clientes: record-cards styled as table rows */
#clientList .record-card,
.ops-list-section .record-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  border-left: 3px solid #a8d2e5;
  background: #fff;
  padding: 12px 16px;
  margin-bottom: 6px;
}
#clientList .record-card:hover,
.ops-list-section .record-card:hover {
  border-left-color: #0f74a8;
  background: #f8fbfd;
}
#clientList .record-card h3,
.ops-list-section .record-card h3 {
  font-size: 14px;
  font-weight: 700;
  color: #0b4d72;
  margin: 0 0 2px;
}
#clientList .record-card small,
.ops-list-section .record-card small {
  font-size: 11px;
  color: #6c8494;
  text-transform: uppercase;
  letter-spacing: .06em;
}
#clientList .record-card p,
.ops-list-section .record-card p {
  font-size: 12px;
  color: #6c8494;
  margin: 2px 0 0;
}
#clientList .record-card .record-actions,
.ops-list-section .record-card .record-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Dark theme overrides for new elements */
body:not(.auth-pending) .pool-client-banner {
  background: linear-gradient(135deg, var(--aqua-dark, #0f74a8), #1594bc);
}
body:not(.auth-pending) .atd-sidebar {
  background: var(--aqua-panel, rgba(255,255,255,.96));
  border-color: var(--aqua-border, #d8e9f2);
}

/* Responsive: stack atd-layout below 1100px */
@media (max-width: 1100px) {
  .atd-layout {
    grid-template-columns: 1fr;
  }
  .atd-sidebar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 18px;
  }
  .atd-sidebar h3 { width: 100%; margin-bottom: 8px; }
  .atd-step { margin-bottom: 0; }
  .atd-step:not(:last-child)::after { display: none; }
  .atd-layout > .analysis-summary-card {
    position: static;
    max-height: none;
  }
  .pool-client-banner { border-radius: 14px; padding: 16px 20px; }
}

/* ============================================================
   Modal de Orientação Técnica
   ============================================================ */
#technicalOrientationModal {
  position: fixed;
  inset: 0;
  background: rgba(21, 56, 77, 0.58);
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.5vw, 28px);
  z-index: 900;
  overflow: hidden;
}
body:has(#technicalOrientationModal:not([hidden])) { overflow: hidden; }
#technicalOrientationModal .modal {
  width: min(1380px, 96vw);
  height: min(94vh, 980px);
  max-height: 94vh;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(6, 48, 70, 0.32);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#technicalOrientationModal .modal-header {
  padding: 20px clamp(20px, 2.5vw, 32px);
  background: linear-gradient(135deg, rgba(15,116,168,0.08), rgba(36,178,204,0.05)), #ffffff;
  border-bottom: 1px solid #d8e9f2;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-shrink: 0;
}
#technicalOrientationModal .title-block { display: flex; gap: 16px; align-items: flex-start; }
#technicalOrientationModal .step-badge {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #0f74a8, #24b2cc);
  color: white; display: grid; place-items: center;
  font-weight: 900; font-size: 14px; min-height: 0;
}
#technicalOrientationModal .eyebrow {
  display: block; color: #0f74a8; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.16em;
  font-weight: 900; margin-bottom: 6px;
}
#technicalOrientationModal h1 {
  margin: 0; color: #0b4d72; font-size: 22px; letter-spacing: -0.02em;
  font-family: Manrope, sans-serif; font-weight: 800;
}
#technicalOrientationModal .header-description {
  margin: 8px 0 0; color: #6c8494; line-height: 1.5; max-width: 580px; font-size: 14px;
}
#technicalOrientationModal .header-context {
  flex: 0 1 440px; background: white;
  border: 1px solid #d8e9f2; border-radius: 14px; padding: 10px 12px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
#technicalOrientationModal .header-context-item { min-width: 0; }
#technicalOrientationModal .header-context small {
  display: block; color: #6c8494; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.12em; font-weight: 900; margin-bottom: 5px;
  min-height: 0;
}
#technicalOrientationModal .header-context strong {
  display: block; color: #0b4d72; font-size: 12px; font-weight: 700; overflow-wrap: anywhere;
}
#technicalOrientationModal .modal-close {
  width: 44px; height: 44px; padding: 0; flex: 0 0 44px; border-radius: 12px;
  border: 1px solid #b8dce9; background: #fff; color: #0f74a8; font-size: 26px;
  line-height: 1; cursor: pointer;
}
#technicalOrientationModal .modal-close:hover { background: #f0f8fc; }
#technicalOrientationModal .modal-close:focus-visible { outline: 3px solid rgba(24, 130, 189, .35); outline-offset: 2px; }
#technicalOrientationModal .modal-stage-nav {
  display: flex; align-items: center; gap: 0; margin: 0; padding: 10px clamp(20px, 2.5vw, 32px);
  list-style: none; border-bottom: 1px solid #d8e9f2; background: #fbfdff; flex-shrink: 0;
}
#technicalOrientationModal .modal-stage-nav li {
  display: inline-flex; align-items: center; gap: 8px; color: #718a9a; font-size: 12px; font-weight: 800;
}
#technicalOrientationModal .modal-stage-nav button {
  display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent;
  color: inherit; font: inherit; cursor: pointer;
}
#technicalOrientationModal .modal-stage-nav button:focus-visible {
  outline: 3px solid rgba(24, 130, 189, .28); outline-offset: 4px; border-radius: 8px;
}
#technicalOrientationModal .modal-stage-nav li:not(:last-child)::after {
  content: ''; width: clamp(34px, 7vw, 92px); height: 1px; margin: 0 14px; background: #d8e9f2;
}
#technicalOrientationModal .modal-stage-nav span {
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid #c7dfeb; background: #fff; color: #54748a; font-size: 11px;
}
#technicalOrientationModal .modal-stage-nav .is-current { color: #0b4d72; }
#technicalOrientationModal .modal-stage-nav .is-current span { border-color: #0f74a8; background: #0f74a8; color: #fff; }
#technicalOrientationModal .modal-stage-nav .is-complete span { border-color: #80c7dd; background: #eef9fc; color: #0f74a8; }
#technicalOrientationModal .modal-body { padding: 18px clamp(20px, 2.5vw, 32px) 20px; overflow: auto; flex: 1; overscroll-behavior: contain; }
#technicalOrientationModal .technical-stage-panel { display: none; }
#technicalOrientationModal .technical-stage-panel.is-active { display: block; }
#technicalOrientationModal .advisor-card {
  background: #f7fbfd; border: 1px solid #d8e9f2;
  border-radius: 14px; padding: 16px; margin-bottom: 14px;
}
#technicalOrientationModal .advisor-card h2 {
  margin: 0 0 8px; color: #0b4d72; font-size: 17px; font-family: Manrope, sans-serif; font-weight: 700;
}
#technicalOrientationModal .advisor-card p { margin: 0; color: #17384d; line-height: 1.65; font-size: 14px; }
#technicalOrientationModal .insight-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 14px; margin-bottom: 14px;
}
#technicalOrientationModal .insight-panel {
  border: 1px solid #d8e9f2; border-radius: 14px; background: white; padding: 15px;
}
#technicalOrientationModal .insight-panel h3 {
  margin: 0 0 12px; color: #0f74a8; font-size: 15px; font-family: Manrope, sans-serif; font-weight: 700;
}
#technicalOrientationModal .problem-list { display: grid; gap: 12px; }
#technicalOrientationModal .problem-item {
  display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start;
}
#technicalOrientationModal .problem-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 900; font-size: 15px; min-height: 0;
}
#technicalOrientationModal .problem-icon.warning { background: #fff8ec; color: #8b5b13; }
#technicalOrientationModal .problem-icon.info { background: #e8f6fc; color: #0f74a8; }
#technicalOrientationModal .problem-item strong {
  display: block; color: #0b4d72; margin-bottom: 3px; font-size: 13px;
}
#technicalOrientationModal .problem-item span { color: #6c8494; font-size: 13px; line-height: 1.45; }
#technicalOrientationModal .parameter-stack { display: grid; gap: 8px; }
#technicalOrientationModal .parameter {
  background: #f8fcfe; border: 1px solid #d8e9f2; border-radius: 12px;
  padding: 11px 14px; display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
#technicalOrientationModal .parameter small {
  color: #6c8494; text-transform: uppercase; font-size: 11px;
  font-weight: 900; letter-spacing: 0.08em; min-height: 0;
}
#technicalOrientationModal .parameter strong { color: #0b4d72; font-size: 13px; }
#technicalOrientationModal .attendant-rule-explanation {
  margin: 0 0 14px; border: 1px solid #d8e9f2; border-radius: 14px; background: #fbfdff;
}
#technicalOrientationModal .attendant-rule-explanation summary {
  min-height: 44px; display: flex; align-items: center; padding: 0 16px; cursor: pointer;
  color: #0b4d72; font-weight: 800; font-size: 14px;
}
#technicalOrientationModal .attendant-rule-explanation-content { padding: 0 16px 16px; }
#technicalOrientationModal .action-summary { margin-bottom: 18px; }
#technicalOrientationModal .section-heading {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 12px;
}
#technicalOrientationModal .section-heading h2 {
  margin: 0; font-size: 17px; color: #0b4d72; font-family: Manrope, sans-serif; font-weight: 700;
}
#technicalOrientationModal .section-heading p { margin: 4px 0 0; color: #6c8494; font-size: 13px; }
#technicalOrientationModal .chips { display: flex; gap: 10px; flex-wrap: wrap; }
#technicalOrientationModal .chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 13px; border-radius: 999px;
  background: white; border: 1px solid #b8dce9;
  color: #0b4d72; font-weight: 800; font-size: 13px;
}
#technicalOrientationModal .chip-status {
  font-size: 11px; color: #8b5b13; background: #fff8ec;
  border-radius: 999px; padding: 3px 8px; font-weight: 900; min-height: 0;
}
#technicalOrientationModal .chip-selected { border-color: #80c7dd; background: #f0f9fc; }
#technicalOrientationModal .chip-selected .chip-status { color: #0f6c55; background: #e8f8f1; }
#technicalOrientationModal .action-cards { display: grid; gap: 12px; padding-bottom: 8px; }
#technicalOrientationModal .action-card {
  background: white; border: 1px solid #d8e9f2; border-radius: 16px;
  padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 185px; gap: 18px; align-items: center;
}
#technicalOrientationModal .action-main small {
  display: block; color: #6c8494; text-transform: uppercase;
  font-size: 11px; letter-spacing: 0.10em; font-weight: 900; margin-bottom: 5px; min-height: 0;
}
#technicalOrientationModal .action-main h3 {
  margin: 0 0 10px; color: #0f74a8; font-size: 17px; font-family: Manrope, sans-serif; font-weight: 700;
}
#technicalOrientationModal .action-meta { display: flex; flex-wrap: wrap; gap: 7px; }
#technicalOrientationModal .action-meta span {
  padding: 6px 8px; border-radius: 8px; background: #f1f8fb; color: #54748a; font-size: 11px;
}
#technicalOrientationModal .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#technicalOrientationModal .detail {
  background: #f8fcfe; border: 1px solid #e7f2f7; border-radius: 12px; padding: 11px;
}
#technicalOrientationModal .detail strong {
  display: block; color: #0b4d72; font-size: 12px; margin-bottom: 4px;
}
#technicalOrientationModal .detail span { color: #6c8494; font-size: 12px; line-height: 1.45; }
#technicalOrientationModal .action-side {
  padding: 0; background: transparent;
}
#technicalOrientationModal .selected-product { display: grid; gap: 4px; margin-bottom: 12px; }
#technicalOrientationModal .selected-product small { color: #6c8494; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; font-weight: 900; }
#technicalOrientationModal .selected-product strong { color: #0b4d72; font-size: 13px; line-height: 1.3; }
#technicalOrientationModal .selected-product span { color: #6c8494; font-size: 12px; }
#technicalOrientationModal .select-button {
  width: 100%; border: 0; min-height: 0; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #0f74a8, #24b2cc);
  color: white; font-weight: 900; font-size: 14px; cursor: pointer;
}
#technicalOrientationModal .select-button:hover { opacity: 0.9; }
#technicalOrientationModal .select-button-secondary { background: #fff; color: #0f74a8; border: 1px solid #8fc9df; }
#technicalOrientationModal .select-button:disabled {
  background: #c8d8e0; color: #8aa4b0; cursor: not-allowed; opacity: 1;
}
#technicalOrientationModal .note { margin-top: 10px; color: #6c8494; font-size: 12px; line-height: 1.45; }
#technicalOrientationModal .inactive-note { color: #8aa4b0; font-style: italic; }
#technicalOrientationModal .action-card--inactive {
  background: #f5f8fa; border-color: #dde8ef; opacity: 0.6;
}
#technicalOrientationModal .exclusive-pair-group { display: grid; gap: 10px; }
#technicalOrientationModal .exclusive-pair-selector {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: #eef6fb; border: 1px solid #cde4f0; border-radius: 14px;
}
#technicalOrientationModal .exclusive-pair-label {
  font-size: 12px; font-weight: 700; color: #3d6b82; white-space: nowrap;
}
#technicalOrientationModal .exclusive-pair-options {
  display: flex; gap: 6px; flex-wrap: wrap;
}
#technicalOrientationModal .exclusive-pair-btn {
  border: 1px solid #b0d4e8; border-radius: 999px; padding: 5px 14px;
  font-size: 13px; font-weight: 600; color: #3d6b82; background: white; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
#technicalOrientationModal .exclusive-pair-btn.active {
  background: linear-gradient(135deg, #0f74a8, #24b2cc); color: white; border-color: transparent;
}
#technicalOrientationModal .exclusive-pair-btn:not(.active):hover { background: #d8eef8; }
#technicalOrientationModal .review-summary { margin: 0; padding: 0; border: 0; }
#technicalOrientationModal .review-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
#technicalOrientationModal .review-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: center; min-height: 56px;
  padding: 10px 12px; border: 1px solid #d8e9f2; border-radius: 12px; background: #fbfdff;
}
#technicalOrientationModal .review-item small { display: block; color: #6c8494; font-size: 11px; margin-bottom: 3px; }
#technicalOrientationModal .review-item strong { display: block; color: #0b4d72; font-size: 12px; }
#technicalOrientationModal .review-item > span { color: #54748a; font-size: 12px; white-space: nowrap; }
#technicalOrientationModal .review-item.is-selected { background: #f0f9fc; border-color: #80c7dd; }
#technicalOrientationModal .modal-footer {
  padding: 14px clamp(20px, 2.5vw, 32px); border-top: 1px solid #d8e9f2;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; background: #fbfdff; flex-shrink: 0;
}
#technicalOrientationModal .footer-note { color: #6c8494; font-size: 13px; line-height: 1.45; flex: 1; }
#technicalOrientationModal .footer-actions { display: flex; gap: 10px; flex-shrink: 0; }
#technicalOrientationModal .secondary-button {
  min-height: 0; height: 44px; border-radius: 12px; padding: 0 18px;
  font-weight: 900; cursor: pointer; background: white;
  color: #0f74a8; border: 1px solid #b8dce9; font-size: 14px;
}
#technicalOrientationModal .secondary-button:hover { background: #f0f8fc; }
#technicalOrientationModal .primary-button {
  min-height: 0; height: 44px; border-radius: 12px; padding: 0 20px;
  font-weight: 900; cursor: pointer; background: #0f74a8;
  color: white; border: 0; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  transform: none; box-shadow: none;
}
#technicalOrientationModal .primary-button:hover { background: #0b5c89; transform: none; }
@media (min-width: 881px) and (max-width: 1180px) {
  #technicalOrientationModal { padding: 8px; }
  #technicalOrientationModal .modal { width: 100%; height: calc(100vh - 16px); max-height: none; border-radius: 16px; }
  #technicalOrientationModal .header-context { flex-basis: 360px; }
  #technicalOrientationModal .modal-header { padding: 16px 20px; }
  #technicalOrientationModal .modal-body { padding: 14px 20px 16px; }
  #technicalOrientationModal .detail-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 880px) {
  #technicalOrientationModal { padding: 0; place-items: stretch; overflow: hidden; }
  #technicalOrientationModal .modal { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  #technicalOrientationModal .modal-header,
  #technicalOrientationModal .modal-footer { flex-direction: column; align-items: stretch; }
  #technicalOrientationModal .header-context { grid-template-columns: 1fr 1fr; flex-basis: auto; }
  #technicalOrientationModal .header-context-item:last-child { grid-column: span 2; }
  #technicalOrientationModal .modal-close { position: absolute; top: 16px; right: 16px; }
  #technicalOrientationModal .modal-stage-nav { overflow-x: auto; }
  #technicalOrientationModal .modal-stage-nav li:not(:last-child)::after { width: 24px; margin: 0 8px; }
  #technicalOrientationModal .insight-grid,
  #technicalOrientationModal .action-card,
  #technicalOrientationModal .detail-grid { grid-template-columns: 1fr; }
  #technicalOrientationModal .header-context { min-width: 0; }
  #technicalOrientationModal .footer-actions { flex-direction: column; }
  #technicalOrientationModal .secondary-button,
  #technicalOrientationModal .primary-button { width: 100%; }
}
