/**
 * Sistema Or�amentos ? Design System (Fase 0)
 * Fonte de verdade: design-system/sistema-or�amentos/MASTER.md
 * Estilo: Data-Dense Dashboard | Primary blue + CTA amber/orange
 * Fonte tipogr�fica: carregar via <link> nos layouts (sem @import).
 */

:root {
  /* Colors */
  --color-primary: #1E40AF;
  --color-primary-hover: #1E3A8A;
  --color-secondary: #3B82F6;
  --color-cta: #F97316;
  --color-cta-hover: #EA580C;
  --color-background: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-border: #E2E8F0;
  --color-border-strong: #CBD5E1;
  --color-text: #1E293B;
  --color-text-muted: #64748B;
  --color-text-subtle: #94A3B8;
  --color-success: #059669;
  --color-success-bg: #ECFDF5;
  --color-warning: #D97706;
  --color-warning-bg: #FFFBEB;
  --color-danger: #DC2626;
  --color-danger-bg: #FEF2F2;
  --color-info: #0284C7;
  --color-info-bg: #F0F9FF;

  /* Status badges */
  --status-pendente-bg: #FEF3C7;
  --status-pendente-text: #92400E;
  --status-analise-bg: #DBEAFE;
  --status-analise-text: #1E40AF;
  --status-aprovado-bg: #D1FAE5;
  --status-aprovado-text: #065F46;
  --status-rejeitado-bg: #FEE2E2;
  --status-rejeitado-text: #991B1B;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Layout */
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 4.25rem;
  --header-height: 56px;
  --radius: 8px;
  --radius-lg: 12px;
  --table-row-height: 40px;
  --font-sans: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;

  /* Shadows ? subtle for BI */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ?? Base ?? */
body.ds-app {
  font-family: var(--font-sans);
  background: var(--color-background);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

.ds-app a[href],
.ds-app button,
.ds-app [role="button"],
.ds-app .ds-clickable {
  cursor: pointer;
}

.ds-tabular {
  font-variant-numeric: tabular-nums;
}

/* ?? Buttons ?? */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  min-height: 40px;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.ds-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.ds-btn:disabled,
.ds-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.ds-btn--sm {
  min-height: 32px;
  padding: 0.25rem 0.75rem;
  font-size: 0.8125rem;
}

.ds-btn--lg {
  min-height: 44px;
  padding: 0.625rem 1.25rem;
}

.ds-btn--primary {
  background: var(--color-primary);
  color: #fff;
}
.ds-btn--primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
}

.ds-btn--cta {
  background: var(--color-cta);
  color: #fff;
}
.ds-btn--cta:hover {
  background: var(--color-cta-hover);
  color: #fff;
}

.ds-btn--secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-border-strong);
}
.ds-btn--secondary:hover {
  background: #F1F5F9;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.ds-btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
}
.ds-btn--ghost:hover {
  background: #F1F5F9;
  color: var(--color-text);
}

.ds-btn--danger {
  background: var(--color-surface);
  color: var(--color-danger);
  border-color: #FECACA;
}
.ds-btn--danger:hover {
  background: var(--color-danger-bg);
  border-color: var(--color-danger);
}

/* ?? Cards ?? */
.ds-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
}

.ds-card--flush {
  padding: 0;
  overflow: hidden;
}

.ds-card--kpi {
  padding: 1.25rem;
  transition: box-shadow 200ms ease, border-color 200ms ease;
}
.ds-card--kpi:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}

.ds-kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.ds-kpi-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.ds-kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  background: #EFF6FF;
  color: var(--color-primary);
}

/* ?? Inputs ?? */
.ds-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.375rem;
}

