:root {
  --bg: #0b1118;
  --bg-soft: #121b24;
  --panel: rgba(20, 28, 38, 0.96);
  --panel-2: #17212c;
  --panel-3: #0f1720;
  --border: #2b3746;
  --text: #edf3fb;
  --muted: #9fb0c2;
  --primary: #d90429;
  --primary-hover: #b00322;
  --success: #1faa59;
  --warning: #f4a100;
  --danger: #ef233c;
  --info: #2a9df4;
  --neutral: #7c8796;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --max-page: 1400px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(42, 157, 244, 0.1), transparent 26%),
    radial-gradient(circle at top right, rgba(217, 4, 41, 0.12), transparent 28%),
    linear-gradient(180deg, #081018 0%, var(--bg) 42%, #09111a 100%);
  color: var(--text);
  min-height: 100vh;
}

/*
body[data-user-role] {
  visibility: hidden;
}
*/

body[data-user-role].app-shell-ready {
  visibility: visible;
}

body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

img {
  display: block;
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-muted {
  color: var(--muted);
}

.success-text {
  color: #9af0b6;
  font-size: 0.88rem;
  min-height: 20px;
  margin-top: 10px;
}

.error-text {
  color: #ff9cab;
  font-size: 0.88rem;
  min-height: 20px;
  margin-top: 10px;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px clamp(16px, 3vw, 28px);
  background: rgba(8, 14, 21, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.nav-left,
.nav-right {
  min-width: 0;
}

.nav-right {
  display: flex;
  justify-content: flex-end;
}

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

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.logo {
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.nav-links a {
  color: var(--muted);
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  border: 1px solid transparent;
  transition: 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle-inner {
  display: grid;
  gap: 4px;
}

.navbar.is-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.navbar.is-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.navbar.is-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.clock-box {
  display: grid;
  gap: 2px;
  min-width: 118px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.clock-label {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#clock,
.clock-value {
  font-size: 1.02rem;
  font-weight: 700;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-user-card {
  display: grid;
  gap: 2px;
  min-width: 220px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.nav-user-name {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.2;
}

.nav-user-meta {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.nav-logout {
  white-space: nowrap;
}

.page {
  width: min(100%, var(--max-page));
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px);
  display: grid;
  gap: clamp(16px, 2.4vw, 24px);
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.panel {
  padding: clamp(18px, 2.2vw, 24px);
}

.soft-card {
  background: var(--panel-2);
  box-shadow: none;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding: clamp(20px, 3vw, 30px);
}

.hero > div {
  min-width: 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: #ffb8c4;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.08;
  margin-bottom: 10px;
}

.hero-text {
  max-width: 68ch;
  color: var(--muted);
  line-height: 1.65;
}

.hero-actions,
.page-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section-heading,
.panel-header,
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.section-heading > div,
.panel-header > div,
.section-header > div {
  min-width: 0;
}

.section-title,
.panel-header h2,
.section-header h2 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.section-copy,
.panel-header p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.mini-link {
  color: #8cc7ff;
  font-size: 0.9rem;
  font-weight: 700;
}

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

.stat-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 20px;
}

.stat-label,
.stat-title {
  color: var(--muted);
  font-size: 0.88rem;
}

.stat-value {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1;
}

.stat-note {
  color: var(--muted);
  font-size: 0.8rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.95fr);
  gap: 20px;
}

.despacho-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.dispatch-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.95fr) minmax(320px, 0.95fr);
  gap: 20px;
}

.dispatch-side-column {
  display: grid;
  gap: 20px;
}

.dispatch-focus-shell {
  min-height: 100%;
}

.dispatch-focus-card {
  display: grid;
  gap: 18px;
  padding: 20px;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(217, 4, 41, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--panel-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
}

.dispatch-focus-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.dispatch-focus-title {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.dispatch-focus-title h3 {
  font-size: 1.2rem;
  line-height: 1.2;
}

.dispatch-focus-title p {
  color: var(--muted);
  line-height: 1.55;
}

.dispatch-kicker {
  color: #ffb8c4;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dispatch-chip-row,
.dispatch-list-meta,
.dispatch-action-row,
.dispatch-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dispatch-inline-actions {
  justify-content: flex-end;
  align-items: flex-start;
}

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

.dispatch-meta-card,
.dispatch-note-card,
.dispatch-empty {
  padding: 14px 16px;
  background: rgba(7, 11, 18, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
}

.dispatch-empty {
  display: grid;
  gap: 8px;
}

.dispatch-empty p,
.dispatch-note-card p {
  color: var(--muted);
  line-height: 1.55;
}

.dispatch-meta-label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dispatch-meta-value {
  line-height: 1.45;
}

.dispatch-queue-item,
.dispatch-call-item,
.dispatch-unit-item {
  align-items: stretch;
}

.dispatch-unit-item.is-ready {
  border-color: rgba(31, 170, 89, 0.28);
}

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

.dispatch-filter-bar {
  align-items: end;
}

.dispatch-table-summary {
  margin-bottom: 16px;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
}

.toggle-chip input {
  accent-color: var(--primary);
}

.toggle-chip span {
  font-size: 0.9rem;
  font-weight: 700;
}

.search-input-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.dispatch-address-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

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

.quick-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.quick-card:hover {
  transform: translateY(-2px);
  border-color: #3e4e61;
}

.quick-icon {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(42, 157, 244, 0.14);
  color: #90cdff;
}

.quick-card h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.quick-card p {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.88rem;
}

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

.summary-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.summary-card h3 {
  font-size: 1rem;
}

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

.summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.summary-item strong {
  color: var(--text);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.field-sm {
  flex: 1 1 220px;
  max-width: 320px;
}

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

.list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.list-item > div {
  min-width: 0;
}

.list-item h4 {
  margin-bottom: 6px;
  font-size: 0.96rem;
}

.list-item p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

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

.status-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.status-item p {
  color: var(--muted);
  font-size: 0.88rem;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px rgba(31, 170, 89, 0.6);
}

.status-dot.warning {
  background: var(--warning);
  box-shadow: 0 0 8px rgba(244, 161, 0, 0.45);
}

.status-dot.info {
  background: var(--info);
  box-shadow: 0 0 8px rgba(42, 157, 244, 0.45);
}

.status-dot.neutral {
  background: var(--neutral);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-success {
  background: rgba(31, 170, 89, 0.16);
  color: #9af0b6;
}

.badge-danger {
  background: rgba(239, 35, 60, 0.16);
  color: #ffb6c0;
}

.badge-warning {
  background: rgba(244, 161, 0, 0.16);
  color: #ffd076;
}

.badge-info {
  background: rgba(42, 157, 244, 0.16);
  color: #90cdff;
}

.badge-neutral {
  background: rgba(124, 135, 150, 0.16);
  color: #d8dfe7;
}

.badge.critical,
.badge-critical {
  background: rgba(239, 35, 60, 0.18);
  color: #ff8c9b;
}

.badge.high,
.badge-high {
  background: rgba(244, 161, 0, 0.18);
  color: #ffd076;
}

.badge.medium,
.badge-medium {
  background: rgba(42, 157, 244, 0.18);
  color: #90cdff;
}

.badge.low,
.badge-low {
  background: rgba(124, 135, 150, 0.18);
  color: #d8dfe7;
}

.badge.available,
.badge-available {
  background: rgba(31, 170, 89, 0.18);
  color: #90efb8;
}

.badge.route,
.badge-route {
  background: rgba(42, 157, 244, 0.18);
  color: #90cdff;
}

.badge.assigned,
.badge-assigned {
  background: rgba(244, 161, 0, 0.18);
  color: #ffd076;
}

.badge.base,
.badge-base {
  background: rgba(124, 135, 150, 0.18);
  color: #d8dfe7;
}

.badge.maintenance,
.badge-maintenance {
  background: rgba(168, 127, 255, 0.18);
  color: #d6c0ff;
}

.badge.out,
.badge-out {
  background: rgba(239, 35, 60, 0.18);
  color: #ff8c9b;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(10, 15, 22, 0.26);
}

.app-table,
.dispatch-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.dispatch-table {
  min-width: 1180px;
}

.app-table th,
.app-table td,
.dispatch-table th,
.dispatch-table td {
  padding: 13px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.app-table th,
.dispatch-table th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.app-table tr:last-child td,
.dispatch-table tr:last-child td {
  border-bottom: none;
}

.app-table tr:hover td,
.dispatch-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

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

.btn-secondary:hover:not(:disabled) {
  background: #203040;
}

.btn-danger {
  background: rgba(239, 35, 60, 0.14);
  color: #ffb6c0;
  border: 1px solid #5a2631;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(239, 35, 60, 0.22);
}

.btn-success {
  background: rgba(31, 170, 89, 0.16);
  color: #9af0b6;
  border: 1px solid #1a5e36;
}

.btn-success:hover:not(:disabled) {
  background: rgba(31, 170, 89, 0.24);
}

.btn-sm {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.dispatch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-select {
  width: 100%;
  min-width: 140px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #526272;
}

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

.empty-message {
  padding: 24px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  background: var(--panel-2);
  color: var(--muted);
  text-align: center;
}

.mini-map {
  width: 100%;
  height: clamp(250px, 42vw, 360px);
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--panel-3);
  overflow: hidden;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at top, rgba(42, 157, 244, 0.16), transparent 28%),
    radial-gradient(circle at bottom, rgba(217, 4, 41, 0.18), transparent 26%),
    linear-gradient(180deg, #081018 0%, var(--bg) 100%);
}

.login-card {
  width: min(100%, 460px);
  padding: 32px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-card-user {
  width: min(100%, 560px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.login-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
}

.auth-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.auth-role-pill {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-2);
}

.auth-role-pill strong {
  font-size: 0.95rem;
}

.auth-role-pill p,
.login-helper {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.login-helper {
  margin-top: 16px;
}

.login-card h1 {
  font-size: clamp(1.7rem, 6vw, 2rem);
  margin-bottom: 8px;
}

.login-card > p {
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.login-form label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.login-form input {
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
}

.login-form button {
  margin-top: 8px;
  padding: 13px 16px;
  border-radius: 12px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.login-form button:hover {
  background: var(--primary-hover);
}

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

.spaced-top {
  margin-top: 18px;
}

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

  .content-grid,
  .dispatch-command-grid,
  .despacho-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 920px) {
  .navbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

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

  .nav-links,
  .nav-right {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
  }

  .navbar.is-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 10px;
  }

  .navbar.is-open .nav-right {
    display: flex;
    justify-content: flex-start;
    padding-top: 4px;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links a {
    width: 100%;
  }

  .clock-box,
  .nav-user-card,
  .nav-logout {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 16px;
  }

  .panel,
  .hero,
  .login-card {
    padding: 20px;
  }

  .login-brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-grid,
  .status-grid,
  .quick-access-grid,
  .despacho-stats,
  .dispatch-mini-stats,
  .dispatch-meta-grid {
    grid-template-columns: 1fr;
  }

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

  .auth-role-grid {
    grid-template-columns: 1fr;
  }

  .panel-header,
  .section-heading,
  .section-header,
  .hero-actions,
  .page-actions,
  .form-actions,
  .dispatch-focus-header,
  .dispatch-inline-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .field-sm {
    max-width: none;
  }

  .list-item,
  .summary-item,
  .dispatch-action-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-input-group {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-table,
  .dispatch-table {
    min-width: 0;
  }

  .app-table thead,
  .dispatch-table thead {
    display: none;
  }

  .app-table tbody,
  .dispatch-table tbody,
  .app-table tr,
  .dispatch-table tr {
    display: block;
  }

  .app-table tr,
  .dispatch-table tr {
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--panel-2);
  }

  .app-table td,
  .dispatch-table td {
    display: grid;
    grid-template-columns: minmax(98px, 120px) minmax(0, 1fr);
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .app-table td:last-child,
  .dispatch-table td:last-child {
    border-bottom: none;
  }

  .app-table td::before,
  .dispatch-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .dispatch-actions {
    justify-content: flex-start;
  }

  .inline-select {
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .app-table td,
  .dispatch-table td {
    grid-template-columns: 1fr;
    gap: 6px;
  }

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