:root {
  --sige-guinda-950: #3b0718;
  --sige-guinda-900: #5f0f2e;
  --sige-guinda-800: #7a173b;
  --sige-guinda-700: #9f2241;
  --sige-guinda-100: #f8e9ee;
  --sige-gold: #b88a2b;
  --sige-teal: #247c7c;
  --sige-ink: #1f2430;
  --sige-muted: #687386;
  --sige-line: #e5dce0;
  --sige-paper: #fffaf7;
  --sige-surface: #ffffff;
  --sige-bg: #f7f2f3;
  --sige-shadow: 0 18px 45px rgba(64, 10, 28, .12);
  --sige-radius: 8px;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--sige-ink);
  background:
    linear-gradient(180deg, rgba(255, 250, 247, .9), rgba(247, 242, 243, .86)),
    url('/img/sigeweb-statistics-bg.png') center center / cover fixed no-repeat;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

a { text-decoration-thickness: .08em; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 286px;
  min-height: 100vh;
  position: fixed;
  inset: 0 auto 0 0;
  padding: 22px 18px;
  background:
    linear-gradient(180deg, rgba(59, 7, 24, .94), rgba(95, 15, 46, .91)),
    url('/img/sigeweb-statistics-bg.png') center center / cover no-repeat;
  border-right: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 18px 0 44px rgba(59, 7, 24, .22);
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.brand-box {
  display: flex;
  gap: 13px;
  align-items: center;
  padding: 12px 10px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  margin-bottom: 18px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: var(--sige-radius);
  background: linear-gradient(135deg, var(--sige-gold), #f3d37b);
  display: grid;
  place-items: center;
  color: var(--sige-guinda-950);
  font-size: 1.35rem;
  box-shadow: 0 14px 28px rgba(0, 0, 0, .24);
}

.brand-title {
  color: #fff;
  font-weight: 900;
  letter-spacing: .04em;
  font-size: 1.12rem;
}

.brand-subtitle {
  color: rgba(255, 255, 255, .72);
  font-size: .78rem;
  font-weight: 700;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 11px 13px;
  border-radius: var(--sige-radius);
  color: rgba(255, 255, 255, .78);
  text-decoration: none;
  font-weight: 800;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.sidebar-nav a i {
  width: 22px;
  text-align: center;
  font-size: 1.1rem;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255, 255, 255, .13);
  color: #fff;
  transform: translateX(2px);
}

.sidebar-nav a.active::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: var(--sige-gold);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 4px 4px;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--sige-radius);
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .82);
  font-size: .82rem;
  font-weight: 800;
}

.btn-sidebar {
  border: 1px solid rgba(255, 255, 255, .24);
  color: #fff;
  background: rgba(255, 255, 255, .1);
}

.btn-sidebar:hover { background: #fff; color: var(--sige-guinda-900); }

.main-wrapper {
  margin-left: 286px;
  width: calc(100% - 286px);
  min-height: 100vh;
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 32px;
  border-bottom: 1px solid rgba(95, 15, 46, .12);
  background: rgba(255, 250, 247, .9);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.page-kicker,
.forms-kicker {
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--sige-guinda-700);
  font-size: .72rem;
  font-weight: 900;
}

.page-title {
  font-size: 1.42rem;
  font-weight: 900;
  margin: 0;
  color: var(--sige-guinda-950);
}

.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(184, 138, 43, .35);
  border-radius: 999px;
  color: var(--sige-guinda-900);
  background: #fff7e6;
  font-weight: 900;
}

.content-area { padding: 28px 32px 42px; }

.content-card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(95, 15, 46, .11);
  border-radius: var(--sige-radius);
  box-shadow: var(--sige-shadow);
  padding: 26px;
}

.app-alert {
  border: 0;
  border-radius: var(--sige-radius);
  box-shadow: 0 10px 24px rgba(64, 10, 28, .1);
}

.mobile-menu {
  background: linear-gradient(180deg, var(--sige-guinda-950), var(--sige-guinda-800));
  color: #fff;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 34px;
  margin-bottom: 22px;
  color: #fff;
  border-radius: var(--sige-radius);
  background:
    linear-gradient(135deg, rgba(59, 7, 24, .98), rgba(159, 34, 65, .92)),
    radial-gradient(circle at top right, rgba(184, 138, 43, .35), transparent 22rem);
  box-shadow: 0 24px 55px rgba(95, 15, 46, .22);
}

