:root {
  --bar: #ffffff;
  --bar-text: #1f2937;
  --bar-line: #e5e7eb;
  --bg: #f5f6f8;
  --text: #1f2937;
  --panel: #fff;
  --sidebar: #eef2f7;
  --sidebar-line: #dbe3ee;
  --card: #fff;
  --card-line: #e2e8f0;
  --submenu: #f4f7fb;
  --line: #e5e7eb;
  --muted: #6b7280;
  --menu-text: #1f2937;
  --hover: #f8fbff;
  --input: #fff;
  --active: #e8eefc;
  --active-text: #1e3a8a;
}

html[data-theme="dark"] {
  --bar: #0c121b;
  --bar-text: #f8fafc;
  --bar-line: #243041;
  --bg: #0f141c;
  --text: #e5e7eb;
  --panel: #1b2430;
  --sidebar: #121820;
  --sidebar-line: #243041;
  --card: #1b2430;
  --card-line: #2c3a4d;
  --submenu: #0f1620;
  --line: #2c3a4d;
  --muted: #9ca3af;
  --menu-text: #e5e7eb;
  --hover: #243044;
  --input: #0f1620;
  --active: #1e3a5f;
  --active-text: #dbeafe;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  padding-top: 64px;
}

.toast-card {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 2000;
  min-width: 260px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 14px 18px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translate(-50%, -130%);
  animation: toast-down 0.4s ease forwards, toast-up 0.45s ease 3.4s forwards;
}

.toast-card strong {
  display: block;
  margin-bottom: 2px;
  font-size: 1.05rem;
}

.toast-success {
  background: #e7f6ec;
  border-color: #8dcea0;
  color: #1f7a3a;
}

.toast-success strong {
  color: #157a32;
}

.toast-danger {
  background: #fdecec;
  border-color: #f0a8a8;
  color: #9f1d1d;
}

.toast-danger strong {
  color: #b42318;
}

.toast-warning {
  background: #fff6e8;
  border-color: #f0c27a;
  color: #9a5b00;
}

.toast-warning strong {
  color: #b45309;
}

@keyframes toast-down {
  from { transform: translate(-50%, -130%); }
  to { transform: translate(-50%, 18px); }
}

@keyframes toast-up {
  from { transform: translate(-50%, 18px); }
  to { transform: translate(-50%, -130%); }
}

.topbar {
  height: 64px;
  background: var(--bar);
  color: var(--bar-text);
  border-bottom: 1px solid var(--bar-line);
  padding-top: 0;
  padding-bottom: 0;
}

.topbar .container-fluid,
.top-actions {
  display: flex;
  align-items: center;
  min-height: 64px;
}

.top-actions {
  gap: 12px;
  margin-left: auto;
  flex-wrap: nowrap;
}

.top-depts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.top-depts .tag {
  margin-left: 0;
}

.brand {
  color: var(--bar-text);
  font-weight: 600;
  font-size: 1.15rem;
  text-decoration: none;
}

.brand:hover {
  color: var(--bar-text);
}

.topbar .form-control {
  width: 11rem;
  background: #fff;
}

.who-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.85rem;
  font-weight: 700;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  margin-right: 8px;
  font-size: 0.75rem;
}

html[data-theme="dark"] .avatar {
  background: #1e3a5f;
  color: #dbeafe;
}

.avatar-editor {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.avatar-stage {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 168px;
  background: #e5e7eb;
  cursor: grab;
  touch-action: none;
}

.avatar-stage canvas {
  width: 168px;
  height: 168px;
  display: block;
}

.avatar-tools {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.avatar-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 180px;
  font-size: 0.85rem;
}

.avatar-zoom input {
  flex: 1;
}

.who-depts,
.name-depts {
  display: none;
  position: absolute;
  z-index: 40;
  flex-wrap: wrap;
  gap: 6px;
  width: max-content;
  max-width: 260px;
  padding: 8px;
  border: 1px solid var(--card-line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.who-depts {
  top: calc(100% + 10px);
  right: 0;
}

.who-wrap:hover .who-depts,
.who-wrap:focus-within .who-depts {
  display: flex;
}

.name-tags {
  position: relative;
  display: inline-block;
}

.name-depts {
  top: calc(100% + 6px);
  left: 0;
}

.name-tags:hover .name-depts,
.name-tags:focus-within .name-depts {
  display: flex;
}

.panel .user-table {
  overflow: visible;
}

.grant-tree {
  display: grid;
  gap: 6px;
  max-height: min(46vh, 420px);
  overflow-y: auto;
  padding-right: 8px;
}

#editModal form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 3.5rem);
  min-height: 0;
}

#editModal .modal-body {
  overflow-y: auto;
  min-height: 0;
}

.grant-kids .grant-kids {
  margin-bottom: 0;
}

.nav-toggle-sub .nav-ico {
  width: 14px;
  height: 14px;
  flex-basis: 14px;
}

.mod-sub {
  width: 100%;
  margin: 4px 0 2px 12px;
  padding-left: 8px;
  border-left: 1px solid var(--sidebar-line);
}

.mod-sub-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 700;
}

