:root {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel-2: #f5f7fa;
  --text: #172033;
  --muted: #687385;
  --line: #e3e8ef;
  --primary: #1f2d44;
  --primary-2: #2f405c;
  --accent: #f28b18;
  --accent-2: #fff3e3;
  --success: #12a66a;
  --danger: #be3144;
  --shadow: 0 16px 38px rgba(23, 32, 51, 0.10);
  --shadow-soft: 0 8px 22px rgba(23, 32, 51, 0.07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(31, 45, 68, 0.08), rgba(238, 242, 247, 0) 310px),
    var(--bg);
  color: var(--text);
}

body.segment-electric {
  --accent: #f5b51b;
  --accent-2: #fff6d8;
  --primary: #202635;
  --primary-2: #333b4d;
}

body.segment-climate {
  --accent: #f28b18;
  --accent-2: #fff3e3;
  --primary: #1f2d44;
  --primary-2: #2f405c;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #1d2433;
  cursor: pointer;
  font-weight: 750;
  min-height: 42px;
  padding: 0 16px;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button:hover {
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  min-height: 42px;
  padding: 10px 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(29, 76, 120, 0.72);
  box-shadow: 0 0 0 3px rgba(29, 76, 120, 0.12);
  outline: 0;
}

input:invalid,
select:invalid,
textarea:invalid {
  border-color: var(--danger);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #1f2d44;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 6px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  flex: 0 0 auto;
  font-weight: 900;
  box-shadow: none;
  overflow: hidden;
}

.brand-mark svg {
  display: block;
  height: 46px;
  width: 46px;
}

.brand small {
  display: block;
  color: rgba(255, 255, 255, 0.62);
  margin-top: 2px;
}

#nav {
  display: grid;
  gap: 6px;
}

.nav-button {
  justify-content: flex-start;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  position: relative;
}

.nav-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.nav-button.active {
  background: rgba(242, 139, 24, 0.15);
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-button.active .nav-icon {
  background: var(--accent);
  border-color: transparent;
  color: #1d2433;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  transform: none;
}

.ghost-button {
  background: transparent;
  border: 1px solid var(--line);
  color: inherit;
}

.sidebar .ghost-button {
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.user-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  margin-top: auto;
  padding: 12px;
}

.user-box strong,
.user-box small {
  display: block;
}

.user-box small {
  color: rgba(255, 255, 255, 0.62);
  margin-top: 4px;
}

.content {
  padding: 26px;
  min-width: 0;
}

.auth-mode .app-shell {
  grid-template-columns: 1fr;
}

.auth-mode .sidebar,
.auth-mode .topbar {
  display: none;
}

.auth-mode .content {
  padding: 0;
}

.login-screen {
  align-items: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(242, 139, 24, .20), transparent 28%),
    linear-gradient(135deg, #1f2d44 0%, #263955 50%, #eef2f7 50%, #eef2f7 100%);
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, .95fr) minmax(360px, 460px);
  min-height: 100vh;
  padding: 42px;
}

.login-copy {
  color: #ffffff;
  max-width: 660px;
}

.login-copy .brand-icon {
  margin-bottom: 22px;
}

.login-copy span {
  color: #ffd39b;
  display: block;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.login-copy h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
  margin: 0 0 16px;
  max-width: 760px;
}

.login-copy p {
  color: rgba(255, 255, 255, .74);
  font-size: 17px;
  line-height: 1.55;
  margin: 0;
  max-width: 560px;
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  justify-self: end;
  max-width: 460px;
  padding: 32px;
  width: 100%;
}

.login-panel .brand-icon {
  margin-bottom: 4px;
}

.segment-choice {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 6px;
}

.segment-choice button {
  background: transparent;
  color: var(--muted);
  min-height: 40px;
  padding: 0 10px;
}

.segment-choice button.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: none;
}

.login-panel h2,
.login-panel p {
  margin: 0;
}

.login-panel p {
  color: var(--muted);
}

.demo-logins {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.demo-logins .ghost-button {
  color: var(--text);
  min-width: 0;
  padding: 0 10px;
}

.topbar {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 16px;
  position: sticky;
  top: 12px;
  z-index: 5;
  backdrop-filter: blur(12px);
}

.menu-toggle {
  align-items: center;
  background: var(--primary);
  color: #ffffff;
  display: none;
  gap: 9px;
  min-width: 96px;
}

.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  display: block;
  height: 2px;
  width: 18px;
}

.menu-toggle span {
  position: relative;
}

.menu-toggle span::before,
.menu-toggle span::after {
  left: 0;
  position: absolute;
}

.menu-toggle span::before {
  top: -6px;
}

.menu-toggle span::after {
  top: 6px;
}

.mobile-menu-backdrop {
  background: rgba(12, 18, 29, 0.48);
  inset: 0;
  position: fixed;
  z-index: 35;
}

.mobile-menu-open {
  overflow: hidden;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.1;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  width: min(640px, 100%);
}

.install-app-button {
  background: #ffffff;
  border-color: rgba(18, 51, 93, .18);
  color: var(--primary);
  font-weight: 900;
}

.install-app-button[hidden] {
  display: none;
}

#globalSearch {
  background: #ffffff;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.panel,
.list-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
}

.metric-card {
  overflow: hidden;
  padding: 18px;
  min-height: 104px;
  position: relative;
}

