/* =========================================================
   SuperSim - Design Tokens & Shared Styles
   ========================================================= */

:root {
  /* Cores Principais */
  --primary: #0F003D;
  --primary-deep: #000634;
  --primary-light: #E8EAF6;
  --primary-subtle: #F8F9FA;
  
  /* Cores de Destaque */
  --brand: #F97316;
  --brand-d: #EA580C;
  --brand-l: #FB923C;
  --brand-soft: #FFF7ED;
  --brand-soft2: #FFFBF5;
  --brand-line: #FED7AA;
  
  --accent: #FE690A;
  --accent-yellow: #FFC000;
  --accent-gold: #FDAC17;
  --yellow-l: #FFD54F;
  
  /* Tons Neutros */
  --bg: #F5F5F7;
  --card: #FFFFFF;
  --surface: #FFFFFF;
  --text: #111827;
  --text-mid: #374151;
  --text-light: #6B7280;
  --muted: #9CA3AF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --line: #E5E7EB;
  --paper: #FFFFFF;
  --ink: #111827;
  --slate: #6B7280;
  
  /* Cores de Feedback */
  --success: #16A34A;
  --success-light: #DCFCE7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  
  /* Gradientes */
  --grad-btn: linear-gradient(172deg, #FFC000 0%, #F97316 100%);
  --grad-btn-h: linear-gradient(172deg, #FFD54F 0%, #FB923C 100%);
  --grad-primary: linear-gradient(135deg, #0F003D 0%, #1a0a5c 50%, #0F003D 100%);
  --grad-hero: linear-gradient(178deg, #FFF7ED 0%, #FFFBEB 42%, #FFFBF5 100%);
  
  /* Sombras */
  --sh-card: 0 4px 20px rgba(15, 0, 61, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --sh-float: 0 20px 48px -18px rgba(15, 0, 61, 0.25);
  --sh-btn: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 1px 2px rgba(15, 0, 61, 0.16), 0 8px 20px -8px rgba(249, 115, 22, 0.50);
  
  /* Bordas e Espaçamentos */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --pad: clamp(16px, 4vw, 24px);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

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

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

:focus-visible {
  outline: 2.5px solid var(--accent-yellow);
  outline-offset: 2px;
  border-radius: 6px;
}

/* =========================================================
   HEADER PADRÃO UNIFICADO
   ========================================================= */
.app-header {
  background: #FFFFFF;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 1px 0 var(--border);
  height: 72px;
  display: flex;
  align-items: center;
}

.app-header-in {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-logo {
  height: 36px;
  width: auto;
  display: block;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.user-badge-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge-cpf {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.3px;
}

.user-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-light);
  border: 2px solid var(--primary);
  display: grid;
  place-items: center;
  color: var(--primary);
  flex-shrink: 0;
}

.user-avatar-circle svg {
  width: 18px;
  height: 18px;
}

/* Header SS Variant (.ss-header) */
.ss-header {
  background: #FFFFFF;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 0 rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  z-index: 1000;
}

.ss-header-content {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ss-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ss-menu-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--primary, #0F003D);
  transition: background 0.15s;
  text-decoration: none;
}

.ss-menu-icon:hover {
  background: #F3F4F6;
}

.ss-header-logo {
  height: 32px;
  max-height: 32px;
  width: auto;
  object-fit: contain;
  display: block;
}

.ss-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ss-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  line-height: 1.25;
}

.ss-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary, #0F003D);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ss-user-cpf {
  font-size: 11px;
  font-weight: 500;
  color: #6B7280;
  letter-spacing: 0.3px;
}

.ss-user-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #F3F4F6;
  color: var(--primary, #0F003D);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* =========================================================
   RODAPÉ PADRÃO UNIFICADO (COMPACTO CONFORME DESIGN)
   ========================================================= */
.app-footer,
.ss-footer {
  background: #FFFFFF;
  border-top: 1px solid #E5E7EB;
  padding: 16px 14px 14px;
  text-align: center;
  color: #64748B;
  font-size: 11.5px;
  margin-top: auto;
  width: 100%;
  box-sizing: border-box;
}

.app-footer-logo,
.ss-footer-logo {
  margin-bottom: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-footer-logo img,
.ss-footer-logo img {
  height: 20px;
  width: auto;
  display: block;
}

.app-footer-company,
.ss-footer-company {
  font-weight: 700;
  color: #1E293B;
  margin: 0 0 2px 0;
  font-size: 12px;
  line-height: 1.35;
}

.app-footer-addr,
.ss-footer-addr {
  font-size: 11px;
  color: #94A3B8;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.app-footer-links,
.ss-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 0 8px;
  margin: 0 0 8px 0;
  border-top: 1px solid #F1F5F9;
  font-size: 11.5px;
}

.app-footer-links a,
.ss-footer-links a {
  color: #64748B;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.app-footer-links a:hover,
.ss-footer-links a:hover {
  color: #FE690A;
}

.app-footer-links span,
.ss-footer-links span {
  color: #CBD5E1;
  font-size: 10px;
  user-select: none;
}

.app-footer-badges,
.ss-footer-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.app-footer-badges span,
.ss-footer-badges span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: #64748B;
}

.app-footer-badges svg,
.ss-footer-badges svg {
  width: 13px;
  height: 13px;
  color: #64748B;
  flex-shrink: 0;
}

/* =========================================================
   FEEDBACK TOAST & NOTIFICAÇÃO
   ========================================================= */
.app-toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 420px;
}

.app-toast {
  background: var(--primary);
  color: #FFFFFF;
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.app-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.app-toast.success {
  background: #0F5132;
  border-left: 4px solid var(--success);
}

.app-toast.error {
  background: #842029;
  border-left: 4px solid var(--danger);
}

.app-toast.info {
  background: var(--primary);
  border-left: 4px solid var(--accent-yellow);
}

/* =========================================================
   DIÁLOGOS E MODAIS ACCESSIBLE
   ========================================================= */
dialog.ss-dialog {
  border: 0;
  padding: 0;
  border-radius: 20px;
  color: var(--text);
  max-width: 540px;
  width: calc(100% - 32px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  margin: auto;
}

dialog.ss-dialog::backdrop {
  background: rgba(15, 0, 61, 0.65);
  backdrop-filter: blur(4px);
}

.ss-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
}

.ss-dialog-head h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}

.ss-dialog-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 24px;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ss-dialog-close:hover {
  background: var(--border-light);
  color: var(--text);
}

.ss-dialog-body {
  padding: 24px;
  overflow-y: auto;
  max-height: 70vh;
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.7;
}

.ss-dialog-body h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 18px 0 8px;
}

.ss-dialog-body h3:first-child {
  margin-top: 0;
}

.ss-dialog-body p {
  margin-bottom: 12px;
}

.ss-dialog-body ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

.ss-dialog-body li {
  margin-bottom: 6px;
}
