/* ============================================================
   CuartoEstudiantil — Estilos globales
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ─── Variables ──────────────────────────────────────────── */
:root {
  --bg:           #F0F4FF;
  --white:        #FFFFFF;
  --primary:      #3B5BDB;
  --primary-dark: #2846C4;
  --primary-light:#EEF2FF;
  --accent:       #6C63FF;
  --text:         #1A1D2E;
  --muted:        #6B7280;
  --border:       #E5E7EB;
  --green:        #10B981;
  --green-bg:     #ECFDF5;
  --yellow:       #F59E0B;
  --yellow-bg:    #FFFBEB;
  --red:          #EF4444;
  --red-bg:       #FEF2F2;
  --purple:       #8B5CF6;
  --purple-bg:    #F5F3FF;
  --radius:       12px;
  --shadow:       0 4px 24px rgba(59,91,219,0.10);
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ─── Layout ─────────────────────────────────────────────── */
.container { max-width: 960px; margin: 0 auto; padding: 0 32px; }
.page { padding: 40px 0 80px; }
.hidden { display: none !important; }

/* ─── Navbar ─────────────────────────────────────────────── */
.navbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 32px;
}
.navbar .nav-inner {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
}
.nav-logo .logo-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.nav-logo span {
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.4px;
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links .nav-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s;
}
.nav-links .nav-btn:hover,
.nav-links .nav-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 24px;
  border: 1px solid var(--border);
  cursor: pointer;
}
.nav-user .user-name { font-size: 13px; font-weight: 600; }

/* ─── Avatar ─────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
}
.avatar-sm  { width: 28px; height: 28px; font-size: 11px; }
.avatar-md  { width: 36px; height: 36px; font-size: 14px; }
.avatar-lg  { width: 72px; height: 72px; font-size: 26px; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s;
  cursor: pointer;
}
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn-full { width: 100%; justify-content: center; }
.btn-primary   { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(59,91,219,.25); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--primary-light); color: var(--primary); }
.btn-outline   { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-success   { background: var(--green-bg); color: var(--green); }
.btn-danger    { background: var(--red-bg); color: var(--red); }
.btn-ghost     { background: transparent; color: var(--muted); border: none; }

/* ─── Card ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border);
}
.card-pad { padding: 24px; }
.card-pad-lg { padding: 32px; }

/* ─── Badge ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-admin      { background: var(--primary-light); color: var(--primary); }
.badge-arrendador { background: var(--purple-bg);     color: var(--purple); }
.badge-estudiante { background: var(--green-bg);      color: var(--green); }
.badge-aprobado   { background: var(--green-bg);      color: var(--green); }
.badge-pendiente  { background: var(--yellow-bg);     color: var(--yellow); }
.badge-rechazado  { background: var(--red-bg);        color: var(--red); }
.badge-activo     { background: var(--green-bg);      color: var(--green); }
.badge-suspendido { background: var(--red-bg);        color: var(--red); }

/* ─── Form ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
}
.form-input-icon { padding-left: 38px; }
.input-wrap { position: relative; }
.input-wrap .input-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-error { color: var(--red); font-size: 13px; margin-top: 6px; }

/* ─── Tags (servicios) ───────────────────────────────────── */
.tag {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px; font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ─── Room Card ──────────────────────────────────────────── */
.room-card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.room-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(59,91,219,0.12);
}
.room-card-img {
  height: 140px;
  background: linear-gradient(135deg, var(--primary-light), #E0E7FF);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  position: relative;
  overflow: hidden;
}
.room-card-img.has-photo {
  background: #E5E7EB;
  font-size: 0;
}
.room-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.room-card-img .badge { position: absolute; top: 12px; right: 12px; }
.room-card-body { padding: 16px 18px 18px; }
.room-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; line-height: 1.3; }
.room-location { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.room-price { font-size: 22px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.room-price span { font-size: 12px; color: var(--muted); font-weight: 400; }
.room-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}
.room-footer .owner { display: flex; align-items: center; gap: 8px; }

/* ─── Grid ───────────────────────────────────────────────── */
.grid-rooms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.grid-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

/* ─── Stat Card ──────────────────────────────────────────── */
.stat-card {
  background: var(--white);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.stat-card .stat-num { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.stat-card .stat-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}

/* ─── Tabs ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 28px;
}
.tab-btn {
  padding: 10px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: all 0.15s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.tab-badge {
  background: var(--yellow);
  color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}

/* ─── Table ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead tr { border-bottom: 2px solid var(--border); }
thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 14px 16px; }
.td-actions { display: flex; gap: 8px; }

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #EEF2FF 0%, #F0F4FF 100%);
  padding: 72px 32px;
}
.hero-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; align-items: center; gap: 48px;
}
.hero h1 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
}
.hero h1 .accent { color: var(--primary); }
.hero p { font-size: 16px; color: var(--muted); line-height: 1.6; margin-bottom: 32px; max-width: 440px; }
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-img {
  flex: 0 0 300px;
  height: 200px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary-light), #E0E7FF);
  display: flex; align-items: center; justify-content: center;
  font-size: 80px;
  box-shadow: 0 8px 32px rgba(59,91,219,0.15);
}

/* ─── Stats bar ──────────────────────────────────────────── */
.stats-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 28px 32px;
}
.stats-bar-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; gap: 48px; justify-content: center;
}
.stats-bar .stat-item { text-align: center; }
.stats-bar .stat-num  { font-size: 28px; font-weight: 800; color: var(--primary); letter-spacing: -1px; }
.stats-bar .stat-lbl  { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ─── Features ───────────────────────────────────────────── */
.features { padding: 64px 32px; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.feature-card { padding: 24px; text-align: center; }
.feature-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 22px;
}
.feature-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.feature-card p  { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ─── Login ──────────────────────────────────────────────── */
#login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #EEF2FF 0%, #F0F4FF 60%, #E0E7FF 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-wrap { width: 100%; max-width: 420px; }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo-big {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 28px;
  box-shadow: 0 8px 24px rgba(59,91,219,.3);
}
.login-logo h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.login-logo p  { margin-top: 6px; color: var(--muted); font-size: 14px; }
.role-btns { display: flex; gap: 10px; }
.role-btn {
  flex: 1; padding: 10px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-weight: 700; font-size: 14px;
  transition: all 0.15s;
}
.role-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ─── Profile ────────────────────────────────────────────── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  margin-bottom: 32px;
}
.profile-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.profile-info-row:last-child { border-bottom: none; }
.profile-info-row .lbl { font-size: 13px; color: var(--muted); }

