/* ================================================================
   ROLES.CSS — Temas de color por rol en bitMédico
   Paciente · Médico · Clínica · Admin
   ================================================================ */

/* ── TEMA PACIENTE ─────────────────────────────────────────── */
.theme-paciente,
body[data-role="paciente"] {
  --color-primary:     #0ea5e9;
  --color-primary-rgb: 14, 165, 233;
  --color-secondary:   #0284c7;
  --color-accent:      #38bdf8;
  --color-accent-rgb:  56, 189, 248;
  --color-light:       #e0f2fe;
  --role-gradient:     linear-gradient(135deg, #0ea5e9, #38bdf8);
  --role-shadow:       0 8px 24px rgba(14,165,233,.35);
}

/* ── TEMA MÉDICO ───────────────────────────────────────────── */
.theme-medico,
body[data-role="medico"] {
  --color-primary:     #6366f1;
  --color-primary-rgb: 99, 102, 241;
  --color-secondary:   #4f46e5;
  --color-accent:      #818cf8;
  --color-accent-rgb:  129, 140, 248;
  --color-light:       #eef2ff;
  --role-gradient:     linear-gradient(135deg, #6366f1, #818cf8);
  --role-shadow:       0 8px 24px rgba(99,102,241,.35);
}

/* ── TEMA CLÍNICA / HOSPITAL ───────────────────────────────── */
.theme-clinica,
body[data-role="clinica"] {
  --color-primary:     #10b981;
  --color-primary-rgb: 16, 185, 129;
  --color-secondary:   #059669;
  --color-accent:      #34d399;
  --color-accent-rgb:  52, 211, 153;
  --color-light:       #d1fae5;
  --role-gradient:     linear-gradient(135deg, #10b981, #34d399);
  --role-shadow:       0 8px 24px rgba(16,185,129,.35);
}

/* ── TEMA ADMIN ────────────────────────────────────────────── */
.theme-admin,
body[data-role="admin"] {
  --color-primary:     #f59e0b;
  --color-primary-rgb: 245, 158, 11;
  --color-secondary:   #d97706;
  --color-accent:      #fbbf24;
  --color-accent-rgb:  251, 191, 36;
  --color-light:       #fef3c7;
  --role-gradient:     linear-gradient(135deg, #f59e0b, #fbbf24);
  --role-shadow:       0 8px 24px rgba(245,158,11,.35);
}

/* ── BADGE DE ROL ──────────────────────────────────────────── */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.role-badge-paciente { background: #e0f2fe; color: #0284c7; }
.role-badge-medico   { background: #eef2ff; color: #4f46e5; }
.role-badge-clinica  { background: #d1fae5; color: #059669; }
.role-badge-admin    { background: #fef3c7; color: #d97706; }

/* ── ROLE HERO CARD ────────────────────────────────────────── */
.role-hero {
  background: rgba(var(--color-primary-rgb), .06);
  border: 2px solid var(--color-primary);
  border-radius: 20px;
  padding: 2rem;
  color: #1a1a2e;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(var(--color-primary-rgb), .1);
}
.role-hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: rgba(var(--color-primary-rgb), .07);
  border-radius: 50%;
}
.role-hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -30px;
  width: 160px; height: 160px;
  background: rgba(var(--color-primary-rgb), .05);
  border-radius: 50%;
}
.role-hero-icon {
  width: 64px; height: 64px;
  background: rgba(var(--color-primary-rgb), .12);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  position: relative; z-index: 1;
}
.role-hero h2 { font-size: 1.6rem; font-weight: 800; color: #1a1a2e; margin: 0 0 .35rem; position: relative; z-index: 1; }
.role-hero p  { font-size: .9rem; color: #374151; margin: 0; opacity: 1; position: relative; z-index: 1; }
.role-hero-meta {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  position: relative; z-index: 1;
}
.role-hero-meta-item {
  background: rgba(var(--color-primary-rgb), .1);
  color: #374151;
  border-radius: 8px;
  padding: .4rem .85rem;
  font-size: .82rem;
  font-weight: 600;
}

/* ── STAT CARDS MEJORADOS ──────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.stat-card-role {
  background: rgba(var(--color-primary-rgb), .05);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  border: 1.5px solid var(--color-primary);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform .2s, box-shadow .2s;
}
.stat-card-role:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--color-primary-rgb),.15);
}
.stat-icon-role {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: rgba(var(--color-primary-rgb),.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.stat-val { font-size: 1.6rem; font-weight: 800; color: #1a1a2e; line-height: 1; }
.stat-lbl { font-size: .8rem; color: #6b7280; margin-top: .2rem; }

/* Dark mode stat cards */
.dark .stat-card-role {
  background: rgba(var(--color-primary-rgb), .08);
  border-color: var(--color-primary);
}
.dark .stat-val { color: #f1f5f9; }

/* ── MEGACITYID BADGE ──────────────────────────────────────── */
.megaid-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  padding: .4rem 1rem;
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 700;
}

/* ── LOGIN SPLIT LAYOUT ────────────────────────────────────── */
.bm-login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 768px) {
  .bm-login-wrap { grid-template-columns: 1fr; }
  .bm-login-left { display: none; }
}
.bm-login-left {
  background:
    radial-gradient(circle at 2px 2px, rgba(var(--color-primary-rgb), .13) 1px, transparent 0),
    rgba(var(--color-primary-rgb), .04);
  background-size: 26px 26px, 100%;
  border-right: 2px solid var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
.bm-login-left::before,
.bm-login-left::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(var(--color-primary-rgb), .1);
}
.bm-login-left::before { width: 300px; height: 300px; top: -80px; right: -80px; }
.bm-login-left::after  { width: 200px; height: 200px; bottom: -50px; left: -50px; }
.bm-login-left-content { color: #1a1a2e; max-width: 380px; position: relative; z-index: 1; }
.bm-login-left-content .logo {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 2rem;
  text-decoration: none;
}
.bm-login-left-content .logo-icon {
  width: 48px; height: 48px;
  background: rgba(var(--color-primary-rgb), .15);
  border: 1.5px solid var(--color-primary);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.bm-login-left-content .logo-text {
  font-size: 1.5rem; font-weight: 800; color: #1a1a2e;
}
.bm-login-left-content h2 { font-size: 2rem; font-weight: 800; color: #1a1a2e; margin: 0 0 1rem; }
.bm-login-left-content p  { color: #374151; opacity: 1; font-size: 1rem; line-height: 1.6; margin: 0; }
.login-features { margin-top: 2rem; display: flex; flex-direction: column; gap: .75rem; }
.login-feature {
  display: flex; align-items: center; gap: .75rem;
  background: rgba(var(--color-primary-rgb), .08);
  border: 1px solid rgba(var(--color-primary-rgb), .2);
  color: #1a1a2e;
  padding: .75rem 1rem;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 500;
}
.login-feature-icon { font-size: 1.2rem; }

.bm-login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background: #fafbff;
}
.bm-login-form-box {
  width: 100%;
  max-width: 420px;
}
.bm-login-header { margin-bottom: 2rem; }
.bm-login-header h1 { font-size: 1.75rem; font-weight: 800; color: #1a1a2e; margin: 0 0 .35rem; }
.bm-login-header p  { color: #6b7280; font-size: .9rem; margin: 0; }
.form-group-bm { margin-bottom: 1.25rem; }
.form-label-bm { display: block; font-size: .85rem; font-weight: 600; color: #374151; margin-bottom: .4rem; }
.form-control-bm {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: .95rem;
  color: #1a1a2e;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  box-sizing: border-box;
}
.form-control-bm:focus {
  border-color: var(--color-primary, #0ea5e9);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb, 14,165,233),.12);
}
.btn-login-bm {
  width: 100%;
  padding: .875rem;
  background: var(--role-gradient, linear-gradient(135deg,#0ea5e9,#38bdf8));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  box-shadow: var(--role-shadow, 0 4px 14px rgba(14,165,233,.4));
  margin-top: .5rem;
}
.btn-login-bm:hover { opacity: .9; transform: translateY(-1px); }
.btn-login-bm:disabled { opacity: .7; cursor: not-allowed; transform: none; }

/* ── SIDEBAR POR ROL ───────────────────────────────────────── */
.sidebar-role-header {
  padding: .875rem 1.25rem;
  border-radius: 12px;
  margin: 0 .75rem .75rem;
  background: rgba(var(--color-primary-rgb, 99,102,241),.08);
  border: 1px solid rgba(var(--color-primary-rgb, 99,102,241),.15);
}
.sidebar-role-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #1a1a2e;
}

/* ── INFO CARDS ────────────────────────────────────────────── */
.info-card {
  background: rgba(var(--color-primary-rgb), .04);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  border: 1.5px solid var(--color-primary);
  margin-bottom: 1.25rem;
  color: #1a1a2e;
}
.dark .info-card {
  background: #1e2030;
  border-color: rgba(var(--color-primary-rgb),.15);
}
.info-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.dark .info-card-title { color: #f1f5f9; }

/* ── EMPTY STATE ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: #9ca3af;
}
.empty-state-icon { font-size: 3rem; margin-bottom: .75rem; }
.empty-state-text { font-size: .9rem; }
.empty-state-cta {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: 1rem;
  padding: .6rem 1.25rem;
  background: var(--role-gradient);
  color: #fff;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity .2s;
}
.empty-state-cta:hover { opacity: .88; }

/* ── VERIFICACION CARD ─────────────────────────────────────── */
.verify-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb),.06), rgba(var(--color-accent-rgb),.04));
  border: 1.5px solid rgba(var(--color-primary-rgb),.15);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
}
.verify-card-icon { font-size: 2rem; flex-shrink: 0; }
.verify-card-title { font-size: .95rem; font-weight: 700; color: #1a1a2e; margin: 0 0 .2rem; }
.dark .verify-card-title { color: #f1f5f9; }
.verify-card-sub { font-size: .82rem; color: #6b7280; margin: 0; }

/* ── TABLA CITAS ───────────────────────────────────────────── */
.bm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.bm-table th {
  text-align: left;
  padding: .75rem 1rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #9ca3af;
  border-bottom: 1.5px solid #f1f5f9;
}
.bm-table td {
  padding: .875rem 1rem;
  border-bottom: 1px solid #f8fafc;
  color: #374151;
  vertical-align: middle;
}
.dark .bm-table th { color: #6b7280; border-bottom-color: #2d3145; }
.dark .bm-table td { color: #cbd5e1; border-bottom-color: #252840; }
.bm-table tbody tr:hover { background: rgba(var(--color-primary-rgb),.03); }
.bm-table tbody tr:last-child td { border-bottom: none; }

/* ── BADGE ESTADO ──────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: .25rem .65rem;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 700;
}
.status-pending   { background: #fef3c7; color: #d97706; }
.status-confirmed { background: #d1fae5; color: #059669; }
.status-cancelled { background: #fef2f2; color: #dc2626; }
.status-done      { background: #e0e7ff; color: #4f46e5; }

/* ── PRÓXIMA CITA HIGHLIGHT ────────────────────────────────── */
.next-appt-card {
  background: var(--role-gradient);
  border-radius: 16px;
  padding: 1.5rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--role-shadow);
}
.next-appt-date {
  background: rgba(255,255,255,.2);
  border-radius: 12px;
  padding: .75rem 1rem;
  text-align: center;
  flex-shrink: 0;
  min-width: 64px;
}
.next-appt-day  { font-size: 1.6rem; font-weight: 900; line-height: 1; }
.next-appt-mon  { font-size: .75rem; font-weight: 700; opacity: .85; text-transform: uppercase; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .role-hero  { padding: 1.5rem; }
  .role-hero h2 { font-size: 1.3rem; }
}
@media (max-width: 400px) {
  .stat-grid { grid-template-columns: 1fr; }
}
