/* =============================================
   TRILHEIROS DE CRISTO - PORTAL ADMIN
   Tema: Laranja/Escuro (baseado no layout)
   ============================================= */

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

/* ---- CSS Variables ---- */
:root {
  --primary: #E87C1E;
  --primary-dark: #C96510;
  --primary-light: #F5A55A;
  --primary-ultra-light: #FEF3E8;
  --secondary: #2D3748;
  --dark: #1A202C;
  --sidebar-bg: #1A202C;
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --topbar-height: 64px;
  --text-dark: #2D3748;
  --text-muted: #718096;
  --bg-light: #F7F8FC;
  --bg-white: #FFFFFF;
  --border: #E2E8F0;
  --success: #38A169;
  --warning: #D69E2E;
  --danger: #E53E3E;
  --info: #3182CE;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1), 0 8px 24px rgba(0,0,0,0.06);
}

/* ---- Reset & Base ---- */
* { box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

h1,h2,h3,h4,h5,h6 { font-family: 'Poppins', sans-serif; font-weight: 600; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: width 0.3s ease, transform 0.3s ease;
  overflow: hidden;
  box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  text-decoration: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  position: relative;
}

.brand-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }

.brand-icon {
  width: 42px;
  height: 42px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.brand-text { overflow: hidden; }

.brand-name {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  line-height: 1.2;
  white-space: nowrap;
}

.brand-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--primary-light);
  font-weight: 500;
  white-space: nowrap;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 0 20px 8px;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.3);
  padding: 12px 10px 4px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: rgba(255,255,255,0.65);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 2px;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item i {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  transition: transform 0.2s;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.nav-item:hover i { transform: scale(1.1); }

.nav-item.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(232,124,30,0.4);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.68rem;
  color: var(--primary-light);
  font-weight: 600;
}

.btn-logout {
  color: rgba(255,255,255,0.5);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 6px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-logout:hover { color: var(--danger); background: rgba(229,62,62,0.1); }

/* =============================================
   MAIN LAYOUT
   ============================================= */
.app-wrapper { display: flex; min-height: 100vh; }

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.3s ease;
}

/* =============================================
   TOPBAR
   ============================================= */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: var(--shadow);
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.sidebar-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: all 0.2s;
}
.sidebar-toggle:hover { background: var(--primary-ultra-light); color: var(--primary); border-color: var(--primary-light); }

.breadcrumb { margin: 0; background: none; padding: 0; }
.breadcrumb-item a { color: var(--text-muted); text-decoration: none; font-size: 0.85rem; }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-dark); font-weight: 600; font-size: 0.85rem; }
.breadcrumb-item+.breadcrumb-item::before { color: var(--text-muted); }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  transition: all 0.2s;
}
.topbar-user:hover { border-color: var(--primary); color: var(--primary); }
.topbar-user::after { display: none; }

.user-avatar-sm {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
}

/* =============================================
   CONTENT AREA
   ============================================= */
.content-area {
  flex: 1;
  padding: 28px 28px 40px;
  overflow-y: auto;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 4px;
  line-height: 1.2;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0;
}

/* =============================================
   CARDS / PANELS
   ============================================= */
.card-panel {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(226,232,240,0.6);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 2px;
}

.panel-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.panel-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-ultra-light);
}

.panel-section-header i {
  font-size: 1.1rem;
}

.panel-section-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

/* =============================================
   STAT CARDS
   ============================================= */
