/* ==========================================================================
   HOSPITAL JARAGUÁ - DESIGN SYSTEM (PORTAL DE DENÚNCIAS & ÉTICA)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Cores Institucionais Hospital Jaraguá */
  --hj-green-dark: #0c5634;
  --hj-green-base: #198754;
  --hj-green-light: #20c997;
  --hj-green-subtle: #e8f5e9;
  --hj-green-glow: rgba(25, 135, 84, 0.25);

  /* Status Colors */
  --status-pending: #0284c7;
  --status-eval: #d97706;
  --status-invest: #ea580c;
  --status-done: #16a34a;
  --status-archived: #64748b;
  --status-danger: #dc2626;

  /* Tema Claro (Default) */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-muted: #f1f5f9;
  --border-color: #e2e8f0;
  --border-focus: #198754;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-inverse: #ffffff;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modo Escuro */
.dark-theme {
  --bg-body: #090d16;
  --bg-surface: #131b2e;
  --bg-surface-elevated: #1a243d;
  --bg-muted: #1e293b;
  --border-color: #2a3756;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  --hj-green-subtle: rgba(25, 135, 84, 0.15);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 8px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 12px 20px -3px rgb(0 0 0 / 0.5);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-base), color var(--transition-base);
}

h1, h2, h3, h4, h5, h6, .brand-font {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  max-width: 860px;
}

/* Navbar Global em Verde Padrão Institucional */
.navbar {
  background: var(--hj-green-dark);
  background: linear-gradient(135deg, #094228 0%, #0c5634 50%, #116840 100%);
  border-bottom: 2px solid #073520;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(12, 86, 52, 0.3);
  color: #ffffff;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: #ffffff;
}

.brand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.brand-text h1 {
  font-size: 1.2rem;
  margin: 0;
  color: #ffffff !important;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-text span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.8) !important;
  display: block;
}

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

.nav-actions .btn-outline {
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.nav-actions .btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
}

.nav-actions .btn-primary {
  background: #ffffff;
  color: var(--hj-green-dark);
  border-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.nav-actions .btn-primary:hover {
  background: #f1f5f9;
  color: #094228;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--hj-green-dark), var(--hj-green-base));
  color: #ffffff;
  box-shadow: 0 4px 12px var(--hj-green-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #094228, var(--hj-green-dark));
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--hj-green-glow);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-muted);
  border-color: var(--text-muted);
}

.btn-outline-primary {
  background: transparent;
  border-color: var(--hj-green-base);
  color: var(--hj-green-base);
}

.btn-outline-primary:hover {
  background: var(--hj-green-subtle);
}

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

.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Formulários & Validação */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-main);
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--hj-green-base);
  box-shadow: 0 0 0 3px var(--hj-green-glow);
}

/* Estilo de Campo Inválido com Destaque Claro */
.form-control.is-invalid {
  border-color: #dc2626 !important;
  background-color: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2) !important;
}

.dark-theme .form-control.is-invalid {
  background-color: rgba(220, 38, 38, 0.1) !important;
}

.field-error-msg {
  color: #dc2626;
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.2;
}

.badge-OK { background: #065f46; color: #34d399; }
.badge-CRIADA { background: #1e40af; color: #93c5fd; }
.badge-AVISO { background: #854d0e; color: #fde047; }
.badge-ERRO { background: #991b1b; color: #fca5a5; }

/* Footer Global em Verde Padrão */
.footer {
  margin-top: auto;
  background: var(--hj-green-dark);
  background: linear-gradient(135deg, #094228 0%, #0c5634 100%);
  border-top: 3px solid #073520;
  padding: 24px 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.footer a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.footer a:hover {
  text-decoration: underline;
  color: #ffffff;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* Toast Notificações */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 300px;
  max-width: 450px;
}

.toast-success { border-left: 4px solid var(--status-done); }
.toast-error { border-left: 4px solid var(--status-danger); }
.toast-warning { border-left: 4px solid var(--status-eval); }
.toast-info { border-left: 4px solid var(--status-pending); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