.hero-chip {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 900;
}

.dashboard-hero h2 {
  margin: 0 0 10px;
  max-width: 760px;
  font-size: clamp(1.75rem, 3vw, 2.65rem);
  font-weight: 900;
}

.dashboard-hero p {
  max-width: 780px;
  margin: 0;
  color: rgba(255, 255, 255, .78);
  font-size: 1.05rem;
}

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

.metric-grid,
.quick-grid,
.forms-grid,
.catalog-modules-grid {
  display: grid;
  gap: 16px;
}

.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px; }
.quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.metric-card,
.quick-card,
.form-card,
.form-section-card,
.records-table-card,
.catalog-content,
.catalog-header,
.catalog-toolbar,
.catalog-module-card,
.catalog-table-card,
.forms-toolbar,
.forms-header,
.forms-empty,
.records-toolbar,
.form-page-header {
  border: 1px solid rgba(95, 15, 46, .11);
  border-radius: var(--sige-radius);
  background: var(--sige-surface);
  box-shadow: 0 12px 30px rgba(64, 10, 28, .08);
}

.metric-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 108px;
  padding: 18px;
}

.metric-icon,
.module-icon,
.form-card-icon,
.form-title-icon,
.form-section-icon {
  display: grid;
  place-items: center;
  border-radius: var(--sige-radius);
}

.metric-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  font-size: 1.3rem;
  background: var(--sige-guinda-100);
  color: var(--sige-guinda-800);
}

