/* styles.css - Design System Paroquial Senhor Bom Jesus de Americana */
:root {
  /* Cores extraídas do Brasão Oficial */
  --primary-blue: #0d47a1;      /* Azul Real do brasão */
  --primary-light: #1565c0;     /* Azul médio */
  --primary-dark: #07153a;      /* Azul escuro de fundo */
  --gold-accent: #f9a825;       /* Amarelo/Dourado do brasão */
  --gold-light: #ffcc02;        /* Amarelo vivo */
  --red-liturgic: #b71c1c;      /* Vermelho vivo do brasão */
  --red-light: #e53935;         /* Vermelho claro */
  --bg-gradient: linear-gradient(145deg, #07153a 0%, #0d1b4a 50%, #0d47a1 100%);
  --card-bg: rgba(7, 21, 58, 0.78);
  --card-border: rgba(249, 168, 37, 0.25);
  --text-main: #f8fafc;
  --text-muted: #90a4c8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Navbar */
.app-header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 1001;
  padding: 1rem 2rem;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--gold-accent), #f59e0b);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--gold-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Selector Role (Modo Admin vs Familia) */
.role-switch {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
}

.role-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.role-btn.active {
  background: var(--primary-light);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.role-btn.gold.active {
  background: var(--gold-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
}

/* Navigation Tabs */
.app-nav {
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(8px);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  padding: 0 2rem;
  overflow-x: auto;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-main);
}

.nav-tab.active {
  color: var(--gold-accent);
  border-bottom-color: var(--gold-accent);
  font-weight: 700;
}

/* Main Content */
.main-content {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  flex: 1;
  width: 100%;
}

/* Glass Cards */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Grid System */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Stats Cards */
.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.stat-icon.gold { background: rgba(217, 119, 6, 0.2); color: #fbbf24; }
.stat-icon.green { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.stat-icon.purple { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-blue));
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-accent), #b45309);
  color: white;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.4);
}

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

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.btn-whatsapp {
  background: #25d366;
  color: #fff;
  font-weight: 700;
}
.btn-whatsapp:hover {
  background: #1eb956;
}

/* Badge Tags */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-cerimoniario { background: rgba(168, 85, 247, 0.25); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.4); }
.badge-turiferario { background: rgba(245, 158, 11, 0.25); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-naveteiro { background: rgba(59, 130, 246, 0.25); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.4); }
.badge-regular { background: rgba(148, 163, 184, 0.25); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.4); }
.badge-especial { background: rgba(239, 68, 68, 0.25); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }

/* Table Styles */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--card-border);
}

th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Missa Card in Escalas */
.missa-card {
  border-left: 4px solid var(--gold-accent);
}

.missa-card.especial {
  border-left-color: #ef4444;
}

.coroinha-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 12px;
  border-radius: 8px;
  margin: 4px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.coroinha-tag.confirmed {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.15);
}

.coroinha-tag .check {
  color: var(--success);
  font-weight: bold;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: #1e293b;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.7rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: white;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--gold-accent);
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--card-border);
  background: rgba(15, 23, 42, 0.8);
  margin-top: auto;
}

/* =========================================================
   RESPONSIVO - MOBILE FIRST
========================================================= */

/* Tablet (até 768px) */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .role-switch {
    width: 100%;
  }

  .role-btn {
    flex: 1;
    justify-content: center;
    font-size: 0.8rem;
    padding: 8px 10px;
  }

  .nav-container {
    padding: 0 0.75rem;
    gap: 0;
  }

  .nav-tab {
    padding: 0.75rem 0.9rem;
    font-size: 0.82rem;
  }

  .main-content {
    margin: 1rem auto;
    padding: 0 0.85rem;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .glass-card {
    padding: 1.1rem;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .card-title {
    font-size: 1rem;
  }

  .stat-card {
    padding: 1rem;
    gap: 1rem;
  }

  .stat-val {
    font-size: 1.4rem;
  }

  .table-container {
    font-size: 0.8rem;
  }

  th, td {
    padding: 0.6rem 0.75rem;
  }
}

/* Celular pequeno (até 480px) */
@media (max-width: 480px) {
  .brand-title {
    font-size: 1rem;
  }

  .brand-subtitle {
    font-size: 0.7rem;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .role-btn {
    font-size: 0.75rem;
    padding: 7px 8px;
  }

  .nav-tab {
    padding: 0.65rem 0.7rem;
    font-size: 0.75rem;
  }

  .glass-card {
    padding: 0.9rem;
    border-radius: 12px;
  }

  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
  }

  .coroinha-tag {
    font-size: 0.78rem;
    padding: 4px 8px;
  }

  .btn {
    font-size: 0.82rem;
    padding: 0.55rem 1rem;
  }

  .btn-sm {
    font-size: 0.75rem;
    padding: 0.4rem 0.7rem;
  }

  .modal-content {
    padding: 1.25rem;
    border-radius: 12px;
  }

  h2 {
    font-size: 1.1rem;
  }

  h3 {
    font-size: 1rem;
  }
}

/* =========================================================
   SIDE DRAWER MENU (HAMBURGER / MENU LATERAL 3 RISCOS ☰)
========================================================= */
.hamburger-btn {
  background: rgba(13, 71, 161, 0.6) !important;
  border: 1px solid var(--gold-accent) !important;
  color: var(--gold-light) !important;
  padding: 8px 14px !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  transition: all 0.3s ease !important;
  z-index: 1002 !important;
}

.hamburger-btn:hover, .hamburger-btn.active {
  background: var(--gold-accent) !important;
  color: #07153a !important;
  border-color: var(--gold-light) !important;
  box-shadow: 0 0 16px rgba(249, 168, 37, 0.6) !important;
}

.hamburger-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: inherit;
}

/* Side Drawer Overlay & Panel */
.side-drawer-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background: rgba(7, 21, 58, 0.75) !important;
  backdrop-filter: blur(6px) !important;
  z-index: 9999 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

.side-drawer-backdrop.active {
  opacity: 1 !important;
  visibility: visible !important;
}

.side-drawer {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 320px !important;
  max-width: 85vw !important;
  background: linear-gradient(180deg, #07153a 0%, #0d1b4a 60%, #0d47a1 100%) !important;
  border-left: 2px solid var(--gold-accent) !important;
  z-index: 10000 !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translateX(100%) !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.7) !important;
}

.side-drawer.active {
  transform: translateX(0) !important;
}

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.5);
}

.drawer-nav {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  flex: 1;
}

.drawer-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.drawer-item:hover {
  background: rgba(249, 168, 37, 0.15);
  border-color: var(--card-border);
  color: var(--gold-light);
  transform: translateX(4px);
}

.drawer-item.active {
  background: linear-gradient(90deg, rgba(13, 71, 161, 0.9) 0%, rgba(21, 101, 192, 0.8) 100%);
  border-color: var(--gold-accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(13, 71, 161, 0.4);
}

.drawer-divider {
  height: 1px;
  background: var(--card-border);
  margin: 0.75rem 0;
  opacity: 0.5;
}

