/* ─── SVG Icons inline ───────────────────────────────────────────────────── */
.svg-icon { display:inline-block; vertical-align:middle; flex-shrink:0; }
.btn .svg-icon, .pub-nav-link .svg-icon { width:16px; height:16px; }
.sidebar-link .svg-icon { width:18px; height:18px; }
.header-icon-btn .svg-icon { width:20px; height:20px; }
.public-card .svg-icon { width:24px; height:24px; }

/* ─── Variables ───────────────────────────────────────────────────────────── */
:root {
  --primary:       #1565C0;
  --primary-dark:  #0D47A1;
  --primary-light: #EBF3FF;
  --primary-mid:   #1976D2;
  --accent:        #006BFF;
  --success:       #0CA678;
  --success-light: #ECFDF5;
  --warning:       #F59E0B;
  --warning-light: #FFFBEB;
  --danger:        #EF4444;
  --danger-light:  #FEF2F2;
  --text:          #111827;
  --text-2:        #374151;
  --text-muted:    #6B7280;
  --text-soft:     #9CA3AF;
  --surface:       #FFFFFF;
  --bg:            #F9FAFB;
  --bg-2:          #F3F4F6;
  --border:        #E5E7EB;
  --border-2:      #D1D5DB;
  --sidebar-w:     256px;
  --header-h:      60px;
  --radius:        12px;
  --radius-sm:     8px;
  --radius-xs:     6px;
  --font:          'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:     0 10px 40px rgba(0,0,0,.12);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ══════════════════════════════════════════════════════════════
   LAYOUT PANEL (con sidebar)
══════════════════════════════════════════════════════════════ */
.layout { display: flex; min-height: 100vh; }
.main   { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }
.main-content {
  flex: 1; padding: 2.25rem 3rem;
  max-width: 1400px; width: 100%;
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; z-index: 200;
  display: flex; flex-direction: column;
}
.sidebar-logo {
  padding: 1.5rem 1.5rem 1rem;
  display: flex; align-items: center;
}
.sidebar-logo img { height: 30px; display: block; }

.sidebar-section { padding: .25rem 0; }
.sidebar-section-label {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-soft);
  padding: .75rem 1.25rem .25rem; display: block;
}
.sidebar-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .58rem 1rem; margin: .1rem .75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: .875rem; font-weight: 400;
  transition: background .12s, color .12s;
}
.sidebar-link i { font-size: 1.05rem; flex-shrink: 0; }
.sidebar-link:hover { background: var(--bg); color: var(--text); }
.sidebar-link.active { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.sidebar-link.active i { color: var(--primary); }
.sidebar-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: .65rem; font-weight: 700; padding: .1rem .45rem;
  border-radius: 99px; line-height: 1.5; min-width: 18px; text-align: center;
}
.sidebar-divider { height: 1px; background: var(--border); margin: .5rem 1.25rem; }
.sidebar-footer {
  margin-top: auto; padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════════════
   TOPBAR
══════════════════════════════════════════════════════════════ */
.site-header {
  height: var(--header-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 2rem;
  gap: 1rem; position: sticky; top: 0; z-index: 100;
}
.header-search {
  flex: 1; max-width: 480px;
  display: flex; align-items: center; gap: .6rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .45rem .9rem;
  transition: border-color .15s, background .15s;
}
.header-search:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(21,101,192,.08); }
.header-search i { color: var(--text-soft); font-size: 1rem; }
.header-search input { border: none; background: transparent; outline: none; font-size: .875rem; color: var(--text); width: 100%; font-family: var(--font); }
.header-search input::placeholder { color: var(--text-soft); }
.header-spacer { flex: 1; }
.header-actions { display: flex; align-items: center; gap: .2rem; }
.header-icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer; position: relative;
  transition: background .12s, color .12s; border: none; background: transparent;
}
.header-icon-btn:hover { background: var(--bg-2); color: var(--primary); }
.header-icon-btn i { font-size: 1.1rem; }
.notif-dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--danger); border: 2px solid var(--surface);
}
.header-divider { width: 1px; height: 22px; background: var(--border); margin: 0 .35rem; }
.header-avatar {
  display: flex; align-items: center; gap: .5rem; padding: .3rem .6rem;
  border-radius: var(--radius-sm); cursor: pointer; transition: background .12s;
  border: none; background: transparent;
}
.header-avatar:hover { background: var(--bg-2); }
.avatar-circle {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  font-size: .8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.avatar-name { font-size: .85rem; font-weight: 500; color: var(--text); }

/* ══════════════════════════════════════════════════════════════
   PORTAL PÚBLICO — full width, estilo SaaS
══════════════════════════════════════════════════════════════ */
.public-header {
  background: var(--primary); border-bottom: none;
  height: var(--header-h); display: flex; align-items: center;
  padding: 0 4rem; gap: 1.5rem;
  position: sticky; top: 0; z-index: 100;
}
.public-header .logo img { height: 28px; display: block; filter: brightness(0) invert(1); }
.public-header .header-spacer { flex: 1; }
.public-header nav { display: flex; align-items: center; gap: .15rem; }
.pub-nav-link {
  display: flex; align-items: center; gap: .35rem;
  padding: .45rem .85rem; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; color: rgba(255,255,255,.82);
  transition: background .12s, color .12s;
}
.pub-nav-link:hover { background: rgba(255,255,255,.15); color: #fff; }
.pub-nav-link.active { background: rgba(255,255,255,.2); color: #fff; font-weight:600; }
.pub-nav-link i { font-size: .95rem; }

.public-wrap { min-height: 100vh; }

/* Hero amplio */
.public-hero {
  background: linear-gradient(135deg, #0D47A1 0%, #1565C0 50%, #1976D2 100%);
  color: #fff; padding: 5rem 2rem 6rem; text-align: center;
}
.public-hero h1 { font-size: 2.6rem; font-weight: 700; margin-bottom: .75rem; line-height: 1.2; }
.public-hero p  { font-size: 1.05rem; opacity: .85; max-width: 560px; margin: 0 auto 2rem; font-weight: 300; line-height: 1.7; }

/* Cards portada */
.public-cards {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; max-width: 1200px; width: 88%; margin: -3.5rem auto 0;
  padding: 0 2rem;
}
.public-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem 1.75rem;
  display: block; color: var(--text);
  transition: box-shadow .2s, transform .2s; box-shadow: var(--shadow-sm);
}
.public-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.public-card .card-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: var(--primary-light); color: var(--primary);
  font-size: 1.3rem; display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.public-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: .4rem; }
.public-card p  { font-size: .85rem; color: var(--text-muted); line-height: 1.6; }
.public-card .card-arrow {
  display: flex; align-items: center; gap: .3rem;
  font-size: .82rem; font-weight: 500; color: var(--primary);
  margin-top: 1.25rem;
}

/* ══════════════════════════════════════════════════════════════
   PÁGINA INTERIOR PÚBLICA (wiki, ticket, citas) — 75% ancho
══════════════════════════════════════════════════════════════ */
.public-inner {
  max-width: 1400px; width: 88%; min-width: min(65vw, 100%); margin: 2.5rem auto; padding: 0 2.5rem;
}
@media (max-width: 1200px) { .public-inner { width: 92%; } }
@media (max-width: 768px)  { .public-inner { width: 100%; padding: 0 1.25rem; } }

/* ══════════════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem; margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap; }
.card-title  { font-size: .7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .1em; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 1rem; margin-bottom: 1.75rem; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem; box-shadow: var(--shadow-sm);
}
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: .3rem; }
.stat-card .stat-label { font-size: .72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.stat-card.danger  .stat-value { color: var(--danger); }
.stat-card.accent  .stat-value { color: var(--accent); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.primary .stat-value { color: var(--primary); }

/* ══════════════════════════════════════════════════════════════
   TABLA
══════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data-table th {
  text-align: left; padding: .7rem 1.1rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid var(--border); background: var(--bg); white-space: nowrap;
}
table.data-table td { padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tbody tr { transition: background .1s; }
table.data-table tbody tr:hover td { background: var(--bg); }
table.data-table .actions { display: flex; gap: .35rem; }

/* ══════════════════════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; padding: .22rem .7rem;
  font-size: .7rem; font-weight: 600; border-radius: 99px;
  white-space: nowrap; letter-spacing: .02em;
}
.badge-abierto           { background:#EBF3FF; color:#1565C0; }
.badge-en_proceso        { background:#FFF7ED; color:#C2410C; }
.badge-pendiente_cliente { background:#FFFBEB; color:#B45309; }
.badge-resuelto          { background:#ECFDF5; color:#065F46; }
.badge-cerrado           { background:#F3F4F6; color:#6B7280; }
.badge-baja    { background:#ECFDF5; color:#065F46; }
.badge-media   { background:#EBF3FF; color:#1565C0; }
.badge-alta    { background:#FFF7ED; color:#C2410C; }
.badge-urgente { background:#FEF2F2; color:#B91C1C; }
.badge-confirmada { background:#ECFDF5; color:#065F46; }
.badge-cancelada  { background:#FEF2F2; color:#B91C1C; }
.badge-completada { background:#F3F4F6; color:#6B7280; }

/* ══════════════════════════════════════════════════════════════
   FORMULARIOS
══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; color: var(--text-2); margin-bottom: .45rem; }
.form-control {
  display: block; width: 100%; padding: .65rem 1rem; font-size: .9rem;
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s; font-family: var(--font); line-height: 1.5;
}
.form-control::placeholder { color: var(--text-soft); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,101,192,.1); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 120px; }
input[type="color"].form-control { padding: .3rem .5rem; height: 40px; }
input[type="date"].form-control, input[type="time"].form-control, input[type="month"].form-control { cursor: pointer; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .35rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

/* ══════════════════════════════════════════════════════════════
   BOTONES
══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.25rem; font-size: .875rem; font-weight: 500;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: all .15s; font-family: var(--font);
  text-decoration: none !important; white-space: nowrap; line-height: 1.4;
}
.btn:disabled { opacity: .5; pointer-events: none; }
.btn i { font-size: 1rem; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--text-2); border-color: var(--border-2); }
.btn-outline:hover { background: var(--bg); color: var(--primary); border-color: var(--primary); }
.btn-danger  { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #DC2626; border-color: #DC2626; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-ghost   { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-2); color: var(--primary); }
.btn-sm { padding: .38rem .85rem; font-size: .8rem; border-radius: var(--radius-xs); }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; border-radius: var(--radius-sm); }
.btn-full { width: 100%; }
.btn-icon { padding: .4rem; border-radius: var(--radius-xs); border: none; background: transparent; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; }
.btn-icon:hover { background: var(--bg-2); color: var(--primary); }

/* ══════════════════════════════════════════════════════════════
   ALERTAS
══════════════════════════════════════════════════════════════ */
.alert { padding: .875rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .875rem; border: 1px solid; }
.alert-success { background: var(--success-light); border-color: #6EE7B7; color: #065F46; }
.alert-danger  { background: var(--danger-light);  border-color: #FCA5A5; color: #991B1B; }
.alert-info    { background: var(--primary-light); border-color: #93C5FD; color: var(--primary-dark); }
.alert-warning { background: var(--warning-light); border-color: #FCD34D; color: #92400E; }

/* ══════════════════════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(15,23,42,.5); align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
}
.modal-header { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header strong { font-size: 1rem; font-weight: 600; }
.modal-body   { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: .6rem; background: var(--bg); border-radius: 0 0 var(--radius) var(--radius); }

/* ══════════════════════════════════════════════════════════════
   LOGIN — estilo Calendly
══════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 2rem;
}
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 2.75rem 2.5rem; width: 100%; max-width: 440px;
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo img { height: 36px; }
.login-title { font-size: 1.25rem; font-weight: 700; color: var(--text); text-align: center; margin-bottom: .3rem; }
.login-sub   { font-size: .85rem; color: var(--text-muted); text-align: center; margin-bottom: 2rem; }

/* ══════════════════════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════════════════════ */
.page-header { margin-bottom: 1.75rem; display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.page-title  { font-size: 1.5rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.page-subtitle { font-size: .875rem; color: var(--text-muted); margin-top: .3rem; }

/* Breadcrumb estilo SaaS */
.breadcrumb { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--text-muted); margin-bottom: .5rem; }
.breadcrumb a { color: var(--text-muted); } .breadcrumb a:hover { color: var(--primary); }
.breadcrumb i { font-size: .75rem; }

/* Filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; align-items: center; }
.filter-bar .form-control { width: auto; flex: 1; min-width: 200px; max-width: 320px; }

/* ══════════════════════════════════════════════════════════════
   CALENDARIO ESTILO CALENDLY
══════════════════════════════════════════════════════════════ */
.cal-wrap { width: 100%; }

/* Layout: izquierda info + derecha calendly */
.cal-layout {
  display: grid; grid-template-columns: 300px 1fr;
  gap: 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
  min-height: 520px;
}
.cal-info-panel {
  border-right: 1px solid var(--border); padding: 2rem 1.75rem;
  background: var(--surface); display: flex; flex-direction: column; gap: 1rem;
}
.cal-info-panel .info-org {
  font-size: .75rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em;
}
.cal-info-panel .info-title { font-size: 1.3rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.cal-info-panel .info-meta  { display: flex; flex-direction: column; gap: .5rem; margin-top: .25rem; }
.cal-info-meta-item { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text-muted); }
.cal-info-meta-item i { font-size: 1rem; color: var(--text-soft); }

/* Panel central: calendario */
.cal-calendar-panel { padding: 2rem; display: flex; flex-direction: column; gap: 1.25rem; }

/* Nav mes */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.cal-nav h2 { font-size: 1rem; font-weight: 600; color: var(--text); }
.cal-nav-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all .12s;
}
.cal-nav-btn:hover { background: var(--bg-2); border-color: var(--border-2); color: var(--text); }
.cal-nav-btn i { font-size: 1.1rem; }

/* Cabecera días */
.cal-grid-head { display: grid; grid-template-columns: repeat(7,1fr); margin-bottom: .25rem; }
.cal-grid-head span { text-align: center; font-size: .72rem; font-weight: 600; color: var(--text-muted); padding: .4rem 0; }

/* Grid días */
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.cal-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-size: .875rem; font-weight: 400;
  cursor: default; transition: all .12s; position: relative;
  color: var(--text-muted);
}
.cal-day.empty { }
.cal-day.past  { color: var(--text-soft); }
.cal-day.today { font-weight: 700; color: var(--text); }
.cal-day.today::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--primary);
}
.cal-day.has-slots {
  cursor: pointer; color: var(--primary); font-weight: 600;
  background: var(--primary-light);
}
.cal-day.has-slots:hover { background: var(--primary); color: #fff; }
.cal-day.selected { background: var(--primary) !important; color: #fff !important; font-weight: 700; }

/* Panel de slots del día — aparece a la derecha */
.cal-slots-panel {
  border-left: 1px solid var(--border); padding: 2rem 1.5rem;
  display: none; flex-direction: column; gap: .75rem; min-width: 220px;
  max-height: 520px; overflow-y: auto;
}
.cal-slots-panel.open { display: flex; }
.cal-slots-panel h3 { font-size: .875rem; font-weight: 600; color: var(--text); margin-bottom: .25rem; }
.cal-slots-panel .slot-tz { font-size: .72rem; color: var(--text-muted); margin-bottom: .5rem; }

/* Botón de slot — estilo Calendly */
.slot-time-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.1rem; border: 2px solid var(--primary);
  border-radius: var(--radius-sm); color: var(--primary);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: all .15s; background: var(--surface);
  font-family: var(--font);
}
.slot-time-btn:hover { background: var(--primary); color: #fff; }
.slot-time-btn .slot-confirm {
  display: none; background: var(--surface); color: var(--primary);
  padding: .35rem .75rem; border-radius: var(--radius-xs);
  font-size: .78rem; font-weight: 600; border: none; cursor: pointer;
}
.slot-time-btn.expanded { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.slot-confirm-row {
  display: none; border: 2px solid var(--primary); border-top: none;
  padding: .6rem 1rem; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--primary);
}
.slot-confirm-row.open { display: block; }
.slot-confirm-row .btn { width: 100%; background: #fff; color: var(--primary); font-weight: 700; font-size: .85rem; }
.slot-confirm-row .btn:hover { background: var(--primary-light); }

/* Layout de 3 columnas cuando hay slots */
.cal-3col { grid-template-columns: 300px 1fr 230px !important; }

/* ══════════════════════════════════════════════════════════════
   THREAD TICKETS
══════════════════════════════════════════════════════════════ */
.thread { display: flex; flex-direction: column; gap: .875rem; }
.thread-msg { border-radius: var(--radius-sm); padding: 1rem 1.25rem; }
.thread-msg.client-msg { background: var(--bg); border: 1px solid var(--border); }
.thread-msg.it-msg     { background: var(--primary-light); border: 1px solid #93C5FD; }
.thread-msg.internal   { background: #FFFBEB; border: 1px solid #FCD34D; }
.thread-meta { font-size: .72rem; color: var(--text-muted); margin-bottom: .4rem; font-weight: 500; }
.thread-body { font-size: .9rem; white-space: pre-wrap; line-height: 1.7; }

/* ══════════════════════════════════════════════════════════════
   TRACKING
══════════════════════════════════════════════════════════════ */
.track-header { background: var(--primary); color: #fff; padding: 1.5rem 2rem; border-radius: var(--radius) var(--radius) 0 0; }
.track-body   { border: 1px solid var(--border); border-top: none; padding: 2rem; background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }

/* Progress steps */
.progress-steps { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 1.5rem; }
.progress-step  { flex: 1; padding: .55rem .5rem; text-align: center; font-size: .72rem; font-weight: 500; border-right: 1px solid var(--border); transition: all .15s; color: var(--text-muted); background: var(--bg); }
.progress-step:last-child { border-right: none; }
.progress-step.done   { background: var(--primary); color: #fff; }
.progress-step.active { background: var(--primary-light); color: var(--primary); font-weight: 700; }

/* ══════════════════════════════════════════════════════════════
   WIKI CONTENT
══════════════════════════════════════════════════════════════ */
.wiki-content h1, .wiki-content h2, .wiki-content h3 { margin: 1.5rem 0 .75rem; font-weight: 600; }
.wiki-content p  { margin-bottom: 1rem; }
.wiki-content ul, .wiki-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.wiki-content li { margin-bottom: .3rem; }
.wiki-content img { max-width: 100%; border-radius: var(--radius-sm); }
.wiki-content code { background: var(--bg-2); padding: .15rem .4rem; border-radius: 4px; font-size: .85em; }
.wiki-content pre { background: var(--bg-2); padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; margin-bottom: 1rem; }
.wiki-content table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.wiki-content th, .wiki-content td { padding: .6rem .875rem; border: 1px solid var(--border); text-align: left; }
.wiki-content th { background: var(--bg); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-info-panel { border-right: none; border-bottom: 1px solid var(--border); }
  .cal-3col { grid-template-columns: 1fr !important; }
  .cal-slots-panel { border-left: none; border-top: 1px solid var(--border); }
  .main-content { padding: 1.5rem; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s; z-index: 900; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .public-hero { padding: 3rem 1.5rem 4rem; }
  .public-hero h1 { font-size: 1.9rem; }
  .public-cards { grid-template-columns: 1fr; padding: 0 1.5rem; }
  .public-header { padding: 0 1.5rem; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .public-inner { width: 100%; padding: 0 1rem; }
  .stats-grid { grid-template-columns: 1fr; }
}
