/* TAUROOS — Estilos da Fase 1 Web Jinja
 * Carregado SEMPRE depois de tokens.css (cascade).
 * Apenas componentes específicos da camada web (auth, app shell extras,
 * toasts, KPI grid, drawer mobile). Nada de override de tokens.
 */

/* ============================================================
 * AUTH SHELL (login, 404, 500)
 * ============================================================ */
.ts-bg-auth {
  background: linear-gradient(160deg, var(--brand-deep) 0%, #1F2329 60%, #0F1419 100%);
  min-height: 100vh;
}
.ts-auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}
.ts-auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-8) var(--space-6);
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.ts-auth-card__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.ts-logo-mark {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--brand-primary);
  color: var(--text-on-brand);
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--text-xl);
}
.ts-logo-text {
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  color: var(--text-heading);
  letter-spacing: 0.04em;
}
.ts-auth-title {
  font-size: var(--text-2xl);
  font-weight: var(--fw-semi);
  color: var(--text-heading);
  margin: 0;
}
.ts-auth-sub {
  color: var(--text-secondary);
  font-size: var(--text-md);
  margin: 0;
}
.ts-auth-card__footer {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0;
  margin-top: var(--space-2);
}
.ts-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.ts-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
}

/* ============================================================
 * SKIP-TO-CONTENT (acessibilidade)
 * ============================================================ */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-primary);
  color: var(--text-on-brand);
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-md) 0;
  z-index: var(--z-tooltip);
  text-decoration: none;
  font-weight: var(--fw-semi);
}
.skip-to-content:focus {
  left: 0;
}

/* ============================================================
 * SIDEBAR — itens desabilitados (módulos em construção)
 * ============================================================ */
.ts-rail__disabled {
  opacity: 0.45;
  cursor: not-allowed !important;
  pointer-events: none;
}

/* ============================================================
 * KPI GRID — Dashboard executivo (responsivo)
 * ============================================================ */
.ts-kpi-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ============================================================
 * TOASTS — flash messages, fixed top-right
 * ============================================================ */
.ts-toasts {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 360px;
  pointer-events: none;
}
.ts-toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: var(--text-md);
  color: var(--text-primary);
  pointer-events: auto;
  animation: ts-toast-in 220ms ease-out;
}
.ts-toast--success { border-left-color: var(--success); }
.ts-toast--danger  { border-left-color: var(--danger);  }
.ts-toast--warning { border-left-color: var(--warning); }
.ts-toast--info    { border-left-color: var(--brand-primary); }
.ts-toast__close {
  background: transparent;
  border: 0;
  font-size: var(--text-xl);
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
@keyframes ts-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
 * MOBILE — sidebar vira drawer abaixo de 768px
 * ============================================================ */
@media (max-width: 767px) {
  .ds-rail {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform 240ms ease;
    z-index: var(--z-sidebar);
  }
  .ds-rail.is-open { transform: translateX(0); }
  .ds-main { width: 100%; }
  .ts-kpi-grid { grid-template-columns: 1fr; }
}
