/* === GOLDEN BRAIN INTRANET — main.css === */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=DM+Sans:wght@400;500&display=swap');

:root {
  --navy:    #0D1B2A;
  --navy2:   #162438;
  --gold:    #F5C842;
  --gold2:   #D4A918;
  --bg:      #F4F2EC;
  --bg2:     #FFFBF3;
  --card:    #FFFFFF;
  --border:  rgba(0,0,0,0.10);
  --border2: rgba(0,0,0,0.18);
  --text:    #1A1A2E;
  --muted:   #6B6B7B;
  --hint:    #9999AA;
  --red:     #A32D2D;
  --green:   #2D6A3F;
  --blue:    #185FA5;
  --amber:   #854F0B;
  --sidebar-w: 220px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: monospace; background: var(--bg); padding: 1px 5px; border-radius: 4px; font-size: 12px; border: 0.5px solid var(--border2); }

/* ── APP SHELL ────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── SIDEBAR ──────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform .2s;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 0.5px solid rgba(255,255,255,0.1);
}
.brand-icon {
  width: 32px; height: 32px;
  background: var(--gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 13px;
  color: var(--navy);
  flex-shrink: 0;
}
.brand-name { font-family: 'Sora', sans-serif; font-size: 13px; font-weight: 600; color: #fff; display: block; }
.brand-sub  { font-size: 10px; color: rgba(255,255,255,.4); }

.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-section {
  padding: 10px 16px 4px;
  font-size: 9px; font-weight: 500;
  color: rgba(255,255,255,.3);
  text-transform: uppercase; letter-spacing: .08em;
}
.nav-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px;
  font-size: 13px; color: rgba(255,255,255,.65);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all .15s;
}
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(245,200,66,.12); color: var(--gold); border-left-color: var(--gold); }
.ni { width: 15px; height: 15px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: rgba(245,200,66,.2); color: var(--gold);
  font-size: 9px; padding: 2px 5px; border-radius: 8px;
}

.sidebar-footer {
  padding: 10px 14px;
  border-top: 0.5px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 8px;
}
.sf-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.sf-info { flex: 1; min-width: 0; }
.sf-name { display: block; font-size: 12px; color: #fff; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-rol  { font-size: 10px; color: rgba(255,255,255,.4); }
.sf-logout {
  color: rgba(255,255,255,.4); padding: 4px;
  border-radius: 4px; transition: color .15s;
}
.sf-logout:hover { color: var(--gold); }

/* ── MAIN ─────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.topbar {
  background: var(--card);
  border-bottom: 0.5px solid var(--border);
  padding: 0 24px;
  height: 52px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.page-heading { font-family: 'Sora', sans-serif; font-size: 16px; font-weight: 600; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar-date  { font-size: 12px; color: var(--muted); }
.menu-toggle  { display: none; background: none; border: none; font-size: 18px; cursor: pointer; }
.page-body    { padding: 20px 24px; }

/* ── CARDS ────────────────────────────── */
.card {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.card-title {
  font-family: 'Sora', sans-serif;
  font-size: 12px; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 12px;
}
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dash-card {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}

/* ── STATS ────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: 8px; padding: 14px;
}
.stat-lbl { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat-num { font-family: 'Sora', sans-serif; font-size: 28px; font-weight: 700; }
.stat-sub { font-size: 10px; color: var(--hint); margin-top: 2px; }
.num-red   { color: var(--red); }
.num-amber { color: var(--amber); }
.num-blue  { color: var(--blue); }
.num-green { color: var(--green); }

/* ── TABLES ───────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 7px 10px;
  font-size: 10px; color: var(--muted); font-weight: 500;
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 0.5px solid var(--border);
}
.data-table td { padding: 9px 10px; border-bottom: 0.5px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.data-table tr.row-alert td { background: #FFF8E1; }

/* ── BADGES ───────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 500;
}
.badge-green  { background: #E6F4EC; color: #2D6A3F; }
.badge-red    { background: #FDEAEA; color: var(--red); }
.badge-amber  { background: #FEF3E2; color: var(--amber); }
.badge-blue   { background: #E6F0FB; color: var(--blue); }
.badge-gray   { background: #F0EFEA; color: #5F5E5A; }
.badge-gold   { background: rgba(245,200,66,.18); color: var(--gold2); }
.badge-purple { background: #EDE9FD; color: #534AB7; }

/* ── FORMS ────────────────────────────── */
.field-group  { margin-bottom: 12px; }
.field-label  { display: block; font-size: 11px; font-weight: 500; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }
.field-input  { width: 100%; padding: 8px 10px; border: 0.5px solid var(--border2); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text); font-family: 'DM Sans', sans-serif; }
.field-input:focus { outline: none; border-color: var(--gold2); }
textarea.field-input { resize: vertical; }
.field-hint   { font-size: 10px; color: var(--hint); margin-top: 3px; display: block; }
.form-row     { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; padding-top: 14px; border-top: 0.5px solid var(--border); }

