:root {
  --rose: #d4a5a5;
  --rose-soft: #f3e2e2;
  --rose-deep: #b88080;
  --cream: #faf6f1;
  --cream-2: #f3ece2;
  --charcoal: #2c2c2c;
  --gray-700: #4a4a4a;
  --gray-500: #8a8a8a;
  --gray-300: #d4d4d4;
  --gray-100: #f5f5f5;
  --green: #6fbf6f;
  --amber: #e6a55b;
  --red: #c95757;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.10);
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: 'Inter', -apple-system, "Segoe UI", system-ui, sans-serif; background: var(--cream); color: var(--charcoal); font-size: 14px; line-height: 1.55; }
a { color: var(--rose-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
pre, code { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 12.5px; }
em { color: var(--gray-500); font-style: italic; }
.muted { color: var(--gray-500); font-size: 13px; }

/* ===== LOGIN ===== */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; background: linear-gradient(135deg, var(--rose-soft) 0%, var(--cream) 100%); }
.login-card { background: white; padding: 48px 40px; border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 380px; }
.login-card h1 { font-size: 26px; margin: 0 0 4px; color: var(--rose-deep); letter-spacing: -0.02em; }
.login-card .muted { font-size: 13px; margin-bottom: 28px; }
.login-card label { display: block; margin-bottom: 16px; }
.login-card label span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; color: var(--gray-700); }
.login-card input { width: 100%; padding: 11px 13px; border: 1.5px solid var(--gray-300); border-radius: 10px; font-size: 14px; transition: border-color 0.15s; }
.login-card input:focus { outline: none; border-color: var(--rose-deep); }
.login-card button { width: 100%; background: var(--charcoal); color: white; border: 0; padding: 13px; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; margin-top: 8px; transition: background 0.15s; }
.login-card button:hover { background: var(--rose-deep); }
.login-card .error { background: #fee2e2; color: #991b1b; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }

/* ===== LAYOUT ===== */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: 240px; background: white; border-right: 1px solid var(--gray-100); display: flex; flex-direction: column; padding: 24px 0; box-shadow: var(--shadow-sm); }
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 0 20px 28px; border-bottom: 1px solid var(--gray-100); margin-bottom: 16px; }
.sidebar .logo { width: 40px; height: 40px; border-radius: 50%; background: var(--rose); color: white; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 18px; }
.brand-name { font-weight: 800; font-size: 17px; color: var(--charcoal); }
.brand-sub { font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.08em; }

.sidebar nav { flex: 1; padding: 0 12px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--gray-700); font-size: 13.5px; font-weight: 500; margin-bottom: 2px; transition: background 0.12s, color 0.12s; }
.nav-item:hover { background: var(--rose-soft); color: var(--rose-deep); text-decoration: none; }
.nav-item.is-active { background: var(--charcoal); color: white; font-weight: 700; }
.nav-icon { font-size: 17px; width: 22px; text-align: center; }

.sidebar-footer { padding: 16px 20px 0; border-top: 1px solid var(--gray-100); }
.user-card { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--cream-2); color: var(--charcoal); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.user-name { font-weight: 600; font-size: 13px; }
.user-logout { font-size: 11px; color: var(--gray-500); }

.layout-main { margin-left: 240px; padding: 36px 40px 60px; min-height: 100vh; max-width: 1280px; }

/* ===== PAGE HEADER ===== */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 28px; font-weight: 800; margin: 0 0 4px; letter-spacing: -0.02em; }
.page-header p { margin: 0; font-size: 14px; color: var(--gray-500); }

/* ===== STATS GRID ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 36px; }
.stat-card { background: white; padding: 22px 20px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm); transition: transform 0.12s, box-shadow 0.12s; color: var(--charcoal); border: 1px solid var(--gray-100); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.stat-value { font-size: 30px; font-weight: 900; letter-spacing: -0.02em; line-height: 1; }
.stat-label { font-size: 12px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat-rose { background: linear-gradient(135deg, var(--rose-soft) 0%, white 100%); }
.stat-cream { background: linear-gradient(135deg, var(--cream-2) 0%, white 100%); }
.stat-charcoal { background: linear-gradient(135deg, var(--charcoal) 0%, #444 100%); color: white; }
.stat-charcoal .stat-label { color: rgba(255,255,255,0.7); }
.stat-celebration { background: linear-gradient(135deg, var(--rose) 0%, var(--rose-soft) 100%); color: white; }
.stat-celebration .stat-label { color: rgba(255,255,255,0.85); }

/* ===== SECTIONS ===== */
.dash-section { background: white; padding: 24px 26px; border-radius: var(--radius); margin-bottom: 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); }
.dash-section h2 { font-size: 16px; font-weight: 700; margin: 0 0 14px; color: var(--charcoal); }

