:root {
  color-scheme: light;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Arial,
    sans-serif;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #172033;
  --text-muted: #64748b;
  --text-faint: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-ring: rgba(37, 99, 235, 0.18);
  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-soft: #fef2f2;
  --info: #0284c7;
  --info-soft: #f0f9ff;
  --sidebar-bg: #0f172a;
  --sidebar-surface: #17233b;
  --sidebar-text: #cbd5e1;
  --sidebar-muted: #7f8da5;
  --sidebar-active: #ffffff;
  --sidebar-width: 252px;
  --topbar-height: 68px;
  --radius-sm: 7px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.18);
  --transition: 160ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
}

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

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

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

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

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

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

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

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden auto;
  color: var(--sidebar-text);
  background:
    radial-gradient(circle at 5% 0%, rgba(59, 130, 246, 0.2), transparent 26%),
    var(--sidebar-bg);
  border-right: 1px solid rgba(148, 163, 184, 0.08);
  transition: transform var(--transition), box-shadow var(--transition);
}

.sidebar-brand {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  gap: 11px;
  padding: 0 21px;
  color: #ffffff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.sidebar-brand:hover {
  color: #ffffff;
}

.sidebar-brand img,
.sidebar-brand .brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 10px;
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.28);
}

.nav-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 18px 12px;
  list-style: none;
}

.nav-item {
  margin: 0;
}

.nav-link {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  color: var(--sidebar-text);
  border-radius: 9px;
  font-size: 14px;
  font-weight: 560;
  transition: color var(--transition), background var(--transition),
    transform var(--transition);
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(148, 163, 184, 0.1);
}

.nav-link.active,
.nav-item.active .nav-link,
.nav-link[aria-current="page"] {
  color: var(--sidebar-active);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.34), rgba(37, 99, 235, 0.2));
  box-shadow: inset 3px 0 #60a5fa;
}

.nav-icon {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
  place-items: center;
  color: var(--sidebar-muted);
  font-size: 18px;
  transition: color var(--transition);
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon,
.nav-item.active .nav-icon,
.nav-link[aria-current="page"] .nav-icon {
  color: #93c5fd;
}

.sidebar-footer {
  padding: 15px 17px 19px;
  color: var(--sidebar-muted);
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 12px;
}

.sidebar-footer a {
  color: var(--sidebar-text);
}

.app-main {
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.025);
  backdrop-filter: blur(12px);
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
}

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