.metric-card::before {
  background: var(--metric-accent, var(--accent));
  content: "";
  height: 5px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.metric-blue {
  --metric-accent: #34445f;
}

.metric-good {
  --metric-accent: #16875b;
}

.metric-warn {
  --metric-accent: #f28b18;
}

.metric-danger {
  --metric-accent: #be3144;
}

.metric-card span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  font-size: 27px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.metric-card:hover,
.panel:hover,
.list-card:hover {
  border-color: #cfd8e6;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  margin-top: 16px;
}

.grid-2 > * {
  min-width: 0;
}

.panel {
  padding: 20px;
}

.tenant-banner {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
}

.executive-banner {
  border-left: 5px solid var(--accent);
  border-top: 0;
}

.home-hero {
  background:
    linear-gradient(135deg, rgba(31, 45, 68, 0.96), rgba(47, 64, 92, 0.92)),
    #1f2d44;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: #ffffff;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  margin-bottom: 16px;
  padding: 22px;
}

.home-hero-main h2 {
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1;
  margin: 8px 0 10px;
}

.home-hero-main p {
  color: rgba(255, 255, 255, 0.74);
  font-size: 15px;
  margin: 0;
  max-width: 660px;
}

.home-pill {
  background: rgba(242, 139, 24, 0.16);
  border: 1px solid rgba(242, 139, 24, 0.34);
  border-radius: 999px;
  color: #ffd39b;
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  padding: 6px 10px;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.secondary-action {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.20);
  color: #ffffff;
}

.secondary-light-action {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
}

.home-hero-side {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #ffffff;
  display: grid;
  gap: 8px;
  padding: 18px;
}

.home-hero-side > span:not(.status),
.home-hero-side small {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 750;
}

.home-hero-side strong {
  font-size: 28px;
}

.home-hero-side .status {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  justify-content: center;
}

.banner-kpis {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.banner-kpis > span:not(.status) {
  background: #fffaf4;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  padding: 8px 10px;
}

.banner-kpis b {
  color: var(--text);
  display: block;
  font-size: 15px;
}

.client-profile {
  background:
    linear-gradient(135deg, rgba(31, 45, 68, .98), rgba(39, 61, 89, .94)),
    var(--primary);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: #ffffff;
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 20px;
}

.client-profile-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.client-profile h2,
.client-profile h3,
.client-profile p {
  margin: 0;
}

.client-profile h2 {
  font-size: clamp(24px, 3vw, 34px);
  margin-top: 8px;
}

.client-profile-head p {
  color: rgba(255, 255, 255, .72);
  font-weight: 700;
  margin-top: 6px;
}

.client-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.client-profile-actions .secondary-light-action {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .18);
  color: #ffffff;
}

.client-profile-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.client-profile-kpis article,
.client-profile-grid article {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 10px;
  padding: 12px;
}

.client-profile-kpis span,
.client-profile-grid small {
  color: rgba(255, 255, 255, .66);
  font-size: 12px;
  font-weight: 800;
}

.client-profile-kpis strong {
  color: #ffffff;
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.client-profile-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-profile-grid article {
  align-content: start;
  display: grid;
  gap: 8px;
  min-height: 118px;
}

.client-profile-grid h3 {
  color: rgba(255, 255, 255, .86);
  font-size: 13px;
  text-transform: uppercase;
}

.client-profile-grid p {
  color: #ffffff;
  font-size: 13px;
  font-weight: 750;
}

.tenant-banner strong,
.tenant-banner small {
  display: block;
}

.tenant-banner small {
  color: var(--muted);
  margin-top: 4px;
}

.settings-hero {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(31, 45, 68, .98), rgba(39, 61, 89, .92)),
    #1f2d44;
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: #ffffff;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 24px;
}

.settings-hero h2,
.settings-hero p {
  margin: 0;
}

.settings-hero h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin-top: 10px;
}

.settings-hero p {
  color: rgba(255, 255, 255, .72);
  margin-top: 6px;
}

.settings-mark {
  align-items: center;
  background: var(--accent);
  border-radius: 14px;
  color: #1f2d44;
  display: flex;
  flex: 0 0 auto;
  font-size: 26px;
  font-weight: 950;
  height: 82px;
  justify-content: center;
  width: 82px;
}

.settings-mark img {
  background: #ffffff;
  border-radius: 12px;
  height: 82px;
  object-fit: contain;
  padding: 7px;
  width: 82px;
}

.settings-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
}

.settings-side {
  display: grid;
  gap: 16px;
}

.settings-form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-form label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 750;
  gap: 6px;
}

.logo-upload-card {
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 14px;
}

.logo-upload-preview {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: inline-flex;
  height: 82px;
  justify-content: center;
  overflow: hidden;
  width: 82px;
}

.company-logo-mark {
  align-items: center;
  background: var(--accent);
  border-radius: 10px;
  color: #1f2d44;
  display: inline-flex;
  font-size: 22px;
  font-weight: 950;
  height: 66px;
  justify-content: center;
  object-fit: contain;
  width: 66px;
}

img.company-logo-mark {
  background: #ffffff;
  padding: 5px;
}

.logo-upload-card strong,
.logo-upload-card small {
  display: block;
}

.logo-upload-card small {
  color: var(--muted);
  margin: 4px 0 10px;
}

.logo-upload-button {
  width: fit-content;
}

.settings-actions {
  grid-column: 1 / -1;
}