.ds-help {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.ds-input,
.ds-select,
.ds-textarea {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  min-height: 40px;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.ds-textarea {
  min-height: 96px;
  resize: vertical;
}

.ds-input:focus,
.ds-select:focus,
.ds-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.ds-input::placeholder,
.ds-textarea::placeholder {
  color: var(--color-text-subtle);
}

.ds-input.is-error,
.ds-select.is-error,
.ds-textarea.is-error {
  border-color: var(--color-danger);
}

.ds-input.is-error:focus,
.ds-select.is-error:focus,
.ds-textarea.is-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* ?? Badges ?? */
.ds-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.35rem 0.6rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.ds-badge--neutral {
  background: #F1F5F9;
  color: #475569;
}
.ds-badge--success {
  background: var(--color-success-bg);
  color: #065F46;
}
.ds-badge--warning {
  background: var(--color-warning-bg);
  color: #92400E;
}
.ds-badge--danger {
  background: var(--color-danger-bg);
  color: #991B1B;
}
.ds-badge--info {
  background: var(--color-info-bg);
  color: #075985;
}

.ds-badge--pendente {
  background: var(--status-pendente-bg);
  color: var(--status-pendente-text);
}
.ds-badge--em_analise {
  background: var(--status-analise-bg);
  color: var(--status-analise-text);
}
.ds-badge--aprovado {
  background: var(--status-aprovado-bg);
  color: var(--status-aprovado-text);
}
.ds-badge--rejeitado {
  background: var(--status-rejeitado-bg);
  color: var(--status-rejeitado-text);
}

/* ?? Alerts ?? */
.ds-alert {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
}

.ds-alert--success {
  background: var(--color-success-bg);
  border-color: #A7F3D0;
  color: #065F46;
}
.ds-alert--warning {
  background: var(--color-warning-bg);
  border-color: #FDE68A;
  color: #92400E;
}
.ds-alert--error,
.ds-alert--danger {
  background: var(--color-danger-bg);
  border-color: #FECACA;
  color: #991B1B;
}
.ds-alert--info {
  background: var(--color-info-bg);
  border-color: #BAE6FD;
  color: #075985;
}

.ds-alert__icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

/* ?? Page header ?? */
.ds-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.ds-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  margin: 0;
}

.ds-page-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.ds-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Dropdown (details) — ações do page-header */
.ds-dropdown {
  position: relative;
}

.ds-dropdown__trigger {
  list-style: none;
  cursor: pointer;
}

.ds-dropdown__trigger::-webkit-details-marker {
  display: none;
}

.ds-dropdown__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 12.5rem;
  padding: 0.35rem 0;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(15, 23, 42, 0.12));
  z-index: 40;
}

.ds-dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.875rem;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}

.ds-dropdown__item:hover {
  background: var(--color-background, #F8FAFC);
}

.ds-dropdown__item i {
  width: 1rem;
  text-align: center;
  color: var(--color-text-muted);
}

.ds-dropdown__item--muted {
  color: var(--color-text-muted);
}

.ds-dropdown__divider {
  height: 1px;
  margin: 0.35rem 0;
  background: var(--color-border);
}

/* Atalhos do dashboard (= destinos do menu lateral) */
.ds-nav-shortcut {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

a.ds-nav-shortcut:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md, 0 4px 14px rgba(15, 23, 42, 0.08));
}

.ds-nav-shortcut--static {
  cursor: default;
}

.ds-nav-shortcut__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius);
  background: var(--color-background, #F8FAFC);
  color: var(--color-primary);
  flex-shrink: 0;
}

.ds-nav-shortcut__body {
  min-width: 0;
  flex: 1;
}

.ds-nav-shortcut__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ds-nav-shortcut__value {
  display: block;
  margin-top: 0.15rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.ds-nav-shortcut__meta {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--color-text-subtle);
}

.ds-nav-shortcut__chevron {
  color: var(--color-text-subtle);
  font-size: 0.75rem;
  flex-shrink: 0;
}

a.ds-nav-shortcut:hover .ds-nav-shortcut__chevron {
  color: var(--color-primary);
}

/* ?? Filter bar ?? */
.ds-filter-bar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

/* ?? Tables ?? */
.ds-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.ds-table thead {
  background: #F8FAFC;
}

.ds-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.ds-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  vertical-align: middle;
  height: var(--table-row-height);
}

.ds-table tbody tr {
  transition: background-color 150ms ease;
}

.ds-table tbody tr:hover {
  background: #F8FAFC;
}

/* ?? Section title ?? */
.ds-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-md);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ?? Admin shell (Fase 1) ?? */
.ds-admin {
  min-height: 100vh;
}

