:root {
  --blue: #0056d6;
  --blue-dark: #003f9e;
  --blue-soft: #eaf3ff;
  --green: #18a957;
  --green-soft: #e9f9ef;
  --amber: #f59e0b;
  --amber-soft: #fff7df;
  --purple: #7c3aed;
  --purple-soft: #f4eeff;
  --ink: #081334;
  --muted: #52617c;
  --line: #d6e0f0;
  --line-strong: #b9c9e2;
  --soft: #eef5ff;
  --white: #fff;
  --danger: #d91524;
  --danger-soft: #fff0f2;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --shadow: 0 16px 40px rgba(8, 19, 52, .08);
  --shadow-soft: 0 8px 22px rgba(8, 19, 52, .055);
}

* { box-sizing: border-box; }
body {
  margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--ink);
  background:
    radial-gradient(circle at 18% -8%, rgba(0,86,214,.12), transparent 32%),
    radial-gradient(circle at 92% 4%, rgba(24,169,87,.10), transparent 28%),
    #f5f8fd;
}
a { color: var(--blue); text-decoration: none; }
.muted { color: var(--muted); }
button, input, select, textarea { font: inherit; }
input, select, textarea {
  width: 100%; border: 1px solid #cbd7eb; border-radius: 8px; padding: 12px 13px; background: #fff; color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:focus, select:focus, textarea:focus {
  outline: 0; border-color: #6da2ff; box-shadow: 0 0 0 4px rgba(0,86,214,.12);
}
textarea { min-height: 82px; resize: vertical; }
label { display: grid; gap: 7px; font-weight: 700; font-size: 13px; }
label input, label select, label textarea { font-weight: 400; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 14px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 12px; color: #15224a; background: #f4f8ff; text-transform: uppercase; letter-spacing: .02em; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #f8fbff; }

.topbar {
  height: 70px; display: grid; grid-template-columns: 310px 48px 1fr auto auto auto; align-items: center; gap: 16px;
  padding: 0 24px; color: #fff; background: linear-gradient(120deg, #003786, #0068df 72%, #0580df); box-shadow: 0 10px 28px rgba(0,63,158,.18);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 20px; margin: 0; }
.brand-row { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand-row strong { font-size: 31px; letter-spacing: 0; }
.app-logo {
  width: 42px; height: 42px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(255,255,255,.28);
}
.verify-brand .app-logo { box-shadow: 0 0 0 1px rgba(0,63,158,.14); }
.shield {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border: 2px solid currentColor;
  border-radius: 8px; font-weight: 800; font-size: 24px;
}
.hamb { border: 0; background: rgba(255,255,255,.10); color: #fff; font-size: 26px; cursor: pointer; border-radius: 8px; min-height: 42px; }
.user-pill { display: grid; gap: 2px; font-size: 13px; }
.user-pill span { opacity: .9; text-transform: capitalize; }
.topbar-avatar {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #fff;
  border: 2px solid rgba(255,255,255,.72); box-shadow: 0 4px 12px rgba(8,19,52,.18);
}
.notification-bell {
  position: relative; width: 42px; height: 42px; display: inline-grid; place-items: center; color: #fff;
  border: 1px solid rgba(255,255,255,.38); border-radius: 50%; font-size: 20px; background: rgba(255,255,255,.10);
  transition: background .16s ease, transform .16s ease;
}
.notification-bell:hover { background: rgba(255,255,255,.18); transform: translateY(-1px); }
.notification-bell strong {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center;
  border-radius: 999px; background: #18a957; color: #fff; font-size: 11px; line-height: 1; border: 1px solid #fff;
}

.app-shell { display: grid; grid-template-columns: 330px 1fr; min-height: calc(100vh - 70px); }
.sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 72%, #eef5ff 100%);
  border-right: 1px solid var(--line); padding: 28px 18px 18px; display: flex; flex-direction: column; gap: 8px;
  position: sticky; top: 70px; height: calc(100vh - 70px); overflow-y: auto; overflow-x: hidden;
  box-shadow: 10px 0 34px rgba(8,19,52,.035); scrollbar-width: thin; scrollbar-color: #9bb7e7 transparent;
}
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: #9bb7e7; border-radius: 999px; }
.sidebar-backdrop { display: none; }
.sidebar .org {
  font-weight: 800; color: var(--blue); line-height: 1.45; padding: 12px 12px 24px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.sidebar .org.has-logo { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 12px; }
.sidebar .org strong { display: inline-block; }
.sidebar .org span { color: var(--ink); font-weight: 500; }
.org-logo { width: 52px; height: 52px; object-fit: contain; }
.org-logo-preview { width: 92px; height: 92px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 6px; }
.sidebar a {
  color: var(--ink); padding: 11px 13px; border-radius: 8px; font-weight: 700; display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.44);
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.sidebar a.active, .sidebar a:hover { color: var(--blue); background: linear-gradient(90deg, #eaf2ff, #ffffff); transform: translateX(2px); }
.sidebar a.active { box-shadow: inset 3px 0 0 var(--blue); }
.nav-mark {
  width: 30px; height: 30px; flex: 0 0 auto; display: inline-grid; place-items: center; border-radius: 8px;
  background: linear-gradient(135deg, #eef7ff, #e8fbef); color: var(--blue-dark); font-size: 11px; font-weight: 900;
  border: 1px solid rgba(0,86,214,.15); box-shadow: 0 3px 10px rgba(0,86,214,.06);
}
.sidebar a.active .nav-mark, .sidebar a:hover .nav-mark { background: linear-gradient(135deg, var(--blue), #16a34a); color: #fff; }
.sidebar footer { margin-top: 12px; color: var(--muted); font-size: 12px; padding: 16px 10px; border-top: 1px solid var(--line); }
.developer-link {
  width: 100%; display: grid; gap: 2px; text-align: left; border: 0; background: transparent; color: var(--muted);
  padding: 0; cursor: pointer; font: inherit;
}
.developer-link strong { color: var(--ink); font-size: 13px; }
.developer-link span { font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.developer-link:hover strong { color: var(--blue); }
.developer-symbol {
  width: 16px; height: 16px; display: inline-block; border-radius: 5px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.42), 0 3px 8px rgba(0,86,214,.18);
}
.developer-modal {
  position: fixed; inset: 0; z-index: 90; display: none; place-items: center; padding: 22px;
  background: rgba(8,19,52,.46);
}
.developer-modal.is-visible { display: grid; }
.developer-card {
  position: relative; width: min(560px, 100%); display: grid; grid-template-columns: 116px 1fr; gap: 18px;
  align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px;
  box-shadow: 0 28px 80px rgba(8,19,52,.26);
}
.developer-close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: #eef5ff; color: var(--blue-dark); font-size: 24px; line-height: 1; cursor: pointer;
}
.developer-photo {
  width: 104px; height: 104px; border-radius: 50%; object-fit: cover; background: #eef5ff;
  border: 3px solid #fff; box-shadow: 0 10px 28px rgba(8,19,52,.16);
}
.developer-initials {
  display: grid; place-items: center; color: #fff; font-size: 32px; font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--green));
}
.developer-card h2 { margin: 0 0 4px; font-size: 24px; }
.developer-role { margin: 0 0 12px; color: var(--blue); font-weight: 900; }
.developer-card p { margin: 0 0 12px; line-height: 1.45; color: #23365f; }
.developer-info { display: grid; grid-template-columns: 82px 1fr; gap: 6px 12px; margin: 0; font-size: 13px; }
.developer-info dt { color: var(--muted); font-weight: 900; }
.developer-info dd { margin: 0; }
.developer-modal-active { overflow: hidden; }
.content { padding: 30px; max-width: 1360px; width: 100%; }

.panel, .stat {
  background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-soft);
}
.panel { padding: 22px; margin-bottom: 20px; position: relative; overflow: hidden; }
.panel::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, rgba(0,86,214,.78), rgba(24,169,87,.72), rgba(124,58,237,.62));
}
.panel h2 { margin: 0 0 16px; font-size: 20px; letter-spacing: .01em; }
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.panel-head, .page-head, .form-actions, .toolbar, .action-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.page-head { margin-bottom: 18px; }
.page-head h2 { margin: 0 0 6px; font-size: 26px; }
.page-head p { margin: 0; color: var(--muted); }

.cards { display: grid; gap: 16px; margin-bottom: 22px; }
.cards.four { grid-template-columns: repeat(4, 1fr); }
.stat { padding: 24px; display: grid; gap: 7px; position: relative; overflow: hidden; }
.stat::before {
  content: ""; position: absolute; width: 82px; height: 82px; right: -18px; top: -24px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(0,86,214,.12), rgba(24,169,87,.12));
}
.stat strong { font-size: 31px; }
.stat span { color: var(--muted); font-weight: 700; }
.stat .btn { margin-top: 10px; }
.unit-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.unit-card {
  position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(180deg, #fff, #f9fcff);
  padding: 18px; display: grid; gap: 14px; box-shadow: 0 8px 22px rgba(8,19,52,.06);
}
.unit-card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 5px;
  background: linear-gradient(90deg, #0b66e4, #16a34a, #7c3aed);
}
.unit-card.is-inactive { background: #fafafa; }
.unit-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.unit-card-head h3 { margin: 0; font-size: 20px; line-height: 1.15; }
.unit-card-head p { margin: 4px 0 0; color: var(--muted); }
.status-pill {
  display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 0 12px;
  border-radius: 999px; font-weight: 800; font-size: 13px; white-space: nowrap;
}
.status-pill.ok { color: #08743a; background: #dcf7e8; }
.status-pill.off { color: #6b7280; background: #eef0f4; }
.unit-db {
  display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px dashed #b9c8df; border-radius: 8px; background: #f5f9ff;
}
.unit-db span {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px;
  color: #fff; background: var(--blue-dark); font-weight: 900; font-size: 12px;
}
.unit-db strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; color: #23365f; }
.unit-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.metric-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 4px; min-width: 0;
}
.metric-card span {
  width: 36px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px;
  color: #fff; font-weight: 900; font-size: 11px;
}
.metric-card strong { font-size: 23px; line-height: 1.1; overflow-wrap: anywhere; }
.metric-card small { color: var(--ink); font-weight: 800; }
.metric-card em { color: var(--muted); font-style: normal; font-size: 12px; line-height: 1.35; }
.metric-card.blue { background: #eef6ff; }
.metric-card.blue span { background: #0b66e4; }
.metric-card.green { background: #effaf2; }
.metric-card.green span { background: #16a34a; }
.metric-card.purple { background: #f6f0ff; }
.metric-card.purple span { background: #7c3aed; }
.unit-detail-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 12px; }
.unit-detail-grid > div { border-top: 1px solid var(--line); padding-top: 12px; min-width: 0; }
.unit-detail-grid strong { display: block; margin-bottom: 5px; }
.unit-detail-grid p { margin: 0 0 4px; overflow-wrap: anywhere; line-height: 1.35; }
.limit-bars { display: grid; gap: 9px; }
.limit-row { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; align-items: center; }
.limit-row span { font-weight: 700; color: #23365f; }
.limit-row em { color: var(--muted); font-style: normal; font-weight: 800; font-size: 12px; }
.limit-row i { grid-column: 1 / -1; height: 7px; overflow: hidden; border-radius: 999px; background: #e7edf7; }
.limit-row b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0b66e4, #16a34a); }
.quality-box { display: grid; grid-template-columns: 14px 1fr; gap: 10px; align-items: start; }
.quality-dot { width: 12px; height: 12px; margin-top: 4px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(255,255,255,.9); }
.quality-dot.ok { background: #16a34a; box-shadow: 0 0 0 4px #dcf7e8; }
.quality-dot.warn { background: #f59e0b; box-shadow: 0 0 0 4px #fff3d6; }
.unit-actions { display: grid; gap: 10px; padding-top: 2px; }
.unit-primary-action .btn { width: 100%; min-height: 44px; font-size: 15px; }
.unit-secondary-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.unit-secondary-actions form { display: inline-flex; }
.unit-secondary-actions .btn { min-height: 36px; padding: 0 11px; gap: 6px; font-size: 13px; }
.unit-secondary-actions .btn span {
  width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 6px;
  background: #eef5ff; color: var(--blue-dark); font-size: 10px; font-weight: 900;
}
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 14px; }
.quick-grid a {
  background: linear-gradient(180deg, #f6faff, #edf5ff); border: 1px solid #cfe0ff; border-radius: 10px;
  min-height: 92px; display: grid; place-items: center; text-align: center; font-weight: 800;
  box-shadow: 0 8px 18px rgba(0,86,214,.06); transition: transform .16s ease, box-shadow .16s ease;
}
.quick-grid a:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0,86,214,.10); }

.grid-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.wide { grid-column: 1 / -1; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 18px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.checkbox-grid legend { font-weight: 800; padding: 0 6px; }
.form-stack { display: grid; gap: 16px; }
.form-actions {
  margin-top: 18px; justify-content: flex-end; padding-top: 14px; border-top: 1px solid #edf2f9;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px;
  border-radius: 8px; border: 1px solid #9cb7ea; background: #fff; color: var(--blue); font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 12px rgba(8,19,52,.045); transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(8,19,52,.09); }
.btn.primary { color: #fff; background: linear-gradient(135deg, var(--blue), #0877f2); border-color: var(--blue); }
.btn.success { color: #fff; background: linear-gradient(135deg, var(--green), #0d8f48); border-color: var(--green); }
.btn.danger { color: #fff; background: linear-gradient(135deg, var(--danger), #b80f1c); border-color: var(--danger); }
.btn.full { width: 100%; }
.danger-zone { border-color: #ffc6cc; background: linear-gradient(180deg, #fffafa, #fff5f6); }
.tag { display: inline-flex; padding: 5px 10px; border-radius: 999px; background: #eaf7ef; color: #08783a; font-size: 12px; font-weight: 800; }
.tag.neutral { background: #eef2f7; color: #52617c; }
.flash {
  padding: 14px 16px; border-radius: 10px; margin-bottom: 18px; background: #eaf7ef; color: #075f30;
  border: 1px solid #b9e4c9; box-shadow: var(--shadow-soft);
}
.flash.error { background: #fff0f1; color: #a50010; border-color: #ffc6cc; }
.notice {
  padding: 14px 16px; border-radius: 10px; border: 1px solid #b9d4ff; background: linear-gradient(180deg, #f3f8ff, #eaf3ff);
  color: #0046b8; margin: 12px 0; line-height: 1.45;
}
.inline-form { display: inline-flex; margin-left: 10px; vertical-align: middle; }
.inline-form .btn { min-height: 32px; padding: 0 12px; }
.success-bg { background: #ecfbf2; border-color: #bce8cb; color: #0c6f38; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.table-wrap table { min-width: 760px; }
.table-wrap th:first-child, .table-wrap td:first-child { padding-left: 18px; }
.table-wrap th:last-child, .table-wrap td:last-child { padding-right: 18px; }
.toolbar { margin-bottom: 14px; }
.toolbar input { flex: 1; }
.search-results { display: grid; gap: 8px; margin: -6px 0 18px; }
.search-results a { background: #fff; border: 1px solid var(--line); padding: 12px 14px; border-radius: 8px; box-shadow: var(--shadow-soft); }

.infraction-list { display: grid; gap: 10px; }
.infraction-tools { display: grid; grid-template-columns: 1.8fr minmax(220px, .8fr); gap: 14px; margin: 12px 0 16px; }
.infraction-card {
  grid-template-columns: 24px 1fr auto; align-items: start; border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fff;
  box-shadow: 0 4px 14px rgba(8,19,52,.035); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.infraction-card:hover { border-color: #a9c6f7; box-shadow: 0 10px 22px rgba(0,86,214,.08); transform: translateY(-1px); }
.infraction-card input { width: 18px; height: 18px; margin-top: 2px; }
.infraction-card span { color: #0f7b39; background: #e6f7ed; border-radius: 999px; padding: 4px 9px; font-size: 12px; }
.infraction-card small { grid-column: 2 / -1; color: var(--muted); font-weight: 500; line-height: 1.45; }
.relato-card { display: none; border: 1px solid #bdd3ff; border-radius: 10px; padding: 16px; background: linear-gradient(180deg, #fff, #f8fbff); }
.relato-card.is-visible { display: block; }
.relato-card.compact textarea { min-height: 110px; }
.compact-facts { grid-template-columns: 1fr minmax(220px, .35fr); align-items: end; }
.manual-infraction, .products-box {
  margin-top: 16px; border: 1px solid #cfe0ff; border-radius: 10px; padding: 16px; background: #f8fbff;
}
.manual-infraction p, .products-box p { margin: -4px 0 14px; color: var(--muted); }
.products-entry { display: grid; gap: 10px; margin: 14px 0; }
[data-products-inline] { display: none; }
[data-products-inline].is-visible, .products-box.is-visible { display: block; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.delegate-users { display: none; }
.delegate-users.is-visible { display: block; }
.product-row {
  display: grid; grid-template-columns: 2fr .7fr .7fr 1.4fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line);
}
.process-request-box { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.process-request-box label { min-width: 0; }
.process-status {
  grid-column: 1 / -1; font-size: 12px; color: var(--muted); background: #f6f9ff; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
}
.process-status[data-state="pending"] { color: #8a5a00; background: #fff8e8; border-color: #f0d493; }
.process-status[data-state="done"] { color: #075f30; background: #eaf7ef; border-color: #b9e4c9; }
.process-status[data-state="error"] { color: #a50010; background: #fff0f1; border-color: #ffc6cc; }
.signature-options { border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0; padding: 15px; background: #fff; }
.signature-options legend { font-weight: 800; padding: 0 8px; }
.signature-options label, .check { display: flex; align-items: center; gap: 8px; }
.check.inline { width: auto; white-space: nowrap; }
.signature-options input, .check input { width: auto; }
.witnesses { display: none; border: 1px solid #ffd6a8; background: #fffaf2; border-radius: 10px; padding: 16px; margin: 14px 0; }
.witnesses.is-visible { display: block; }
.signature-pad-box {
  display: none; margin-top: 14px; border: 1px solid #bdd3ff; background: #f8fbff; border-radius: 10px; padding: 14px;
}
.signature-pad-box.is-visible, .witnesses .signature-pad-box { display: block; }
.code-signature-box {
  display: none; margin-top: 14px; border: 1px solid #b7d7c5; background: #f3fbf6; border-radius: 10px; padding: 14px;
}
.code-signature-box.is-visible { display: block; }
.signature-canvas {
  width: 100%; height: 180px; display: block; border: 1px dashed #8aa9de; border-radius: 6px; background: #fff; touch-action: none;
}
.signature-fullscreen-open { margin-top: 10px; }
.signature-fullscreen {
  position: fixed; inset: 0; z-index: 80; display: none; padding: 14px;
  background: rgba(3, 14, 38, .88);
}
.signature-fullscreen.is-visible { display: grid; place-items: stretch; }
.signature-fullscreen-card {
  width: 100%; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px;
  background: #f7fbff; border-radius: 14px; padding: 14px; box-shadow: 0 28px 80px rgba(0,0,0,.35);
}
.signature-fullscreen-head, .signature-fullscreen-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.signature-fullscreen-head strong { display: block; font-size: 18px; }
.signature-fullscreen-head span { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.signature-fullscreen-canvas {
  width: 100%; height: 100%; min-height: 260px; border: 2px dashed #7aa7ec; border-radius: 12px;
  background: #fff; touch-action: none; box-shadow: inset 0 0 0 1px rgba(0,86,214,.08);
}
.signature-fullscreen-actions { padding-top: 2px; }
.signature-fullscreen-active { overflow: hidden; }
.email-log { font-size: 12px; margin: 3px 0; color: #075f30; }
.email-log.erro { color: var(--danger); }
.mini-form { display: grid; gap: 8px; min-width: 260px; }
.avatar-preview {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: #fff;
}
.avatar-preview.large { width: 92px; height: 92px; }
.signature-preview {
  width: min(260px, 100%); height: 82px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
.media-preview {
  display: grid; gap: 8px; align-content: start; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbff;
}
.user-signature { display: block; }

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(135deg, #eaf2fb, #f8fbff); }
.login-shell { width: min(1460px, 100%); min-height: 760px; display: grid; grid-template-columns: 1fr 1fr; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.login-brand { color: #fff; background: linear-gradient(140deg, #0972e8, #003f9e); padding: 34px 80px; display: flex; flex-direction: column; justify-content: center; gap: 26px; }
.login-brand-row { display: flex; align-items: center; gap: 18px; color: inherit; }
.login-brand-row strong { font-size: 40px; letter-spacing: 0; }
.login-brand-row span { font-size: 21px; font-weight: 800; }
.login-brand-logo { width: 78px; height: 78px; border-radius: 16px; object-fit: cover; box-shadow: 0 0 0 2px rgba(255,255,255,.32), 0 16px 36px rgba(0,0,0,.22); }
.login-hero-logo { width: min(190px, 46vw); height: min(190px, 46vw); object-fit: contain; margin: 4px 0 -10px; filter: drop-shadow(0 18px 32px rgba(0,0,0,.2)); }
.login-brand h1 { font-size: 52px; line-height: 1.08; margin: 0; max-width: 620px; }
.login-brand p { font-size: 25px; line-height: 1.35; margin: 0; }
.sus-mark { font-size: 44px; font-weight: 900; margin-top: 30px; }
.login-config-preview { width: 88px; height: 88px; border-radius: 16px; object-fit: contain; border: 1px solid var(--line); background: #fff; padding: 6px; }
.login-config-preview.hero { width: 136px; height: 136px; }
.login-card { align-self: center; justify-self: center; width: min(540px, calc(100% - 48px)); border: 1px solid var(--line); border-radius: 16px; padding: 42px 36px; box-shadow: var(--shadow-soft); }
.login-card h2 { font-size: 34px; text-align: center; margin: 0 0 8px; }
.login-card p { text-align: center; color: var(--muted); margin: 0 0 28px; }
.verify-shell { width: min(760px, 100%); }
.verify-brand { color: var(--blue-dark); margin-bottom: 18px; }
.verify-result { margin: 18px 0; }
.verify-result dl, .detail-grid { display: grid; grid-template-columns: 180px 1fr; gap: 10px 16px; }
.verify-result dt, .detail-grid dt { font-weight: 800; color: var(--muted); }
.verify-result dd, .detail-grid dd { margin: 0; }
.pdf-preview {
  width: 100%; height: 760px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
}
.pdf-preview-panel .panel-head { margin-bottom: 12px; }
.pdf-mobile-actions { justify-content: flex-end; }
.recipient-list { display: grid; gap: 10px; }
.recipient-list h3 { margin: 0 0 4px; }
.email-body { min-height: 210px; line-height: 1.45; }
.modal {
  width: min(780px, calc(100vw - 32px)); border: 0; border-radius: 14px; padding: 0; box-shadow: 0 24px 70px rgba(8, 19, 52, .28);
}
.modal::backdrop { background: rgba(8, 19, 52, .42); }
.modal-card { display: grid; gap: 14px; padding: 22px; background: #fff; }
.modal-card h2 { margin: 0; font-size: 20px; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto auto; height: auto; min-height: 66px; padding: 12px 16px; gap: 10px; }
  .topbar h1, .user-pill, .topbar-avatar { display: none; }
  .brand-row strong { font-size: 26px; }
  .brand-row span { display: none; }
  .app-logo { width: 38px; height: 38px; }
  .notification-bell { width: 38px; height: 38px; font-size: 18px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; inset: 66px auto 0 0; width: min(320px, 86vw); height: calc(100dvh - 66px); padding-bottom: 24px; transform: translateX(-105%); transition: transform .18s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 66px 0 0; z-index: 29; background: rgba(8,19,52,.34);
    opacity: 0; pointer-events: none; transition: opacity .18s ease;
  }
  .sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  .developer-card { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 22px 18px; }
  .developer-info { grid-template-columns: 1fr; text-align: center; }
  .content { padding: 18px; }
  .panel { padding: 16px; }
  .panel-head { align-items: stretch; flex-direction: column; }
  .cards.four, .quick-grid, .grid-form, .signature-options, .product-row, .process-request-box, .infraction-tools, .compact-facts, .choice-grid, .unit-card-grid, .unit-metrics, .unit-detail-grid { grid-template-columns: 1fr; }
  .unit-card { padding: 15px; }
  .unit-secondary-actions { display: grid; grid-template-columns: 1fr; }
  .unit-secondary-actions .btn, .unit-secondary-actions form, .unit-secondary-actions form button { width: 100%; }
  .page-head, .toolbar, .action-row { align-items: stretch; flex-direction: column; }
  .toolbar .btn, .form-actions .btn, .action-row .btn { width: 100%; }
  .table-wrap { border-radius: 8px; }
  .table-wrap table { min-width: 0; border-collapse: separate; border-spacing: 0 10px; }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: grid; gap: 10px; padding: 8px; }
  .table-wrap tr {
    display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
    background: #fff; box-shadow: 0 6px 16px rgba(8,19,52,.045);
  }
  .table-wrap td {
    display: grid; grid-template-columns: minmax(104px, .38fr) 1fr; gap: 12px; border: 0;
    border-bottom: 1px solid #edf2f9; padding: 11px 12px; align-items: start;
  }
  .table-wrap td:last-child { border-bottom: 0; }
  .table-wrap td::before {
    content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 900;
    text-transform: uppercase; letter-spacing: .02em;
  }
  .table-wrap td[colspan] { display: block; }
  .table-wrap td[colspan]::before { content: ""; display: none; }
  .signature-fullscreen { padding: 8px; }
  .signature-fullscreen-card { border-radius: 10px; padding: 10px; gap: 8px; }
  .signature-fullscreen-head { align-items: flex-start; }
  .signature-fullscreen-head span { font-size: 12px; }
  .signature-fullscreen-actions .btn, .signature-fullscreen-head .btn { min-height: 44px; padding: 0 14px; }
  .login-shell { grid-template-columns: 1fr; min-height: auto; }
  .login-brand { padding: 34px 28px; }
  .login-brand-row { gap: 12px; }
  .login-brand-row strong { font-size: 31px; }
  .login-brand-row span { font-size: 17px; }
  .login-brand-logo { width: 58px; height: 58px; border-radius: 13px; }
  .login-hero-logo { width: 128px; height: 128px; }
  .login-brand h1 { font-size: 34px; }
  .login-card { margin: 28px 0; }
  .verify-result dl, .detail-grid { grid-template-columns: 1fr; }
  .verify-result dt, .detail-grid dt { margin-top: 8px; }
  .pdf-preview-panel .panel-head { align-items: stretch; }
  .pdf-mobile-actions { display: grid; grid-template-columns: 1fr; }
  .pdf-preview { height: 360px; }
}