.plan-usage {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.plan-usage article {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}

.plan-usage strong,
.plan-usage span {
  display: block;
}

.plan-usage strong {
  font-size: 26px;
}

.plan-usage span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-top: 4px;
}

.panel-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel h2 {
  font-size: 18px;
  margin: 0;
}

.quick-actions {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.compact-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-actions button {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  color: var(--text);
  display: flex;
  font-weight: 800;
  gap: 10px;
  justify-content: flex-start;
  min-height: 64px;
  padding: 12px;
  text-align: left;
}

.quick-actions strong,
.quick-actions small {
  display: block;
}

.quick-actions small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  margin-top: 2px;
}

.quick-actions span {
  align-items: center;
  background: var(--accent-2);
  border: 1px solid rgba(242, 139, 24, 0.22);
  border-radius: 8px;
  color: #a65a00;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  height: 36px;
  justify-content: center;
  width: 40px;
}

.feature-card {
  border-left: 4px solid var(--accent);
}

.home-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  margin-top: 16px;
}

.home-side-stack {
  display: grid;
  gap: 16px;
}

.mini-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-metrics .metric-card {
  box-shadow: none;
  min-height: 92px;
}

.timeline-list {
  display: grid;
  gap: 10px;
}

.timeline-item {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 12px;
}

.timeline-item strong,
.timeline-item small {
  display: block;
}

.timeline-item small {
  color: var(--muted);
  margin-top: 3px;
}

.time-chip {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
  min-width: 58px;
  padding: 8px 10px;
  text-align: center;
}

.timeline-empty {
  background: var(--panel-2);
  border-radius: 10px;
  color: var(--muted);
  padding: 16px;
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-list article {
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 10px;
}

.compact-list span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-list b {
  white-space: nowrap;
}

.service-flow {
  display: grid;
  gap: 10px;
}

.service-flow article {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 3px;
  grid-template-columns: auto 1fr auto;
  padding: 11px;
}

.service-flow strong,
.service-flow small {
  grid-column: 2;
}

.service-flow small {
  color: var(--muted);
}

.service-flow b {
  align-self: center;
  grid-column: 3;
  grid-row: 1 / span 3;
  white-space: nowrap;
}

.flow-type {
  align-self: start;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  grid-row: 1 / span 3;
  padding: 5px 8px;
  text-transform: uppercase;
}

.desktop-only-section {
  margin-top: 16px;
}

.services-header {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 18px;
}

.services-header h2 {
  font-size: 30px;
  margin: 8px 0 6px;
}

.services-header p {
  color: var(--muted);
  margin: 0;
}

.services-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.compact-metric-grid {
  margin-bottom: 16px;
}

.services-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}

.operation-focus {
  background:
    linear-gradient(135deg, rgba(31, 45, 68, .98), rgba(38, 59, 88, .94)),
    var(--primary);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: #ffffff;
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 20px;
}

.operation-focus.empty-focus {
  background: #ffffff;
  border: 1px dashed var(--line);
  box-shadow: var(--shadow-soft);
  color: var(--text);
}

.operation-focus.empty-focus p {
  color: var(--muted);
  max-width: 760px;
}

.operation-focus-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.operation-focus h2,
.operation-focus h3,
.operation-focus p {
  margin: 0;
}

.operation-focus h2 {
  font-size: clamp(24px, 3vw, 34px);
  margin-top: 8px;
}

.operation-focus-head p {
  color: rgba(255, 255, 255, .72);
  font-weight: 700;
  margin-top: 6px;
}

.operation-focus-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.operation-focus-grid article,
.operation-focus-body article {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 10px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.operation-focus-grid span,
.operation-focus-grid small,
.operation-focus-body small {
  color: rgba(255, 255, 255, .66);
  font-size: 12px;
  font-weight: 800;
}

.operation-focus-grid strong {
  color: #ffffff;
  font-size: 20px;
}

.operation-action-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.operation-action-strip button {
  min-height: 38px;
}

.operation-action-strip .secondary-light-action {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .18);
  color: #ffffff;
}

.operation-focus-body {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.operation-focus-body h3 {
  color: rgba(255, 255, 255, .86);
  font-size: 13px;
  text-transform: uppercase;
}

.operation-focus-body p {
  color: rgba(255, 255, 255, .82);
  line-height: 1.45;
}

.operation-readiness {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.operation-readiness span {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  padding: 7px 9px;
}

.operation-readiness .done {
  background: rgba(18, 166, 106, .18);
  color: #d8fff0;
}

.operation-readiness .pending {
  background: rgba(242, 139, 24, .18);
  color: #ffe2bb;
}

.operation-focus .technical-checklist article,
.operation-focus .technical-checklist label {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .16);
  color: #ffffff;
}

.table-link-button {
  background: transparent;
  border: 0;
  color: var(--primary);
  cursor: pointer;
  font-weight: 950;
  height: auto;
  min-height: 0;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.service-pipeline {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 16px;
  overflow: hidden;
  padding: 16px;
}

.service-pipeline .panel-header {
  margin-bottom: 12px;
}

.service-pipeline .panel-header small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
}

.pipeline-board {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  overflow-x: auto;
  padding-bottom: 2px;
}

.pipeline-column {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  min-height: 240px;
  padding: 10px;
}

.pipeline-column header {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.pipeline-column header strong,
.pipeline-column header small {
  display: block;
}

.pipeline-column header small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 3px;
}

.pipeline-column header > span {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary);
  display: inline-flex;
  font-size: 12px;
  font-weight: 950;
  height: 28px;
  justify-content: center;
  min-width: 28px;
  padding: 0 8px;
}

