/* ============================================================
   Next Step RN – Tutorías · CSS principal
   ============================================================ */

:root {
  --blue:        #1e3a5f;
  --blue-light:  #2d5a8e;
  --blue-pale:   #e8f0fb;
  --green:       #1a7f4b;
  --green-light: #d1fae5;
  --red:         #b91c1c;
  --red-light:   #fee2e2;
  --yellow:      #92400e;
  --yellow-light:#fef3c7;
  --gray-50:     #f8fafc;
  --gray-100:    #f1f5f9;
  --gray-200:    #e2e8f0;
  --gray-400:    #94a3b8;
  --gray-600:    #475569;
  --gray-800:    #1e293b;
  --white:       #ffffff;
  --radius:      8px;
  --shadow:      0 1px 4px rgba(0,0,0,.10);
  --shadow-md:   0 4px 16px rgba(0,0,0,.12);
  --sidebar-w:   240px;
  --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  display: flex;
  min-height: 100vh;
}

a { color: var(--blue-light); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { padding-left: 1.25rem; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--blue);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform .25s ease;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon { font-size: 1.6rem; }
.logo-text  { font-size: .95rem; font-weight: 700; line-height: 1.2; }

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  font-size: .9rem;
  transition: background .15s, color .15s;
  border-radius: 0;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,.12);
  color: var(--white);
  text-decoration: none;
}
.nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.15);
}
.user-info   { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-avatar {
  width: 36px; height: 36px;
  background: var(--blue-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.user-name   { font-size: .85rem; font-weight: 600; color: var(--white); }
.user-role   { font-size: .75rem; color: rgba(255,255,255,.6); }
.btn-logout  {
  display: block; text-align: center;
  padding: 7px; border-radius: var(--radius);
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.8);
  font-size: .82rem; transition: background .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.2); text-decoration: none; }

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

.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-title  { font-size: 1.15rem; font-weight: 700; color: var(--gray-800); flex: 1; }
.header-right { margin-left: auto; }
.credits-badge {
  background: var(--blue-pale);
  color: var(--blue);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .82rem;
}
.sidebar-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; color: var(--gray-600);
}

.page-content { padding: 24px 28px; flex: 1; }

/* ---- Cards ---- */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h2 { font-size: 1rem; font-weight: 700; color: var(--gray-800); }
.card-body { padding: 20px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 20px; }
.mb-3 { margin-bottom: 12px; }
.ml-2 { margin-left: 8px; }

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}
.stat-card.accent       { border-left: 4px solid var(--yellow); background: var(--yellow-light); }
.stat-card.accent-green { border-left: 4px solid var(--green);  background: var(--green-light); }
.stat-icon  { font-size: 1.8rem; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--blue); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--gray-600); margin-top: 2px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 18px;
  border: none; border-radius: var(--radius);
  font-size: .88rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: opacity .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary   { background: var(--blue);       color: var(--white); }
.btn-secondary { background: var(--gray-200);    color: var(--gray-800); }
.btn-success   { background: var(--green);       color: var(--white); }
.btn-danger    { background: var(--red);         color: var(--white); }
.btn-ghost     { background: transparent; color: var(--gray-600); border: 1px solid var(--gray-200); }
.btn-block     { width: 100%; }
.btn-lg        { padding: 12px 28px; font-size: 1rem; }
.btn-sm        { padding: 5px 12px; font-size: .8rem; }
.btn:disabled  { opacity: .5; cursor: not-allowed; }

/* ---- Forms ---- */
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group  { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--gray-600); }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .9rem;
  font-family: var(--font);
  background: var(--white);
  color: var(--gray-800);
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px var(--blue-pale);
}
.form-group small { font-size: .78rem; color: var(--gray-400); }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }

/* ---- Tables ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.data-table th { background: var(--gray-50); color: var(--gray-600); font-weight: 600; padding: 10px 12px; text-align: left; border-bottom: 2px solid var(--gray-200); white-space: nowrap; }
.data-table td { padding: 10px 12px; 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); }
.data-table .actions { display: flex; gap: 6px; }
.row-inactive td { opacity: .55; }

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-success { background: var(--green-light);  color: var(--green); }
.badge-warning { background: var(--yellow-light); color: var(--yellow); }
.badge-danger  { background: var(--red-light);    color: var(--red); }
.badge-info    { background: var(--blue-pale);     color: var(--blue); }
.badge-muted   { background: var(--gray-100);      color: var(--gray-600); }
.badge-starter { background: var(--blue-pale);     color: var(--blue); }
.badge-full    { background: var(--green-light);   color: var(--green); }

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-top: 8px;
}
.alert-error   { background: var(--red-light);    color: var(--red);    border: 1px solid #fca5a5; }
.alert-success { background: var(--green-light);  color: var(--green);  border: 1px solid #6ee7b7; }
.alert-warning { background: var(--yellow-light); color: var(--yellow); border: 1px solid #fcd34d; }
.hidden { display: none !important; }

/* ---- Toolbar ---- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.search-input  { padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: .88rem; min-width: 240px; }
.filter-select { padding: 8px 12px; border: 1px solid var(--gray-200); border-radius: var(--radius); font-size: .88rem; }
.filter-group  { display: flex; align-items: center; gap: 8px; }

/* ---- Session Cards ---- */
.session-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow);
}
.session-card.pending   { border-left: 4px solid #f59e0b; }
.session-card.confirmed { border-left: 4px solid var(--green); }
.session-card.completed { border-left: 4px solid var(--gray-400); }
.session-card.cancelled { border-left: 4px solid var(--red); opacity: .75; }
.session-header  { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.session-id      { font-size: .78rem; color: var(--gray-400); }
.session-student { font-size: .95rem; margin-bottom: 4px; }
.session-teacher { font-size: .95rem; margin-bottom: 4px; }
.session-time    { font-size: .85rem; color: var(--gray-600); margin-bottom: 4px; }
.session-notes   { font-size: .82rem; color: var(--gray-600); font-style: italic; }
.session-meet    { margin-top: 8px; }
.session-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* ---- Session Row (compact) ---- */
.session-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-100);
  gap: 12px;
}

