:root {
  --bg: #062a59;
  --surface: #0a356c;
  --surface2: #0b407b;
  --line: rgba(155, 210, 235, .22);
  --text: #fff;
  --muted: #b8cee0;
  --lime: #ff7900;
  --cyan: #009bd3;
  --violet: #064b84;
  --success: #3ed59b;
}

body {
  background-color: #062a59;
  background-image: radial-gradient(circle at 8% 0%, rgba(0, 155, 211, .24), transparent 34%), radial-gradient(circle at 100% 100%, rgba(5, 75, 132, .58), transparent 42%), linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
}

.ambient-one { background: #009bd3; opacity: .2; }
.ambient-two { background: #0575a5; opacity: .24; }
.topbar { background: rgba(5, 31, 67, .94); border-bottom-color: rgba(155, 210, 235, .2); }
.brand { gap: 12px; }
.brand-logo-wrap { display: flex; align-items: center; justify-content: center; width: 116px; height: 43px; padding: 5px 10px; border-radius: 10px; background: #fff; box-shadow: 0 7px 22px rgba(0, 16, 44, .22); }
.brand-logo { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; }
.brand small { color: #9cc7df; margin-top: 0; }
.brand-large { align-items: center; }
.brand-large .brand-logo-wrap { width: 172px; height: 61px; padding: 7px 14px; border-radius: 13px; }
.login-shell { background: rgba(7, 42, 89, .8); border-color: rgba(155, 210, 235, .24); box-shadow: 0 40px 100px rgba(0, 20, 50, .42); }
.login-story { background: radial-gradient(circle at 10% 100%, rgba(0, 155, 211, .27), transparent 48%), radial-gradient(circle at 95% 12%, rgba(255, 121, 0, .12), transparent 38%), linear-gradient(145deg, #07346d, #062957); }
.login-card { background: rgba(5, 31, 67, .9); }
.login-card input, .stack-form select, .access-form select { background: #062654; border-color: rgba(155, 210, 235, .25); }
.panel, .empty { background: rgba(7, 45, 92, .84); }
.report-card { background: linear-gradient(145deg, rgba(16, 73, 126, .88), rgba(5, 42, 87, .9)); }
.report-card::after { background: #009bd3; }
.report-card:hover { border-color: rgba(255, 121, 0, .7); }
.eyebrow, .open-label { color: #ff9a35; }
.pulse-line i:nth-child(2) { background: #009bd3; }
.pulse-line i:nth-child(3) { background: #ff7900; }
button.primary, .primary.inline { background: linear-gradient(100deg, #ff7900, #ff9b38); color: #fff; box-shadow: 0 10px 28px rgba(255, 121, 0, .18); }
.report-frame { background: #fff; border-color: rgba(155, 210, 235, .3); }

/* V1.2 — melhor aproveitamento de telas largas e administração multiempresa. */
.app-main { max-width: 1760px; width: 100%; padding-left: 2vw; padding-right: 2vw; }
.report-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.stack-form textarea { width: 100%; resize: vertical; border: 1px solid var(--line); background: #062654; color: #fff; border-radius: 11px; padding: 14px 15px; outline: 0; font: inherit; }
.stack-form textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0, 155, 211, .12); }
.helper { color: var(--muted); font-size: 11px; line-height: 1.6; margin: -10px 0 18px; }
.panel-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-title-row h2 { margin-bottom: 8px; }
.count-chip { white-space: nowrap; border: 1px solid var(--line); background: rgba(255,255,255,.04); padding: 8px 11px; border-radius: 999px; color: #b8cee0; font-size: 10px; }
.table-action { color: #ff9a35; font-size: 10px; font-weight: 800; }
.table-action:hover { color: #fff; }
.row-actions { display: flex; align-items: center; gap: 7px; }
.danger-button { border: 1px solid rgba(255,111,104,.38); background: rgba(255,111,104,.1); color: #ffaaa5; border-radius: 9px; padding: 8px 11px; cursor: pointer; font-weight: 700; }
.danger-zone { margin-top: 28px; padding-top: 20px; border-top: 1px solid rgba(255,111,104,.28); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.danger-zone h3 { flex-basis: 100%; margin: 0 0 4px; font-size: 14px; color: #ffaaa5; }
.danger-zone p { flex-basis: 100%; color: var(--muted); font-size: 9px; line-height: 1.5; }
.client-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.summary-card { min-height: 100px; border: 1px solid var(--line); border-radius: 15px; padding: 18px; background: linear-gradient(145deg,rgba(16,73,126,.88),rgba(5,42,87,.9)); display: flex; flex-direction: column; justify-content: space-between; }
.summary-card small { color: #9cc7df; letter-spacing: .14em; font-size: 8px; }
.summary-card strong { font-size: 28px; }
.summary-card .small-value { font-size: 14px; line-height: 1.35; word-break: break-word; }
.linked-section + .linked-section { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.workflow-guide { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 20px; }
.workflow-guide > div { position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 17px 18px 17px 58px; background: rgba(7,45,92,.84); min-height: 82px; }
.workflow-guide span { position: absolute; left: 17px; top: 18px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #ff7900; font-weight: 900; }
.workflow-guide b,.workflow-guide small { display: block; }.workflow-guide small { color: var(--muted); font-size: 9px; margin-top: 6px; line-height: 1.45; }
.reports-layout { display: grid; grid-template-columns: minmax(300px,390px) 1fr; gap: 20px; align-items: start; }
.access-flow { display: grid; grid-template-columns: .8fr 1.35fr 1.2fr .8fr auto; gap: 10px; align-items: end; }
.access-flow label { display: flex; flex-direction: column; gap: 7px; color: #bdc5ce; font-size: 10px; font-weight: 700; }
.access-flow select { width: 100%; border: 1px solid var(--line); background: #062654; color: #fff; border-radius: 11px; padding: 13px; min-width: 0; }
.access-flow select:disabled { opacity: .48; cursor: not-allowed; }
.access-panel .linked-section { margin-top: 30px; }.access-list { max-height: 285px; }
.reports-catalog { margin-top: 20px; }
.configuration-note { margin-top: 28px; border: 1px solid rgba(0,155,211,.32); background: rgba(0,155,211,.08); border-radius: 13px; padding: 17px; }
.configuration-note b { color: #fff; }.configuration-note p { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 7px 0 0; }
.account-profile { display: block; border-radius: 9px; padding: 7px 9px; }
.account-profile:hover { background: rgba(255,255,255,.06); }
.form-link { text-align: center; color: #9cc7df; font-size: 11px; margin: 18px 0 0; }
.form-link a:hover { color: #ff9a35; }
.public-card { width: min(520px,100%); border: 1px solid var(--line); border-radius: 22px; padding: 42px; background: rgba(5,31,67,.92); box-shadow: 0 35px 90px rgba(0,20,50,.4); }
.public-card .brand-large { margin-bottom: 35px; }
.public-card h1 { font-size: 31px; margin: 8px 0 14px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.settings-grid .stack-form { margin-top: 22px; }
.stack-form select { width: 100%; border: 1px solid var(--line); background: #062654; color: #fff; border-radius: 11px; padding: 14px 15px; }
.check-line { flex-direction: row!important; align-items: center; gap: 10px!important; }
.check-line input { width: 17px!important; height: 17px; margin: 0; }
.status-box { display: flex; flex-direction: column; gap: 7px; padding: 18px; margin: 22px 0; border: 1px solid rgba(255,111,104,.3); background: rgba(255,111,104,.08); border-radius: 13px; }
.status-box.is-on { border-color: rgba(62,213,155,.34); background: rgba(62,213,155,.08); }
.status-box small { color: var(--muted); }
button.secondary { border: 1px solid rgba(0,155,211,.5); background: rgba(0,155,211,.12); color: #fff; border-radius: 11px; padding: 14px 17px; cursor: pointer; font-weight: 800; }
button.secondary:disabled { opacity: .4; cursor: not-allowed; }

/* O relatório ocupa a janela inteira e elimina somente a rolagem externa. */
.report-page { height: 100vh; overflow: hidden; }
.report-page .app-main { height: calc(100vh - 74px); max-width: none; padding: 10px 12px 12px; display: flex; flex-direction: column; overflow: hidden; }
.report-page .report-head { flex: 0 0 54px; margin: 0 0 10px; align-items: center; }
.report-page .report-frame { flex: 1 1 auto; height: auto; min-height: 0; }
.report-page .footer { display: none; }

@media (max-width: 900px) {
  .brand-logo-wrap { width: 102px; }
  .report-page .app-main { padding: 9px 12px 11px; }
  .report-page .report-head { flex-basis: 48px; }
  .report-page .report-frame { height: auto; min-height: 0; }
  .client-summary,.workflow-guide { grid-template-columns: 1fr 1fr; }
  .reports-layout { grid-template-columns: 1fr; }
  .access-flow { grid-template-columns: 1fr; }
  .row-actions { flex-direction: column; align-items: stretch; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .client-summary,.workflow-guide { grid-template-columns: 1fr; }
  .panel-title-row { flex-direction: column; }
}

/* V2.0 — sistema responsivo consolidado */
:root {
  --content-max: 1720px;
  --space-page: clamp(16px, 2vw, 34px);
  --space-panel: clamp(17px, 1.55vw, 27px);
  --radius-panel: 16px;
}

html { font-size: clamp(13px, .72vw, 16px); }
body { min-width: 320px; overflow-x: hidden; }
.app-main { width: 100%; max-width: var(--content-max); padding: clamp(22px,2.5vh,34px) var(--space-page) 64px; }
.topbar { height: clamp(62px,6.8vh,74px); padding: 0 var(--space-page); gap: clamp(12px,1.7vw,28px); }
.topbar .brand { min-width: auto; flex: 0 0 auto; }
.brand-logo-wrap { width: clamp(100px,7.5vw,122px); height: clamp(38px,4.3vh,45px); }
.topbar nav { min-width: 0; gap: 3px; }
.topbar nav a { padding: 9px clamp(8px,.75vw,14px); font-size: clamp(10px,.72vw,13px); white-space: nowrap; }
.account { margin-left: auto; gap: 10px; flex: 0 0 auto; }
.account b { font-size: clamp(10px,.68vw,12px); }
.account small { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-toggle { display: none; margin-left: auto; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: #fff; width: 39px; height: 39px; border-radius: 10px; cursor: pointer; }

.page-head { margin-bottom: clamp(20px,2.4vh,30px); gap: 18px; }
.page-head h1 { font-size: clamp(28px,2.2vw,40px); margin: 5px 0 7px; }
.page-head p { margin: 0; }
.compact-head { align-items: center; }
.panel,.empty { padding: var(--space-panel); border-radius: var(--radius-panel); }
.panel h2 { font-size: clamp(16px,1.05vw,20px); margin-bottom: 14px; }
.helper { font-size: clamp(9px,.62vw,11px); margin: -5px 0 14px; }
.stack-form { gap: 13px; margin-top: 20px; }
.stack-form input,.stack-form select,.access-form select,.form-grid input,.form-grid select { min-height: 42px; padding: 10px 12px; font-size: 12px; }
button.primary,.primary.inline,button.secondary { min-height: 42px; padding: 11px 15px; }

.admin-grid { grid-template-columns: minmax(285px,350px) minmax(0,1fr); gap: clamp(16px,1.4vw,22px); align-items: start; }
.settings-grid { gap: clamp(16px,1.4vw,22px); }
.client-summary { gap: 12px; margin-bottom: 16px; }
.summary-card { min-height: 84px; padding: 15px; }
.summary-card strong { font-size: clamp(22px,1.8vw,30px); }
.table-wrap { width: 100%; overflow: auto; border-radius: 10px; }
table { min-width: 720px; font-size: clamp(10px,.65vw,12px); }
th { position: sticky; top: 0; z-index: 1; background: rgba(7,45,92,.98); padding: 10px 11px; }
td { padding: 11px; }
.row-actions { flex-wrap: wrap; }

.report-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,290px),1fr)); gap: clamp(14px,1.2vw,20px); }
.report-card { min-height: clamp(205px,24vh,260px); padding: clamp(22px,1.8vw,30px); }
.report-card h2 { font-size: clamp(19px,1.4vw,25px); }
.report-icon { margin-bottom: clamp(24px,3vh,36px); }

.workflow-strip { display: flex; align-items: center; justify-content: center; gap: clamp(10px,1.4vw,24px); min-height: 48px; padding: 9px 18px; margin: -6px 0 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(7,45,92,.72); color: var(--muted); font-size: 10px; }
.workflow-strip span { display: flex; align-items: center; gap: 8px; }
.workflow-strip b { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: #ff7900; color: #fff; }
.workflow-strip i { color: rgba(255,255,255,.25); font-style: normal; }
.admin-tabs { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 14px; }
.admin-tabs button { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 11px 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(7,45,92,.72); color: #d9e7f0; cursor: pointer; text-align: left; }
.admin-tabs button span { font-weight: 800; }
.admin-tabs button small { color: var(--muted); font-size: 9px; }
.admin-tabs button.active { border-color: rgba(255,121,0,.65); background: linear-gradient(110deg,rgba(255,121,0,.17),rgba(7,45,92,.9)); box-shadow: inset 3px 0 #ff7900; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: tab-in .16s ease-out; }
@keyframes tab-in { from { opacity: 0; transform: translateY(4px); } }
.reports-catalog { margin-top: 0; }
.table-search { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 700; min-width: min(260px,100%); }
.table-search input { min-height: 38px; border: 1px solid var(--line); background: #062654; color: #fff; border-radius: 10px; padding: 9px 12px; }
.access-flow { grid-template-columns: minmax(125px,.8fr) minmax(210px,1.35fr) minmax(210px,1.25fr) minmax(130px,.8fr) auto; }
.compact-linked { margin-top: 20px!important; padding-top: 18px!important; }
.access-list { max-height: min(44vh,430px); }
.form-panel { display: grid; grid-template-columns: minmax(230px,.65fr) minmax(0,1.7fr); gap: clamp(24px,3vw,55px); }
.form-intro { padding: 8px 0; }
.form-intro h2 { font-size: clamp(22px,1.7vw,31px); margin: 8px 0 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 7px; color: #bdc5ce; font-size: 10px; font-weight: 700; }
.form-grid input,.form-grid select { width: 100%; border: 1px solid var(--line); background: #062654; color: #fff; border-radius: 11px; outline: 0; }
.form-grid input:focus,.form-grid select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,155,211,.12); }
.form-grid .span-2 { grid-column: 1/-1; }
.form-actions { display: flex; justify-content: flex-end; }
.form-actions .primary { min-width: 210px; }

/* Relatório: máxima área útil e três modos de visualização. */
.report-page { height: 100dvh; }
.report-page .topbar { height: 62px; }
.report-page .app-main { height: calc(100dvh - 62px); padding: 8px 10px 10px; }
.report-page .report-head { flex: 0 0 48px; margin: 0 2px 7px; }
.report-identification { min-width: 0; }
.report-identification h1 { font-size: clamp(16px,1.15vw,22px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 54vw; }
.report-toolbar { display: flex; align-items: center; gap: 10px; }
.view-switch { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.035); }
.view-switch button { border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); padding: 8px 11px; font-size: 9px; cursor: pointer; }
.view-switch button:last-child { border-right: 0; }
.view-switch button.active,.view-switch button:hover { color: #fff; background: rgba(0,155,211,.18); }
.report-page .report-frame { border-radius: 14px; }
.report-frame:fullscreen { border: 0; border-radius: 0; width: 100vw; height: 100vh; background: #fff; }
.report-frame:fullscreen #powerbi-container { width: 100%; height: 100%; }

.login-shell { width: min(1160px,100%); }
.login-story { min-height: min(590px,calc(100dvh - 80px)); padding: clamp(40px,5vw,72px); }
.login-card { padding: clamp(38px,4vw,62px) clamp(28px,3vw,50px); }
.brand-large { margin-bottom: clamp(38px,7vh,76px); }
.email-settings .panel:first-child .stack-form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.email-settings .panel:first-child .stack-form > input[type="hidden"] { display: none; }
.email-settings .panel:first-child .stack-form .check-line,
.email-settings .panel:first-child .stack-form button { grid-column: 1/-1; }

@media (max-width: 1180px) {
  .topbar { gap: 10px; }
  .topbar nav a { padding-inline: 7px; }
  .brand small { display: none; }
  .account small { max-width: 150px; }
  .access-flow { grid-template-columns: 1fr 1fr; }
  .access-flow button { align-self: end; }
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .topbar nav { display: none; position: absolute; left: var(--space-page); right: var(--space-page); top: calc(100% + 8px); flex-direction: column; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(5,31,67,.98); box-shadow: 0 20px 55px rgba(0,10,35,.45); }
  .topbar nav.open { display: flex; }
  .topbar nav a { font-size: 12px; padding: 11px 13px; }
  .admin-grid,.settings-grid,.form-panel { grid-template-columns: 1fr; }
  .email-settings .panel:first-child .stack-form { grid-template-columns: 1fr 1fr; }
  .admin-tabs { grid-template-columns: 1fr; }
  .workflow-strip { justify-content: flex-start; overflow-x: auto; }
  .workflow-strip span { min-width: max-content; }
  .client-summary { grid-template-columns: 1fr 1fr; }
  .report-page .account { display: none; }
  .report-identification h1 { max-width: 45vw; }
}

@media (max-width: 650px) {
  .app-main { padding-top: 18px; }
  .account { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .status-chip { align-self: flex-start; }
  .panel-title-row { align-items: stretch; }
  .table-search { width: 100%; }
  .access-flow,.form-grid { grid-template-columns: 1fr; }
  .email-settings .panel:first-child .stack-form { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .client-summary { grid-template-columns: 1fr; }
  .report-page .report-head { flex-basis: auto; min-height: 68px; align-items: flex-start; }
  .report-toolbar { align-items: flex-end; flex-direction: column-reverse; gap: 5px; }
  .view-switch button { padding: 7px 8px; }
  .report-identification h1 { max-width: 55vw; white-space: normal; }
}