.pipeline-cards {
  display: grid;
  gap: 9px;
}

.pipeline-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 9px;
  display: grid;
  gap: 7px;
  padding: 10px;
}

.pipeline-card-top,
.pipeline-card-foot {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.pipeline-card-top span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pipeline-card .status {
  font-size: 10px;
  padding: 4px 7px;
}

.pipeline-card strong,
.pipeline-card small {
  display: block;
}

.pipeline-card > small,
.pipeline-card-foot small {
  color: var(--muted);
}

.pipeline-card p {
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  margin: 0;
}

.pipeline-card-foot span {
  color: var(--primary);
  font-weight: 950;
}

.pipeline-card-actions {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pipeline-card-actions button {
  font-size: 11px;
  min-height: 34px;
  padding: 0 8px;
}

.pipeline-empty {
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  min-height: 80px;
  padding: 10px;
  text-align: center;
}

.finance-hero {
  align-items: stretch;
  background:
    linear-gradient(135deg, rgba(31, 45, 68, .98), rgba(38, 59, 88, .94)),
    #1f2d44;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: #ffffff;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .7fr);
  margin-bottom: 16px;
  padding: 24px;
}

.finance-hero h2,
.finance-hero p {
  margin: 0;
}

.finance-hero h2 {
  color: #ffffff;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1;
  margin-top: 10px;
}

.finance-hero p {
  color: rgba(255, 255, 255, .72);
  margin-top: 6px;
  max-width: 620px;
}

.finance-hero-kpis {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
}

.finance-hero-kpis span {
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 10px;
  color: rgba(255, 255, 255, .70);
  font-size: 12px;
  font-weight: 800;
  padding: 12px;
}

.finance-hero-kpis small {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
}

.finance-hero-kpis strong {
  color: #ffffff;
  display: block;
  font-size: 20px;
  margin-top: 5px;
}

.finance-rules {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.finance-rules article {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 13px;
}

.finance-rules span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.finance-rules strong {
  font-size: 18px;
}

.finance-rules small {
  color: var(--muted);
}

.cash-health {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.cash-health article {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 8px;
  padding: 16px;
}

.cash-health span,
.cash-health small {
  color: var(--muted);
  font-weight: 750;
}

.cash-health strong {
  font-size: 28px;
}

.cash-health i {
  background: var(--panel-2);
  border-radius: 999px;
  display: block;
  height: 9px;
  overflow: hidden;
}

.cash-health b {
  background: var(--accent);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.finance-toolbar {
  flex-wrap: wrap;
}

.report-toolbar {
  flex-wrap: wrap;
}

.finance-board {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, .7fr);
}

.finance-main-panel {
  padding: 0;
  overflow: hidden;
}

.finance-main-panel .panel-header {
  margin: 0;
  padding: 18px 20px;
}

.finance-main-panel .table-wrap {
  border-radius: 0;
}

.finance-side {
  display: grid;
  gap: 16px;
}

.finance-open-list,
.profit-list,
.category-bars {
  display: grid;
  gap: 10px;
}

.finance-open-list article {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 14px;
}

.finance-open-list strong,
.finance-open-list small,
.profit-list strong,
.profit-list small {
  display: block;
}

.finance-open-list small,
.profit-list small {
  color: var(--muted);
  margin-top: 3px;
}

.positive-value {
  color: var(--success);
}

.negative-value {
  color: var(--danger);
}

.category-bars article {
  display: grid;
  gap: 7px;
}

.category-bars div {
  display: flex;
  font-size: 13px;
  font-weight: 850;
  justify-content: space-between;
}

.category-bars span {
  color: var(--muted);
}

.category-bars i {
  background: linear-gradient(90deg, var(--accent), #f6b15f);
  border-radius: 999px;
  display: block;
  height: 8px;
}

.profit-list article {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--success);
  border-radius: 12px;
  padding: 12px;
}

.report-hero {
  align-items: stretch;
  background:
    linear-gradient(135deg, rgba(31, 45, 68, .98), rgba(32, 55, 84, .94)),
    #1f2d44;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: #ffffff;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .28fr);
  margin-bottom: 16px;
  padding: 24px;
}

.report-hero h2,
.report-hero p {
  margin: 0;
}

.report-hero h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  margin-top: 10px;
}

.report-hero p {
  color: rgba(255, 255, 255, .72);
  margin-top: 10px;
  max-width: 760px;
}

.report-score {
  align-items: center;
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  display: grid;
  justify-items: center;
  padding: 18px;
  text-align: center;
}

.report-score strong {
  font-size: 42px;
  line-height: 1;
}

.report-score span {
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 850;
  margin-top: 8px;
  text-transform: uppercase;
}

.report-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-card-wide {
  grid-column: 1 / -1;
}

.trend-chart {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 240px;
  padding-top: 20px;
}

.trend-chart article {
  display: grid;
  gap: 8px;
  grid-template-rows: minmax(130px, 1fr) auto auto;
}

.trend-chart i {
  align-self: end;
  background: linear-gradient(180deg, var(--accent), #d5710c);
  border-radius: 8px 8px 2px 2px;
  display: block;
  min-height: 12px;
}

.trend-chart span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.trend-chart strong {
  font-size: 14px;
}

.report-bars,
.insight-list,
.rank-list {
  display: grid;
  gap: 10px;
}

.report-bars article {
  display: grid;
  gap: 7px;
}

.report-bars div {
  display: flex;
  font-size: 13px;
  font-weight: 850;
  justify-content: space-between;
}

.report-bars span {
  color: var(--muted);
}

.report-bars i {
  background: var(--accent);
  border-radius: 999px;
  display: block;
  height: 9px;
}

.rank-list article {
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 12px;
}

.rank-list b {
  align-items: center;
  background: var(--primary);
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  font-size: 12px;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.rank-list strong,
.rank-list small,
.insight-list strong,
.insight-list small {
  display: block;
}

.rank-list small,
.insight-list small {
  color: var(--muted);
  margin-top: 3px;
}

.rank-list span {
  font-weight: 900;
  white-space: nowrap;
}

.insight-list article {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-radius: 10px;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 680px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

th {
  background: #f0f4f9;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: #fbfdff;
}

.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 10px;
  white-space: nowrap;
}

.status.good {
  background: rgba(22, 135, 91, 0.14);
  color: var(--success);
}

.status.warn {
  background: rgba(246, 162, 26, 0.16);
  color: #9a5b00;
}

.status.bad {
  background: rgba(190, 49, 68, 0.14);
  color: var(--danger);
}

.list-grid {
  display: grid;
  gap: 12px;
}

.list-card {
  padding: 14px;
  transition: border-color 140ms ease, transform 140ms ease;
}

.list-card:hover {
  border-color: rgba(29, 76, 120, 0.28);
  transform: none;
}

.list-card strong {
  display: block;
}

.list-card small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.info-tip {
  align-items: center;
  background: #eef3f8;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--primary);
  cursor: help;
  display: inline-flex;
  font-size: 11px;
  font-weight: 950;
  height: 18px;
  justify-content: center;
  line-height: 1;
  margin-left: 4px;
  position: relative;
  text-transform: none;
  vertical-align: text-top;
  width: 18px;
  z-index: 4;
}

.info-tip > em {
  background: #172033;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  bottom: calc(100% + 8px);
  box-shadow: 0 16px 40px rgba(13, 23, 37, .24);
  color: #ffffff;
  display: none;
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
  left: 50%;
  line-height: 1.35;
  max-width: min(280px, 70vw);
  min-width: 220px;
  opacity: 0;
  padding: 10px 11px;
  pointer-events: none;
  position: absolute;
  text-align: left;
  text-transform: none;
  transform: translate(-50%, 4px);
  transition: opacity 140ms ease, transform 140ms ease;
  visibility: hidden;
  white-space: normal;
}

.info-tip > em::after {
  border: 6px solid transparent;
  border-top-color: #172033;
  content: "";
  left: 50%;
  position: absolute;
  top: 100%;
  transform: translateX(-50%);
}

.info-tip:hover,
.info-tip:focus-visible {
  background: #fff4e5;
  border-color: rgba(242, 139, 24, .35);
  outline: none;
}

.info-tip:hover > em,
.info-tip:focus-visible > em {
  display: block;
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.pricing-grid .info-tip,
.finance-rules .info-tip,
.cash-health .info-tip,
.closure-grid .info-tip {
  color: var(--primary);
  font-size: 11px;
  text-transform: none;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.toolbar select,
.toolbar input {
  max-width: 260px;
}

.document-toolbar {
  flex-wrap: wrap;
}

.service-command-center {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.service-command-center article {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 14px;
}

.service-command-center span:first-child,
.service-command-center small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.service-command-center strong {
  font-size: 18px;
}

.status-control {
  display: grid;
  gap: 8px;
}

.status-control select {
  min-height: 38px;
}

.next-actions-panel {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(190px, .7fr) minmax(0, 1.3fr);
  margin-bottom: 14px;
  padding: 14px;
}

.next-actions-panel strong,
.next-actions-panel small {
  display: block;
}

.next-actions-panel small {
  color: var(--muted);
  margin-top: 3px;
}

.next-action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.next-action-list span {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 10px;
}

.pricing-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(22, 34, 52, .06);
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
}

.pricing-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.pricing-head strong,
.pricing-head small {
  display: block;
}

.pricing-head small,
.pricing-grid small,
.pricing-foot {
  color: var(--muted);
}

.pricing-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pricing-grid article {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 104px;
  padding: 12px;
}

.pricing-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pricing-grid strong {
  font-size: 18px;
}

.pricing-grid .suggested-price {
  background: #fff4e5;
  border-color: rgba(242, 139, 24, .32);
  grid-column: span 2;
}

.pricing-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 13px;
  font-weight: 800;
}

.settings-subtitle {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
}

.settings-subtitle strong,
.settings-subtitle small {
  display: block;
}

.settings-subtitle small {
  color: var(--muted);
  margin-top: 3px;
}

.closure-panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(22, 34, 52, .07);
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
}

.closure-header {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.closure-header strong,
.closure-header small {
  display: block;
}

.closure-header small {
  color: var(--muted);
  margin-top: 3px;
}

.closure-progress {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 180px;
}

.closure-progress i {
  background: var(--panel-2);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  display: block;
  height: 10px;
  overflow: hidden;
  width: 120px;
}

.closure-progress b {
  background: var(--success);
  display: block;
  height: 100%;
}

.closure-progress span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.closure-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.closure-grid article {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-height: 90px;
  padding: 11px;
}

.closure-grid article.done {
  background: rgba(18, 166, 106, .08);
  border-color: rgba(18, 166, 106, .25);
}

.closure-grid article.pending {
  background: rgba(242, 139, 24, .09);
  border-color: rgba(242, 139, 24, .25);
}

.closure-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.closure-grid article.done span {
  color: var(--success);
}

.closure-grid article.pending span {
  color: #9a5f0b;
}

.closure-grid strong {
  font-size: 13px;
}

.closure-grid small {
  color: var(--muted);
}

.closure-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.technical-checklist {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checklist-progress {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.checklist-progress span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.checklist-progress i {
  background: var(--panel-2);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line);
  display: block;
  flex: 1;
  height: 9px;
  overflow: hidden;
}

.checklist-progress b {
  background: var(--success);
  display: block;
  height: 100%;
}

.technical-checklist article,
.technical-checklist label {
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 11px;
}

.technical-checklist article.checked,
.technical-checklist label.checked {
  background: rgba(18, 166, 106, .08);
  border-color: rgba(18, 166, 106, .28);
  border-left-color: var(--success);
}

.technical-checklist input,
.technical-checklist span {
  accent-color: var(--success);
  align-items: center;
  border: 2px solid var(--accent);
  border-radius: 5px;
  color: var(--success);
  display: inline-flex;
  font-size: 12px;
  font-weight: 950;
  height: 18px;
  justify-content: center;
  margin: 0;
  width: 18px;
}

.technical-checklist label.checked input,
.technical-checklist article.checked span {
  border-color: var(--success);
}

.technical-checklist strong {
  font-size: 13px;
}

.upload-strip {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px;
}

.upload-strip small {
  color: var(--muted);
  font-weight: 700;
}

.upload-button {
  align-items: center;
  background: var(--primary);
  border: 1px solid rgba(18, 51, 93, 0.18);
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  min-height: 40px;
  padding: 0 14px;
}

.upload-button input {
  display: none;
}

.document-preview {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  padding: 0;
  overflow: hidden;
}

.doc-heading {
  background: var(--primary);
  border-bottom: 0;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
}

.doc-brand-preview {
  align-items: center;
  display: flex;
  gap: 14px;
}

.doc-logo-mark,
.doc-brand-preview > span {
  align-items: center;
  background: var(--accent);
  border-radius: 10px;
  display: inline-flex;
  font-size: 18px;
  font-weight: 950;
  height: 52px;
  justify-content: center;
  object-fit: contain;
  width: 52px;
}

img.doc-logo-mark {
  background: #ffffff;
  padding: 5px;
}

.doc-heading h2,
.doc-heading p {
  margin: 0;
}

.doc-heading p,
.doc-number-preview span,
.doc-number-preview small {
  color: rgba(255, 255, 255, 0.70);
}

.doc-number-preview {
  min-width: 190px;
  text-align: right;
}

.doc-number-preview small,
.doc-number-preview strong,
.doc-number-preview span {
  display: block;
}

.doc-number-preview strong {
  font-size: 24px;
  margin: 4px 0;
}

.doc-preview-body {
  padding: 22px;
}

.doc-preview-body h3 {
  color: var(--primary);
  font-size: 14px;
  letter-spacing: .04em;
  margin-top: 22px;
  text-transform: uppercase;
}

.doc-kv-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.doc-card {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}

.doc-card h3 {
  margin-top: 0;
}

.doc-card p {
  margin-bottom: 0;
}

.doc-total-strip {
  align-items: center;
  background: #fff4e5;
  border: 1px solid rgba(242, 139, 24, .25);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding: 14px 16px;
}

.doc-total-strip span {
  color: #8b5a16;
  font-weight: 850;
  text-transform: uppercase;
}

.doc-total-strip strong {
  font-size: 24px;
}

.doc-note {
  border-left: 4px solid var(--accent);
  color: #29364d;
  padding-left: 12px;
}

.doc-photo-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.doc-photo-grid > div {
  background: repeating-linear-gradient(135deg, #f4f7fb 0, #f4f7fb 10px, #edf2f8 10px, #edf2f8 20px);
  border: 1px dashed #bcc8d8;
  border-radius: 12px;
  color: var(--muted);
  display: grid;
  gap: 8px;
  min-height: 86px;
  padding: 14px;
}

.doc-photo-grid strong,
.doc-photo-grid span {
  display: block;
}

.doc-photo-grid strong {
  color: var(--text);
  margin-bottom: 6px;
}

.doc-photo-grid img {
  aspect-ratio: 16 / 10;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  width: 100%;
}

.empty-evidence {
  color: var(--muted);
}

.signature-image {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  max-height: 120px;
  max-width: 320px;
  object-fit: contain;
  padding: 10px;
  width: 100%;
}

.doc-signatures {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.signature-line {
  border-top: 1px solid var(--text);
  margin-top: 46px;
  padding-top: 8px;
  text-align: center;
}

dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  max-width: 720px;
  width: calc(100% - 28px);
  padding: 22px;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-header h2 {
  margin: 0;
}

.dialog-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0;
}

.dialog-fields label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  font-weight: 750;
  gap: 6px;
}

.field-required::after {
  color: var(--danger);
  content: "obrigatorio";
  font-size: 11px;
  font-weight: 800;
  justify-self: end;
  pointer-events: none;
}

.field-full {
  grid-column: 1 / -1;
}

.form-note {
  background: var(--accent-2);
  border: 1px solid rgba(242, 139, 24, 0.28);
  border-radius: 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  margin: 0;
  padding: 12px;
}

.custom-due-panel {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.custom-due-panel[hidden] {
  display: none;
}

.custom-due-panel strong,
.custom-due-panel small {
  display: block;
}

.custom-due-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.icon-button {
  background: var(--panel-2);
  color: var(--text);
  min-height: 36px;
  padding: 0;
  width: 36px;
  border: 1px solid var(--line);
  font-weight: 900;
}

.row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.danger-button {
  background: rgba(190, 49, 68, 0.14);
  color: var(--danger);
  border-color: rgba(190, 49, 68, 0.24);
}

.good-button {
  background: rgba(22, 135, 91, 0.14);
  border-color: rgba(22, 135, 91, 0.24);
  color: var(--success);
}

.pdf-button {
  background: rgba(18, 51, 93, 0.10);
  color: var(--primary);
  font-size: 11px;
  width: auto;
  min-width: 48px;
  border-color: rgba(18, 51, 93, 0.18);
}

.schedule-hero {
  align-items: center;
  background: var(--primary);
  border-radius: 12px;
  color: #ffffff;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 16px;
  padding: 22px;
}

.schedule-hero h2,
.schedule-hero p {
  margin: 0;
}

.schedule-hero h2 {
  font-size: 30px;
  text-transform: capitalize;
}

.schedule-title-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.schedule-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schedule-nav button {
  background: rgba(255, 255, 255, .10);
  border-color: rgba(255, 255, 255, .18);
  color: #ffffff;
  min-height: 34px;
  padding: 0 12px;
}

.schedule-hero p {
  color: rgba(255, 255, 255, .74);
  margin-top: 6px;
}

.schedule-kpis {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
}

.schedule-kpis span {
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
  font-weight: 800;
  padding: 10px;
}

.schedule-kpis strong {
  color: #ffffff;
  display: block;
  font-size: 22px;
}

.schedule-toolbar {
  flex-wrap: wrap;
}

.schedule-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr);
}

.schedule-calendar-panel {
  overflow: hidden;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  overflow-x: auto;
}

.calendar-weekday {
  background: #f1f5f9;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  padding: 10px;
  text-align: center;
  text-transform: uppercase;
}

.calendar-cell {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  cursor: pointer;
  min-height: 132px;
  padding: 10px;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.calendar-cell:hover {
  background: #fffaf4;
}

.today-cell {
  box-shadow: inset 0 0 0 2px rgba(18, 51, 93, .18);
}

.selected-cell {
  background: #fff7ec;
  box-shadow: inset 0 0 0 2px rgba(242, 139, 24, .64);
}

.calendar-cell strong {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

.muted-cell {
  background: var(--panel-2);
  color: var(--muted);
}

.calendar-events {
  display: grid;
  gap: 6px;
}

.calendar-event {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  color: var(--text);
  display: grid;
  gap: 2px;
  height: auto;
  min-height: 44px;
  padding: 7px 8px;
  text-align: left;
  white-space: normal;
}

.calendar-event.good {
  border-left-color: var(--success);
}

.calendar-event.bad {
  border-left-color: var(--danger);
}

.calendar-event.warn {
  border-left-color: var(--accent);
}

.calendar-event span {
  font-size: 12px;
  font-weight: 850;
}

.calendar-event small {
  color: var(--muted);
  font-size: 11px;
}

.schedule-side {
  display: grid;
  gap: 16px;
}

.route-list {
  display: grid;
  gap: 10px;
}

.route-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 12px;
}

.route-card strong,
.route-card small {
  display: block;
}

.route-card small {
  color: var(--muted);
  margin-top: 3px;
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  grid-column: 2 / -1;
}

.route-actions button {
  min-height: 34px;
  padding: 0 10px;
}

.schedule-alerts {
  display: grid;
  gap: 10px;
}

.schedule-alerts article {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
}

.schedule-alerts strong,
.schedule-alerts small {
  display: block;
}

.schedule-alerts small {
  color: var(--muted);
  margin-top: 4px;
}

.dark {
  color-scheme: dark;
  --bg: #101827;
  --panel: #172236;
  --panel-2: #202d43;
  --text: #edf2f7;
  --muted: #aab7c8;
  --line: #2d3b52;
  --primary: #0f2747;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.dark body,
body.dark {
  background: #101827;
}

.dark .topbar,
.dark .toolbar {
  background: rgba(23, 34, 54, 0.84);
}

.dark #globalSearch,
.dark .calendar-cell {
  background: var(--panel);
}

.dark tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 1040px) {
  .login-screen {
    background: linear-gradient(180deg, #1f2d44 0%, #263955 42%, #eef2f7 42%);
    grid-template-columns: 1fr;
  }

  .login-panel {
    justify-self: stretch;
    margin: 0 auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    box-shadow: 20px 0 48px rgba(12, 18, 29, 0.28);
    height: 100vh;
    left: 0;
    max-width: min(86vw, 320px);
    overflow-y: auto;
    position: fixed;
    top: 0;
    transform: translateX(-104%);
    transition: transform 180ms ease;
    width: 320px;
    z-index: 40;
  }

  .mobile-menu-open .sidebar {
    transform: translateX(0);
  }

  .menu-toggle {
    display: inline-flex;
  }

  #nav {
    grid-template-columns: 1fr;
  }

  .nav-button {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .nav-icon {
    display: inline-flex;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-command-center {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pipeline-board {
    grid-template-columns: repeat(5, minmax(210px, 1fr));
  }

  .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-hero,
  .home-layout,
  .client-profile-grid,
  .settings-grid,
  .schedule-hero,
  .schedule-layout,
  .finance-hero,
  .finance-board,
  .report-hero,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .cash-health {
    grid-template-columns: 1fr;
  }

  .schedule-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .client-profile-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }


  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .login-screen {
    padding: 22px;
  }

  .login-copy h1 {
    font-size: 34px;
  }

  .content {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 8px;
  }

  .topbar-actions,
  .toolbar,
  .demo-logins {
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .dialog-fields {
    grid-template-columns: 1fr;
  }

  dialog {
    border-radius: 0;
    height: 100dvh;
    max-height: 100dvh;
    max-width: none;
    padding: 0;
    width: 100vw;
  }

  #recordForm {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
  }

  .dialog-header {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    padding: 16px 18px;
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .dialog-header h2 {
    font-size: 20px;
    line-height: 1.2;
  }

  .dialog-fields {
    align-content: start;
    margin: 0;
    overflow-y: auto;
    padding: 16px 18px 96px;
  }

  .dialog-actions {
    background: var(--panel);
    border-top: 1px solid var(--line);
    bottom: 0;
    box-shadow: 0 -12px 28px rgba(23, 32, 51, 0.08);
    gap: 10px;
    padding: 12px 18px;
    position: sticky;
    z-index: 2;
  }

  .dialog-actions button {
    flex: 1 1 0;
    min-width: 0;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .compact-actions {
    grid-template-columns: 1fr;
  }

  .service-flow article {
    grid-template-columns: 1fr;
  }

  .service-flow strong,
  .service-flow small,
  .service-flow b,
  .flow-type {
    grid-column: auto;
    grid-row: auto;
  }

  .home-hero {
    padding: 18px;
  }

  .hero-actions,
  .hero-actions button,
  .client-profile-actions,
  .client-profile-actions button {
    width: 100%;
  }

  .client-profile {
    padding: 16px;
  }

  .client-profile-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mini-metrics {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .schedule-kpis,
  .client-profile-kpis,
  .client-profile-grid,
  .operation-focus-grid,
  .operation-focus-body,
  .finance-hero-kpis,
  .finance-rules,
  .settings-form,
  .plan-usage,
  .route-card,
  .custom-due-grid {
    grid-template-columns: 1fr;
  }

  .settings-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .logo-upload-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .route-actions {
    grid-column: auto;
  }

  .route-actions button,
  .schedule-nav,
  .schedule-nav button,
  .schedule-toolbar select,
  .schedule-toolbar button,
  .finance-toolbar select,
  .finance-toolbar button {
    width: 100%;
  }

  .finance-open-list article {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .table-wrap {
    background: transparent;
    border: 0;
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tbody tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    padding: 10px 12px;
  }

  td {
    align-items: flex-start;
    border: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(96px, 0.38fr) minmax(0, 1fr);
    padding: 9px 0;
  }

  td + td {
    border-top: 1px solid var(--line);
  }

  td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  td[data-label="Acoes"],
  td[data-label="PDF / Acoes"] {
    grid-template-columns: 1fr;
  }

  td[data-label="Acoes"]::before,
  td[data-label="PDF / Acoes"]::before {
    margin-bottom: 2px;
  }

  td .row-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  td .row-actions button {
    min-width: 0;
    width: 100%;
  }

  .trend-chart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rank-list article {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .services-header {
    align-items: stretch;
    flex-direction: column;
  }

  .services-actions,
  .operation-action-strip,
  .operation-action-strip button,
  .services-actions button {
    width: 100%;
  }

  .operation-focus {
    padding: 16px;
  }

  .operation-focus-head {
    align-items: stretch;
    flex-direction: column;
  }

  .time-chip {
    width: fit-content;
  }

  .desktop-only-section {
    display: none;
  }

  .banner-kpis {
    justify-content: stretch;
  }

  .banner-kpis > span,
  .banner-kpis .status {
    flex: 1 1 100%;
  }

  .executive-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .service-command-center,
  .pipeline-card-actions,
  .next-actions-panel,
  .pricing-grid,
  .closure-grid,
  .technical-checklist,
  .doc-kv-grid,
  .doc-photo-grid {
    grid-template-columns: 1fr;
  }

  .pricing-head {
    align-items: stretch;
    flex-direction: column;
  }

  .pricing-head button {
    width: 100%;
  }

  .closure-header {
    align-items: stretch;
    flex-direction: column;
  }

  .closure-progress,
  .closure-progress i,
  .closure-actions button {
    width: 100%;
  }

  .document-toolbar select,
  .document-toolbar button,
  .upload-strip label {
    width: 100%;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(96px, 1fr));
  }

  .calendar-cell {
    min-height: 112px;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  body * {
    visibility: hidden;
  }

  .sidebar,
  .topbar,
  .toolbar,
  button {
    display: none !important;
  }

  .app-shell,
  .content {
    display: block;
    padding: 0;
  }

  .document-preview,
  .document-preview * {
    visibility: visible;
  }

  .document-preview {
    border: 0;
    box-shadow: none;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
  }
}
