/* =====================================================
   Sistema de Asistencias IESTP Nasca — app.css
   ===================================================== */

:root {
  --bg:          #f5f4f0;
  --surface:     #ffffff;
  --surface-2:   #f8f7f4;
  --border:      rgba(0,0,0,0.10);
  --border-2:    rgba(0,0,0,0.18);
  --text:        #1a1a18;
  --text-muted:  #6b6b67;
  --text-hint:   #9e9e9a;
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --blue:        #185FA5;
  --blue-light:  #E6F1FB;
  --green:       #3B6D11;
  --green-light: #EAF3DE;
  --amber:       #854F0B;
  --amber-light: #FAEEDA;
  --red:         #A32D2D;
  --red-light:   #FCEBEB;
  --teal:        #0F6E56;
  --teal-light:  #E1F5EE;
  --purple:      #534AB7;
  --purple-light:#EEEDFE;
  --sidebar-w:   210px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* ── LAYOUT ─────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 0.5px solid var(--border);
}
.logo-icon { font-size: 18px; color: var(--blue); }
.logo-title { font-size: 13px; font-weight: 600; }
.logo-sub   { font-size: 10px; color: var(--text-muted); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 0.5px solid var(--border);
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
}
.user-name { font-size: 11px; font-weight: 500; }
.user-rol  { font-size: 9px; margin-top: 2px; }

.nav { padding: 8px 0; flex: 1; }
.nav-section {
  font-size: 9px;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 8px 16px 3px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { color: var(--blue); border-left-color: var(--blue); background: var(--blue-light); font-weight: 500; }
.nav-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.btn-logout {
  width: 100%;
  padding: 7px;
  font-size: 11px;
  background: none;
  border: 0.5px solid var(--border-2);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
}
.btn-logout:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }

/* ── MAIN ───────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  padding: 14px 24px;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 15px; font-weight: 500; }
.topbar-right { display: flex; gap: 8px; align-items: center; }

.content { padding: 20px 24px; flex: 1; }

/* ── MÉTRICAS ───────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.metric {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.metric-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.metric-value { font-size: 26px; font-weight: 500; }
.metric-sub   { font-size: 10px; color: var(--text-hint); margin-top: 3px; }

/* ── CARDS ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-grid {
  display: grid;
  gap: 14px;
}
.card-grid-2 { grid-template-columns: 1fr 1fr; }
.card-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── TABLAS ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 0.5px solid var(--border);
}
td {
  padding: 8px 10px;
  border-bottom: 0.5px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* ── BOTONES ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border-2);
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: #0e4f8a; }
.btn-danger  { background: var(--red-light); color: var(--red); border-color: #F7C1C1; }
.btn-sm      { padding: 4px 10px; font-size: 11px; }
.btn-group   { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── FORMULARIOS ────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.form-label { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  padding: 7px 10px;
  font-size: 12px;
  border: 0.5px solid var(--border-2);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  width: 100%;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(24,95,165,0.12);
}
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* ── BADGES ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.badge-blue   { background: var(--blue-light);   color: var(--blue); }
.badge-green  { background: var(--green-light);  color: var(--green); }
.badge-amber  { background: var(--amber-light);  color: var(--amber); }
.badge-red    { background: var(--red-light);    color: var(--red); }
.badge-teal   { background: var(--teal-light);   color: var(--teal); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-gray   { background: #F1EFE8; color: #5F5E5A; }

/* ── INFO BOXES ─────────────────────────────────────── */
.info-box {
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 12px;
  margin-bottom: 12px;
}
.info-blue   { background: var(--blue-light);   color: #0C447C;  border: 0.5px solid #B5D4F4; }
.info-amber  { background: var(--amber-light);  color: #633806;  border: 0.5px solid #FAC775; }
.info-green  { background: var(--green-light);  color: #27500A;  border: 0.5px solid #C0DD97; }
.info-red    { background: var(--red-light);    color: #701F1F;  border: 0.5px solid #F7C1C1; }

/* ── ZONA DE CARGA ──────────────────────────────────── */
.upload-zone {
  border: 1.5px dashed var(--border-2);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  background: var(--surface-2);
  margin-bottom: 14px;
}
.upload-zone-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.upload-zone-sub   { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

/* ── LOGIN ──────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 360px;
}
.login-logo   { text-align: center; margin-bottom: 24px; }
.login-title  { font-size: 18px; font-weight: 500; }
.login-inst   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.login-error  { background: var(--red-light); color: var(--red); border-radius: var(--radius-md); padding: 10px 12px; font-size: 12px; margin-bottom: 14px; }

/* ── UTILIDADES ─────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-hint    { color: var(--text-hint); }
.text-blue    { color: var(--blue); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-amber   { color: var(--amber); }
.text-bold    { font-weight: 500; }
.text-sm      { font-size: 11px; }
.text-xs      { font-size: 10px; }
.mt-1         { margin-top: 4px; }
.mt-2         { margin-top: 8px; }
.mt-3         { margin-top: 12px; }
.mb-0         { margin-bottom: 0; }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.w-full       { width: 100%; }
.divider      { border: none; border-top: 0.5px solid var(--border); margin: 14px 0; }