/* ─── Activity ───────────────────────────────────────────── */
.activity-item {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.activity-item .act-title { font-weight: 600; font-size: 14px; }
.activity-item .act-time  { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ─── Pending card ───────────────────────────────────────── */
.pending-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.pending-thumb {
  width: 60px; height: 60px;
  border-radius: 12px;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
  overflow: hidden;
}
.pending-thumb.has-photo {
  background: #E5E7EB;
  font-size: 0;
}
.pending-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pending-card .pending-btns { display: flex; gap: 8px; margin-left: auto; }
.room-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.room-gallery img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.room-gallery-empty {
  margin: 12px 0 16px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ─── Empty state ────────────────────────────────────────── */
.empty { text-align: center; padding: 64px 0; color: var(--muted); }
.empty .empty-icon { font-size: 48px; margin-bottom: 16px; }

/* ─── Toast ──────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--text); color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 24px rgba(0,0,0,.2);
  z-index: 999;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.3s;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.success { background: var(--green); }
#toast.error   { background: var(--red); }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  backdrop-filter: blur(3px);
}
.modal-box {
  background: var(--white);
  border-radius: 18px;
  max-width: 500px; width: 100%;
  padding: 32px;
  position: relative;
  max-height: 90vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  font-size: 18px; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ─── Section header ─────────────────────────────────────── */
.section-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 24px;
}
.section-header h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.section-header a  { font-size: 13px; font-weight: 600; color: var(--primary); }

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { flex-direction: column; }
  .hero-img   { display: none; }
  .profile-grid { grid-template-columns: 1fr; }
  .stats-bar-inner { gap: 24px; flex-wrap: wrap; }
  .container { padding: 0 16px; }
  .navbar { padding: 0 16px; }
}