.metric-icon.process { background: #edf7f6; color: var(--sige-teal); }
.metric-icon.done { background: #edf8ef; color: #21764a; }
.metric-icon.imports { background: #fff5db; color: #906616; }

.metric-card span {
  display: block;
  color: var(--sige-muted);
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  color: var(--sige-guinda-950);
  font-size: 2.05rem;
  line-height: 1;
}

.quick-card {
  min-height: 245px;
  padding: 20px;
  border-radius: var(--sige-radius);
  background: #fff;
  border: 1px solid rgba(95, 15, 46, .11);
  box-shadow: 0 12px 30px rgba(64, 10, 28, .08);
  display: flex;
  flex-direction: column;
}

.quick-card h3,
.form-card h3,
.catalog-module-card h3 {
  margin: 0 0 8px;
  color: var(--sige-guinda-950);
  font-size: 1.08rem;
  font-weight: 900;
}

.quick-card p,
.form-card p,
.catalog-module-card p {
  margin: 0 0 18px;
  color: var(--sige-muted);
  line-height: 1.45;
}

.quick-card .btn { margin-top: auto; }

.module-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  background: var(--sige-guinda-100);
  color: var(--sige-guinda-800);
  font-size: 1.3rem;
}

.btn {
  border-radius: var(--sige-radius);
  font-weight: 900;
}

.btn-primary,
.btn-success {
  background: linear-gradient(135deg, var(--sige-guinda-800), var(--sige-guinda-700));
  border-color: var(--sige-guinda-700);
  box-shadow: 0 10px 22px rgba(159, 34, 65, .22);
}

.btn-primary:hover,
.btn-success:hover {
  background: var(--sige-guinda-900);
  border-color: var(--sige-guinda-900);
}

.btn-outline-primary {
  color: var(--sige-guinda-800);
  border-color: rgba(159, 34, 65, .42);
}

.btn-outline-primary:hover,
.btn-outline-primary.active,
.btn-primary.active {
  color: #fff;
  background: var(--sige-guinda-800);
  border-color: var(--sige-guinda-800);
}

.btn-outline-secondary {
  color: #4b5565;
  border-color: #cfc5c9;
}

.form-control,
.form-select {
  border-radius: var(--sige-radius);
  border-color: #d8cdd2;
  padding: .72rem .9rem;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--sige-guinda-700);
  box-shadow: 0 0 0 .24rem rgba(159, 34, 65, .12);
}

.table {
  --bs-table-bg: #fff;
  margin: 0;
  border-radius: var(--sige-radius);
  overflow: hidden;
  box-shadow: none;
}

.table thead th {
  background: #f6edf0;
  color: var(--sige-guinda-900);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .72rem;
  border-bottom: 0;
}

.table tbody td { border-color: #f0e6ea; }

.badge,
.status-pill,
.report-pill {
  font-weight: 900;
}

.text-bg-primary { background-color: var(--sige-guinda-800) !important; }
.text-bg-info { background-color: var(--sige-teal) !important; color: #fff !important; }

.forms-dashboard,
.form-workspace,
.catalog-workspace {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.forms-header,
.form-page-header,
.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
  padding: 18px;
  background: #fffdfb;
}

.forms-header h2,
.form-title-block h2,
.catalog-header h2 {
  margin: 0 0 6px;
  color: var(--sige-guinda-950);
  font-size: 1.65rem;
  font-weight: 900;
}

.forms-summary,
.catalog-summary {
  display: grid;
  gap: 10px;
}

.forms-summary { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
.catalog-summary { grid-template-columns: repeat(4, minmax(92px, 1fr)); }

.forms-summary > div,
.catalog-summary > div {
  min-height: 74px;
  padding: 13px 15px;
  background: #fff7f1;
  border: 1px solid rgba(184, 138, 43, .22);
  border-radius: var(--sige-radius);
}

.forms-summary span,
.catalog-summary strong {
  display: block;
  color: var(--sige-guinda-900);
  font-size: 1.42rem;
  font-weight: 900;
  line-height: 1;
}

.forms-summary small,
.catalog-summary span {
  color: var(--sige-muted);
  font-size: .78rem;
  font-weight: 900;
}

.forms-toolbar,
.records-toolbar,
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
}

.forms-search {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.forms-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sige-guinda-700);
}

.forms-search .form-control {
  padding-left: 42px;
  background: #fff;
}

.forms-filters,
.catalog-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.forms-featured {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.forms-featured-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid rgba(95, 15, 46, .12);
  border-radius: var(--sige-radius);
  background: #fff;
  color: var(--sige-ink);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(64, 10, 28, .07);
}

.forms-featured-item:hover { border-color: var(--sige-guinda-700); color: var(--sige-guinda-800); }
.forms-featured-item i { color: var(--sige-guinda-800); font-size: 1.2rem; }
.forms-featured-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; }
.forms-featured-item strong { margin-left: auto; color: var(--sige-guinda-900); }

.forms-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.form-card {
  min-height: 244px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.form-card:hover {
  transform: translateY(-2px);
  border-color: rgba(159, 34, 65, .35);
  box-shadow: 0 18px 42px rgba(64, 10, 28, .13);
}

.form-card-main {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.form-card-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  font-size: 1.35rem;
}

.form-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.form-card-meta span {
  min-height: 24px;
  padding: 3px 8px;
  border-radius: var(--sige-radius);
  background: #f6edf0;
  color: var(--sige-guinda-800);
  font-size: .72rem;
  font-weight: 900;
}

.form-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-card-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
}

.forms-empty {
  padding: 42px 20px;
  text-align: center;
  color: var(--sige-muted);
  background: #fffdfb;
  border-style: dashed;
}

.forms-empty i { font-size: 2rem; color: var(--sige-guinda-700); }
.forms-empty h3 { margin: 10px 0 4px; color: var(--sige-guinda-950); font-size: 1.2rem; font-weight: 900; }
.forms-empty p { margin: 0; }

.form-page-title {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-title-block {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.form-title-icon {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  background: var(--sige-guinda-100);
  color: var(--sige-guinda-800);
  font-size: 1.45rem;
}

.form-title-block p:not(.forms-kicker) {
  margin: 0;
  color: var(--sige-muted);
  line-height: 1.42;
}

.form-page-actions { display: flex; align-items: center; gap: 10px; }
.dynamic-form { display: flex; flex-direction: column; gap: 16px; }

.form-section-card { overflow: hidden; }
.form-section-detail {
  overflow: visible;
}

.form-section-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(95, 15, 46, .09);
  background: #fffdfb;
}

.form-section-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  background: var(--sige-guinda-100);
  color: var(--sige-guinda-800);
  font-size: 1.15rem;
}

.form-section-heading h3 {
  margin: 0 0 4px;
  color: var(--sige-guinda-950);
  font-size: 1.05rem;
  font-weight: 900;
}

.form-section-heading p { margin: 0; color: var(--sige-muted); font-size: .9rem; }

.form-section-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  padding: 18px;
}