.page-heading h1,
.page-heading .page-title {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.page-heading p,
.page-heading .page-subtitle {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.page-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.content {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 26px 28px 40px;
}

.card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card {
  padding: 20px;
}

.card + .card,
.panel + .panel {
  margin-top: 18px;
}

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

.stat-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  padding: 19px 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.stat-card::after {
  position: absolute;
  right: -20px;
  bottom: -32px;
  width: 88px;
  height: 88px;
  background: currentColor;
  border-radius: 50%;
  content: "";
  opacity: 0.035;
}

.stat-icon {
  display: grid;
  width: 45px;
  height: 45px;
  grid-row: 1 / 3;
  place-items: center;
  align-self: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 12px;
  font-size: 21px;
}

.stat-card.success .stat-icon,
.stat-icon.success {
  color: var(--success);
  background: var(--success-soft);
}

.stat-card.warning .stat-icon,
.stat-icon.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.stat-card.danger .stat-icon,
.stat-icon.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.stat-value {
  min-width: 0;
  color: var(--text);
  font-size: clamp(21px, 2vw, 27px);
  font-variant-numeric: tabular-nums;
  font-weight: 780;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.stat-label {
  align-self: end;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 520;
}

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 720;
  line-height: 1.4;
}

.panel-subtitle {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.panel-body {
  padding: 20px;
}

.panel-body.flush,
.panel-body:has(> .table-wrap:only-child) {
  padding: 0;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.filters {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 11px;
}

.filters .form-group {
  min-width: 150px;
  flex: 1 1 170px;
  margin: 0;
}

.filters .form-group.search,
.filters .search-field {
  min-width: 220px;
  flex-grow: 2;
}

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

.form-grid > .form-group {
  grid-column: span 6;
}

.form-grid > .form-group.full,
.form-grid > .full-width {
  grid-column: 1 / -1;
}

.form-grid > .form-group.third {
  grid-column: span 4;
}

.form-group {
  min-width: 0;
  margin-bottom: 17px;
}

.form-label {
  display: block;
  margin: 0 0 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
}

.form-label .required,
.required-mark {
  margin-left: 3px;
  color: var(--danger);
}

.form-control,
.form-select {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition),
    background var(--transition);
}

.form-control::placeholder {
  color: var(--text-faint);
}

.form-control:hover,
.form-select:hover {
  border-color: #a8b6ca;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
  color: var(--text-muted);
  background: var(--surface-subtle);
  cursor: not-allowed;
}

textarea.form-control {
  min-height: 106px;
  resize: vertical;
}

select.form-select {
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  appearance: none;
}

.form-help {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.form-error {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.has-error .form-control,
.has-error .form-select,
.form-control[aria-invalid="true"],
.form-select[aria-invalid="true"] {
  border-color: var(--danger);
}

.form-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 3px;
}

.message-preview {
  max-width: 760px;
  min-height: 96px;
  margin: 16px 0 20px;
  padding: 16px;
  color: #172033;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .btn {
  margin-left: -1px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.check-row,
.radio-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

.check-label,
.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #334155;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.upload-zone {
  display: grid;
  min-height: 126px;
  place-items: center;
  padding: 20px;
  color: var(--text-muted);
  background: var(--surface-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition),
    background var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  color: #334155;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition), background var(--transition),
    border-color var(--transition), box-shadow var(--transition),
    transform 80ms ease;
}

.btn:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: #b6c2d2;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:focus-visible,
.menu-toggle:focus-visible,
.pagination a:focus-visible,
.pagination button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.btn.primary,
.btn-primary {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.btn.primary:hover,
.btn-primary:hover {
  color: #ffffff;
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 5px 13px rgba(37, 99, 235, 0.2);
}

.btn.secondary,
.btn-secondary {
  color: #1e40af;
  background: var(--primary-soft);
  border-color: #bfdbfe;
}

.btn.secondary:hover,
.btn-secondary:hover {
  color: #1e3a8a;
  background: #dbeafe;
  border-color: #93c5fd;
}

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

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

.btn.ghost,
.btn-ghost {
  color: var(--text-muted);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.btn.ghost:hover,
.btn-ghost:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.btn.sm,
.btn-sm {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
}

.btn.icon-only {
  width: 40px;
  padding: 0;
}

.btn.sm.icon-only {
  width: 32px;
}

.btn:disabled,
.btn.disabled {
  opacity: 0.52;
  cursor: not-allowed;
  pointer-events: none;
}

.badge {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 3px 8px;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 680;
  line-height: 1.2;
  white-space: nowrap;
}

.badge::before {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  content: "";
  opacity: 0.7;
}

.badge.status-active,
.badge.status-approved,
.badge.status-success,
.status-active,
.status-approved {
  color: #047857;
  background: var(--success-soft);
  border-color: #a7f3d0;
}

.badge.status-pending,
.badge.status-warning,
.status-pending {
  color: #b45309;
  background: var(--warning-soft);
  border-color: #fde68a;
}

.badge.status-rejected,
.badge.status-disabled,
.badge.status-danger,
.status-rejected,
.status-disabled {
  color: #b91c1c;
  background: var(--danger-soft);
  border-color: #fecaca;
}

.badge.status-info,
.badge.status-processing,
.status-processing {
  color: #0369a1;
  background: var(--info-soft);
  border-color: #bae6fd;
}

.badge.status-neutral {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: inherit;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table,
table.data-table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}

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

.table-wrap th,
table.data-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  color: #475569;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.table-wrap tbody tr,
table.data-table tbody tr {
  transition: background var(--transition);
}

.table-wrap tbody tr:hover,
table.data-table tbody tr:hover {
  background: #fafcff;
}

.table-wrap tbody tr:last-child td,
table.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-wrap td,
table.data-table td {
  color: #334155;
  font-size: 13px;
}

.table-wrap td.numeric,
.table-wrap th.numeric,
.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cell-primary {
  display: block;
  color: var(--text);
  font-weight: 620;
}

.cell-secondary {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 44px 22px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  place-items: center;
  color: var(--text-faint);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 26px;
}

.empty-state h3 {
  margin: 0 0 5px;
  color: #334155;
  font-size: 15px;
}

.empty-state p {
  max-width: 420px;
  margin: 0 auto 17px;
  font-size: 13px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 16px 0 0;
}

.panel > .pagination,
.panel-body.flush + .pagination {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.pagination a,
.pagination button,
.pagination .page-item {
  display: inline-flex;
  min-width: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  color: #475569;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  transition: color var(--transition), background var(--transition),
    border-color var(--transition);
}

.pagination a:hover,
.pagination button:hover {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #bfdbfe;
}

.pagination .active,
.pagination [aria-current="page"] {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.pagination .disabled,
.pagination :disabled {
  color: var(--text-faint);
  background: var(--surface-subtle);
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-summary {
  margin-right: auto;
  color: var(--text-muted);
  font-size: 12px;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 11px 14px;
  color: #075985;
  background: var(--info-soft);
  border: 1px solid #bae6fd;
  border-radius: var(--radius);
  font-size: 13px;
}

.alert.success {
  color: #047857;
  background: var(--success-soft);
  border-color: #a7f3d0;
}

.alert.warning {
  color: #92400e;
  background: var(--warning-soft);
  border-color: #fde68a;
}

.alert.danger,
.alert.error {
  color: #991b1b;
  background: var(--danger-soft);
  border-color: #fecaca;
}

.login-shell {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 28px 18px;
  background:
    radial-gradient(circle at 14% 12%, rgba(59, 130, 246, 0.23), transparent 31%),
    radial-gradient(circle at 86% 92%, rgba(14, 165, 233, 0.14), transparent 32%),
    #0b1220;
}

.login-shell::before {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: 34px 34px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 34px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(2, 6, 23, 0.45);
}

.login-card .brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 13px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.26);
}

.login-card h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.login-card > p,
.login-subtitle {
  margin: 0 0 25px;
  color: var(--text-muted);
}

.login-card .form-actions,
.login-card .btn.primary,
.login-card .btn-primary {
  width: 100%;
}

.login-card .form-actions {
  display: block;
  padding-top: 4px;
}

.login-footer {
  margin: 20px 0 0;
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--transition);
}

.modal-backdrop.show,
.modal-backdrop.is-open,
.modal-backdrop[data-state="open"] {
  display: flex;
  opacity: 1;
}

.modal {
  position: relative;
  width: min(100%, 540px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px) scale(0.99);
  transition: transform var(--transition);
}

.modal-backdrop.show .modal,
.modal-backdrop.is-open .modal,
.modal-backdrop[data-state="open"] .modal,
.modal.show,
.modal.is-open {
  transform: translateY(0) scale(1);
}

.modal.modal-sm {
  width: min(100%, 420px);
}

.modal.modal-lg {
  width: min(100%, 820px);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 20px;
}

.modal-header {
  border-bottom: 1px solid var(--border);
}

.modal-header h2,
.modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 740;
}

.modal-body {
  padding: 20px;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-footer {
  justify-content: flex-end;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border);
}

.modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.confirm-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  place-items: center;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 50%;
  font-size: 21px;
}

.toast-container {
  position: fixed;
  z-index: 140;
  top: 18px;
  right: 18px;
  display: flex;
  width: min(380px, calc(100vw - 36px));
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-left: 4px solid var(--info);
  border-radius: var(--radius);
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.16);
  pointer-events: auto;
  animation: toast-in 220ms ease both;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast.danger,
.toast.error {
  border-left-color: var(--danger);
}

.toast-title {
  margin: 0 0 2px;
  font-weight: 700;
}

.toast-message {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.toast-close {
  padding: 0;
  color: var(--text-faint);
  background: none;
  border: 0;
  cursor: pointer;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate3d(18px, -4px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.sidebar-scrim {
  position: fixed;
  z-index: 45;
  inset: 0;
  display: none;
  background: rgba(15, 23, 42, 0.48);
  opacity: 0;
  transition: opacity var(--transition);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.divider {
  height: 1px;
  margin: 18px 0;
  background: var(--border);
  border: 0;
}

/* Application markup integration */
.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  align-items: end;
  justify-content: center;
  gap: 3px;
  padding: 8px;
}

.brand-mark i {
  display: block;
  width: 4px;
  height: 11px;
  background: currentColor;
  border-radius: 4px;
  transform: skewY(-18deg);
}

.brand-mark i:nth-child(2) {
  height: 17px;
}

.brand-mark i:nth-child(3) {
  height: 14px;
}

.brand-mark-large {
  width: 58px;
  height: 58px;
  grid-template-columns: repeat(3, 5px);
  gap: 4px;
  padding: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 16px;
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.32);
}

.brand-mark-large i {
  width: 5px;
  height: 15px;
}

.brand-mark-large i:nth-child(2) {
  height: 24px;
}

.brand-mark-large i:nth-child(3) {
  height: 19px;
}

.sidebar-brand > span:last-child,
.sidebar-admin > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.25;
}

.sidebar-brand strong,
.sidebar-admin strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand small {
  margin-top: 3px;
  color: var(--sidebar-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex: 1;
}

.nav-link.is-active {
  color: var(--sidebar-active);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.34), rgba(37, 99, 235, 0.2));
  box-shadow: inset 3px 0 #60a5fa;
}

.nav-link.is-active .nav-icon {
  color: #93c5fd;
}

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

.nav-icon svg rect {
  fill: none;
}

.sidebar-admin {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 0 3px 13px;
}

.sidebar-admin small {
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 10px;
}

.avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  color: #1d4ed8;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 740;
}

.sidebar .avatar {
  color: #dbeafe;
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(147, 197, 253, 0.22);
}

.sidebar-footer form {
  margin: 0;
}

.logout-link {
  width: 100%;
  border: 0;
  cursor: pointer;
}

.sidebar-backdrop {
  position: fixed;
  z-index: 45;
  inset: 0;
  display: none;
  padding: 0;
  background: rgba(15, 23, 42, 0.5);
  border: 0;
  opacity: 0;
  cursor: pointer;
  transition: opacity var(--transition);
}

.menu-toggle span {
  display: block;
  width: 17px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.menu-toggle {
  flex-direction: column;
  gap: 4px;
}

.topbar-title {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: baseline;
  gap: 9px;
}

.topbar-title > span {
  color: var(--text-muted);
  font-size: 12px;
}

.topbar-title > strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-admin {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border: 2px solid #d1fae5;
  border-radius: 50%;
  box-sizing: content-box;
}

.page-heading,
.section-heading {
  display: flex;
  min-width: 0;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

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

.page-heading h1,
.section-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(21px, 2vw, 27px);
  font-weight: 780;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.page-heading p:not(.eyebrow),
.section-heading p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 9px;
  font-weight: 780;
  letter-spacing: 0.16em;
}

.panel-head {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.panel-head h2,
.panel > h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 720;
}

.panel-head a {
  font-size: 12px;
  font-weight: 650;
}

.panel > h2 {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

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

.stat-card {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 19px 20px;
}

.stat-card::before {
  position: absolute;
  top: 0;
  right: 18px;
  left: 18px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 6px 6px;
  content: "";
  opacity: 0.85;
}

.stat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card .stat-icon {
  grid-row: auto;
  align-self: auto;
}

.stat-card .stat-label {
  align-self: auto;
}

.stat-card > span:first-child:not(.stat-icon):not(.stat-trend) {
  order: 2;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 560;
}

.stat-card > strong {
  order: 1;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 27px;
  font-variant-numeric: tabular-nums;
  font-weight: 790;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.stat-trend {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
}

.stat-note {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 11px;
}

.stat-green::before,
.stat-success::before {
  background: var(--success);
}

.stat-amber::before,
.stat-warning::before {
  background: var(--warning);
}

.stat-red::before,
.stat-danger::before {
  background: var(--danger);
}

.stat-blue::before,
.stat-info::before {
  background: var(--info);
}

.stat-purple::before {
  background: #7c3aed;
}

.stat-slate::before {
  background: #64748b;
}

.stat-green .stat-icon,
.stat-success .stat-icon {
  color: var(--success);
  background: var(--success-soft);
}

.stat-amber .stat-icon,
.stat-warning .stat-icon {
  color: var(--warning);
  background: var(--warning-soft);
}

.stat-red .stat-icon,
.stat-danger .stat-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.stat-blue .stat-icon,
.stat-info .stat-icon {
  color: var(--info);
  background: var(--info-soft);
}

.stat-purple .stat-icon {
  color: #7c3aed;
  background: #f5f3ff;
}

.stat-slate .stat-icon {
  color: #475569;
  background: #f1f5f9;
}

.panel > .filters,
.panel > .form-grid {
  margin: 0;
  padding: 18px 20px;
}

.panel > .filters {
  background: #fbfdff;
  border-bottom: 1px solid var(--border);
}

.filter-fields {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 11px;
}

.filter-fields > .form-control,
.filter-fields > .form-select {
  width: auto;
  min-width: 160px;
  flex: 1 1 170px;
}

.filter-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.filters > .field {
  min-width: 150px;
  flex: 1 1 170px;
}

.filters > .field:first-of-type {
  min-width: 220px;
  flex-grow: 1.6;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 650;
}

.field > input,
.field > select,
.field > textarea,
.point-form input,
.ticket-reply textarea {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  font-weight: 400;
  transition: border-color var(--transition), box-shadow var(--transition),
    background var(--transition);
}

.field > input::placeholder,
.field > textarea::placeholder,
.point-form input::placeholder,
.ticket-reply textarea::placeholder {
  color: var(--text-faint);
}

.field > input:hover,
.field > select:hover,
.field > textarea:hover,
.point-form input:hover,
.ticket-reply textarea:hover {
  border-color: #a8b6ca;
}

.field > input:focus,
.field > select:focus,
.field > textarea:focus,
.point-form input:focus,
.ticket-reply textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.field > textarea {
  min-height: 112px;
  resize: vertical;
}

.form-grid .field,
.form-grid > .form-group {
  grid-column: span 6;
  margin: 0;
}

.form-grid .field-wide,
.form-grid > .full-width,
.form-grid > .form-group.full,
.form-grid > .form-actions {
  grid-column: 1 / -1;
}

.form-grid-1 > .form-group {
  grid-column: 1 / -1;
}

.form-grid-3 > .form-group {
  grid-column: span 4;
}

.form-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.form-label-row .form-label {
  margin: 0;
}

.char-count {
  color: var(--text-faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.char-count.is-near-limit {
  color: var(--warning);
}

.check-control {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

.check-control > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.check-box {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  transition: background var(--transition), border-color var(--transition),
    box-shadow var(--transition);
}

.check-control > input:checked + .check-box {
  background: var(--primary);
  border-color: var(--primary);
}

.check-control > input:checked + .check-box::after {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.check-control > input:focus-visible + .check-box {
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.check-control small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
}

.btn-light {
  color: #334155;
  background: #ffffff;
  border-color: var(--border-strong);
}

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

.btn-success:hover {
  color: #ffffff;
  background: #047857;
  border-color: #047857;
}

.btn-lg {
  min-height: 46px;
  padding: 11px 18px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.badge::before {
  display: none;
}

.badge-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
  opacity: 0.76;
}

.badge-primary {
  color: #1d4ed8;
  background: var(--primary-soft);
  border-color: #bfdbfe;
}

.badge-success {
  color: #047857;
  background: var(--success-soft);
  border-color: #a7f3d0;
}

.badge-warning {
  color: #b45309;
  background: var(--warning-soft);
  border-color: #fde68a;
}

.badge-danger {
  color: #b91c1c;
  background: var(--danger-soft);
  border-color: #fecaca;
}

.badge-info {
  color: #0369a1;
  background: var(--info-soft);
  border-color: #bae6fd;
}

.badge-purple {
  color: #6d28d9;
  background: #f5f3ff;
  border-color: #ddd6fe;
}

.badge-neutral {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.table-compact th,
.table-compact td {
  padding-block: 9px;
}

.table-check {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.inline {
  display: inline-flex;
  margin: 0;
}

.empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  place-items: center;
  color: var(--text-faint);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 26px;
}

.empty-state strong {
  display: block;
  margin-bottom: 4px;
  color: #334155;
  font-size: 15px;
}

.empty-action {
  margin-top: 15px;
}

.result-count {
  padding: 13px 20px;
  color: var(--text-muted);
  background: #fbfdff;
  border-top: 1px solid var(--border);
  font-size: 12px;
  text-align: right;
}

.point-form {
  display: grid;
  min-width: 355px;
  grid-template-columns: 86px minmax(130px, 1fr) auto;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.point-form input {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}

.ticket-reply {
  display: flex;
  min-width: 310px;
  align-items: flex-end;
  gap: 7px;
  margin: 0;
}

.ticket-reply textarea {
  min-width: 230px;
  min-height: 58px;
  resize: vertical;
  font-size: 12px;
}

.pagination-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.pagination .page-link {
  display: inline-flex;
  min-width: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  color: #475569;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
}

.pagination .page-link.is-current {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

.pagination .page-link.is-disabled {
  color: var(--text-faint);
  background: var(--surface-subtle);
  cursor: not-allowed;
}

.page-gap {
  display: inline-grid;
  min-width: 22px;
  place-items: center;
  color: var(--text-faint);
}

.alert-info {
  color: #075985;
  background: var(--info-soft);
  border-color: #bae6fd;
}

.alert-success {
  color: #047857;
  background: var(--success-soft);
  border-color: #a7f3d0;
}

.alert-warning {
  color: #92400e;
  background: var(--warning-soft);
  border-color: #fde68a;
}

.alert-danger {
  color: #991b1b;
  background: var(--danger-soft);
  border-color: #fecaca;
}

.login-shell {
  grid-template-columns: minmax(0, 1.06fr) minmax(430px, 0.94fr);
  place-items: stretch;
  padding: 0;
}

.login-visual {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  padding: clamp(44px, 8vw, 110px);
  overflow: hidden;
}

.login-visual-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  color: #ffffff;
}

.login-visual-content h1 {
  margin: 0;
  font-size: clamp(31px, 3.7vw, 52px);
  font-weight: 780;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.login-visual-content .brand-mark-large + h1 {
  margin-top: 26px;
}

.login-orb {
  position: absolute;
  border: 1px solid rgba(147, 197, 253, 0.16);
  border-radius: 50%;
  filter: blur(1px);
}

.login-orb-one {
  top: -20vw;
  right: -11vw;
  width: 52vw;
  height: 52vw;
  background: rgba(37, 99, 235, 0.08);
}

.login-orb-two {
  bottom: -12vw;
  left: -13vw;
  width: 38vw;
  height: 38vw;
  background: rgba(14, 165, 233, 0.06);
}

.login-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 42px;
  background: rgba(248, 250, 252, 0.98);
}

.login-panel .login-card {
  padding: 38px;
}

.login-card h2 {
  margin: 0 0 6px;
  font-size: 25px;
  font-weight: 780;
  letter-spacing: -0.025em;
}

.login-form .form-group:last-of-type {
  margin-bottom: 20px;
}

.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 16px;
}

.login-mobile-brand .brand-mark {
  width: 36px;
  height: 36px;
  margin-bottom: 0;
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-radius: 10px;
}

.login-card > .eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 9px;
  font-weight: 780;
  letter-spacing: 0.16em;
}

.login-footnote {
  margin: 20px 0 0;
  color: var(--text-faint);
  font-size: 11px;
  text-align: center;
}

body.modal-open {
  overflow: hidden;
}

.modal[id] {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: flex;
  width: auto;
  max-height: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  opacity: 0;
  transform: none;
  transition: opacity var(--transition);
}

.modal[id][hidden] {
  display: none !important;
}

.modal[id].is-open {
  opacity: 1;
  transform: none;
}

.modal[id] > .modal-backdrop {
  position: fixed;
  z-index: 0;
  inset: 0;
  display: block;
  padding: 0;
  background: rgba(15, 23, 42, 0.58);
  border: 0;
  border-radius: 0;
  opacity: 1;
  backdrop-filter: blur(3px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity var(--transition), transform var(--transition);
}

.modal.is-open .modal-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-dialog h2 {
  margin: 0 0 7px;
  font-size: 18px;
  font-weight: 750;
}

.modal-dialog > p {
  margin: 0;
  color: var(--text-muted);
}

.modal-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 15px;
  place-items: center;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
}

.toast {
  opacity: 0;
  transform: translate3d(18px, -4px, 0);
  transition: opacity 220ms ease, transform 220ms ease;
  animation: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.toast-success {
  border-left-color: var(--success);
}

.toast-warning {
  border-left-color: var(--warning);
}

.toast-danger {
  border-left-color: var(--danger);
}

.toast-marker {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  color: #ffffff;
  background: var(--info);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.toast-success .toast-marker {
  background: var(--success);
}

.toast-warning .toast-marker {
  background: var(--warning);
}

.toast-danger .toast-marker {
  background: var(--danger);
}

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

  .form-grid > .form-group.third {
    grid-column: span 6;
  }

  .form-grid-3 > .form-group {
    grid-column: span 6;
  }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-102%);
    box-shadow: none;
  }

  .app-main {
    width: 100%;
    margin-left: 0;
  }

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

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 20px 0 55px rgba(2, 6, 23, 0.28);
  }

  body.nav-open .sidebar-scrim {
    display: block;
    opacity: 1;
  }

  body.nav-open .sidebar-backdrop {
    display: block;
    opacity: 1;
  }

  .topbar {
    padding: 0 20px;
  }

  .content {
    padding: 22px 20px 34px;
  }

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

  .toolbar > .page-actions,
  .toolbar > .form-actions {
    align-self: flex-end;
  }

  .login-shell {
    display: block;
    background: #f8fafc;
  }

  .login-visual {
    display: none;
  }

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

  .login-mobile-brand {
    display: flex;
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-height: 62px;
  }

  body {
    font-size: 13px;
  }

  .sidebar {
    width: min(84vw, 286px);
  }

  .topbar {
    gap: 11px;
    padding: 0 14px;
  }

  .topbar-admin > span:nth-child(2) {
    display: none;
  }

  .page-heading h1,
  .page-heading .page-title {
    max-width: none;
    font-size: 17px;
    white-space: normal;
  }

  .page-heading,
  .section-heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .page-heading p,
  .page-heading .page-subtitle {
    display: none;
  }

  .page-actions {
    gap: 6px;
  }

  .page-actions .btn:not(.always-label) {
    min-width: 38px;
    padding-inline: 10px;
  }

  .content {
    padding: 17px 12px 28px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }

  .stat-card {
    padding: 15px 16px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
  }

  .stat-value {
    font-size: 22px;
  }

  .panel-header {
    min-height: 56px;
    align-items: flex-start;
    padding: 13px 14px;
  }

  .panel-head {
    min-height: 56px;
    padding: 13px 14px;
  }

  .panel-header .page-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .panel-body,
  .card {
    padding: 15px 14px;
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .panel > .filters,
  .panel > .form-grid {
    padding: 15px 14px;
  }

  .filter-fields {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }

  .filter-fields > .form-control,
  .filter-fields > .form-select,
  .filters > .field {
    width: 100%;
    min-width: 0;
  }

  .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .filters .form-group,
  .filters .form-group.search,
  .filters .search-field {
    min-width: 0;
  }

  .filters .form-group.search,
  .filters .search-field {
    grid-column: 1 / -1;
  }

  .form-grid {
    display: block;
  }

  .form-grid > .form-group,
  .form-grid > .field {
    margin-bottom: 15px;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .form-actions .btn {
    flex: 1 1 auto;
  }

  .split {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .table-wrap {
    margin-inline: 0;
    border-radius: 0;
  }

  .table-wrap table,
  table.data-table {
    min-width: 740px;
  }

  .table-wrap th,
  .table-wrap td,
  table.data-table th,
  table.data-table td {
    padding: 11px 12px;
  }

  .pagination {
    justify-content: center;
  }

  .pagination-summary {
    width: 100%;
    margin: 0 0 5px;
    text-align: center;
  }

  .login-panel .login-card,
  .login-card {
    padding: 28px 22px;
    border-radius: 15px;
  }

  .modal[id] {
    align-items: flex-end;
    padding: 0;
  }

  .modal[id] > .modal-backdrop {
    padding: 0;
  }

  .modal[id] > .modal-dialog {
    width: 100%;
    max-height: 88vh;
    overflow: auto;
    border-width: 1px 0 0;
    border-radius: 17px 17px 0 0;
  }

  .toast-container {
    top: 10px;
    right: 10px;
    width: calc(100vw - 20px);
  }
}

@media (max-width: 420px) {
  .filters {
    grid-template-columns: 1fr;
  }

  .filters .form-group.search,
  .filters .search-field {
    grid-column: auto;
  }

  .filter-fields {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    justify-content: stretch;
  }

  .filter-actions .btn {
    flex: 1 1 auto;
  }

  .panel-header,
  .panel-head {
    flex-direction: column;
  }

  .panel-header .page-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: #ffffff;
  }

  .sidebar,
  .topbar,
  .page-actions,
  .toolbar,
  .pagination,
  .toast-container,
  .modal-backdrop {
    display: none !important;
  }

  .app-main {
    width: 100%;
    margin: 0;
  }

  .content {
    max-width: none;
    padding: 0;
  }

  .card,
  .panel,
  .stat-card {
    break-inside: avoid;
    box-shadow: none;
  }

  .table-wrap {
    overflow: visible;
  }

  .table-wrap table,
  table.data-table {
    min-width: 0;
  }
}

/* Public acceptance map and approved-directory page. */
.public-map-body {
  min-height: 100vh;
  color: #eaf6ff;
  background:
    radial-gradient(circle at 12% -5%, rgba(18, 183, 255, 0.17), transparent 31%),
    radial-gradient(circle at 92% 16%, rgba(53, 240, 181, 0.1), transparent 24%),
    #050e18;
}

.public-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px max(24px, calc((100vw - 1240px) / 2));
  background: rgba(5, 14, 24, 0.88);
  border-bottom: 1px solid rgba(94, 150, 188, 0.18);
  backdrop-filter: blur(16px);
}

.public-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #f5fbff;
}

.public-brand:hover {
  color: #ffffff;
}

.public-brand .brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #12b7ff, #0b66e7 58%, #35f0b5);
  border-radius: 11px;
  box-shadow: 0 8px 22px rgba(18, 183, 255, 0.3);
}

.public-brand > span:last-child {
  display: grid;
}

.public-brand strong {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.public-brand small {
  color: #7793a8;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.public-verified {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #a9c1d4;
  font-size: 12px;
}

.public-verified i {
  width: 8px;
  height: 8px;
  background: #35f0b5;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(53, 240, 181, 0.8);
}

.public-main {
  display: grid;
  width: min(1240px, calc(100% - 40px));
  gap: 24px;
  margin: 0 auto;
  padding: 38px 0 54px;
}

.public-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 18px 2px 4px;
}

.public-kicker {
  display: block;
  margin-bottom: 9px;
  color: #35f0b5;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.public-hero h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.public-hero p {
  max-width: 760px;
  margin: 13px 0 0;
  color: #8fa9bf;
  font-size: 14px;
}

.public-map-body .btn-light,
.public-map-body .btn-secondary {
  color: #d8e9f5;
  background: rgba(19, 43, 63, 0.72);
  border-color: #254964;
}

.public-map-body .btn-light:hover,
.public-map-body .btn-secondary:hover {
  color: #ffffff;
  background: #183a54;
}

.public-directory {
  padding: 24px;
  background: rgba(9, 25, 41, 0.84);
  border: 1px solid #18344e;
  border-radius: 18px;
}

.public-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.public-section-head h2 {
  margin: 0;
  color: #f7fcff;
  font-size: 20px;
}

.public-section-head p {
  margin: 5px 0 0;
  color: #7895aa;
  font-size: 12px;
}

.public-section-head > strong {
  color: #35f0b5;
  font-size: 18px;
  white-space: nowrap;
}

.public-map-filters {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(170px, 0.7fr) minmax(150px, 0.55fr) auto auto;
  gap: 12px;
  align-items: end;
  margin: 20px 0 22px;
  padding: 16px;
  background: rgba(5, 17, 28, 0.72);
  border: 1px solid #18344e;
  border-radius: 12px;
}

.public-map-filters label {
  display: grid;
  gap: 6px;
  color: #91aabd;
  font-size: 12px;
}

.public-map-filters input,
.public-map-filters select {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  color: #eaf6ff;
  background: #0b2033;
  border: 1px solid #27465d;
  border-radius: 8px;
  outline: 0;
}

.public-map-filters input:focus,
.public-map-filters select:focus {
  border-color: #12b7ff;
  box-shadow: 0 0 0 3px rgba(18, 183, 255, 0.13);
}

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

.acceptor-card {
  min-width: 0;
  padding: 18px;
  background: linear-gradient(145deg, rgba(15, 43, 63, 0.88), rgba(7, 25, 39, 0.92));
  border: 1px solid #21455e;
  border-radius: 13px;
}

.acceptor-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.acceptor-card h3 {
  margin: 3px 0 0;
  color: #f7fdff;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.acceptor-location {
  color: #7f9db1;
  font-size: 11px;
}

.acceptor-type {
  flex: 0 0 auto;
  padding: 4px 9px;
  color: #61f5c5;
  background: rgba(53, 240, 181, 0.09);
  border: 1px solid rgba(53, 240, 181, 0.25);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

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

.acceptor-details > div {
  min-width: 0;
  padding: 9px 10px;
  background: rgba(4, 17, 28, 0.68);
  border-radius: 8px;
}

.acceptor-details dt {
  color: #68879e;
  font-size: 10px;
}

.acceptor-details dd {
  margin: 2px 0 0;
  color: #dff4ff;
  font-size: 13px;
  font-weight: 680;
  overflow-wrap: anywhere;
}

.acceptor-contact {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 13px;
  border-top: 1px solid rgba(99, 143, 174, 0.16);
}

.acceptor-contact span {
  flex: 0 0 auto;
  color: #7895aa;
  font-size: 11px;
}

.acceptor-contact strong {
  color: #12b7ff;
  font-size: 13px;
  overflow-wrap: anywhere;
  text-align: right;
}

.public-empty {
  padding: 55px 20px;
  color: #7895aa;
  text-align: center;
  background: rgba(4, 17, 28, 0.45);
  border: 1px dashed #29445a;
  border-radius: 12px;
}

.public-footer {
  display: flex;
  width: min(1240px, calc(100% - 40px));
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  padding: 20px 0 30px;
  color: #607d92;
  border-top: 1px solid rgba(72, 112, 139, 0.18);
  font-size: 11px;
}

/* External equivalent of app.acceptance_map's standalone styles. */
.acceptance-map {
  --active: #35f0b5;
  --active2: #12b7ff;
  --muted: #718096;
  overflow-x: auto;
  padding: 18px;
  color: #eaf6ff;
  background: linear-gradient(145deg, #071425, #0b1d31 64%, #07111d);
  border: 1px solid #18344e;
  border-radius: 18px;
}

.acceptance-map__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
}

.acceptance-map__head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.acceptance-map__head p {
  margin: 0;
  color: #8fa9bf;
  font-size: 12px;
}

.acceptance-map__total {
  color: #dffdf5;
  font-size: 13px;
  white-space: nowrap;
}

.acceptance-map__total strong {
  margin-right: 4px;
  color: var(--active);
  font-size: 22px;
}

.acceptance-map svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: 680px;
}

.acceptance-map .tile polygon {
  fill: #10263a;
  stroke: #29445a;
  stroke-width: 1.5;
  transition: fill 0.2s, filter 0.2s;
}

.acceptance-map .tile--active polygon {
  fill: #0d514d;
  filter: url(#acceptance-glow);
  stroke: var(--active);
  stroke-width: 2;
}

.acceptance-map .tile text {
  fill: #7f98ac;
  text-anchor: middle;
  pointer-events: none;
}

.acceptance-map .tile--active text {
  fill: #eafff9;
}

.acceptance-map .province {
  font-size: 14px;
  font-weight: 700;
}

.acceptance-map .count {
  font-size: 12px;
  font-weight: 700;
}

.acceptance-map .detail {
  fill: #7890a3;
  font-size: 9.5px;
}

.acceptance-map .tile--active .detail {
  fill: #aeeede;
}

.acceptance-map__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  color: #8fa9bf;
  font-size: 12px;
}

.acceptance-map__legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.acceptance-map__legend i {
  width: 10px;
  height: 10px;
  background: #10263a;
  border: 1px solid #29445a;
  border-radius: 3px;
}

.acceptance-map__legend .is-active {
  background: #0d514d;
  border-color: var(--active);
  box-shadow: 0 0 8px rgba(53, 240, 181, 0.65);
}

.acceptance-map--compact {
  padding: 12px;
}

.acceptance-map--compact .acceptance-map__head p,
.acceptance-map--compact .acceptance-map__legend {
  display: none;
}

@media (max-width: 760px) {
  .public-header {
    padding: 11px 18px;
  }

  .public-verified {
    display: none;
  }

  .public-main,
  .public-footer {
    width: min(100% - 24px, 1240px);
  }

  .public-main {
    gap: 16px;
    padding-top: 24px;
  }

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

  .public-directory,
  .acceptance-map {
    padding: 15px;
    border-radius: 14px;
  }

  .public-map-filters,
  .acceptor-grid {
    grid-template-columns: 1fr;
  }

  .public-map-filters .btn {
    width: 100%;
  }

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

  .acceptance-map svg {
    min-width: 620px;
  }

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