.ds-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: var(--sidebar-width);
  height: 100vh;
  background: #0F172A;
  color: #E2E8F0;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 200ms ease, width 200ms ease;
}

.ds-sidebar.is-open {
  transform: translateX(0);
}

@media (min-width: 768px) {
  .ds-sidebar {
    transform: translateX(0);
  }
}

.ds-sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, 0.45);
}

.ds-sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.ds-sidebar__logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: #F8FAFC;
  text-decoration: none;
  font-weight: 600;
}

.ds-sidebar__logo-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.875rem;
}

.ds-sidebar__logo-text {
  font-size: 0.9375rem;
}

.ds-sidebar__close {
  background: transparent;
  border: 0;
  color: #94A3B8;
  cursor: pointer;
  padding: 0.5rem;
}

.ds-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ds-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  color: #CBD5E1;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 150ms ease, color 150ms ease;
  border: 0;
  background: transparent;
  width: 100%;
  cursor: pointer;
  text-align: left;
}

.ds-sidebar__link i {
  width: 1.25rem;
  text-align: center;
  opacity: 0.9;
}

.ds-sidebar__link:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #F8FAFC;
}

.ds-sidebar__link.is-active {
  background: rgba(30, 64, 175, 0.35);
  color: #FFFFFF;
  box-shadow: inset 3px 0 0 var(--color-secondary);
}

.ds-sidebar__footer {
  padding: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.ds-sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.25rem 0.75rem;
}

.ds-sidebar__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ds-sidebar__user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #F8FAFC;
}

.ds-sidebar__user-role {
  font-size: 0.6875rem;
  color: #94A3B8;
}

.ds-sidebar__logout {
  color: #FCA5A5;
}

.ds-sidebar__logout:hover {
  background: rgba(220, 38, 38, 0.15);
  color: #FECACA;
}

.ds-admin__main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 200ms ease;
}

@media (min-width: 768px) {
  .ds-admin__main {
    margin-left: var(--sidebar-width);
  }

  /* Sidebar recolhida (desktop) */
  body.ds-sidebar-collapsed .ds-sidebar {
    width: var(--sidebar-collapsed-width, 4.25rem);
  }

  body.ds-sidebar-collapsed .ds-admin__main {
    margin-left: var(--sidebar-collapsed-width, 4.25rem);
  }

  body.ds-sidebar-collapsed .ds-sidebar__logo-text,
  body.ds-sidebar-collapsed .ds-sidebar__link span,
  body.ds-sidebar-collapsed .ds-sidebar__user .min-w-0,
  body.ds-sidebar-collapsed .ds-sidebar__close {
    display: none;
  }

  body.ds-sidebar-collapsed .ds-sidebar__brand {
    justify-content: center;
    padding: 0 0.5rem;
  }

  body.ds-sidebar-collapsed .ds-sidebar__logo {
    justify-content: center;
  }

  body.ds-sidebar-collapsed .ds-sidebar__link {
    justify-content: center;
    padding: 0.75rem;
    gap: 0;
  }

  body.ds-sidebar-collapsed .ds-sidebar__user {
    justify-content: center;
    padding: 0.5rem 0;
  }

  body.ds-sidebar-collapsed .ds-sidebar__nav {
    padding: 0.75rem 0.35rem;
  }
}

.ds-admin__topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .ds-admin__topbar {
    padding: 0 1.5rem;
  }
}

.ds-admin__toggle {
  flex-shrink: 0;
}

.ds-admin__topbar-title {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.ds-admin__topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ds-admin__content {
  flex: 1;
  padding: 1rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .ds-admin__content {
    padding: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .ds-admin__content {
    padding: 1.5rem 2rem;
  }
}

.ds-bar {
  height: 0.625rem;
  background: #E2E8F0;
  border-radius: 9999px;
  overflow: hidden;
}

.ds-bar__fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 9999px;
  transition: width 400ms ease;
}

.ds-delta-up {
  color: var(--color-success);
  font-size: 0.75rem;
  font-weight: 600;
}

.ds-delta-down {
  color: var(--color-danger);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ?? Form actions (Fase 3) ?? */
.ds-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-top: var(--space-md);
  margin-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}

/* ?? Charts (Fase 4) ?? */
.ds-chart-wrap {
  position: relative;
  height: 320px;
  width: 100%;
}

.ds-chart-wrap--lg {
  height: 380px;
}

@media (min-width: 768px) {
  .ds-chart-wrap {
    height: 360px;
  }
  .ds-chart-wrap--lg {
    height: 420px;
  }
}

/* �� Row actions (listagens) �� */
.ds-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem;
}

