/* ================================================================
   assets/css/main.css
   Estilos personalizados — Sistema Visitas a Empresas TecNM
   ================================================================ */

/* ── Variables de marca TecNM ─────────────────────────────────── */
:root {
  --tecn-azul:     #003366;
  --tecn-azul-md:  #004C97;
  --tecn-azul-lt:  #E8EFF8;
  --tecn-rojo:     #CC0000;
  --tecn-oro:      #E5A823;
  --tecn-gris:     #F4F6F9;
  --sidebar-w:     248px;
  --header-h:      58px;
  --trans:         0.18s ease;
}

/* ── Reset mínimo ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--tecn-gris);
  color: #2d3748;
  font-size: 14px;
  margin: 0;
}

/* ── Login page ───────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-brand {
  background: linear-gradient(145deg, var(--tecn-azul) 0%, var(--tecn-azul-md) 60%, #1a6aad 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  top: -120px; right: -120px;
}

.login-brand::after {
  content: '';
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: rgba(229,168,35,0.12);
  bottom: -80px; left: -60px;
}

.login-brand .brand-logo {
  width: 90px; height: 90px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem;
  margin-bottom: 1.5rem;
  position: relative; z-index: 1;
}

.login-brand h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 .5rem; position: relative; z-index: 1; }
.login-brand p  { font-size: .85rem; opacity: .75; max-width: 280px; text-align: center; position: relative; z-index: 1; }

.login-brand .features {
  margin-top: 2.5rem;
  display: flex; flex-direction: column; gap: .75rem;
  position: relative; z-index: 1; align-self: stretch;
}

.feature-item {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: .8rem;
}
.feature-item .fi-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 1rem;
}

.login-form-area {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 2rem;
  background: #fff;
}

.login-card { width: 100%; max-width: 380px; }
.login-card .card-title { font-size: 1.3rem; font-weight: 700; color: var(--tecn-azul); }

@media (max-width: 768px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-form-area { padding: 2rem 1.25rem; }
}

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--tecn-azul);
  display: flex; flex-direction: column;
  z-index: 1040;
  transition: transform var(--trans);
}

.sidebar-header {
  padding: 0 1rem;
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}

.sidebar-header span {
  color: #fff; font-weight: 700; font-size: .78rem;
  line-height: 1.2; flex: 1; min-width: 0;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.nav-section-label {
  font-size: .65rem; font-weight: 600; letter-spacing: .08em;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  padding: 1rem 1.25rem .35rem;
}

.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 1.25rem;
  color: rgba(255,255,255,0.7);
  border-radius: 0;
  font-size: .82rem;
  transition: all var(--trans);
  border-left: 3px solid transparent;
}

.sidebar-nav .nav-link i { font-size: .95rem; width: 16px; text-align: center; flex-shrink: 0; }

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.1);
  border-left-color: var(--tecn-oro);
}

.sidebar-footer {
  padding: .75rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.user-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--tecn-oro);
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: var(--tecn-azul);
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info .uname { font-size: .78rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .urole { font-size: .68rem; color: rgba(255,255,255,0.55); }

/* ── Header topbar ────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  display: flex; align-items: center;
  padding: 0 1.5rem;
  z-index: 1030;
  gap: 1rem;
}

.topbar .page-title { font-size: .95rem; font-weight: 600; color: var(--tecn-azul); flex: 1; }
.topbar .periodo-badge {
  font-size: .72rem; padding: 3px 10px;
  background: var(--tecn-azul-lt); color: var(--tecn-azul-md);
  border-radius: 20px; font-weight: 600;
}

.notif-btn {
  position: relative;
  background: none; border: none; cursor: pointer;
  color: #6b7280; font-size: 1.1rem;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  transition: background var(--trans);
}
.notif-btn:hover { background: var(--tecn-gris); }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--tecn-rojo); color: #fff;
  font-size: .6rem; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Main content area ────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  padding-top: var(--header-h);
  min-height: 100vh;
}

.content-inner { padding: 1.5rem; }

/* ── Stat cards ───────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e9ecef;
  padding: 1.1rem 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: box-shadow var(--trans);
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,51,102,.08); }
.stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.stat-icon.azul   { background: var(--tecn-azul-lt); color: var(--tecn-azul-md); }
.stat-icon.rojo   { background: #FEE2E2; color: var(--tecn-rojo); }
.stat-icon.oro    { background: #FEF3C7; color: #B45309; }
.stat-icon.verde  { background: #D1FAE5; color: #065F46; }
.stat-icon.gris   { background: #F3F4F6; color: #6B7280; }

.stat-num  { font-size: 1.6rem; font-weight: 700; line-height: 1; color: var(--tecn-azul); }
.stat-lbl  { font-size: .75rem; color: #6b7280; margin-top: 2px; }

/* ── Cards generales ──────────────────────────────────────────── */
.card { border: 1px solid #e9ecef; border-radius: 12px; }
.card-header {
  background: #fff; border-bottom: 1px solid #e9ecef;
  padding: .85rem 1.25rem;
  font-weight: 600; font-size: .85rem; color: var(--tecn-azul);
  border-radius: 12px 12px 0 0;
}

/* ── Tablas ───────────────────────────────────────────────────── */
.table th {
  font-size: .72rem; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 600;
  color: #6b7280; background: #f9fafb;
  border-bottom: 2px solid #e9ecef;
  padding: .6rem .75rem;
}
.table td { padding: .65rem .75rem; vertical-align: middle; font-size: .82rem; }
.table-hover tbody tr:hover { background: #f8faff; }

/* ── Formularios ──────────────────────────────────────────────── */
.form-label { font-size: .78rem; font-weight: 600; color: #374151; margin-bottom: .3rem; }
.form-control, .form-select {
  border-radius: 8px; border: 1px solid #d1d5db;
  font-size: .85rem; padding: .45rem .75rem;
  transition: border-color var(--trans), box-shadow var(--trans);
}
.form-control:focus, .form-select:focus {
  border-color: var(--tecn-azul-md);
  box-shadow: 0 0 0 3px rgba(0,76,151,0.12);
}
.form-text { font-size: .72rem; }

/* ── Botones ──────────────────────────────────────────────────── */
.btn { border-radius: 8px; font-size: .82rem; font-weight: 500; padding: .4rem 1rem; }
.btn-primary   { background: var(--tecn-azul-md); border-color: var(--tecn-azul-md); }
.btn-primary:hover { background: var(--tecn-azul); border-color: var(--tecn-azul); }
.btn-danger    { background: var(--tecn-rojo); border-color: var(--tecn-rojo); }
.btn-sm { padding: .25rem .65rem; font-size: .76rem; }

/* ── Breadcrumb ───────────────────────────────────────────────── */
.breadcrumb { font-size: .78rem; margin-bottom: 1rem; }
.breadcrumb-item + .breadcrumb-item::before { color: #9ca3af; }

/* ── Badge estados custom ─────────────────────────────────────── */
.badge { font-size: .7rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; }

/* ── Sidebar toggle mobile ────────────────────────────────────── */
.sidebar-toggle {
  display: none;
  background: none; border: none;
  font-size: 1.2rem; color: var(--tecn-azul); cursor: pointer;
}

@media (max-width: 991px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar { left: 0; }
  .sidebar-toggle { display: flex; align-items: center; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.4); z-index: 1039;
  }
  .sidebar-overlay.show { display: block; }
}

/* ── Scrollbar global ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }

/* ── Utilidades ───────────────────────────────────────────────── */
.text-azul  { color: var(--tecn-azul) !important; }
.text-rojo  { color: var(--tecn-rojo) !important; }
.text-oro   { color: var(--tecn-oro)  !important; }
.bg-azul-lt { background: var(--tecn-azul-lt) !important; }
.fw-600     { font-weight: 600; }
.fs-xs      { font-size: .75rem; }
.fs-sm      { font-size: .82rem; }

/* ── Timeline de aprobación ───────────────────────────────────── */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before {
  content: '';
  position: absolute; left: 18px; top: 0; bottom: 0;
  width: 2px; background: #e9ecef;
}
.timeline-item { display: flex; gap: 1rem; padding-bottom: 1.25rem; position: relative; }
.timeline-dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; flex-shrink: 0;
  background: #fff; border: 2px solid #e9ecef; z-index: 1;
}
.timeline-dot.done    { background: #D1FAE5; border-color: #065F46; color: #065F46; }
.timeline-dot.pending { background: var(--tecn-azul-lt); border-color: var(--tecn-azul-md); color: var(--tecn-azul-md); }
.timeline-dot.reject  { background: #FEE2E2; border-color: var(--tecn-rojo); color: var(--tecn-rojo); }
.timeline-body { flex: 1; padding-top: 6px; }
.timeline-title { font-size: .82rem; font-weight: 600; }
.timeline-sub   { font-size: .75rem; color: #6b7280; }