.stat-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(226,232,240,0.6);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-card-primary .stat-icon { background: var(--primary-ultra-light); color: var(--primary); }
.stat-card-success .stat-icon { background: #F0FFF4; color: var(--success); }
.stat-card-warning .stat-icon { background: #FFFFF0; color: var(--warning); }
.stat-card-info .stat-icon { background: #EBF8FF; color: var(--info); }

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text-dark); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-top: 4px; }

/* =============================================
   TABLE
   ============================================= */
.table-custom {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 0;
}

.table-custom thead th {
  background: var(--bg-light);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.table-custom tbody tr {
  transition: background 0.15s;
}

.table-custom tbody tr:hover {
  background: var(--primary-ultra-light);
}

.table-custom tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  vertical-align: middle;
}

.table-custom tbody tr:last-child td {
  border-bottom: none;
}

/* =============================================
   BADGES / STATUS
   ============================================= */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-ativo { background: #F0FFF4; color: #276749; border: 1px solid #C6F6D5; }
.badge-pendente { background: #FFFFF0; color: #7B5B00; border: 1px solid #FEFCBF; }
.badge-inativo { background: #FFF5F5; color: #9B2C2C; border: 1px solid #FED7D7; }

.badge-perfil {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-perfil-admin { background: var(--primary-ultra-light); color: var(--primary-dark); border: 1px solid var(--primary-light); }
.badge-perfil-moderador { background: #EBF8FF; color: #2C5282; border: 1px solid #BEE3F8; }
.badge-perfil-visualizador { background: var(--bg-light); color: var(--text-muted); border: 1px solid var(--border); }

/* =============================================
   AVATARS
   ============================================= */
.avatar-circle {
  width: 34px;
  height: 34px;
  background: var(--primary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 1.4rem;
}

/* =============================================
   FORMS
   ============================================= */
.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 0.875rem;
  font-family: 'Nunito', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: var(--text-dark);
  background: var(--bg-white);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232,124,30,0.12);
  outline: none;
}

.form-control::placeholder { color: #A0AEC0; }

.input-group-text {
  border: 1.5px solid var(--border);
  background: var(--bg-light);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.input-group .form-control { border-left: none; }
.input-group:focus-within .input-group-text {
  border-color: var(--primary);
}

.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
  color: var(--primary);
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(232,124,30,0.2);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(232,124,30,0.35);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* =============================================
   ALERTS
   ============================================= */
.alert {
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
}

.alert-success { background: #F0FFF4; color: #276749; border-left: 4px solid var(--success); }
.alert-danger { background: #FFF5F5; color: #9B2C2C; border-left: 4px solid var(--danger); }
.alert-warning { background: #FFFFF0; color: #7B5B00; border-left: 4px solid var(--warning); }

/* =============================================
   DETAIL GRID (member view)
   ============================================= */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-item-full {
  grid-column: 1 / -1;
}

.detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

/* =============================================
   EVENT CARDS
   ============================================= */
.event-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(226,232,240,0.6);
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.event-card-header { display: flex; justify-content: space-between; align-items: center; }

.event-type-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--primary-ultra-light);
  color: var(--primary);
  text-transform: capitalize;
}

.event-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: capitalize;
}
.status-aberto { background: #F0FFF4; color: var(--success); }
.status-fechado { background: #EBF8FF; color: var(--info); }
.status-cancelado { background: #FFF5F5; color: var(--danger); }
.status-concluido { background: var(--bg-light); color: var(--text-muted); }

.event-title { font-size: 1rem; font-weight: 700; margin: 0; }

.event-desc { font-size: 0.82rem; color: var(--text-muted); margin: 0; flex: 1; }

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.event-actions { display: flex; gap: 8px; margin-top: auto; }

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-wrapper {
  display: flex;
  min-height: 100vh;
}

.login-visual {
  flex: 1;
  background: linear-gradient(145deg, #1A202C 0%, #2D3748 50%, #E87C1E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.login-visual-content {
  text-align: center;
  color: white;
  position: relative;
  z-index: 1;
}

.login-logo-big {
  font-size: 4rem;
  color: var(--primary);
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 16px rgba(232,124,30,0.5));
}

.login-visual-content h1 {
  font-size: 2.8rem;
  font-weight: 800;
  color: white;
  line-height: 1.1;
  margin-bottom: 12px;
  font-family: 'Poppins', sans-serif;
}

.login-visual-content p {
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  margin-bottom: 36px;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
}

.feat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  font-size: 0.95rem;
}

.feat-item i {
  width: 36px;
  height: 36px;
  background: rgba(232,124,30,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  font-size: 1.1rem;
}

.login-wave {
  position: absolute;
  bottom: -50px;
  right: -50px;
  width: 300px;
  opacity: 0.3;
}

.login-form-container {
  width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-light);
}

.login-card {
  width: 100%;
  background: var(--bg-white);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.login-card-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-mobile-logo {
  display: none;
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.6rem;
  color: white;
}

.login-card-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.login-card-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-floating > .form-control { border-radius: var(--radius-sm); }

.btn-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 5;
  padding: 4px;
  font-size: 1rem;
  transition: color 0.2s;
}
.btn-eye:hover { color: var(--primary); }

.btn-login {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-login:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(232,124,30,0.4);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* =============================================
   PAGINATION
   ============================================= */
.page-link {
  color: var(--primary);
  border-color: var(--border);
}

.page-link:hover {
  background: var(--primary-ultra-light);
  border-color: var(--primary-light);
  color: var(--primary-dark);
}

.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

/* =============================================
   MODALS
   ============================================= */
.modal-content { border-radius: var(--radius); border: none; box-shadow: var(--shadow-md); }

/* =============================================
   DROPDOWN
   ============================================= */
.dropdown-menu { border-radius: var(--radius-sm); box-shadow: var(--shadow-md); border: 1px solid var(--border); }
.dropdown-item:hover { background: var(--primary-ultra-light); color: var(--primary); }
.dropdown-item i { color: var(--primary); }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0 !important;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
  }
  .sidebar-overlay.active { display: block; }
  .login-visual { display: none; }
  .login-form-container { width: 100%; padding: 24px; }
  .login-mobile-logo { display: flex; }
  .content-area { padding: 20px 16px 32px; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 575px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  .topbar { padding: 0 16px; }
}

/* Estilos para badges de tipo de membro */
.badge-status.badge-principal {
  background-color: #e07020; /* Cor dos Trilheiros de Cristo */
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 600;
  display: inline-block;
}

.badge-status.badge-dependente {
  background-color: #6c757d; /* Cinza */
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 600;
  display: inline-block;
}