.btn { display: inline-block; background: var(--charcoal); color: white; padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 13px; margin-top: 10px; }
.btn:hover { background: var(--rose-deep); text-decoration: none; color: white; }
.btn-mini { background: white; color: var(--charcoal); border: 1.5px solid var(--gray-300); padding: 5px 12px; font-size: 12px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn-mini:hover { background: var(--charcoal); color: white; border-color: var(--charcoal); }

/* ===== AGENT STATUS ===== */
.status-grid { display: grid; gap: 10px; }
.status-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--gray-100); border-radius: 10px; }
.status-key { font-weight: 600; font-size: 13px; }
.badge { font-size: 12px; padding: 4px 10px; border-radius: 20px; font-weight: 600; }
.badge.ok { background: #dcf2dc; color: #2c6b2c; }
.badge.pending { background: #fcebd5; color: #8a5028; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; }
.alert-bad { background: #fee2e2; color: #991b1b; }

.pending-list { padding-left: 22px; margin: 0; }
.pending-list li { margin-bottom: 6px; font-size: 13px; color: var(--gray-700); }

/* ===== CUMPLES PREVIEW (DASHBOARD) ===== */
.cumple-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.cumple-card { background: linear-gradient(135deg, var(--rose-soft) 0%, var(--cream) 100%); padding: 16px; border-radius: 12px; }
.cumple-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.cumple-edad { background: white; padding: 2px 10px; border-radius: 20px; font-size: 11px; color: var(--rose-deep); font-weight: 700; margin-left: 6px; }
.cumple-meta { font-size: 12px; color: var(--gray-500); margin-bottom: 6px; }
.cumple-status { font-size: 11px; font-weight: 700; text-transform: uppercase; }

/* ===== PROFESIONALES ===== */
.area-section { margin-bottom: 32px; }
.area-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 0 4px; }
.area-header h2 { font-size: 18px; font-weight: 800; color: var(--charcoal); margin: 0; }
.area-count { font-size: 12px; color: var(--gray-500); background: var(--cream-2); padding: 4px 12px; border-radius: 20px; font-weight: 600; }

.prof-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.prof-card { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); transition: transform 0.12s, box-shadow 0.12s; }
.prof-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.prof-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--gray-100); }
.prof-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--rose-soft); color: var(--rose-deep); display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 17px; flex-shrink: 0; }
.prof-card h3 { font-size: 15px; margin: 0 0 2px; color: var(--charcoal); }
.prof-rol { font-size: 12px; color: var(--gray-500); font-weight: 500; }

.prof-section { margin-bottom: 12px; }
.prof-section:last-child { margin-bottom: 0; }
.prof-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-500); margin-bottom: 6px; }
.prof-phone { font-size: 13px; font-weight: 600; color: var(--charcoal); }
.prof-phone-alt { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

.prof-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11px; background: var(--cream-2); color: var(--gray-700); padding: 3px 9px; border-radius: 20px; }

.prof-slots { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.slot { font-size: 11px; background: var(--rose-soft); color: var(--rose-deep); padding: 3px 9px; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.prof-dias { color: var(--gray-500); font-weight: 500; text-transform: none; letter-spacing: 0; }
.prof-dias-block { margin-top: 8px; font-size: 12px; }
.prof-duracion { font-size: 11px; color: var(--gray-500); margin-top: 6px; }
.prof-note { font-size: 11px; color: var(--amber); margin-top: 8px; padding: 6px 8px; background: #fef6e7; border-radius: 6px; }

/* ===== SALAS ===== */
.salas-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.sala-card { background: white; padding: 16px; border-radius: 12px; border: 1px solid var(--gray-100); box-shadow: var(--shadow-sm); }
.sala-phone { font-weight: 800; font-size: 16px; color: var(--rose-deep); margin-bottom: 4px; }
.sala-area { font-size: 12px; color: var(--gray-700); margin-bottom: 6px; }
.sala-count { font-size: 11px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

/* ===== PROCEDIMIENTOS TABLE ===== */
.proc-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); }
.proc-table th { background: var(--cream-2); padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-700); }
.proc-table td { padding: 12px 14px; border-top: 1px solid var(--gray-100); font-size: 13px; vertical-align: top; }
.proc-name { font-weight: 600; color: var(--charcoal); }
.proc-pending { color: var(--amber); font-size: 14px; }
.prof-chip { display: inline-block; font-size: 11px; background: var(--rose-soft); color: var(--rose-deep); padding: 2px 8px; border-radius: 10px; margin: 2px 2px 2px 0; font-weight: 600; }

/* ===== CUMPLEAÑOS ===== */
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cfg-item { background: var(--cream); padding: 14px 18px; border-radius: 10px; border: 1px solid var(--gray-100); }
.cfg-item.span-2 { grid-column: span 2; }
.cfg-key { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-500); margin-bottom: 4px; }
.cfg-val { font-size: 13.5px; color: var(--charcoal); }