.form-field { grid-column: span 4; min-width: 0; }
.form-field-wide { grid-column: span 12; }
.form-field .form-label { margin-bottom: 6px; color: #453640; font-size: .86rem; font-weight: 900; }

.form-section-detail .form-source-reader {
  position: sticky;
  top: 110px;
  z-index: 2;
  float: left;
  width: min(42%, 620px);
  margin: 18px 0 18px 18px;
  padding: 14px;
  border: 1px solid rgba(95, 15, 46, .12);
  border-radius: var(--sige-radius);
  background: #fff8f4;
  box-shadow: 0 12px 26px rgba(64, 10, 28, .08);
}

.form-source-reader-heading {
  margin-bottom: 12px;
}

.form-source-reader-heading strong {
  display: block;
  color: var(--sige-guinda-950);
  font-size: .95rem;
  font-weight: 900;
}

.form-source-reader-heading span {
  display: block;
  color: var(--sige-muted);
  font-size: .8rem;
  font-weight: 700;
}

.form-source-reader .form-field {
  margin-bottom: 12px;
}

.form-source-reader .form-field:last-child {
  margin-bottom: 0;
}

.form-source-textarea {
  min-height: 260px;
  max-height: 52vh;
  resize: vertical;
  line-height: 1.45;
}

.form-section-detail .form-source-reader + .form-section-grid {
  margin-left: calc(min(42%, 620px) + 18px);
}

.involved-panel {
  margin: 0 18px 18px;
  padding: 14px;
  border: 1px solid rgba(95, 15, 46, .12);
  border-radius: var(--sige-radius);
  background: #fffdfb;
}

.form-section-detail .form-source-reader ~ .involved-panel {
  margin-left: calc(min(42%, 620px) + 18px);
}

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

.involved-panel-heading h4 {
  margin: 0 0 4px;
  color: var(--sige-guinda-950);
  font-size: 1rem;
  font-weight: 900;
}

.involved-panel-heading p {
  margin: 0;
  color: var(--sige-muted);
  font-size: .84rem;
  font-weight: 700;
}

.involved-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.involved-row {
  padding: 12px;
  border: 1px solid rgba(95, 15, 46, .1);
  border-radius: 8px;
  background: #fff;
}

.involved-row-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.involved-row-title strong {
  color: var(--sige-guinda-900);
  font-weight: 900;
}

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

.involved-row-grid .form-field {
  grid-column: span 4;
}

.form-section-detail::after {
  content: "";
  display: block;
  clear: both;
}

.location-map-panel {
  position: relative;
  z-index: 0;
  padding: 0 18px 18px;
  isolation: isolate;
}

.location-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(95, 15, 46, .1);
  border-bottom: 0;
  border-radius: var(--sige-radius) var(--sige-radius) 0 0;
  background: #fff8f4;
}

.location-map-toolbar strong {
  display: block;
  color: var(--sige-guinda-950);
  font-size: .92rem;
  font-weight: 900;
}

.location-map-toolbar span {
  display: block;
  color: var(--sige-muted);
  font-size: .82rem;
  font-weight: 700;
}

.location-map {
  position: relative;
  z-index: 0;
  width: 100%;
  min-height: 460px;
  border: 1px solid rgba(95, 15, 46, .14);
  border-radius: 0 0 var(--sige-radius) var(--sige-radius);
  overflow: hidden;
  background: #eef2f4;
}

.location-map .leaflet-pane,
.location-map .leaflet-top,
.location-map .leaflet-bottom {
  z-index: 1;
}

.location-map .leaflet-control-attribution {
  font-size: .68rem;
}

.form-switch-lg {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 3.1em;
  background: #fff8f4;
  border: 1px solid #d8cdd2;
  border-radius: var(--sige-radius);
}

.form-switch-lg .form-check-input { width: 2.35em; height: 1.25em; margin-left: -2.55em; }
.form-switch-lg .form-check-input:checked { background-color: var(--sige-guinda-800); border-color: var(--sige-guinda-800); }
.form-switch-lg .form-check-label { font-weight: 800; color: var(--sige-muted); }

