/* ─────────────────────────────────────────────────────────────────────────────
   ERP Pasión360. Estilos principales
   Paleta de colores alineada con la app (UiConstants)
   ───────────────────────────────────────────────────────────────────────────── */

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

:root {
  --gold:          #C9A84C;
  --gold-dark:     #AA8A3A;
  --gold-light:    #E8C87A;
  --burgundy:      #8B1A1A;
  --cream:         #F5ECD7;
  --alert-red:     #FF4444;
  --success-green: #66DD88;
  --info-blue:     #88AAFF;
  --bg:            #080507;
  --card:          #0F0C10;
  --surface:       #160F18;
  --border:        #1E1720;
  --text-primary:  #F5ECD7;
  --text-secondary:#9E8F80;
  --font-heading:  'Cinzel', serif;
  --font-body:     'Outfit', sans-serif;
  --radius-sm:     10px;
  --radius-md:     14px;
  --radius-lg:     18px;
}

/* Reset y estilos base */

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-primary);
  margin: 0;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-light); }

h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); color: var(--cream); }

/* Pantalla de inicio de sesión */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, var(--surface) 50%, var(--bg) 100%);
}

.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px rgba(201,168,76,.08);
}

.login-card .logo { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 20px; display: block; }
.login-card h2 { text-align: center; color: var(--gold); font-size: 1.5rem; letter-spacing: 3px; margin-bottom: 6px; }
.login-card .subtitle { text-align: center; color: var(--text-secondary); font-size: .85rem; margin-bottom: 28px; }

/* Barra lateral de navegación */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 260px;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  overflow-y: auto;
  z-index: 100;
  transition: transform .3s;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.sidebar .brand img { width: 42px; height: 42px; border-radius: 50%; }
.sidebar .brand h5 { font-size: .9rem; color: var(--gold); letter-spacing: 2px; margin: 0; }
.sidebar .brand small { color: var(--text-secondary); font-size: .7rem; }

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: .88rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .2s;
}

.sidebar .nav-link:hover { color: var(--cream); background: rgba(201,168,76,.05); }
.sidebar .nav-link.active { color: var(--gold); border-left-color: var(--gold); background: rgba(201,168,76,.08); }
.sidebar .nav-link i { font-size: 1.1rem; width: 22px; text-align: center; }

.sidebar .nav-section {
  font-family: var(--font-heading);
  font-size: .65rem;
  color: var(--gold-dark);
  letter-spacing: 2.5px;
  padding: 18px 20px 6px;
  text-transform: uppercase;
}

.sidebar .user-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--card);
}
.sidebar .user-info .name { color: var(--cream); font-weight: 600; font-size: .85rem; }
.sidebar .user-info .role { color: var(--gold); font-size: .72rem; letter-spacing: 1px; }

/* Contenedor principal de contenido */

.main-content {
  margin-left: 260px;
  padding: 28px 32px;
  min-height: 100vh;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h2 {
  font-size: 1.35rem;
  color: var(--gold);
  letter-spacing: 2px;
  margin: 0;
}

.page-header .breadcrumb { font-size: .78rem; color: var(--text-secondary); }
.page-header .breadcrumb a { color: var(--gold-dark); }

/* Tarjetas (cards) genéricas del ERP */

.erp-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.erp-card:hover { border-color: rgba(201,168,76,.25); box-shadow: 0 4px 16px rgba(201,168,76,.06); }
.erp-card h5 { font-family: var(--font-heading); color: var(--cream); font-size: .95rem; margin-bottom: 6px; }
.erp-card .meta { color: var(--text-secondary); font-size: .78rem; }
.erp-card .meta i { color: var(--gold-dark); margin-right: 4px; }
.erp-card p { color: var(--text-secondary); font-size: .85rem; line-height: 1.55; }

.erp-card.pinned { border-left: 3px solid var(--gold); }

/* Tarjetas de estadísticas (panel del dashboard) */

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  transition: border-color .2s;
}
.stat-card:hover { border-color: rgba(201,168,76,.3); }
.stat-card .stat-icon { font-size: 1.8rem; margin-bottom: 8px; }
.stat-card .stat-value { font-family: var(--font-heading); font-size: 1.6rem; color: var(--gold); font-weight: 700; }
.stat-card .stat-label { color: var(--text-secondary); font-size: .78rem; margin-top: 2px; }

