/* assets/css/app.css — miPorteria */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #2563eb;
  --primary-d: #1d4ed8;
  --success:   #16a34a;
  --danger:    #dc2626;
  --warn:      #d97706;
  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-700:  #374151;
  --gray-900:  #111827;
  --radius:    8px;
  --shadow:    0 1px 4px rgba(0,0,0,.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  color: var(--gray-900);
  background: var(--gray-100);
  min-height: 100vh;
}

/* ---- NAV ---- */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: 1.05rem; }
.nav-logo { height: 36px; border-radius: 4px; }
.navbar-menu { display: flex; gap: 1rem; align-items: center; }
.navbar-menu a { text-decoration: none; color: var(--gray-700); font-size: .9rem; }
.navbar-menu a:hover { color: var(--primary); }

/* ---- MAIN ---- */
.main-content { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; }

/* ---- ALERTS ---- */
.alert { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ---- BUTTONS ---- */
.btn-primary, .btn-secondary, .btn-sm, .btn-danger, .btn-warn, .btn-logout {
  display: inline-block; padding: .5rem 1rem; border-radius: var(--radius);
  font-size: .875rem; font-weight: 500; cursor: pointer; text-decoration: none;
  border: none; line-height: 1.4;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-d); }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); filter: brightness(.95); }
.btn-sm       { padding: .3rem .7rem; font-size: .8rem; background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-sm:hover { background: var(--gray-200); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-warn     { background: var(--warn); color: #fff; }
.btn-block    { width: 100%; text-align: center; display: block; }
.btn-logout   { background: transparent; color: var(--danger); border: 1px solid var(--danger); font-size: .8rem; }

/* ---- TABLES ---- */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th { background: var(--gray-50); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; padding: .65rem 1rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
.data-table td { padding: .65rem 1rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-50); }

/* ---- BADGES ---- */
.badge { display: inline-block; padding: .2rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-amber { background: #fef3c7; color: #92400e; }

/* ---- IMAGES ---- */
.thumb-sm  { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.thumb-md  { width: 80px; height: 80px; border-radius: var(--radius); object-fit: cover; margin-bottom: .5rem; }
.table-logo { height: 32px; border-radius: 4px; }
.avatar-placeholder { display: inline-flex; width: 36px; height: 36px; border-radius: 50%;
  align-items: center; justify-content: center; background: var(--primary); color: #fff; font-weight: 700; font-size: 1rem; }

/* ---- FORMS ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.emp-form { background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; }
.emp-form h4 { margin: 1.25rem 0 .75rem; color: var(--gray-700); font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; }
label { font-size: .85rem; font-weight: 500; color: var(--gray-700); }
input, select, textarea {
  width: 100%; padding: .5rem .75rem; border: 1px solid var(--gray-200);
  border-radius: var(--radius); font-size: .9rem; background: #fff;
  transition: border-color .15s;
}
input:focus, select:focus { outline: none; border-color: var(--primary); }
.form-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }

/* ---- PAGE HEADER ---- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.page-header h2 { font-size: 1.3rem; }

/* ---- SEARCH / FILTER ---- */
.search-bar, .filter-bar { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search-bar input { max-width: 320px; }

/* ---- DASHBOARD STATS ---- */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 1.25rem; text-align: center; box-shadow: var(--shadow); }
.stat-card.stat-green { border-top: 3px solid var(--success); }
.stat-card.stat-amber { border-top: 3px solid var(--warn); }
.stat-number { font-size: 2.5rem; font-weight: 700; color: var(--primary); }
.stat-label  { font-size: .8rem; color: var(--gray-700); margin-top: .25rem; }

/* ---- MODAL ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal-box { background: #fff; border-radius: var(--radius); padding: 1.75rem;
  width: 520px; max-width: 95vw; max-height: 90vh; overflow-y: auto; }
.modal-box h3 { margin-bottom: 1.25rem; }
.modal-actions { display: flex; gap: 1rem; margin-top: 1.5rem; }

/* ---- LOGIN ---- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--gray-100); }
.login-card { background: #fff; border-radius: var(--radius); padding: 2.5rem 2rem;
  width: 380px; max-width: 95vw; box-shadow: 0 4px 24px rgba(0,0,0,.1); }
.login-logo { height: 60px; display: block; margin: 0 auto 1rem; }
.login-brand { text-align: center; font-size: 1.75rem; margin-bottom: .5rem; }
.login-card h1 { font-size: 1.3rem; text-align: center; margin-bottom: .25rem; }
.login-sub { text-align: center; color: var(--gray-700); font-size: .85rem; margin-bottom: 1.25rem; }
.login-card label { display: block; margin-bottom: .25rem; font-size: .85rem; font-weight: 500; margin-top: .75rem; }

/* ---- QR PÁGINA EMPLEADO ---- */
.qr-fullpage { display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: #f0f4ff; }
.qr-emp-card { background: #fff; border-radius: 16px; padding: 2rem 1.5rem;
  max-width: 380px; width: 95vw; text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,.12); }
.qr-emp-logo { height: 48px; margin-bottom: 1rem; }
.qr-emp-foto { width: 90px; height: 90px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--primary); margin-bottom: .75rem; }
.qr-emp-nombre { font-size: 1.25rem; font-weight: 700; margin-bottom: .25rem; }
.qr-emp-cargo  { color: var(--gray-700); font-size: .9rem; margin-bottom: 1rem; }
.qr-big { display: flex; justify-content: center; margin: .5rem 0; }
.qr-hint { font-size: .8rem; color: var(--gray-700); margin-top: .5rem; margin-bottom: 1rem; }
.btn-logout-small { font-size: .8rem; color: var(--danger); text-decoration: none; display: block; margin-top: 1rem; }
.redes-social { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .75rem; }
.red-btn { padding: .3rem .75rem; border-radius: 999px; font-size: .78rem;
  text-decoration: none; font-weight: 600; background: var(--gray-100); color: var(--gray-700); }
.red-whatsapp { background: #dcfce7; color: #166534; }
.red-instagram { background: #fce7f3; color: #9d174d; }
.red-linkedin  { background: #dbeafe; color: #1e40af; }

/* ---- QR SCAN RESULT ---- */
.scan-result-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.scan-card { background: #fff; border-radius: 16px; padding: 2rem 1.5rem;
  max-width: 380px; width: 95vw; text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,.12); }
.scan-card.scan-entrada { border-top: 6px solid var(--success); }
.scan-card.scan-salida  { border-top: 6px solid var(--warn); }
.scan-tipo { font-size: 1.4rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: .03em; }
.scan-entrada .scan-tipo { color: var(--success); }
.scan-salida  .scan-tipo { color: var(--warn); }
.scan-logo { height: 40px; margin-bottom: .75rem; }
.scan-foto { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: .75rem auto; display: block; }
.scan-hora { margin: 1rem 0; }
.scan-hora strong { font-size: 2rem; display: block; }
.scan-hora span { color: var(--gray-700); }
.scan-redirect { font-size: .8rem; color: var(--gray-700); margin-top: 1rem; }
.emergencia-box { background: #fef3c7; border-radius: var(--radius); padding: .75rem; margin-top: .75rem; text-align: left; font-size: .85rem; }
.emergencia-box summary { cursor: pointer; font-weight: 600; }

/* ---- QR CARD ADMIN ---- */
.qr-page { display: flex; justify-content: center; padding: 2rem 1rem; }
.qr-card { background: #fff; border-radius: 16px; padding: 2rem; width: 360px;
  text-align: center; box-shadow: var(--shadow); }
.qr-container { display: flex; justify-content: center; margin: 1rem 0; }
.qr-code-text { font-size: .7rem; color: var(--gray-700); word-break: break-all; margin-bottom: .75rem; }
.emp-foto { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: 0 auto .75rem; display: block; }

/* ---- FOOTER ---- */
.site-footer { text-align: center; padding: 1.5rem; color: var(--gray-700); font-size: .8rem; border-top: 1px solid var(--gray-200); margin-top: 2rem; }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
}
/* ── Añadir al final de assets/css/app.css ── */

/* Separador de nav */
.nav-sep { color: var(--gray-200); padding: 0 .25rem; }

/* Tabla responsive en móvil */
.table-wrap { overflow-x: auto; }

/* Instalador */
.check-row { display:flex; justify-content:space-between; align-items:center;
  padding:.5rem 0; border-bottom:1px solid var(--gray-100); font-size:.9rem; }

/* Reportes - scroll horizontal en tabla */
.data-table th, .data-table td { white-space: nowrap; }

/* QR fullpage mobile */
@media (max-width: 480px) {
  .qr-emp-card { padding: 1.5rem 1rem; }
  .qr-emp-nombre { font-size: 1.1rem; }
  .scan-hora strong { font-size: 2.5rem; }
}

/* Navbar mobile */
@media (max-width: 768px) {
  .navbar { flex-direction: column; gap: .5rem; padding: .75rem 1rem; }
  .navbar-menu { flex-wrap: wrap; justify-content: center; gap: .5rem; }
  .navbar-menu a { font-size: .8rem; }
  .main-content { padding: 1rem .75rem; }
}