.form-sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(95, 15, 46, .11);
  border-radius: var(--sige-radius);
  box-shadow: 0 -10px 28px rgba(64, 10, 28, .1);
  backdrop-filter: blur(12px);
}

.records-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  color: var(--sige-muted);
}

.records-count strong {
  color: var(--sige-guinda-900);
  font-size: 1.35rem;
}

.records-table-card,
.catalog-table-card { overflow: auto; }

.records-table thead th,
.catalog-table thead th { padding: 13px 14px; }

.records-table tbody td,
.catalog-table tbody td { padding: 13px 14px; }

.table-location {
  min-width: 360px;
  max-width: 620px;
}

.record-id { font-weight: 900; color: var(--sige-guinda-900); }

.record-rnd {
  display: inline-flex;
  padding: 4px 8px;
  background: var(--sige-guinda-100);
  border-radius: var(--sige-radius);
  color: var(--sige-guinda-800);
  font-size: .82rem;
  font-weight: 900;
}

.status-pill,
.report-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: var(--sige-radius);
  font-size: .78rem;
}

.status-captured { background: var(--sige-guinda-100); color: var(--sige-guinda-800); }
.status-review { background: #fff3d5; color: #855c12; }
.status-valid,
.report-pill-on { background: #eaf8f0; color: #137b47; }
.status-excluded { background: #fdecec; color: #b42318; }
.report-pill-off { background: #f2f4f7; color: #52657c; }

.case-summary-grid,
.raw-fields-grid {
  display: grid;
  gap: 12px;
  padding: 18px;
}

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

.raw-fields-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.case-summary-grid > div,
.raw-field {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(95, 15, 46, .1);
  border-radius: var(--sige-radius);
  background: #fffdfb;
}

.case-summary-wide {
  grid-column: span 2;
}

.case-summary-grid span,
.raw-field span {
  display: block;
  margin-bottom: 5px;
  color: var(--sige-guinda-800);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.case-summary-grid strong,
.raw-field strong {
  display: block;
  color: var(--sige-ink);
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.38;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.catalog-content { overflow: hidden; }
.catalog-content .tab-pane { padding: 16px; }

.catalog-tabs .nav-link {
  border-radius: var(--sige-radius);
  font-weight: 900;
  color: var(--sige-muted);
}

.catalog-tabs .nav-link.active {
  background: var(--sige-guinda-800);
  color: #fff;
}

.catalog-quick-form {
  display: grid;
  grid-template-columns: 1fr minmax(120px, .35fr) auto;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  background: #fff8f4;
  border: 1px solid rgba(95, 15, 46, .1);
  border-radius: var(--sige-radius);
}

.catalog-quick-form-wide { grid-template-columns: minmax(180px, .8fr) 1fr repeat(3, minmax(110px, .45fr)) auto; }
.catalog-quick-form-descriptor { grid-template-columns: repeat(2, minmax(160px, 1fr)) repeat(4, minmax(130px, .8fr)) auto; }
.catalog-quick-form .btn { white-space: nowrap; }

.catalog-modules-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.catalog-module-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  padding: 16px;
}

.catalog-module-forms {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-module-forms span {
  padding: 4px 8px;
  background: var(--sige-guinda-100);
  color: var(--sige-guinda-800);
  border-radius: var(--sige-radius);
  font-size: .78rem;
  font-weight: 900;
}

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(59, 7, 24, .24), rgba(255, 250, 247, .82)),
    url('/img/sigeweb-statistics-bg.png') center center / cover no-repeat;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-panel {
  width: min(980px, 100%);
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(280px, .92fr) minmax(320px, 1fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(95, 15, 46, .12);
  border-radius: var(--sige-radius);
  box-shadow: 0 28px 85px rgba(64, 10, 28, .22);
}

.login-brand-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 46px 34px;
  background: linear-gradient(180deg, var(--sige-guinda-950), var(--sige-guinda-800));
  color: #fff;
}

.login-logo {
  width: min(280px, 82%);
  height: auto;
  object-fit: contain;
  background: rgba(255, 255, 255, .96);
  border-radius: var(--sige-radius);
  padding: 16px;
}

.login-brand-copy { text-align: center; }
.login-brand-title { font-size: 1.6rem; font-weight: 900; }
.login-brand-subtitle { max-width: 280px; margin-top: 6px; color: rgba(255, 255, 255, .75); font-weight: 700; line-height: 1.35; }

.login-form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 52px 58px;
}

.login-form-header { margin-bottom: 28px; }
.login-kicker { margin: 0 0 8px; color: var(--sige-guinda-700); text-transform: uppercase; font-size: .72rem; font-weight: 900; letter-spacing: .12em; }
.login-form-header h1 { margin: 0; color: var(--sige-guinda-950); font-size: 1.85rem; font-weight: 900; }

.login-input-group .input-group-text {
  background: #fff8f4;
  border-color: #d8cdd2;
  color: var(--sige-guinda-800);
}

.login-input-group .form-control { border-left: 0; }
.login-input-group .form-control:focus { border-left: 0; }

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

@media (max-width: 991.98px) {
  .sidebar { display: none; }
  .main-wrapper { margin-left: 0; width: 100%; }
  .topbar { min-height: auto; padding: 16px 18px; }
  .content-area { padding: 18px; }
  .content-card { padding: 18px; }
  .sidebar-nav.mobile a { color: #fff; }
  .dashboard-hero,
  .forms-header,
  .form-page-header,
  .records-toolbar,
  .catalog-header,
  .catalog-toolbar,
  .forms-toolbar { flex-direction: column; align-items: stretch; }
  .hero-actions { justify-content: flex-start; }
  .forms-summary,
  .catalog-summary { width: 100%; grid-template-columns: repeat(2, 1fr); }
  .forms-search { min-width: 100%; }
  .forms-filters,
  .catalog-tabs { justify-content: flex-start; }
  .forms-featured { grid-template-columns: 1fr; }
  .form-field { grid-column: span 6; }
  .form-section-detail .form-source-reader {
    position: static;
    float: none;
    width: auto;
    margin: 18px 18px 0;
  }
  .form-section-detail .form-source-reader + .form-section-grid {
    margin-left: 0;
  }
  .form-section-detail .form-source-reader ~ .involved-panel {
    margin-left: 18px;
  }
  .involved-row-grid .form-field {
    grid-column: span 6;
  }
  .case-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .location-map-toolbar { align-items: flex-start; flex-direction: column; }
  .catalog-quick-form,
  .catalog-quick-form-wide,
  .catalog-quick-form-descriptor { grid-template-columns: 1fr; }
}

@media (max-width: 767.98px) {
  .login-shell { padding: 18px; }
  .login-panel { grid-template-columns: 1fr; min-height: auto; }
  .login-brand-panel { padding: 30px 22px; }
  .login-logo { width: min(210px, 72%); }
  .login-form-panel { padding: 34px 24px; }
}

@media (max-width: 575.98px) {
  .content-area { padding: 14px; }
  .content-card { padding: 14px; }
  .dashboard-hero { padding: 24px; }
  .metric-grid,
  .quick-grid,
  .forms-summary,
  .forms-grid,
  .catalog-summary,
  .catalog-modules-grid { grid-template-columns: 1fr; }
  .form-card-main,
  .form-title-block { flex-direction: column; }
  .form-card-actions { grid-template-columns: 1fr; }
  .form-section-grid { grid-template-columns: 1fr; }
  .form-field,
  .form-field-wide { grid-column: span 1; }
  .involved-panel-heading {
    flex-direction: column;
  }
  .involved-panel-heading .btn {
    width: 100%;
  }
  .involved-row-grid {
    grid-template-columns: 1fr;
  }
  .involved-row-grid .form-field {
    grid-column: span 1;
  }
  .form-source-textarea {
    max-height: none;
  }
  .case-summary-grid,
  .raw-fields-grid { grid-template-columns: 1fr; }
  .case-summary-wide { grid-column: span 1; }
  .location-map { min-height: 360px; }
  .form-sticky-actions { position: static; flex-direction: column; }
  .form-sticky-actions .btn { width: 100%; }
  .catalog-tabs .nav-link { font-size: .86rem; padding: .45rem .6rem; }
}
