:root {
  --bg: #07101d;
  --bg-2: #0a1424;
  --panel: rgba(255, 255, 255, 0.965);
  --panel-dark: rgba(10, 20, 36, 0.86);
  --panel-2: #eef1f5;
  --ink: #101827;
  --muted: #647083;
  --line: rgba(191, 195, 201, 0.38);
  --brand: #d4af37;
  --brand-2: #b8860b;
  --accent: #ffffff;
  --steel: #bfc3c9;
  --navy: #0a1424;
  --ok: #1c8f5a;
  --warn: #b8860b;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(212, 175, 55, 0.14), transparent 32%),
    linear-gradient(135deg, #07101d, #0a1424 58%, #050b14);
  background-size: 48px 48px, 48px 48px, auto, auto;
  color: var(--ink);
  font-family: Futura, "Trebuchet MS", Inter, Segoe UI, Roboto, Arial, sans-serif;
  letter-spacing: 0;
}

html[data-theme="light"] body {
  background:
    linear-gradient(rgba(10,20,36,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,20,36,.045) 1px, transparent 1px),
    linear-gradient(135deg, #f7f8fa, #ffffff 52%, #eef1f5);
  background-size: 48px 48px, 48px 48px, auto;
}

html[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, #ffffff, #eef1f5);
  color: #0a1424;
  border-right-color: rgba(10, 20, 36, 0.12);
}

html[data-theme="light"] .sidebar .brand p,
html[data-theme="light"] .sidebar-footer {
  color: #647083;
}

html[data-theme="light"] .nav button {
  color: #263245;
}

html[data-theme="light"] .nav button:hover,
html[data-theme="light"] .nav button.active {
  color: #0a1424;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.22), rgba(10, 20, 36, 0.04));
}

html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: rgba(10, 20, 36, 0.12);
}

html[data-theme="light"] .page-title h2,
html[data-theme="light"] .icon-button {
  color: #0a1424;
}

html[data-theme="light"] .page-title p {
  color: #647083;
}

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

button {
  cursor: pointer;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 460px) 1fr;
  background:
    linear-gradient(90deg, rgba(10, 20, 36, 0.98), rgba(10, 20, 36, 0.72)),
    url("data:image/svg+xml,%3Csvg width='1200' height='900' viewBox='0 0 1200 900' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1200' height='900' fill='%23f2f5f6'/%3E%3Cg stroke='%2317212b' stroke-opacity='.16' fill='none' stroke-width='3'%3E%3Cpath d='M640 70h230v700H640zM698 70v700M812 70v700M640 160h230M640 250h230M640 340h230M640 430h230M640 520h230M640 610h230M640 700h230'/%3E%3Cpath d='M410 210h110v420H410zM465 210v420M410 300h110M410 390h110M410 480h110M410 570h110'/%3E%3Ccircle cx='755' cy='815' r='34'/%3E%3Cpath d='M755 770v-70M712 815h-84M798 815h84'/%3E%3C/g%3E%3C/svg%3E") center/cover;
}

.login-panel {
  background: rgba(255, 255, 255, 0.94);
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--navy);
  color: white;
  font-weight: 800;
  overflow: hidden;
  font-size: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand-mark::before {
  content: none;
  display: none;
}


.brand h1 {
  margin: 0;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-art {
  display: flex;
  align-items: end;
  padding: 44px;
  color: white;
}

.login-art h2 {
  max-width: 660px;
  margin: 0 0 12px;
  font-size: 42px;
  line-height: 1.08;
  text-transform: uppercase;
}

.login-art p {
  max-width: 620px;
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  background: linear-gradient(180deg, rgba(10, 20, 36, 0.98), rgba(7, 16, 29, 0.98));
  color: white;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid rgba(212, 175, 55, 0.22);
  min-height: 0;
  overflow: hidden;
}

.sidebar .brand-mark {
  background: #0a1424;
  border: 1px solid rgba(212, 175, 55, 0.34);
  color: #ffffff;
}

.sidebar .brand p {
  color: rgba(255, 255, 255, 0.7);
}

.nav {
  display: grid;
  gap: 5px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.nav button,
.icon-button {
  border: 0;
  background: transparent;
}

.nav button {
  color: rgba(255, 255, 255, 0.78);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
  text-align: left;
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav button:hover,
.nav button.active {
  color: white;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.22), rgba(255, 255, 255, 0.06));
  box-shadow: inset 3px 0 0 var(--brand);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
  background: rgba(10, 20, 36, 0.9);
  backdrop-filter: blur(12px);
}

.page-title h2 {
  margin: 0;
  font-size: 22px;
  color: #ffffff;
}

.page-title p {
  margin: 3px 0 0;
  color: var(--steel);
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.content {
  padding: 24px 28px 40px;
  display: grid;
  gap: 20px;
}

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

.kpi {
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,248,250,.96));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 3px 12px rgba(23, 33, 43, 0.04);
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.kpi strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  color: #0a1424;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 16px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.13);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(10, 20, 36, 0.04), rgba(212, 175, 55, 0.08));
}