.ds-actions-menu {
  position: relative;
  display: inline-block;
}

.ds-actions-menu > summary {
  list-style: none;
  cursor: pointer;
}

.ds-actions-menu > summary::-webkit-details-marker {
  display: none;
}

.ds-actions-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 40;
  min-width: 11.5rem;
  padding: 0.35rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.ds-actions-menu__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.ds-actions-menu__item:hover {
  background: var(--color-background);
}

.ds-actions-menu__item--danger {
  color: var(--color-danger);
}

.ds-actions-menu__item--danger:hover {
  background: var(--color-danger-bg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== Login (marca Albano) ========== */
body.ds-login {
  --color-primary: #FF6018;
  --color-primary-hover: #E55510;
  --color-primary-soft: #FFF4ED;
  --color-cta: #FF6018;
  --color-cta-hover: #E55510;

  position: relative;
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-sans, 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif);
  color: var(--color-text, #1E293B);
  background: var(--color-background, #F8FAFC);
  overflow-x: hidden;
}

.ds-login__atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(255, 96, 24, 0.16), transparent 58%),
    radial-gradient(700px 360px at 100% 100%, rgba(255, 96, 24, 0.06), transparent 50%),
    linear-gradient(180deg, #FFF8F3 0%, #F8FAFC 42%, #F1F5F9 100%);
}

.ds-login__atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 96, 24, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 96, 24, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%);
}

.ds-login__main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.ds-login__stack {
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
  animation: ds-login-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ds-login-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ds-login__brand {
  width: 100%;
  margin: 0;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 14px 36px -14px rgba(30, 64, 175, 0.4);
  background: #1e3a8a;
}

.ds-login__brand-logo {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
}

.ds-login__brand-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5.5rem;
  font-family: var(--font-sans, 'IBM Plex Sans', sans-serif);
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  text-transform: uppercase;
  line-height: 1.2;
}

.ds-login__card {
  width: 100%;
  box-sizing: border-box;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #E2E8F0);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 10px 28px -12px rgba(15, 23, 42, 0.14);
  padding: 1.75rem 1.65rem 1.5rem;
}

.ds-login__header {
  text-align: center;
  margin-bottom: 1.35rem;
}

.ds-login__title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.ds-login__subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.ds-login__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.ds-login__form > div {
  width: 100%;
}

body.ds-login .ds-label {
  color: #9A3412;
}

body.ds-login .ds-input:focus {
  border-color: #FF6018;
  box-shadow: 0 0 0 3px rgba(255, 96, 24, 0.2);
}

body.ds-login .ds-input.is-invalid {
  border-color: var(--color-danger);
}

.ds-login__password-wrap {
  position: relative;
}

.ds-login__password-wrap .ds-input {
  padding-right: 2.75rem;
}

.ds-login__toggle-pass {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius);
  cursor: pointer;
}

.ds-login__toggle-pass:hover,
.ds-login__toggle-pass:focus-visible {
  color: var(--color-primary);
  outline: none;
  background: var(--color-primary-soft);
}

.ds-login__remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
}

.ds-login__remember input {
  width: 1rem;
  height: 1rem;
  accent-color: #FF6018;
  cursor: pointer;
}

.ds-login__submit {
  margin-top: 0.25rem;
  min-height: 44px;
  background: #FF6018 !important;
  border-color: #FF6018 !important;
}

.ds-login__submit:hover:not(:disabled) {
  background: #E55510 !important;
  border-color: #E55510 !important;
}

.ds-login__footer {
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-subtle, #94A3B8);
}

@media (prefers-reduced-motion: reduce) {
  .ds-login__stack {
    animation: none;
  }
}