.cumple-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); }
.cumple-table th { background: var(--cream-2); padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray-700); }
.cumple-table td { padding: 12px 14px; border-top: 1px solid var(--gray-100); font-size: 13px; vertical-align: middle; }
.cumple-table tr.hoy { background: linear-gradient(90deg, var(--rose-soft) 0%, white 60%); }
.hoy-badge { background: var(--rose-deep); color: white; padding: 3px 10px; border-radius: 12px; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; }
.status-tag { display: inline-block; font-size: 11px; padding: 2px 10px; border-radius: 12px; font-weight: 600; text-transform: capitalize; }
.status-pendiente { background: #fef0d7; color: #8a5028; }
.status-mensaje_enviado { background: #d6e9fb; color: #1e518d; }
.status-canjeado { background: #dcf2dc; color: #2c6b2c; }

.msg-template { background: var(--cream); padding: 16px; border-radius: 10px; border: 1px solid var(--gray-100); white-space: pre-wrap; font-size: 13px; color: var(--gray-700); }

/* ===== SHOW (Adivina y Gana) ===== */
.show-section { background: linear-gradient(135deg, var(--rose-soft) 0%, white 100%); }
.trivia-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 12px; }
.trivia-card { background: white; padding: 18px; border-radius: 12px; border: 1px solid var(--gray-100); position: relative; }
.trivia-num { position: absolute; top: -8px; left: 14px; background: var(--rose-deep); color: white; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; }
.trivia-q { font-weight: 700; font-size: 14px; margin-bottom: 12px; padding-top: 6px; }
.trivia-opts { list-style: none; padding: 0; margin: 0; }
.trivia-opts li { padding: 8px 12px; margin-bottom: 4px; background: var(--gray-100); border-radius: 8px; font-size: 13px; position: relative; }
.trivia-opts li.correct { background: #dcf2dc; color: #2c6b2c; font-weight: 600; }
.check { position: absolute; right: 12px; color: var(--green); font-weight: 800; }

/* ===== CHECKLIST ===== */
.checklist { padding-left: 22px; margin: 0; }
.checklist li { margin-bottom: 8px; font-size: 13.5px; color: var(--gray-700); line-height: 1.5; }

/* ===== FAQ ===== */
.faq { padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.faq:last-child { border-bottom: 0; }
.faq-q { font-weight: 700; font-size: 13.5px; color: var(--charcoal); margin-bottom: 4px; }
.faq-a { font-size: 13px; color: var(--gray-700); }

/* ===== PLACEHOLDER ===== */
.placeholder-card { background: white; padding: 40px; border-radius: var(--radius); text-align: center; box-shadow: var(--shadow-sm); border: 1px dashed var(--gray-300); }
.placeholder-icon { font-size: 48px; margin-bottom: 16px; }
.placeholder-card p { font-size: 14px; color: var(--gray-700); max-width: 480px; margin: 0 auto; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar { width: 100%; position: relative; height: auto; flex-direction: row; align-items: center; padding: 12px 16px; flex-wrap: wrap; }
  .sidebar .brand { padding: 0 12px 0 0; border-bottom: 0; margin-bottom: 0; border-right: 1px solid var(--gray-100); padding-right: 16px; }
  .sidebar nav { display: flex; gap: 4px; padding: 0; overflow-x: auto; }
  .nav-item { white-space: nowrap; padding: 8px 12px; font-size: 12px; }
  .sidebar-footer { border-top: 0; padding: 0 0 0 12px; }
  .layout-main { margin-left: 0; padding: 24px 16px; }
  .cfg-grid { grid-template-columns: 1fr; }
  .cfg-item.span-2 { grid-column: span 1; }
}