/* ---- Availability ---- */
.two-col-layout { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
.avail-block {
  background: var(--blue-pale);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.avail-date  { font-weight: 700; font-size: .9rem; min-width: 160px; }
.avail-time  { color: var(--blue); font-size: .9rem; flex: 1; }
.avail-notes { font-size: .8rem; color: var(--gray-600); font-style: italic; }
.month-nav   { display: flex; align-items: center; gap: 12px; }
.month-title { font-weight: 700; font-size: .95rem; min-width: 140px; text-align: center; }
.date-nav    { display: flex; align-items: center; gap: 8px; }

/* ---- Booking Steps ---- */
.booking-steps { max-width: 700px; }
.step { display: none; }
.step.active { display: block; }
.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
}
.step-number {
  width: 32px; height: 32px;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; flex-shrink: 0;
}
.step-header h2 { font-size: 1.05rem; font-weight: 700; flex: 1; }
.teacher-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.teacher-card:hover { border-color: var(--blue-light); box-shadow: var(--shadow-md); }
.teacher-avatar {
  width: 42px; height: 42px;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
}
.teacher-name  { font-weight: 700; font-size: .95rem; }
.teacher-tz    { font-size: .8rem; color: var(--gray-400); }
.teacher-arrow { margin-left: auto; color: var(--gray-400); font-size: 1.2rem; }
.teacher-info  { flex: 1; }

.day-group   { margin-bottom: 18px; }
.day-label   { font-weight: 700; font-size: .9rem; color: var(--blue); margin-bottom: 8px; }
.slots-row   { display: flex; flex-wrap: wrap; gap: 8px; }
.slot-btn {
  background: var(--white);
  border: 1px solid var(--blue-light);
  color: var(--blue);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.slot-btn:hover { background: var(--blue); color: var(--white); }

.booking-summary { background: var(--blue-pale); border-radius: var(--radius); padding: 16px; }
.summary-table   { width: 100%; border-collapse: collapse; }
.summary-table td { padding: 6px 12px; font-size: .9rem; }
.summary-table td:first-child { color: var(--gray-600); width: 120px; }

.success-icon { font-size: 4rem; margin-bottom: 16px; }
.text-center  { text-align: center; }

/* ---- CTA Banner ---- */
.cta-banner {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.cta-banner h3 { font-size: 1.1rem; margin-bottom: 4px; }
.cta-banner p  { opacity: .85; font-size: .9rem; }

/* ---- Info Banner ---- */
.info-banner {
  background: var(--blue-pale);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: .88rem;
  color: var(--gray-800);
}
.info-banner ul  { margin-top: 8px; }
.info-banner li  { margin-bottom: 4px; }
.info-list       { font-size: .9rem; list-style: disc; color: var(--gray-600); }
.info-list li    { margin-bottom: 6px; }

/* ---- Active Session Card ---- */
.active-session-card { border: 2px solid var(--green); margin-bottom: 20px; }
.active-session-card .card-header { background: var(--green-light); }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--gray-800);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  max-width: 360px;
}
.toast.toast-success { background: var(--green); }
.toast.toast-error   { background: var(--red); }
.toast.toast-info    { background: var(--blue); }
.toast.visible { opacity: 1; transform: translateY(0); }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-md);
}
.modal h2     { font-size: 1.1rem; margin-bottom: 20px; color: var(--blue); }
.modal-close  {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--gray-400);
}
.modal-open body { overflow: hidden; }

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--gray-400);
}
.empty-icon { font-size: 3rem; margin-bottom: 12px; }

/* ---- Misc ---- */
.loading   { padding: 24px; text-align: center; color: var(--gray-400); font-size: .9rem; }
.text-sm   { font-size: .82rem; }
.text-muted { color: var(--gray-400); font-size: .9rem; }
.text-warning { color: #b45309; }

/* ---- Login page ---- */
body.login-page {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-container { width: 100%; max-width: 420px; padding: 20px; }
.login-card {
  background: var(--white);
  border-radius: 12px;
  padding: 36px;
  box-shadow: var(--shadow-md);
}
.login-logo      { text-align: center; margin-bottom: 24px; }
.logo-icon-lg    { font-size: 3rem; display: block; }
.login-logo h1   { font-size: 1.4rem; color: var(--blue); margin: 8px 0 4px; }
.login-logo p    { color: var(--gray-400); font-size: .9rem; }
.login-tabs      { display: flex; gap: 0; margin-bottom: 24px; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.tab-btn         { flex: 1; padding: 9px; background: var(--white); border: none; cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--gray-600); transition: background .15s; }
.tab-btn.active  { background: var(--blue); color: var(--white); }
.tab-panel       { display: none; }
.tab-panel.active { display: block; }
.login-form      { display: flex; flex-direction: column; gap: 16px; }
.login-hint      { font-size: .78rem; color: var(--gray-400); text-align: center; margin-top: 4px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .two-col-layout { grid-template-columns: 1fr; }
  .form-grid  { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; text-align: center; }
  .session-card { flex-direction: column; }
  .page-content { padding: 16px; }
}