/* Tablas */

.table-dark-custom { background: transparent; color: var(--text-primary); }
.table-dark-custom thead th {
  font-family: var(--font-heading);
  font-size: .72rem;
  color: var(--gold);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  font-weight: 700;
}
.table-dark-custom tbody td {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  font-size: .85rem;
  color: var(--cream);
  vertical-align: middle;
}
.table-dark-custom tbody tr:hover td { background: rgba(201,168,76,.04); }

/* Pastillas de estado (badges) */

.badge-gold  { background: rgba(201,168,76,.15); color: var(--gold); font-weight: 600; border: 1px solid rgba(201,168,76,.3); }
.badge-green { background: rgba(102,221,136,.12); color: var(--success-green); border: 1px solid rgba(102,221,136,.3); }
.badge-red   { background: rgba(255,68,68,.12); color: var(--alert-red); border: 1px solid rgba(255,68,68,.3); }
.badge-blue  { background: rgba(136,170,255,.12); color: var(--info-blue); border: 1px solid rgba(136,170,255,.3); }
.badge-muted { background: rgba(158,143,128,.1); color: var(--text-secondary); border: 1px solid rgba(158,143,128,.2); }

/* Botones */

.btn-gold {
  background: var(--gold);
  color: var(--bg);
  border: none;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 1px;
  font-size: .82rem;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  transition: background .2s;
}
.btn-gold:hover { background: var(--gold-light); color: var(--bg); }

.btn-outline-gold {
  background: transparent;
  color: var(--gold);
  border: 1px solid rgba(201,168,76,.5);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .82rem;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  transition: all .2s;
}
.btn-outline-gold:hover { background: rgba(201,168,76,.1); color: var(--gold-light); border-color: var(--gold); }

/* Formularios */

.form-control, .form-select {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--cream) !important;
  font-family: var(--font-body);
  border-radius: var(--radius-sm) !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 2px rgba(201,168,76,.15) !important;
}
.form-control::placeholder { color: var(--text-secondary) !important; }
.form-label { color: var(--text-secondary); font-size: .82rem; font-weight: 500; }

/* Chat de la cofradía */

.chat-container { max-height: 520px; overflow-y: auto; padding: 16px; }

.chat-msg {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.chat-msg.own { flex-direction: row-reverse; }

.chat-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: .7rem;
  color: var(--gold);
  font-weight: 700;
  flex-shrink: 0;
}
.chat-msg.admin-msg .chat-avatar { border-color: var(--gold); background: rgba(201,168,76,.1); }

.chat-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  max-width: 75%;
}
.chat-msg.own .chat-bubble { background: rgba(201,168,76,.08); border-color: rgba(201,168,76,.2); }
.chat-bubble .chat-name { font-size: .75rem; color: var(--gold); font-weight: 600; margin-bottom: 3px; }
.chat-bubble .chat-text { font-size: .85rem; color: var(--cream); line-height: 1.45; }
.chat-bubble .chat-time { font-size: .7rem; color: var(--text-secondary); margin-top: 4px; text-align: right; }

/* Adaptación a pantallas pequeñas (responsive) */

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
}

/* Barra de desplazamiento personalizada */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* Utilidades varias */

.gold-divider { height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dark), transparent); margin: 20px 0; }
.escudo-sm { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); object-fit: cover; }
.empty-state { text-align: center; padding: 40px; color: var(--text-secondary); }
.empty-state i { font-size: 2.5rem; color: var(--border); margin-bottom: 12px; display: block; }