/* ── BUTTONS ──────────────────────────── */
.btn-gold {
  padding: 8px 18px; background: var(--gold); color: var(--navy);
  border: none; border-radius: 7px; font-weight: 600;
  font-family: 'Sora', sans-serif; font-size: 13px; cursor: pointer;
}
.btn-gold:hover { background: var(--gold2); }
.btn-gold-sm {
  padding: 5px 12px; background: var(--gold); color: var(--navy);
  border: none; border-radius: 6px; font-size: 12px; font-weight: 600;
  font-family: 'Sora', sans-serif; cursor: pointer; text-decoration: none;
}
.btn-secondary {
  padding: 8px 16px; background: var(--bg);
  border: 0.5px solid var(--border2); border-radius: 7px;
  font-size: 13px; cursor: pointer; color: var(--text); text-decoration: none;
}
.btn-xs {
  padding: 3px 9px; font-size: 11px; background: var(--bg);
  border: 0.5px solid var(--border2); border-radius: 5px; cursor: pointer; color: var(--text);
}
.btn-xs:hover { background: var(--border); }
.btn-xs-danger { background: #FDEAEA; color: var(--red); border-color: #F5C1C1; }
.btn-marcar {
  padding: 8px 14px; background: var(--gold); color: var(--navy);
  border: none; border-radius: 7px; font-size: 13px; font-weight: 600;
  cursor: pointer; margin-top: 8px; margin-right: 6px;
}
.row-actions { display: flex; gap: 4px; }

/* ── LOGIN ────────────────────────────── */
.login-body   { background: var(--navy); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap   { width: 100%; display: flex; align-items: center; justify-content: center; }
.login-card   { background: var(--card); border-radius: 14px; padding: 32px 28px; width: 340px; }
.login-logo   { text-align: center; margin-bottom: 22px; }
.login-icon   { width: 50px; height: 50px; background: var(--gold); border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 20px; color: var(--navy); }
.login-brand  { font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 700; margin-top: 10px; }
.login-sub    { font-size: 12px; color: var(--muted); margin-top: 4px; }
.btn-login-submit { width: 100%; padding: 10px; background: var(--gold); color: var(--navy); border: none; border-radius: 8px; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 15px; cursor: pointer; margin-top: 4px; }
.login-footer { font-size: 10px; color: var(--hint); text-align: center; margin-top: 14px; }

/* ── ALERTS ───────────────────────────── */
.alert { padding: 10px 14px; border-radius: 7px; font-size: 13px; margin-bottom: 14px; }
.alert-danger  { background: #FDEAEA; color: var(--red); border: 0.5px solid #F5C1C1; }
.alert-success { background: #E6F4EC; color: var(--green); border: 0.5px solid #B5D4A5; }
.alert-amber   { background: #FEF3E2; color: var(--amber); border: 0.5px solid #FAD08A; }

/* ── ASISTENCIA ───────────────────────── */
.marcacion-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.marc-item { background: var(--bg); border-radius: 6px; padding: 8px; text-align: center; }
.marc-ok   { background: #E6F4EC; }
.marc-pend { background: var(--bg); }
.marc-lbl  { font-size: 10px; color: var(--muted); display: block; margin-bottom: 4px; }
.marc-hora { font-family: 'Sora', sans-serif; font-size: 16px; font-weight: 600; }
.marc-done { color: var(--green); font-weight: 500; padding: 8px 0; }
.marc-total{ font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* ── CALENDARIO ───────────────────────── */
.event-item { border-left: 3px solid var(--gold); padding: 6px 10px; margin-bottom: 6px; background: var(--bg); border-radius: 0 6px 6px 0; }
.event-titulo { font-size: 13px; font-weight: 500; }
.event-fecha  { font-size: 11px; color: var(--muted); }
.link-ver-mas { font-size: 12px; display: inline-block; margin-top: 8px; }

/* ── CRM ──────────────────────────────── */
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pill { padding: 4px 12px; border: 0.5px solid var(--border2); border-radius: 14px; font-size: 12px; color: var(--muted); text-decoration: none; }
.pill:hover { background: var(--bg2); }
.pill-active { background: var(--navy); color: var(--gold); border-color: var(--navy); }
.link-wa { color: #25D366; font-size: 12px; }
.interaction-item { padding: 8px 0; border-bottom: 0.5px solid var(--border); }
.int-meta   { font-size: 11px; font-weight: 600; color: var(--muted); }
.int-desc   { font-size: 13px; margin-top: 3px; }
.int-result { font-size: 11px; color: var(--green); margin-top: 2px; }
.int-next   { font-size: 11px; color: var(--blue); margin-top: 2px; }
.badge-select { padding: 2px 6px; border: 0.5px solid var(--border2); border-radius: 8px; font-size: 11px; background: var(--bg); }

/* ── 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: var(--card);
  border-radius: 12px;
  width: 90%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 0.5px solid var(--border); }
.modal-title  { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 600; }
.modal-close  { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--muted); }
.modal-body   { padding: 16px 18px; }

/* ── MISC ─────────────────────────────── */
.empty-msg  { color: var(--hint); font-size: 13px; padding: 20px 0; text-align: center; }
.text-muted { color: var(--muted); }
.text-red   { color: var(--red); }
.info-box   { background: var(--bg2); border: 0.5px solid var(--border); border-radius: 7px; padding: 10px 14px; font-size: 12px; color: var(--muted); }
.user-cell  { display: flex; align-items: center; gap: 8px; }
.avatar-circle {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; flex-shrink: 0;
}

/* ── RESPONSIVE ───────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .form-row  { grid-template-columns: 1fr; }
  .marcacion-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}