.grant-branch,
.grant-kids label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.grant-branch {
  font-weight: 700;
}

.grant-kids {
  display: grid;
  gap: 4px;
  margin: 0 0 8px 16px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.who {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.nivel {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2f7;
  color: #1f2937;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1;
}

html[data-theme="dark"] .nivel {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-perfil {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #1f2937;
}

.btn-perfil:hover,
.btn-perfil:focus {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #111827;
}

html[data-theme="dark"] .btn-perfil {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

html[data-theme="dark"] .btn-perfil:hover,
html[data-theme="dark"] .btn-perfil:focus {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-entrar {
  background: #1b2430;
  border: 1px solid #1b2430;
  color: #fff;
}

.btn-entrar:hover,
.btn-entrar:focus {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

html[data-theme="dark"] .btn-entrar {
  background: #fff;
  border-color: #fff;
  color: #1b2430;
}

.area360 {
  position: relative;
}

.area360-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 8px;
  width: 240px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.area360-panel .form-control {
  width: 100%;
}

.land-cta {
  margin-top: 22px;
}

.theme-switch {
  position: relative;
  width: 56px;
  height: 28px;
  flex: 0 0 56px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: #e7eef6;
  box-shadow: inset 0 0 0 1px #d3dde8;
  overflow: hidden;
}

.theme-switch svg {
  width: 16px;
  height: 16px;
  display: block;
}

.theme-ghost {
  position: absolute;
  top: 6px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
}

.theme-ghost-sun { left: 6px; color: #f59e0b; }
.theme-ghost-moon { right: 6px; color: #64748b; }

.theme-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: #d97706;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.16);
  transition: transform 0.28s ease;
}

html[data-theme="dark"] .theme-switch {
  background: #334155;
  box-shadow: none;
}

html[data-theme="dark"] .theme-ghost-moon {
  color: #e2e8f0;
}

html[data-theme="dark"] .theme-knob {
  transform: translateX(28px);
  background: #0f172a;
  color: #e2e8f0;
  box-shadow: none;
}

.theme-moon { display: none; }
html[data-theme="dark"] .theme-sun { display: none; }
html[data-theme="dark"] .theme-moon { display: block; }

.btn-sair {
  background: #c2413a;
  border: 1px solid #c2413a;
  color: #fff;
}

.btn-sair:hover,
.btn-sair:focus {
  background: #9f2c26;
  border-color: #9f2c26;
  color: #fff;
}

.pwd-rules {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 0.85rem;
}

.pwd-rules li {
  color: #6b7280;
}

.pwd-rules li.is-ok {
  color: #166534;
}

.pwd-rules li.is-bad {
  color: #b91c1c;
}

.sidebar {
  position: fixed;
  top: 64px;
  left: 0;
  bottom: 0;
  width: 246px;
  overflow: auto;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-line);
  padding: 10px 8px;
}

.nav-direct {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--menu-text);
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: none;
}

.nav-direct:hover {
  background: var(--hover);
  color: var(--menu-text);
}

.nav-direct.active {
  background: var(--active);
  color: var(--active-text);
}

.nav-find {
  display: flex;
  gap: 6px;
  margin: 0 0 8px;
}

.nav-find input {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
  background: #fff;
  color: var(--menu-text);
  padding: 0 8px;
  font-size: 0.78rem;
}

.nav-find button {
  flex: 0 0 auto;
  height: 32px;
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
  background: transparent;
  color: var(--menu-text);
  font-size: 0.75rem;
  padding: 0 8px;
}

.nav-find button:hover,
.nav-find input:focus {
  border-color: #94a3b8;
  outline: none;
}

.nav-fold {
  display: flex;
  gap: 6px;
  margin: 0 0 8px;
}

.nav-fold button {
  flex: 1;
  min-width: 0;
  height: 28px;
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
  background: transparent;
  color: var(--menu-text);
  font-size: 0.7rem;
  padding: 0 6px;
  white-space: nowrap;
}

.nav-fold button:hover {
  border-color: #94a3b8;
}

.nav-empty {
  margin: 0 8px 8px;
  color: #64748b;
  font-size: 0.78rem;
}

html[data-theme="dark"] .nav-find input {
  background: #0f172a;
}

.dash-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-view {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.dash {
  display: flex;
  flex-wrap: nowrap;
  gap: 18px;
  align-items: flex-start;
  width: max-content;
  transition: transform 0.48s cubic-bezier(0.22, 0.8, 0.28, 1);
}

.dash-arrow {
  flex: 0 0 42px;
  width: 42px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 0;
}

.dash-arrow svg {
  width: 22px;
  height: 22px;
  transition: transform 0.25s ease;
}

.dash-prev:hover svg { transform: translateX(-3px); }
.dash-next:hover svg { transform: translateX(3px); }

.dash-arrow.is-off {
  visibility: hidden;
  pointer-events: none;
}

.dash-fit .dash-arrow { display: none; }

.cal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cal-config-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-top: 6px;
  padding: 10px 16px;
  border: 1px solid #f9a8d4;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #fdf2f8 100%);
  color: #9d174d;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(190, 24, 93, 0.08);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.cal-config-btn svg {
  width: 18px;
  height: 18px;
}

.cal-config-btn:hover,
.cal-config-btn:focus {
  color: #9d174d;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(190, 24, 93, 0.16);
}

html[data-theme="dark"] .cal-config-btn {
  background: #3b1224;
  border-color: #9d174d;
  color: #fbcfe8;
}

html[data-theme="dark"] .cal-config-btn:hover,
html[data-theme="dark"] .cal-config-btn:focus {
  color: #fce7f3;
}

@media (max-width: 640px) {
  .cal-head { flex-direction: column; }
  .cal-config-btn { margin-top: 0; }
}

.cal-sum {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.cal-sum button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: inherit;
  padding: 14px 16px;
}

.cal-sum strong { font-size: 1.7rem; line-height: 1; }
.cal-sum span { font-weight: 700; }
.cal-sum small { color: var(--muted); }

.cal-list { display: grid; gap: 8px; }
.cal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.cal-item p { margin: 4px 0 0; color: var(--muted); font-size: 0.86rem; }
.cal-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cal-form .wide { grid-column: 1 / -1; }
.cal-form label { display: grid; gap: 6px; font-size: 0.86rem; font-weight: 650; }
.cal-checks, .cal-check { display: grid; gap: 8px; font-weight: 600; }
.cal-checks { grid-template-columns: 1fr 1fr; }
.cal-checks label, .cal-check { display: flex; align-items: center; gap: 8px; }

@media (max-width: 900px) {
  .cal-sum, .cal-form, .cal-checks { grid-template-columns: 1fr; }
}

.mod-contabil {
  border-color: #99f6e4;
}

.mod-contabil strong {
  color: #0f766e;
}

html[data-theme="dark"] .mod-contabil {
  border-color: #134e4a;
}

html[data-theme="dark"] .mod-contabil strong {
  color: #5eead4;
}

.acct-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.acct-stat {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.acct-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.acct-stat strong {
  font-size: 1.6rem;
  font-weight: 650;
}

.acct-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 900px) {
  .acct-grid { grid-template-columns: 1fr; }
}

.mod-financeiro { border-color: #bbf7d0; }
.mod-financeiro strong { color: #15803d; }
html[data-theme="dark"] .mod-financeiro { border-color: #14532d; }
html[data-theme="dark"] .mod-financeiro strong { color: #86efac; }
.mod-mestre { border-color: #bfdbfe; }
.mod-mestre strong { color: #1d4ed8; }
html[data-theme="dark"] .mod-mestre { border-color: #1e3a8a; }
html[data-theme="dark"] .mod-mestre strong { color: #93c5fd; }
.fin-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.fin-filters .form-control, .fin-filters .form-select { width: auto; min-width: 10rem; }

.fin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.fin-head h1 { margin: 0 0 4px; font-size: 1.6rem; }
.fin-head p { margin: 0; color: var(--muted); }
.fin-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fin-search { flex: 1 1 16rem; }
.fin-list-head { margin: 2px 2px 8px; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.fin-launch-lead { margin: 2px 0 0; color: var(--muted); font-size: 0.86rem; }
.fin-launch-top { display: grid; grid-template-columns: 1fr 180px; gap: 12px; margin-bottom: 14px; }
.fin-launch-top label, .fin-line { display: grid; gap: 6px; font-size: 0.82rem; font-weight: 700; }
.fin-lines { display: grid; gap: 10px; }
.fin-line {
  grid-template-columns: 140px 1fr 120px 150px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--submenu);
}
.fin-line strong { font-size: 0.86rem; }
.fin-extras { display: grid; gap: 10px; margin-top: 10px; }
.fin-extra { grid-template-columns: 140px 1fr 120px 150px auto; }
.fin-add-extra { margin-top: 10px; }
.fin-lote-form { display: grid; gap: 10px; margin-top: 16px; }
.fin-lote-form label { display: grid; gap: 6px; font-size: 0.86rem; font-weight: 700; }
.fin-lote-note { margin: 14px 0 0; color: var(--muted); font-size: 0.84rem; }
.fin-warn-in { margin: 0 16px 0; }
@media (max-width: 800px) {
  .fin-launch-top, .fin-line { grid-template-columns: 1fr; }
}

.fin-kpi { position: relative; overflow: hidden; padding-left: 18px; }
.fin-kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.fin-kpi-billed::before { background: #16a34a; }
.fin-kpi-received::before { background: #0284c7; }
.fin-kpi-open::before { background: #d97706; }
.fin-kpi-clients::before { background: #4f46e5; }
.fin-kpi-billed strong { color: #15803d; }
.fin-kpi-received strong { color: #0369a1; }
.fin-kpi-open strong { color: #b45309; }
.fin-kpi-clients strong { color: #4338ca; }
html[data-theme="dark"] .fin-kpi-billed strong { color: #86efac; }
html[data-theme="dark"] .fin-kpi-received strong { color: #7dd3fc; }
html[data-theme="dark"] .fin-kpi-open strong { color: #fcd34d; }
html[data-theme="dark"] .fin-kpi-clients strong { color: #c4b5fd; }

.fin-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.fin-bar .form-control,
.fin-bar .form-select { width: auto; min-width: 11rem; }

.fin-tools { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
.fin-tools details {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 12px 14px;
}
.fin-tools summary { font-weight: 700; cursor: pointer; }
@media (max-width: 800px) { .fin-tools { grid-template-columns: 1fr; } }

.fin-table-wrap,
.fin-detail {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  overflow: auto;
}
.fin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.fin-table th {
  position: sticky;
  top: 0;
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--submenu);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.fin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.fin-table tbody tr:last-child td { border-bottom: 0; }
.fin-table tbody tr:hover { background: var(--hover); }
.fin-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fin-table th.num { text-align: right; }
.fin-client a { color: #1d4ed8; font-weight: 700; text-decoration: none; }
.fin-client a:hover { text-decoration: underline; }
.fin-modal-head { align-items: flex-start; gap: 12px; }
.fin-modal-head p { margin: 2px 0 0; color: var(--muted); font-size: 0.86rem; }
.fin-modal-head .fin-badge { margin-left: auto; }
#finModal .fin-actions { flex-wrap: wrap; justify-content: flex-start; }
.fin-client span { display: block; margin-top: 2px; color: var(--muted); font-size: 0.78rem; }
.fin-chip {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--submenu);
  font-size: 0.78rem;
  font-weight: 700;
}
.fin-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.fin-badge.late { background: #fee2e2; color: #b91c1c; }
.fin-badge.due { background: #fef3c7; color: #b45309; }
.fin-badge.paid { background: #dcfce7; color: #15803d; }
.fin-due { color: #b45309; font-weight: 700; }
.fin-row.late td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
.fin-row.due td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.fin-row.paid td:first-child { box-shadow: inset 3px 0 0 #22c55e; }
.fin-row.is-current { background: #eff6ff; }
.fin-empty { color: var(--muted); text-align: center; padding: 28px 14px; }
html[data-theme="dark"] .fin-badge.late { background: #450a0a; color: #fecaca; }
html[data-theme="dark"] .fin-badge.due { background: #451a03; color: #fde68a; }
html[data-theme="dark"] .fin-badge.paid { background: #052e16; color: #bbf7d0; }
html[data-theme="dark"] .fin-due { color: #fcd34d; }
html[data-theme="dark"] .fin-row.is-current { background: #172033; }
html[data-theme="dark"] .fin-client a { color: #93c5fd; }

.fin-detail { margin-top: 16px; padding: 16px; }
.fin-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.fin-detail-head h2 { margin: 0 0 2px; font-size: 1.15rem; }
.fin-detail-head p { margin: 0; color: var(--muted); }
.fin-detail-sum { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; color: var(--muted); }
.fin-detail-sum strong { color: var(--text); font-weight: 700; }
.fin-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.fin-actions form { margin: 0; }
.fin-money { max-width: 8rem; margin-left: auto; text-align: right; }
.fin-warn {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid #fcd34d;
  border-radius: 14px;
  background: #fffbeb;
  color: #92400e;
}
.fin-warn p { margin: 0 0 10px; font-weight: 650; }
.fin-warn form { display: flex; flex-wrap: wrap; gap: 8px; }
html[data-theme="dark"] .fin-warn { background: #451a03; border-color: #b45309; color: #fde68a; }

.mod-manual { border-color: #fecdd3; }
.mod-manual strong { color: #be123c; }
html[data-theme="dark"] .mod-manual { border-color: #9f1239; }
html[data-theme="dark"] .mod-manual strong { color: #fda4af; }

.manual-search { margin-bottom: 18px; }
.man-block { margin: 0 0 22px; padding: 6px 14px 16px; border: 1px solid #e7ebf0; border-radius: 16px; background: #f8fafc; }
.man-block-head { text-align: center; padding: 14px 8px 12px; }
.man-block-head h2 { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 0.98rem; letter-spacing: 0.05em; text-transform: uppercase; }
.man-block-head h2 svg { width: 18px; height: 18px; }
.man-block-head span { display: block; margin-top: 2px; color: #94a3b8; font-size: 0.8rem; }
.man-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.man-square { display: flex; flex-direction: column; min-height: 188px; padding: 16px 16px 12px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.man-square:hover { border-color: #fb7185; }
.man-square strong { font-size: 0.92rem; line-height: 1.35; text-transform: uppercase; }
.man-square p { margin: 8px 0 0; color: #6b7280; font-size: 0.86rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.man-square footer { margin-top: auto; padding-top: 10px; border-top: 1px solid #e5e7eb; display: grid; gap: 3px; }
.man-meta { display: flex; align-items: center; gap: 6px; color: #6b7280; font-size: 0.78rem; }
.man-meta svg { width: 14px; height: 14px; flex: 0 0 auto; }
.man-admin-block { margin-bottom: 22px; }
.man-table { width: 100%; border-collapse: collapse; }
.man-table th, .man-table td { padding: 10px 12px; border-bottom: 1px solid var(--sidebar-line); text-align: left; vertical-align: middle; }
.man-table th { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: #64748b; }
.man-pos, .man-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.man-pos form, .man-actions form, .manual-files form { margin: 0; }
.man-pos .btn { min-width: 2rem; padding-left: 0.45rem; padding-right: 0.45rem; }
.man-pos .is-off { opacity: 0.35; pointer-events: none; }
.man-form { display: grid; gap: 12px; max-width: 860px; margin-bottom: 18px; }
.man-form label { display: grid; gap: 6px; font-weight: 650; }
.man-form-inline { align-items: end; grid-template-columns: minmax(220px, 420px) auto auto; }
.manual-files li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.manual-lead, .manual-kicker { color: var(--muted, #64748b); }
html[data-theme="dark"] .man-block { background: rgba(15, 23, 42, 0.35); border-color: #334155; }
html[data-theme="dark"] .man-square { background: #0f172a; border-color: #334155; }
html[data-theme="dark"] .man-square p, html[data-theme="dark"] .man-meta { color: #cbd5e1; }
.manual-kicker { margin: 0 0 4px; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.manual-lead { margin: 0 0 16px; }
.manual-empty { color: var(--muted, #64748b); }
.manual-body { line-height: 1.55; }
.manual-body p { margin: 0 0 0.8em; }
.manual-body img, .manual-body video { display: block; max-width: 100%; height: auto; margin: 12px 0; border-radius: 10px; }
.manual-body a { color: #be123c; }
.ql-align-center { text-align: center; }
.ql-align-justify { text-align: justify; }
.ql-indent-1 { padding-left: 1.5rem; }
.manual-files { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--sidebar-line); }
.manual-files h2 { font-size: 1rem; margin: 0 0 8px; }
.manual-files ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.manual-files span { color: var(--muted, #64748b); font-size: 0.85rem; }
html[data-theme="dark"] .manual-card { background: transparent; }
html[data-theme="dark"] .manual-body a { color: #fda4af; }

.mod-sistema strong {
  color: #6d28d9;
}

html[data-theme="dark"] .mod-sistema {
  border-color: #3b2f63;
}

html[data-theme="dark"] .mod-sistema strong {
  color: #c4b5fd;
}

.mod-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 0 0 320px;
  width: 320px;
  padding: 22px 18px 16px;
  border: 1px solid var(--sidebar-line);
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  color: inherit;
}

.acct-grid .panel,
.acct-page {
  background: transparent;
  border: none;
  box-shadow: none;
}

.acct-page .table,
.acct-grid .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--line);
}

.mod-link .nav-ico {
  background: transparent;
}

.mod-tile strong {
  align-self: center;
  margin: 0 0 14px;
  color: #9a5b2f;
  font-family: Georgia, "Palatino Linotype", Palatino, serif;
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
}

.mod-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.mod-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--menu-text);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.mod-link:hover {
  background: var(--hover);
  color: var(--menu-text);
}

html[data-theme="dark"] .mod-tile {
  background: transparent;
  border-color: var(--sidebar-line);
}

html[data-theme="dark"] .mod-tile strong {
  color: #e0b070;
}

.nav-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-branch {
  background: transparent;
}

.nav-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--menu-text);
  font-size: 0.84rem;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.nav-toggle::-webkit-details-marker {
  display: none;
}

.nav-toggle::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.45;
  flex: 0 0 auto;
  transition: transform 0.26s ease;
}

.nav-branch[open] > .nav-toggle::after {
  transform: rotate(45deg) translateY(-1px);
}

.nav-toggle:hover {
  background: var(--hover);
}

.nav-toggle-sub {
  min-height: 30px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.nav-kids {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 1px 0 6px 11px;
  padding-left: 8px;
  border-left: 1px solid var(--sidebar-line);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 3px 8px;
  border-radius: 7px;
  color: var(--menu-text);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 550;
  line-height: 1.25;
}

.nav-item:hover {
  background: var(--hover);
  color: var(--menu-text);
}

.nav-item.active {
  background: var(--active);
  color: var(--active-text);
  font-weight: 650;
}

.nav-ico {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  background: transparent;
}

.nav-ico svg {
  width: 16px;
  height: 16px;
}

.nav-ico.ico-blue { color: #2563eb; }
.nav-ico.ico-violet { color: #7c3aed; }
.nav-ico.ico-green { color: #15803d; }
.nav-ico.ico-orange { color: #c2410c; }
.nav-ico.ico-rose { color: #be185d; }
.nav-ico.ico-teal { color: #0f766e; }

html[data-theme="dark"] .nav-ico {
  background: transparent;
}

html[data-theme="dark"] .nav-ico.ico-blue { color: #93c5fd; }
html[data-theme="dark"] .nav-ico.ico-violet { color: #c4b5fd; }
html[data-theme="dark"] .nav-ico.ico-green { color: #86efac; }
html[data-theme="dark"] .nav-ico.ico-orange { color: #fdba74; }
html[data-theme="dark"] .nav-ico.ico-rose { color: #f9a8d4; }
html[data-theme="dark"] .nav-ico.ico-teal { color: #5eead4; }

.crumb {
  position: fixed;
  top: 64px;
  left: 246px;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 28px;
  background: var(--bar);
  border-bottom: 1px solid var(--bar-line);
  color: var(--muted);
  font-size: 0.8rem;
}

.crumb a {
  color: var(--menu-text);
  font-weight: 650;
  text-decoration: none;
}

.crumb a:hover {
  color: #2563eb;
}

.crumb-sep {
  opacity: 0.45;
}

.crumb-here {
  color: var(--text);
  font-weight: 650;
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle::after {
    transition: none;
  }
}

.dprh-page {
  padding: 22px;
}

.ficha-page {
  display: grid;
  gap: 16px;
  max-width: 980px;
}

.ficha-card {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: 16px;
  padding: 22px 24px 24px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ficha-head h1,
.ficha-help h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.ficha-head h1 svg,
.ficha-help h2 svg {
  width: 20px;
  height: 20px;
  color: #4f46e5;
}

.ficha-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.ficha-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 42px 20px;
  border: 2px dashed #d7dee8;
  border-radius: 16px;
  background: #fff;
  text-align: center;
  cursor: pointer;
}

.ficha-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ficha-drop strong {
  color: var(--text);
  font-size: 1.02rem;
}

.ficha-hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.ficha-file {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
  border-radius: 16px;
  background: #eef2ff;
  color: #4f46e5;
}

.ficha-file svg {
  width: 30px;
  height: 30px;
}

.ficha-drop.is-over {
  border-color: #4f46e5;
  background: #f5f7ff;
}

.ficha-help {
  background: #f3f5f8;
}

.ficha-help h2 {
  font-size: 1.02rem;
  margin-bottom: 16px;
}

.ficha-help h3 {
  margin: 0 0 6px;
  font-size: 0.98rem;
}

.ficha-help ul {
  margin: 0 0 14px;
  padding-left: 1.2rem;
  color: var(--muted);
}

.ficha-help li + li {
  margin-top: 4px;
}

.ficha-help strong {
  color: var(--text);
}

html[data-theme="dark"] .ficha-drop {
  background: var(--input);
  border-color: var(--line);
}

html[data-theme="dark"] .ficha-help {
  background: var(--submenu);
}

html[data-theme="dark"] .ficha-file {
  background: rgba(99, 102, 241, 0.18);
}

.mod-title h1 {
  margin: 0 0 6px;
  font-size: 1.8rem;
}

.mod-title p,
.ficha-help p {
  margin: 0 0 6px;
  color: var(--muted);
}

.mod-go,
.mod-actions {
  margin-top: 16px;
}

.mod-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.file-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--submenu);
}

.cal-grid,
.conv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.cal-grid {
  margin-top: 8px;
}

.cal-grid label {
  display: grid;
  gap: 6px;
  font-weight: 650;
}

.cal-grid button,
.mod-go {
  justify-self: start;
}

@media (max-width: 800px) {
  .cal-grid,
  .conv-grid {
    grid-template-columns: 1fr;
  }
}

.dprh-kicker {
  margin: 0 0 6px;
  color: #be185d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ico {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
}

.ico svg {
  width: 16px;
  height: 16px;
}

.ico-blue { background: #dbeafe; color: #1d4ed8; }
.ico-violet { background: #ede9fe; color: #6d28d9; }
.ico-green { background: #dcfce7; color: #15803d; }
.ico-orange { background: #ffedd5; color: #c2410c; }
.ico-rose { background: #fce7f3; color: #be185d; }
.ico-teal { background: #ccfbf1; color: #0f766e; }

.tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
}

.tag-light {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.dept-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dept-picks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
}

.menu-dot {
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 3px #ffedd5;
}

.fw-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.fw-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fw-you {
  color: #c2410c;
  font-weight: 700;
}

.fw-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px 18px;
  margin-bottom: 14px;
}

.fw-card h2 {
  font-size: 1.05rem;
  margin: 0 0 6px;
}

.fw-help {
  color: var(--muted);
  margin-bottom: 14px;
}

.cert-dates {
  display: grid;
  margin: 0 0 16px;
}

.cert-dates div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.cert-ok { color: #15803d; }
.cert-soon { color: #c2410c; }

html[data-theme="dark"] .cert-ok { color: #86efac; }
html[data-theme="dark"] .cert-soon { color: #fdba74; }

.backup-table {
  width: 100%;
  border-collapse: collapse;
}

.backup-table th,
.backup-table td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.backup-table th {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.backup-table td:last-child,
.backup-table th:last-child {
  text-align: right;
}

.backup-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.backup-actions form { margin: 0; }

.res-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.res-top h1 {
  font-size: 1.35rem;
  margin: 0;
}

.res-top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.res-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px 18px;
  margin-bottom: 14px;
}

.res-card-head,
.res-card h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 0 4px;
  font-size: 1.02rem;
}

.res-spin {
  position: absolute;
  right: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 0;
}

.res-spin svg { width: 16px; height: 16px; }
.res-spin.on svg { animation: res-spin 0.8s linear infinite; }

@keyframes res-spin { to { transform: rotate(360deg); } }

.res-when {
  text-align: center;
  font-weight: 800;
  margin: 8px 0 2px;
}

.res-uptime {
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  margin: 0 0 16px;
}

.res-gauges {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.res-gauge { text-align: center; min-width: 0; }
.res-gauge h3 {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.res-gauge h3.res-in { color: #16a34a; }
.res-gauge h3.res-out { color: #dc2626; }

.res-dial {
  position: relative;
  width: 118px;
  height: 118px;
  margin: 0 auto 8px;
}

.res-dial svg { width: 100%; height: 100%; }
.res-track, .res-arc, .res-arc-cache { fill: none; stroke-width: 9; }
.res-track-in, .res-arc-cache { stroke-width: 7; }
.res-track { stroke: #e5e7eb; }
html[data-theme="dark"] .res-track { stroke: #334155; }
.res-arc, .res-arc-cache { stroke-linecap: round; transform: rotate(-90deg); transform-origin: 60px 60px; }
[data-dial="cpu"] .res-arc { stroke: #16a34a; }
[data-dial="ram"] .res-arc { stroke: #f59e0b; }
[data-dial="ram"] .res-arc-cache { stroke: #0284c7; }
[data-dial="swap"] .res-arc { stroke: #9ca3af; }
[data-dial="disk"] .res-arc { stroke: #2563eb; }
[data-dial="in"] .res-arc { stroke: #16a34a; }
[data-dial="out"] .res-arc { stroke: #dc2626; }

.res-dial-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.res-dial-value strong { font-size: 1.7rem; }
.res-dial-value span { margin-top: 3px; color: var(--muted); font-size: 0.85rem; }
.res-dial-disk strong { font-size: 1.15rem; color: #2563eb; }

.res-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2px 0;
  color: var(--muted);
  font-size: 0.75rem;
}
.res-mark i {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  flex: 0 0 8px;
}
.res-mark i.mem { background: #f59e0b; }
.res-mark i.cache { background: #0284c7; }

.res-sub, .res-extra {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}
.res-sub { white-space: pre-line; }
.res-disk { color: #2563eb; font-weight: 700; }
.res-extra {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.res-trash {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  display: grid;
  place-items: center;
}
.res-trash:hover { color: #dc2626; background: #fee2e2; }
.res-trash svg { width: 16px; height: 16px; }

.res-note { margin: 8px 0; color: #15803d; }
.res-note.bad { color: #b91c1c; }

.res-table-wrap { overflow-x: auto; }
.res-table { width: 100%; border-collapse: collapse; }
.res-table th, .res-table td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.res-table th { color: var(--muted); font-size: 0.92rem; }
.res-actions { text-align: right; white-space: nowrap; }
.res-actions .btn { margin-left: 6px; }

.res-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}
.res-pill.on { background: #dcfce7; color: #166534; }
.res-pill.off { background: #f3f4f6; color: #4b5563; }
html[data-theme="dark"] .res-pill.on { background: #14532d; color: #bbf7d0; }
html[data-theme="dark"] .res-pill.off { background: #334155; color: #e5e7eb; }

.res-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 16px;
}
.res-modal[hidden] { display: none; }
.res-modal form {
  width: min(440px, 100%);
  background: var(--panel);
  color: var(--text);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid var(--line);
}
.res-modal h2 { margin: 0 0 8px; font-size: 1.15rem; }
.res-modal p { margin: 0 0 12px; color: var(--muted); }
.res-phrase { display: grid; gap: 6px; margin-bottom: 14px; }
.res-phrase input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: transparent;
  color: inherit;
}
.res-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 1100px) {
  .res-gauges { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .res-top { align-items: flex-start; flex-direction: column; }
  .res-gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.fw-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.fw-switch {
  border: 0;
  border-radius: 999px;
  padding: 8px 16px 8px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.fw-switch.on {
  background: #dcfce7;
  color: #166534;
}

.fw-switch.off {
  background: #e5e7eb;
  color: #4b5563;
}

.fw-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: currentColor;
}

.fw-card .table {
  background: transparent;
  color: var(--text);
}

.fw-pass {
  max-width: 180px;
  word-break: break-all;
}

.content {
  margin-left: 246px;
  margin-top: 40px;
  padding: 22px 28px 28px;
}

.content-guest {
  padding: 28px;
}

.content-guest:has(.landing) {
  padding: 0;
}

.landing {
  --ink: #142033;
  --paper: #f6f3ec;
  --card: #fffdf8;
  --line: #e4dccb;
  --muted: #5c6b7a;
  --teal: #0f766e;
  --gold: #c4a15a;
  --rose: #e11d48;
  --sky: #0284c7;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(15, 118, 110, 0.16), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(196, 161, 90, 0.2), transparent 55%),
    var(--paper);
}

html[data-theme="dark"] .landing {
  --ink: #e7eef6;
  --paper: #0d141c;
  --card: #16202b;
  --line: #2a3848;
  --muted: #9aabbb;
  --teal: #2dd4bf;
  --gold: #e4c27a;
  --rose: #fb7185;
  --sky: #7dd3fc;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(45, 212, 191, 0.12), transparent 60%),
    radial-gradient(700px 380px at 100% 0%, rgba(228, 194, 122, 0.1), transparent 55%),
    var(--paper);
}

.land-hero,
.land-services,
.land-charts,
.land-steps,
.land-foot {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.land-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 36px;
  align-items: center;
  padding: 42px 0 18px;
}

.land-kicker {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.land-copy h1,
.land-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.land-copy h1 {
  font-size: clamp(2.4rem, 4.6vw, 4.3rem);
  max-width: 12ch;
}

.land-lead {
  max-width: 38rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.land-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.land-pills li {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.86rem;
  font-weight: 650;
}

.land-scene {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 18px 30px rgba(16, 32, 51, 0.12));
}

.land-head {
  max-width: 38rem;
  margin-bottom: 22px;
}

.land-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.land-head p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
}

.land-services,
.land-charts,
.land-steps {
  padding: 34px 0;
}

.land-grid,
.chart-grid,
.land-steps ol {
  display: grid;
  gap: 16px;
}

.land-grid {
  grid-template-columns: repeat(4, 1fr);
}

.land-card,
.chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.land-ico {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--teal);
}

.land-ico svg {
  width: 22px;
  height: 22px;
}

.land-card h3,
.land-steps h3 {
  margin: 14px 0 6px;
  font-size: 1.05rem;
}

.land-card p,
.land-steps p,
.land-foot p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.chart-grid {
  grid-template-columns: 1.3fr 0.9fr;
}

.chart-wide {
  grid-column: 1 / -1;
}

.chart-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.chart-card figcaption span,
.chart-labels {
  color: var(--muted);
  font-size: 0.82rem;
}

.chart-card svg {
  width: 100%;
  height: auto;
}

.chart-axis {
  color: var(--line);
}

.chart-labels text {
  fill: currentColor;
  font-size: 11px;
  text-anchor: middle;
}

.bars rect:nth-child(odd) { fill: var(--teal); }
.bars rect:nth-child(even) { fill: var(--gold); }

.bars rect {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: bar-rise 0.7s ease both;
}

.bars rect:nth-child(2) { animation-delay: 0.05s; }
.bars rect:nth-child(3) { animation-delay: 0.1s; }
.bars rect:nth-child(4) { animation-delay: 0.12s; }
.bars rect:nth-child(5) { animation-delay: 0.16s; }
.bars rect:nth-child(6) { animation-delay: 0.18s; }
.bars rect:nth-child(7) { animation-delay: 0.22s; }
.bars rect:nth-child(8) { animation-delay: 0.24s; }
.bars rect:nth-child(9) { animation-delay: 0.28s; }
.bars rect:nth-child(10) { animation-delay: 0.3s; }
.bars rect:nth-child(11) { animation-delay: 0.34s; }
.bars rect:nth-child(12) { animation-delay: 0.36s; }

@keyframes bar-rise {
  from { transform: scaleY(0.15); }
  to { transform: scaleY(1); }
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.84rem;
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 3px;
}

.swatch-teal { background: var(--teal); }
.swatch-gold { background: var(--gold); }
.swatch-rose { background: var(--rose); }
.swatch-sky { background: var(--sky); }

.donut-wrap {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: center;
}

.donut-num,
.donut-sub {
  fill: var(--ink);
}

.donut-num {
  font-size: 22px;
  font-weight: 700;
}

.donut-sub {
  font-size: 11px;
}

.donut-legend {
  flex-direction: column;
  gap: 8px;
}

.land-steps ol {
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.land-steps li {
  padding: 20px;
  border-top: 3px solid var(--teal);
  background: var(--card);
  border-radius: 0 0 16px 16px;
}

.land-steps li span {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
}

.land-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
}

.land-foot strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  font-weight: 500;
}

@media (max-width: 980px) {
  .land-hero,
  .land-grid,
  .chart-grid,
  .land-steps ol {
    grid-template-columns: 1fr;
  }

  .chart-wide {
    grid-column: auto;
  }

  .land-copy h1 {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .land-hero,
  .land-services,
  .land-charts,
  .land-steps,
  .land-foot {
    width: min(1120px, calc(100% - 28px));
  }

  .donut-wrap,
  .land-foot {
    grid-template-columns: 1fr;
    display: grid;
  }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.form-card {
  max-width: 480px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
  background: var(--input);
  color: var(--text);
  border-color: var(--line);
}

html[data-theme="dark"] .topbar .form-control {
  background: #fff;
  color: #1f2937;
}

html[data-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--line);
  color: var(--text);
}

html[data-theme="dark"] .modal-content {
  background: var(--panel);
  color: var(--text);
}

html[data-theme="dark"] .btn-close {
  filter: invert(1);
}

html[data-theme="dark"] .form-text,
html[data-theme="dark"] .pwd-rules li {
  color: var(--muted);
}

.table {
  margin-bottom: 0;
}

.panel .table th,
.panel .table td {
  padding-left: 1rem;
  padding-right: 1rem;
}

.panel .table thead th {
  border-bottom-width: 1px;
}