.panel-header h3 {
  margin: 0;
  font-size: 16px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.search {
  min-width: 260px;
}

.table-wrap {
  overflow: auto;
}

.mobile-cards {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  background: #101827;
  color: #ffffff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

tr:hover td {
  background: #fbfcfd;
}

.list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.list-row {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.list-row strong {
  font-size: 14px;
}

.list-row span {
  color: var(--muted);
  font-size: 13px;
}

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

.report-form {
  padding: 16px;
}

.report-kpis {
  padding: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

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

label {
  color: #2d3d49;
  font-size: 13px;
  font-weight: 650;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #cbd5dc;
  border-radius: 8px;
  background: white;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f7fafb;
  font-weight: 600;
}

.checkline input {
  width: auto;
  min-height: auto;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cbd5dc;
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(20, 108, 99, 0.13);
}

.btn {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0a1424;
  font-weight: 700;
  white-space: nowrap;
}

.btn:hover {
  background: linear-gradient(135deg, #e2c567, var(--brand-2));
}

.btn.secondary {
  background: #ffffff;
  color: #0a1424;
  border-color: var(--line);
}

.btn.secondary:hover {
  background: var(--panel-2);
}

.btn.danger {
  background: var(--danger);
}

.btn.small {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 13px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: #ffffff;
}

.icon-button:hover {
  background: rgba(212, 175, 55, 0.2);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  color: #26323b;
  background: #e6edf1;
}

.badge.ok {
  color: white;
  background: var(--ok);
}

.badge.warn {
  color: #3e2600;
  background: #ffd98a;
}

.badge.danger {
  color: white;
  background: var(--danger);
}

.badge.info {
  color: #0a1424;
  background: var(--brand);
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(16, 42, 47, 0.5);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal {
  width: min(860px, 100%);
  max-height: min(860px, 92vh);
  overflow: auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(16, 42, 47, 0.28);
}

.modal-head,
.modal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
}

.modal-body {
  padding: 18px;
}

.modal-foot {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  justify-content: end;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  background: #0a1424;
  color: white;
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.portal-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(10, 20, 36, 0.96), rgba(10, 20, 36, 0.78)),
    url("data:image/svg+xml,%3Csvg width='1200' height='900' viewBox='0 0 1200 900' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1200' height='900' fill='%23f2f5f6'/%3E%3Cg stroke='%2317212b' stroke-opacity='.16' fill='none' stroke-width='3'%3E%3Cpath d='M640 70h230v700H640zM698 70v700M812 70v700M640 160h230M640 250h230M640 340h230M640 430h230M640 520h230M640 610h230M640 700h230'/%3E%3Cpath d='M410 210h110v420H410zM465 210v420M410 300h110M410 390h110M410 480h110M410 570h110'/%3E%3C/g%3E%3C/svg%3E") center/cover;
}

.portal-card {
  width: min(920px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(16, 42, 47, 0.28);
  padding: 26px;
  border: 1px solid rgba(212, 175, 55, 0.28);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.portal-brand img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
}

.portal-brand h1 {
  margin: 0;
  font-size: 26px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.portal-brand p {
  margin: 4px 0 0;
  color: var(--muted);
}

.portal-form {
  display: grid;
  gap: 16px;
}

.portal-alert,
.portal-success {
  border-radius: 8px;
  padding: 16px;
  background: #eef3f6;
  color: var(--ink);
}

.portal-success {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.portal-success strong {
  font-size: 30px;
  color: var(--brand);
}

.client-portal {
  min-height: 100vh;
  padding: 22px;
  display: grid;
  gap: 18px;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(135deg, #07101d, #0a1424 58%, #050b14);
  background-size: 48px 48px, 48px 48px, auto;
}

.client-hero,
.client-welcome,
.client-login,
.client-panel,
.client-kpi {
  width: min(1180px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(212, 175, 55, 0.22);
  background: rgba(255, 255, 255, 0.965);
  border-radius: 8px;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.14);
}

.client-hero {
  min-height: 76px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.client-hero .portal-brand {
  margin: 0;
}

.client-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 8px;
  background: #0a1424;
  color: #ffffff;
  font-size: 20px;
  cursor: pointer;
}

.client-mobile-menu {
  display: none;
  width: min(1180px, 100%);
  margin: -8px auto 0;
  padding: 8px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.client-mobile-menu a {
  display: block;
  padding: 12px;
  border-radius: 6px;
  color: #0a1424;
  font-weight: 800;
  text-decoration: none;
}

.client-mobile-menu a:hover {
  background: rgba(212, 175, 55, 0.14);
}

.client-welcome,
.client-login {
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  background:
    linear-gradient(120deg, rgba(255,255,255,.98), rgba(238,241,245,.95)),
    linear-gradient(90deg, rgba(212, 175, 55, 0.16), transparent);
}

.client-login {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  align-items: stretch;
}

.client-welcome span {
  color: var(--brand-2);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}

.client-welcome h2,
.client-login h2 {
  margin: 4px 0 6px;
  color: #0a1424;
  font-size: 30px;
}

.client-welcome p,
.client-login p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.client-login-form {
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.client-kpis {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.client-kpi {
  padding: 16px;
  margin: 0;
}

.client-kpi span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.client-kpi strong {
  color: #0a1424;
  font-size: 28px;
}

.client-quick-actions {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.client-quick-actions a {
  padding: 14px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: #0a1424;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.1);
}

.client-quick-actions a.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.client-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.client-panel {
  overflow: hidden;
}

.client-panel .portal-form {
  padding: 16px;
}

.client-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.client-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.client-item div {
  display: grid;
  gap: 4px;
}

.client-item span,
.client-item small {
  color: var(--muted);
}

.client-item small {
  font-size: 12px;
}

.file-upload {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px dashed rgba(10, 20, 36, 0.25);
  border-radius: 8px;
  background: #fbfcfd;
}

.file-upload input[type="file"] {
  width: 100%;
}

.file-link {
  color: #0a1424;
  font-weight: 800;
}

.file-hint {
  color: var(--muted);
  font-size: 13px;
}

.mobile-menu {
  display: none;
}

.mobile-menu {
  font-size: 0;
}

.mobile-menu::before {
  content: "☰";
  font-size: 20px;
}

.sidebar-scrim,
.mobile-module-bar {
  display: none;
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .client-grid,
  .client-login {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  html,
  body {
    overflow-x: hidden;
  }

  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-panel {
    min-height: 100vh;
    padding: 28px 20px;
  }

  .login-art {
    display: none;
  }

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

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 340px);
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    max-height: 100dvh;
    padding: 16px 12px max(18px, env(safe-area-inset-bottom));
    overflow: hidden;
  }

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

  .sidebar .brand {
    flex: 0 0 auto;
  }

  .sidebar .brand h1 {
    font-size: 18px;
  }

  .nav {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
  }

  .nav button {
    min-height: 46px;
    padding: 12px;
    font-size: 15px;
  }

  .sidebar-footer {
    flex: 0 0 auto;
    margin-top: 0;
  }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    border: 0;
    background: rgba(5, 11, 20, 0.58);
  }

  .mobile-menu {
    display: inline-grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    background: rgba(212, 175, 55, 0.16);
    border: 1px solid rgba(212, 175, 55, 0.2);
  }

  .topbar {
    position: static;
    min-height: auto;
    padding: 12px;
    align-items: stretch;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 10px;
  }

  .page-title {
    min-width: 0;
  }

  .page-title h2 {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-title p {
    display: none;
  }

  .top-actions {
    display: contents;
  }

  .theme-toggle {
    grid-column: 3;
  }

  .toolbar {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .toolbar .btn,
  .toolbar .search {
    width: 100%;
    min-width: 0;
  }

  .content {
    padding: 12px 12px max(28px, env(safe-area-inset-bottom));
    gap: 14px;
  }

  .mobile-module-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 12px;
    background: rgba(10, 20, 36, 0.94);
    border-bottom: 1px solid rgba(212, 175, 55, 0.18);
    -webkit-overflow-scrolling: touch;
  }

  .mobile-module-bar button {
    flex: 0 0 auto;
    min-width: 92px;
    min-height: 54px;
    padding: 8px 10px;
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    display: grid;
    justify-items: center;
    gap: 4px;
    font-size: 12px;
  }

  .mobile-module-bar button.active {
    color: #0a1424;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
  }

  .mobile-module-bar .nav-icon {
    width: 20px;
    height: 20px;
  }

  .mobile-module-bar .nav-icon svg {
    width: 19px;
    height: 19px;
  }

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

  .kpi {
    padding: 13px;
  }

  .kpi strong {
    font-size: 23px;
  }

  .panel {
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.11);
  }

  .panel-header {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .panel-header .btn {
    width: 100%;
  }

  .table-wrap {
    display: none;
  }

  .mobile-cards {
    display: grid;
    gap: 10px;
    padding: 12px;
  }

  .mobile-card {
    display: grid;
    gap: 9px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
  }

  .mobile-card-title {
    font-size: 16px;
    font-weight: 800;
    color: #0a1424;
    overflow-wrap: anywhere;
  }

  .mobile-card-select {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .mobile-card-select input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--brand-2);
  }

  .mobile-card-row {
    display: grid;
    grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    font-size: 13px;
  }

  .mobile-card-row span {
    color: var(--muted);
  }

  .mobile-card-row strong {
    color: #17212b;
    font-weight: 700;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .mobile-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 4px;
  }

.mobile-card-actions .btn {
  width: 100%;
  min-height: 38px;
}

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

.mobile-card-actions-wide .btn:last-child {
  grid-column: 1 / -1;
}

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

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

  .search {
    min-width: 100%;
  }

  .modal-backdrop {
    align-items: stretch;
    justify-items: stretch;
    padding: 0;
  }

  .modal {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }

  .modal-head,
  .modal-foot {
    padding: 13px;
  }

  .modal-body {
    padding: 13px;
  }

  .modal-foot {
    position: sticky;
    bottom: 0;
    background: #ffffff;
    display: grid;
    grid-template-columns: 1fr;
  }

  input,
  select,
  textarea,
  .btn {
    min-height: 44px;
  }

  .client-portal {
    padding: 12px;
  }

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

  .client-welcome {
    grid-template-columns: 1fr;
  }

  .client-kpis {
    grid-template-columns: 1fr 1fr;
  }

  .client-item {
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  .login-panel {
    padding: 28px 22px;
  }

  .portal-page {
    padding: 0;
    place-items: stretch;
  }

  .portal-card {
    min-height: 100vh;
    border-radius: 0;
    padding: 22px;
  }

  .portal-brand h1 {
    font-size: 22px;
  }

  .client-kpis {
    grid-template-columns: 1fr;
  }

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

  .toolbar,
  .top-actions {
    width: 100%;
  }

  .btn {
    width: 100%;
  }
}

/* Estrutura operacional inspirada nos prints, mantendo a identidade Fortaltech. */
:root {
  --bg: #07101d;
  --bg-2: #0a1424;
  --panel: rgba(255, 255, 255, 0.965);
  --panel-dark: rgba(10, 20, 36, 0.86);
  --panel-2: #eef1f5;
  --ink: #101827;
  --muted: #647083;
  --line: rgba(191, 195, 201, 0.38);
  --brand: #d4af37;
  --brand-2: #b8860b;
  --accent: #ffffff;
  --steel: #bfc3c9;
  --navy: #0a1424;
  --ok: #1c8f5a;
  --warn: #b8860b;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

html,
body {
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 0%, rgba(212, 175, 55, 0.14), transparent 32%),
    linear-gradient(135deg, #07101d, #0a1424 58%, #050b14);
  background-size: 48px 48px, 48px 48px, auto, auto;
  color: var(--ink);
  font-family: Futura, "Trebuchet MS", Inter, Segoe UI, Roboto, Arial, sans-serif;
}

html[data-theme="light"] body {
  background:
    linear-gradient(rgba(10,20,36,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10,20,36,.045) 1px, transparent 1px),
    linear-gradient(135deg, #f7f8fa, #ffffff 52%, #eef1f5);
  background-size: 48px 48px, 48px 48px, auto;
}

.app-shell {
  grid-template-columns: 264px minmax(0, 1fr);
  background: transparent;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 82px minmax(0, 1fr);
}

.sidebar,
html[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(10, 20, 36, 0.98), rgba(7, 16, 29, 0.98));
  color: #ffffff;
  padding: 22px 16px;
  gap: 18px;
  border-right: 1px solid rgba(212, 175, 55, 0.22);
  box-shadow: none;
}

.sidebar .brand {
  min-height: auto;
  padding: 0 8px 8px;
  justify-content: center;
  background: transparent;
  color: #ffffff;
  border-bottom: 0;
  position: relative;
  text-align: center;
}

.brand-lockup {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
}

.sidebar .brand-mark {
  width: 72px;
  height: 72px;
  background: #0a1424;
  border: 1px solid rgba(212, 175, 55, 0.34);
}

.sidebar .brand h1 {
  color: #ffffff;
  font-size: 18px;
  line-height: 1.15;
  text-transform: uppercase;
}

.sidebar .brand p {
  display: none;
  color: rgba(255, 255, 255, 0.7);
}

.collapse-nav {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  cursor: pointer;
}

.sidebar-collapsed .sidebar {
  padding-inline: 12px;
}

.sidebar-collapsed .sidebar .brand h1,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .sidebar-footer span {
  display: none;
}

.sidebar-collapsed .sidebar .brand-mark {
  width: 48px;
  height: 48px;
}

.sidebar-collapsed .collapse-nav {
  position: absolute;
  right: -8px;
  top: 4px;
}

.sidebar-collapsed .nav button {
  justify-content: center;
  padding: 12px 8px;
}

.nav {
  gap: 5px;
  padding: 0 2px 0 0;
  background: transparent;
}

.nav button,
html[data-theme="light"] .nav button {
  min-height: auto;
  padding: 11px 12px;
  border-radius: 8px;
  border-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
}

.nav button:hover,
.nav button.active,
html[data-theme="light"] .nav button:hover,
html[data-theme="light"] .nav button.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.22), rgba(255, 255, 255, 0.06));
  box-shadow: inset 3px 0 0 var(--brand);
}

.nav-icon {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  border: 0;
  border-radius: 0;
  color: currentColor;
}

.nav button.active .nav-icon,
.nav button:hover .nav-icon {
  border-color: transparent;
  color: currentColor;
}

.sidebar-footer {
  margin-top: auto;
  padding: 0;
  color: rgba(255, 255, 255, 0.72);
  border-top: 0;
}

.sidebar-footer .btn {
  background: #ffffff;
  color: #0a1424;
  border-color: var(--line);
}

.topbar,
html[data-theme="light"] .topbar {
  min-height: 72px;
  padding: 16px 28px;
  background: rgba(10, 20, 36, 0.9);
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.page-title h2 {
  color: #ffffff;
}

.page-title p {
  color: var(--steel);
}

html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.92);
}

html[data-theme="light"] .page-title h2,
html[data-theme="light"] .icon-button {
  color: #0a1424;
}

html[data-theme="light"] .page-title p {
  color: #647083;
}

.content {
  padding: 24px 28px 40px;
  gap: 20px;
  background: transparent;
}

.btn,
.btn:hover {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0a1424;
  border-color: transparent;
  border-radius: 8px;
  box-shadow: none;
}

.btn.secondary,
.btn.secondary:hover {
  background: #ffffff;
  color: #0a1424;
  border-color: var(--line);
}

.btn.danger {
  background: var(--danger);
  color: #ffffff;
}

.filter-panel,
.home-start,
.panel,
.list-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.13);
}

.filter-panel,
.home-start {
  padding: 16px;
}

.filter-form {
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr) 34px;
}

.filter-row {
  grid-template-columns: minmax(220px, 1fr) auto auto;
}

.filter-funnel,
.link-button {
  color: #0a6380;
}

input,
select,
textarea {
  border-radius: 8px;
  border-color: #cbd5dc;
  min-height: 40px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.panel-header {
  min-height: auto;
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(10, 20, 36, 0.04), rgba(212, 175, 55, 0.08));
  border-bottom: 1px solid var(--line);
}

.panel-header h3 {
  color: #101827;
  font-size: 16px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.table-wrap {
  padding: 0;
}

table {
  min-width: 760px;
  border: 0;
}

th {
  background: #101827;
  color: #ffffff;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

tbody tr:nth-child(even) td {
  background: transparent;
}

tbody tr:hover td {
  background: #fbfcfd;
}

.home-start {
  min-height: auto;
}

.home-link-list button {
  color: #0a6380;
  font-size: 17px;
}

.kpi,
.list-row,
.mobile-card,
.client-panel,
.client-kpi {
  border-radius: 8px;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    width: min(86vw, 340px);
    background: linear-gradient(180deg, rgba(10, 20, 36, 0.98), rgba(7, 16, 29, 0.98));
    padding: 16px 12px max(18px, env(safe-area-inset-bottom));
  }

  .sidebar .brand {
    justify-content: flex-start;
  }

  .sidebar .brand h1 {
    font-size: 18px;
  }

  .nav button {
    min-height: 46px;
    padding: 12px;
  }

  .nav-icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  .topbar {
    grid-template-columns: 42px minmax(0, 1fr) 42px 42px;
    padding: 12px;
  }

  .content {
    padding: 12px 12px max(28px, env(safe-area-inset-bottom));
  }

  .mobile-module-bar {
    background: rgba(10, 20, 36, 0.94);
  }

  .mobile-module-bar button.active {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #0a1424;
    border-color: rgba(212, 175, 55, 0.18);
  }

  .filter-form,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    display: none;
  }

  .mobile-cards {
    display: grid;
  }
}

.breadcrumb {
  display: block;
  margin-bottom: 4px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 260px;
  padding: 7px 8px 7px 14px;
  border: 1px solid rgba(212, 175, 55, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  white-space: nowrap;
  cursor: pointer;
}

.user-chip::-webkit-details-marker {
  display: none;
}

.user-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 50%;
}

.user-chip strong {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0a1424;
}

.user-menu {
  position: relative;
}

.user-menu summary {
  list-style: none;
}

.user-menu-popover {
  position: absolute;
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 190px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 8px;
  background: #0a1424;
  box-shadow: var(--shadow);
}

.user-menu-popover button {
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
}

.user-menu-popover button:hover {
  background: rgba(212, 175, 55, 0.16);
}

html[data-theme="light"] .user-chip {
  background: #ffffff;
  color: #0a1424;
}

.profile-editor {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
}

.profile-preview {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fa;
}

.profile-preview img,
.profile-preview strong {
  display: grid;
  width: 104px;
  height: 104px;
  place-items: center;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0a1424;
  font-size: 38px;
}

.filter-minimal {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px) minmax(190px, 260px) auto;
  gap: 12px;
  align-items: end;
}

.filter-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.signature-modal {
  max-width: 760px;
}

.signature-canvas {
  width: 100%;
  height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  touch-action: none;
}

.ops-filter {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(160px, 220px) auto;
  gap: 14px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.visual-widget-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.visual-widget {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.visual-widget svg {
  width: 22px;
  height: 22px;
}

.visual-widget i {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.14);
  color: var(--brand-2);
  font-style: normal;
}

.visual-widget span,
.visual-widget small {
  color: var(--muted);
  font-size: 12px;
}

.visual-widget strong {
  display: block;
  margin-top: 4px;
  color: #0a1424;
  font-size: 24px;
  line-height: 1;
}

.visual-widget.donut-mini {
  grid-template-columns: 58px minmax(0, 1fr);
  cursor: default;
}

.visual-widget:nth-child(1) {
  border-left: 5px solid #d4af37;
}

.visual-widget:nth-child(2) {
  border-left: 5px solid #1d6fb8;
}

.visual-widget:nth-child(3) {
  border-left: 5px solid #1c8f5a;
}

.visual-widget:nth-child(4) {
  border-left: 5px solid #b42318;
}

.visual-widget:nth-child(5) {
  border-left: 5px solid #0a6380;
}

.ops-kpi:nth-child(4n + 1) {
  border-top: 4px solid #d4af37;
}

.ops-kpi:nth-child(4n + 2) {
  border-top: 4px solid #1d6fb8;
}

.ops-kpi:nth-child(4n + 3) {
  border-top: 4px solid #1c8f5a;
}

.ops-kpi:nth-child(4n + 4) {
  border-top: 4px solid #b8860b;
}

.mini-donut {
  width: 58px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--brand) 0 var(--value), rgba(10, 20, 36, 0.1) var(--value) 100%);
  position: relative;
}

.mini-donut::after {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: #ffffff;
}

.pill {
  border-radius: 999px;
  min-height: 40px;
}

.loading-panel {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 800;
}

.calendar-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.calendar-panel {
  overflow: hidden;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays span {
  padding: 10px;
  background: #0a1424;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.calendar-day {
  min-height: 132px;
  padding: 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.calendar-day.muted {
  background: #f3f5f7;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px var(--brand);
}

.calendar-day > strong {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 20, 36, 0.06);
  color: #0a1424;
}

.calendar-events {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.calendar-events button,
.agenda-event-row {
  border: 0;
  border-radius: 6px;
  background: rgba(212, 175, 55, 0.14);
  color: #0a1424;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.calendar-events button {
  padding: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-events button span {
  margin-right: 6px;
  color: var(--brand-2);
}

.calendar-events small {
  color: var(--muted);
}

.agenda-side .list {
  padding: 12px;
}

.agenda-event-row {
  width: 100%;
}

.agenda-event-row small {
  color: var(--muted);
}

.contract-detail {
  display: grid;
  gap: 14px;
}

.contract-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.contract-title-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.contract-title-row h3 {
  margin: 2px 0 0;
  color: #b42318;
  font-size: 28px;
}

.contract-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.contract-tabs button {
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #f3f5f7;
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.contract-tabs button:last-child {
  border-right: 0;
}

.contract-tabs button.active {
  background: #ffffff;
  color: #b42318;
  box-shadow: inset 0 3px 0 var(--brand);
}

.contract-section {
  overflow: hidden;
}

.section-note {
  margin: 0;
  padding: 0 16px 14px;
  color: var(--muted);
  line-height: 1.5;
}

.contract-form-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 10px 16px;
  padding: 16px;
}

.contract-field {
  display: contents;
}

.contract-field span {
  color: var(--muted);
}

.contract-field strong {
  min-height: 34px;
  padding: 8px 10px;
  border-left: 3px solid #e33b2f;
  border-radius: 6px;
  background: #ffffff;
  color: #0a1424;
  font-weight: 700;
  white-space: pre-wrap;
}

.contract-text {
  min-height: 180px;
  padding: 18px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.ops-kpis {
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.ops-kpi {
  text-align: left;
  cursor: pointer;
}

.ops-kpi .kpi-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ops-kpi svg,
.panel-header svg,
.more-filters svg {
  width: 18px;
  height: 18px;
}

.ops-kpi em {
  display: block;
  margin-top: 8px;
  color: #0a6380;
  font-style: normal;
  font-size: 12px;
}

.ops-grid {
  align-items: stretch;
}

.ok-text {
  color: #1c8f5a;
  font-weight: 800;
}

.warn-text {
  color: #b8860b;
  font-weight: 800;
}

.danger-text {
  color: #b42318;
  font-weight: 900;
}

.chart-panel {
  min-height: 320px;
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 24px;
  height: 240px;
  margin: 20px;
  padding: 18px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(10, 20, 36, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 20, 36, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
}

.bar-chart span {
  width: clamp(28px, 9vw, 64px);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--brand), #0a6380);
}

.donut-wrap {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  padding: 26px;
}

.donut {
  width: 170px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#d4af37 0 28%, #0a6380 28% 48%, #1c8f5a 48% 68%, #b8860b 68% 82%, #bfc3c9 82% 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 44px;
  border-radius: 50%;
  background: var(--panel);
}

.legend {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--brand);
}

.ops-list-filter .form-grid {
  grid-template-columns: minmax(260px, 1fr) 180px auto auto;
  align-items: end;
}

.action-field .btn {
  width: 100%;
}

.more-filters {
  grid-column: 1 / -1;
  justify-self: end;
}

.ops-list-panel .panel-header span {
  color: var(--muted);
  font-size: 12px;
}

.dense-table {
  min-width: 980px;
}

.os-table {
  min-width: 1380px;
}

.dense-table th {
  white-space: nowrap;
}

.select-col {
  width: 42px;
  text-align: center;
}

.select-col input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-2);
  cursor: pointer;
}

.dense-table td {
  vertical-align: middle;
}

.expand-cell {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: #0a1424;
  font-weight: 800;
}

.detail-row > td {
  padding: 0;
  background: #f7f8fa;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr minmax(260px, 0.9fr);
  gap: 14px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

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

.detail-grid section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.detail-grid h4 {
  margin: 0 0 10px;
  color: #0a1424;
}

.detail-grid dl {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 7px 10px;
  margin: 0;
}

.detail-grid dt {
  color: var(--muted);
}

.detail-grid dd {
  margin: 0;
  color: #0a1424;
  font-weight: 700;
}

.detail-grid p {
  margin: 0 0 10px;
  color: #0a1424;
  line-height: 1.5;
}

.detail-signatures > div {
  display: grid;
  gap: 10px;
}

.signature-status-card {
  display: grid;
  gap: 6px;
  min-height: 100px;
  padding: 10px;
  border: 1px dashed rgba(10, 20, 36, 0.22);
  border-radius: 8px;
  background: #fbfcfd;
}

.signature-status-card.signed {
  border-style: solid;
  border-color: rgba(28, 143, 90, 0.38);
}

.signature-status-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.signature-status-card strong {
  color: #b42318;
}

.signature-status-card img,
.signature-status-card svg {
  width: 100%;
  max-height: 72px;
  object-fit: contain;
  border-bottom: 1px solid #0a1424;
  background: #ffffff;
}

.signature-svg polyline,
.signature-status-card svg polyline {
  fill: none;
  stroke: #0a1424;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.signature-status-card small {
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 160px;
  min-height: 24px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
}

.status-pill.blue {
  background: #1d6fb8;
}

.status-pill.orange {
  background: #b8860b;
}

.status-pill.green {
  background: #1c8f5a;
}

.status-pill.gray {
  background: #647083;
}

.row-menu {
  position: relative;
  display: inline-block;
}

.row-menu summary {
  list-style: none;
  cursor: pointer;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #0a1424;
  font-weight: 800;
  font-size: 12px;
}

.row-menu summary::-webkit-details-marker {
  display: none;
}

.row-menu div {
  position: absolute;
  right: 0;
  z-index: 20;
  display: grid;
  min-width: 160px;
  margin-top: 8px;
  padding: 6px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 8px;
  background: #0a1424;
  box-shadow: var(--shadow);
}

.row-menu button {
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #ffffff;
  text-align: left;
  cursor: pointer;
}

.row-menu button:hover {
  background: rgba(212, 175, 55, 0.16);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 16px;
  color: var(--muted);
}

.pagination button,
.pagination select {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #0a1424;
}

.pagination button {
  min-width: 32px;
}

.pagination button.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #0a1424;
  border-color: transparent;
  font-weight: 900;
}

.pagination.compact {
  justify-content: center;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.settings-card {
  display: grid;
  gap: 8px;
  min-height: 130px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.settings-card svg {
  width: 24px;
  height: 24px;
  color: var(--brand-2);
}

.settings-card span {
  color: var(--muted);
}

.list-tool-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #0a1424;
  font-weight: 800;
  cursor: pointer;
}

.list-tool-button.export {
  border-color: rgba(28, 143, 90, 0.28);
  color: #1c8f5a;
}

.list-tool-button svg {
  width: 16px;
  height: 16px;
}

.selected-counter {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.settings-sections .panel {
  overflow: hidden;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

@media (max-width: 1100px) {
  .ops-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .ops-list-filter .form-grid,
  .ops-filter {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .collapse-nav {
    display: none;
  }

  .user-chip span {
    display: none;
  }

  .user-menu {
    position: static;
  }

  .user-menu-popover {
    position: fixed;
    top: 62px;
    right: 12px;
    left: 12px;
    min-width: 0;
    margin-top: 0;
  }

  .ops-kpis,
  .visual-widget-row,
  .client-quick-actions,
  .ops-list-filter .form-grid,
  .ops-filter,
  .filter-minimal,
  .profile-editor,
  .donut-wrap {
    grid-template-columns: 1fr;
  }

  .ops-list-panel .table-wrap {
    display: none;
  }

  .visual-widget {
    min-height: 74px;
    padding: 12px;
  }

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

  .calendar-weekdays {
    display: none;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .calendar-day {
    min-height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .calendar-day.muted {
    display: none;
  }

  .contract-tabs {
    display: flex;
    overflow-x: auto;
  }

  .contract-tabs button {
    flex: 0 0 auto;
    min-width: 150px;
  }

  .contract-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .contract-title-row h3 {
    font-size: 22px;
  }

  .contract-form-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .contract-field {
    display: grid;
    gap: 4px;
  }

  .detail-grid,
  .detail-grid.compact {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .detail-grid dl {
    grid-template-columns: 1fr;
  }

  .client-hero {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
  }

  .client-hero .portal-brand {
    min-width: 0;
  }

  .client-hero .portal-brand h1,
  .client-hero .portal-brand p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .client-menu-button {
    display: grid;
  }

  .client-mobile-menu.open {
    display: block;
  }

  .more-filters {
    justify-self: stretch;
  }
}

/* Telas de acesso com foto institucional Fortaltech. */
.login-screen {
  position: relative;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(380px, 480px) minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 11, 20, 0.92) 0%, rgba(10, 20, 36, 0.78) 42%, rgba(10, 20, 36, 0.22) 100%),
    url("/login-bg.jpeg") center/cover no-repeat;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 18% 22%, rgba(212, 175, 55, 0.24), transparent 28%);
  background-size: 44px 44px, 44px 44px, auto;
  opacity: 0.85;
}

.login-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100dvh;
  padding: clamp(28px, 5vw, 54px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 241, 245, 0.92));
  border-right: 1px solid rgba(212, 175, 55, 0.36);
  box-shadow: 24px 0 70px rgba(0, 0, 0, 0.28);
}

.login-panel .brand {
  align-items: center;
}

.login-panel .brand-mark {
  width: 62px;
  height: 62px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.36);
  box-shadow: 0 14px 30px rgba(10, 20, 36, 0.22);
}

.login-panel .brand h1 {
  font-size: clamp(24px, 2.6vw, 34px);
  color: #0a1424;
  line-height: 1;
}

.login-panel .brand p {
  margin-top: 8px;
  color: #647083;
  line-height: 1.4;
}

.login-form {
  display: grid;
  gap: 15px;
}

.login-form .field label {
  color: #243047;
  font-weight: 900;
}

.login-form input {
  min-height: 48px;
  border-color: rgba(10, 20, 36, 0.16);
  background: rgba(255, 255, 255, 0.94);
}

.login-form input:focus {
  border-color: rgba(212, 175, 55, 0.72);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.16);
  outline: 0;
}

.login-form .btn {
  min-height: 48px;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(184, 134, 11, 0.24);
}

.login-form .link-button {
  justify-self: center;
  color: #0a1424;
  font-weight: 900;
}

.login-art {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: end;
  padding: clamp(30px, 6vw, 74px);
  color: #ffffff;
}

.login-art > div {
  max-width: 620px;
  padding: 24px;
  border-left: 3px solid var(--brand);
  background: linear-gradient(90deg, rgba(5, 11, 20, 0.68), rgba(5, 11, 20, 0.16));
  backdrop-filter: blur(6px);
}

.login-art h2 {
  margin: 0 0 12px;
  font-size: clamp(34px, 4.4vw, 64px);
  line-height: 1.02;
  letter-spacing: 0;
}

.login-art p {
  max-width: 540px;
  font-size: 17px;
  color: rgba(255, 255, 255, 0.86);
}

.client-portal {
  position: relative;
  min-height: 100dvh;
  background:
    linear-gradient(135deg, rgba(5, 11, 20, 0.92), rgba(10, 20, 36, 0.72) 48%, rgba(5, 11, 20, 0.84)),
    url("/login-bg.jpeg") center/cover fixed no-repeat;
}

.client-portal::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 15% 12%, rgba(212, 175, 55, 0.22), transparent 26%);
}

.client-portal > * {
  position: relative;
  z-index: 1;
}

.client-hero,
.client-welcome,
.client-login,
.client-panel,
.client-kpi,
.client-quick-actions a {
  border-color: rgba(212, 175, 55, 0.28);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.2);
}

.client-login {
  min-height: min(620px, calc(100dvh - 140px));
  align-items: center;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(238, 241, 245, 0.9)),
    linear-gradient(90deg, rgba(212, 175, 55, 0.18), transparent);
}

.client-login > div:first-child {
  padding: clamp(8px, 3vw, 28px);
}

.client-login h2 {
  max-width: 620px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.04;
}

.client-login p {
  max-width: 560px;
  font-size: 16px;
}

.client-login-form {
  padding: clamp(18px, 3vw, 28px);
  border-color: rgba(212, 175, 55, 0.28);
  box-shadow: 0 18px 38px rgba(10, 20, 36, 0.12);
}

.client-hero {
  background: rgba(255, 255, 255, 0.92);
}

.client-hero .portal-brand img {
  border: 1px solid rgba(212, 175, 55, 0.38);
  background: #0a1424;
}

@media (max-width: 820px) {
  .login-screen {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    grid-template-columns: 1fr;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    background:
      linear-gradient(rgba(5, 11, 20, 0.78), rgba(5, 11, 20, 0.78)),
      url("/login-bg.jpeg") center/cover no-repeat;
  }

  .login-screen::before {
    opacity: 0.32;
  }

  .login-panel {
    width: min(100%, 430px);
    min-height: auto;
    padding: 24px;
    border: 1px solid rgba(212, 175, 55, 0.34);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  }

  .login-panel .brand {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 12px;
  }

  .login-panel .brand-mark {
    width: 78px;
    height: 78px;
  }

  .login-panel .brand h1 {
    font-size: 24px;
  }

  .login-panel .brand p {
    font-size: 14px;
  }

  .login-art {
    display: none;
  }

  .client-portal {
    padding: 12px;
    background:
      linear-gradient(rgba(5, 11, 20, 0.8), rgba(5, 11, 20, 0.8)),
      url("/login-bg.jpeg") center/cover fixed no-repeat;
  }

  .client-login {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .client-login > div:first-child {
    text-align: center;
    padding: 0;
  }

  .client-login h2 {
    font-size: 25px;
  }

  .client-login-form {
    padding: 16px;
  }

  .client-hero {
    min-height: 64px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding: 10px;
    border-radius: 12px;
  }

  .client-hero .portal-brand img {
    width: 42px;
    height: 42px;
  }

  .client-hero .portal-brand h1 {
    font-size: 17px;
  }

  .client-hero .portal-brand p {
    font-size: 12px;
  }
}

@media (max-width: 540px) {
  .login-panel {
    padding: 20px;
  }

  .login-form .btn,
  .login-form .link-button {
    width: 100%;
  }

  .client-login {
    width: 100%;
    border-radius: 12px;
  }
}

/* Refinamentos de login e mobile solicitados. */
.login-screen {
  grid-template-columns: minmax(380px, 480px) minmax(0, 1fr);
}

.login-panel {
  border-radius: 0;
}

.login-panel .brand-mark {
  width: 66px;
  height: 66px;
  border-radius: 10px;
  padding: 0;
  background: #0a1424;
}

.login-panel .brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-panel .brand h1 {
  text-transform: uppercase;
}

.login-art {
  align-items: stretch;
  justify-content: stretch;
}

.login-art > div {
  display: none;
}

.subtle-link {
  width: auto;
  min-height: auto;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #4b5565;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  box-shadow: none;
}

.subtle-link:hover {
  color: #0a1424;
}

.client-hero:not(:has(.client-menu-button)) {
  grid-template-columns: minmax(0, 1fr);
}

.client-hero:not(:has(.client-menu-button)) .portal-brand {
  justify-content: center;
}

@media (max-width: 820px) {
  .topbar {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
  }

  .top-actions {
    grid-column: 3 / 5;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }

  .top-actions .toolbar {
    grid-column: 1 / -1;
    order: 10;
  }

  .topbar:has(.toolbar) {
    grid-template-rows: auto auto;
  }

  .topbar:has(.toolbar) .top-actions {
    display: contents;
  }

  .topbar:has(.toolbar) .theme-toggle {
    grid-column: 3;
    grid-row: 1;
  }

  .topbar:has(.toolbar) .user-menu {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
  }

  .topbar:has(.toolbar) .toolbar {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .user-menu {
    position: relative;
  }

  .user-chip {
    width: 42px;
    height: 42px;
    justify-content: center;
    padding: 0;
    border-radius: 999px;
  }

  .user-chip img,
  .user-chip strong {
    width: 32px;
    height: 32px;
  }

  .user-chip span {
    display: none;
  }

  .user-menu-popover {
    top: 58px;
    right: 12px;
    left: auto;
    width: min(260px, calc(100vw - 24px));
  }

  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-panel {
    border-radius: 14px;
  }

  .client-hero:not(:has(.client-menu-button)) {
    display: flex;
    justify-content: center;
    text-align: center;
  }

  .client-hero:not(:has(.client-menu-button)) .portal-brand {
    justify-content: center;
  }
}

@media (max-width: 540px) {
  .client-hero:not(:has(.client-menu-button)) .portal-brand {
    width: 100%;
  }
}

/* Ajustes finais de acesso desktop/mobile. */
.login-panel .brand {
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.login-panel .brand > div:not(.brand-mark) {
  display: grid;
  gap: 5px;
  justify-items: center;
}

.login-panel .brand-mark {
  width: 74px;
  height: 74px;
}

.portal-login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 34px);
}

.client-login-public {
  width: min(980px, 100%);
  min-height: auto;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  padding: clamp(22px, 4vw, 34px);
  gap: clamp(20px, 4vw, 38px);
  align-items: center;
}

.client-login-brand {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.client-login-brand img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.38);
  background: #0a1424;
}

.client-login-brand h1 {
  margin: 0;
  color: #0a1424;
  font-size: 24px;
  line-height: 1.05;
  text-transform: uppercase;
}

.client-login-brand p {
  margin: 4px 0 0;
  color: #647083;
  font-weight: 800;
}

.client-login-copy h2 {
  margin: 0 0 10px;
}

.client-login-copy p {
  margin: 0;
}

@media (max-width: 820px) {
  .login-panel .brand {
    justify-items: center;
    text-align: center;
  }

  .portal-login-shell {
    align-content: center;
    padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  }

  .client-login-public {
    width: min(100%, 430px);
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
    border-radius: 16px;
  }

  .client-login-brand {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 10px;
    margin-bottom: 12px;
  }

  .client-login-brand img {
    width: 68px;
    height: 68px;
    border-radius: 13px;
  }

  .client-login-brand h1 {
    font-size: 22px;
  }

  .client-login-brand p {
    font-size: 13px;
  }

  .client-login-public h2 {
    margin: 0 0 8px;
    font-size: 22px;
    text-align: center;
  }

  .client-login-public p {
    max-width: 34ch;
    margin: 0 auto;
    color: #647083;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
  }

  .client-login-public .client-login-form {
    padding: 14px;
    box-shadow: none;
  }

  .client-login-public .field {
    gap: 6px;
  }

  .client-login-public input {
    min-height: 44px;
  }
}

@media (max-width: 390px) {
  .client-login-public {
    padding: 15px;
  }

  .client-login-public h2 {
    font-size: 20px;
  }

  .mobile-card-actions,
  .mobile-card-actions-wide {
    grid-template-columns: 1fr;
  }

  .mobile-card-actions-wide .btn:last-child {
    grid-column: auto;
  }
}
