/* ============================================================
 * OptimOS · Actas de Reunión IA — Estilos
 * (base heredada del aplicativo PDF ↔ Word)
 * ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --red: #E31E24;
  --red-dark: #B71C1C;
  --black: #1a1a1a;
  --dark-gray: #2d2d2d;
  --medium-gray: #555;
  --light-gray: #f5f6f8;
  --line: #e6e8ec;
  --white: #ffffff;
  --blue: #2563eb;
  --ok: #16a34a;
  --warn: #d97706;
  --purple: #7c3aed;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--light-gray);
  min-height: 100vh;
  color: var(--black);
}

/* ---------- Auth loader ---------- */
#authLoader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; background: var(--light-gray); color: var(--medium-gray);
  opacity: 1; transition: opacity 0.35s ease;
}
#authLoader.oculto { opacity: 0; }
#authLoader .spin {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid #e0e0e0; border-top-color: var(--red);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
body:not(.auth-ok) .app-shell { display: none; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 92px; background: #3a4a54; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 0; gap: 18px; position: sticky; top: 0; height: 100vh;
}
.side-logo {
  width: 46px; height: 46px; border-radius: 12px; object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.side-nav { display: flex; flex-direction: column; gap: 8px; width: 100%; align-items: center; margin-top: 4px; }
.side-btn {
  width: 74px; padding: 10px 4px; border: none; background: transparent;
  border-radius: 12px; cursor: pointer; color: #cbd5db;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 0.66rem; font-weight: 600; transition: all 0.18s;
}
.side-btn i { font-size: 1.15rem; }
.side-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.side-btn.active { background: var(--red); color: #fff; box-shadow: 0 4px 12px rgba(227,30,36,0.35); }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar-accent { height: 4px; background: linear-gradient(90deg, var(--red), #ff5a5f); }

/* ---------- Header ---------- */
.header {
  background: var(--white); border-bottom: 1px solid var(--line);
  padding: 16px 28px; display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.h-title h1 { font-size: 1.28rem; font-weight: 800; }
.h-title span { font-size: 0.82rem; color: var(--medium-gray); }
.h-user {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid rgba(227,30,36,0.28); border-radius: 40px; padding: 5px 14px 5px 5px;
  box-shadow: 0 1px 6px rgba(227,30,36,0.06);
}
.h-user-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
  background-size: cover; background-position: center; font-size: 0.85rem;
}
.h-user-info { line-height: 1.15; }
.h-user-info b { font-size: 0.85rem; }
.h-user-info small { display: block; color: var(--medium-gray); font-size: 0.72rem; }
.h-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn-volver { white-space: nowrap; }

/* ---------- Content ---------- */
.content { padding: 26px 28px; flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: 10px; padding: 11px 20px; font-weight: 600;
  font-size: 0.88rem; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; transition: all 0.18s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--red-dark); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--medium-gray); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-sm { padding: 7px 12px; font-size: 0.8rem; }

/* Botón refrescar (solo icono, circular) */
.btn-refresh {
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
}
.btn-refresh.loading {
  background: #d97706; border-color: #d97706; color: #fff;
  box-shadow: 0 4px 12px rgba(217,119,6,0.35);
}
.btn-refresh.loading:hover { border-color: #d97706; color: #fff; }

/* ============================================================
 * KPIs
 * ============================================================ */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px;
}
.kpi-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; display: flex; align-items: center; gap: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.kpi-ico {
  width: 54px; height: 54px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff;
}
.kpi-ico-red { background: linear-gradient(135deg, var(--red), #ff5a5f); }
.kpi-ico-green { background: linear-gradient(135deg, #16a34a, #4ade80); }
.kpi-ico-warn { background: linear-gradient(135deg, #d97706, #fbbf24); }
.kpi-ico-blue { background: linear-gradient(135deg, var(--blue), #60a5fa); }
.kpi-ico-purple { background: linear-gradient(135deg, var(--purple), #a78bfa); }
.kpi-body { display: flex; flex-direction: column; }
.kpi-num { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.kpi-label { font-size: 0.8rem; color: var(--medium-gray); margin-top: 4px; }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .kpi-grid { grid-template-columns: 1fr; } }

/* ---------- Barra de progreso de actas ---------- */
.progress-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 24px; margin-bottom: 22px; box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.progress-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.progress-head h3 { font-size: 1rem; }
.progress-pct { font-size: 1.3rem; font-weight: 800; color: var(--ok); }
.progress-bar { height: 14px; background: #eef1f5; border-radius: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--ok), #4ade80); border-radius: 20px; transition: width 0.6s ease; }
.progress-note-txt { margin-top: 10px; font-size: 0.85rem; color: var(--medium-gray); }

/* ---------- Gráficos ---------- */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 20px 22px; box-shadow: 0 4px 16px rgba(0,0,0,0.04); min-height: 260px;
}
.chart-card h3 { font-size: 0.98rem; margin-bottom: 14px; }
.chart-card canvas { max-height: 240px; }
@media (max-width: 900px) { .charts-grid { grid-template-columns: 1fr; } }

/* ============================================================
 * Reuniones (tabla + filtros)
 * ============================================================ */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.05rem; }
.count-badge {
  background: #fff0f0; color: var(--red); font-weight: 700; font-size: 0.78rem;
  padding: 5px 14px; border-radius: 30px;
}

.filtros {
  display: flex; gap: 12px; align-items: flex-end; margin-bottom: 16px; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px;
}
.filtro-campo { display: flex; flex-direction: column; gap: 4px; }
.filtro-campo label { font-size: 0.72rem; font-weight: 600; color: var(--medium-gray); }
.filtro-campo input, .filtro-campo select {
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 0.84rem; font-family: inherit; background: #fff; color: var(--black);
}
.filtro-campo .btn { height: 40px; padding: 0 16px; }

/* Buscador ocupa el espacio flexible */
.filtro-buscar { flex: 1; min-width: 240px; }
.filtro-campo .search { position: relative; display: flex; align-items: center; }
.filtro-campo .search i { position: absolute; left: 12px; color: #9aa0aa; font-size: 0.85rem; }
.filtro-campo .search input {
  width: 100%; height: 40px; padding: 0 14px 0 34px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 0.86rem; font-family: inherit; background: #fff; color: var(--black);
}

.table-wrap {
  background: var(--white); border: 1px solid var(--line); border-radius: 16px;
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
}
/* barra de scroll discreta */
.table-wrap::-webkit-scrollbar { height: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: #d5d9e0; border-radius: 8px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
table.conv-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.conv-table thead th {
  text-align: left; padding: 13px 16px; font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--medium-gray); background: #fafbfc; border-bottom: 1px solid var(--line);
}
.conv-table tbody td { padding: 13px 16px; border-bottom: 1px solid #f0f1f4; font-size: 0.87rem; vertical-align: middle; transition: background 0.12s ease; }
.conv-table tbody tr:last-child td { border-bottom: none; }
.conv-table tbody tr:hover td { background: #fff1f1; }
.conv-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--red); }

.doc-cell { display: flex; align-items: center; gap: 10px; }
.doc-badge {
  width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 0.9rem; flex-shrink: 0;
  background: linear-gradient(135deg, var(--red), #ff5a5f);
}
.doc-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
@media (max-width: 1200px) { .doc-name { max-width: 180px; } }
.doc-name-row { display: flex; align-items: center; gap: 8px; }
.edit-titulo {
  flex-shrink: 0; border: 1px solid var(--line); background: #fff; color: #9aa0aa;
  width: 24px; height: 24px; border-radius: 6px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.68rem;
  transition: all 0.15s;
}
.edit-titulo:hover { border-color: var(--blue); color: var(--blue); }
.doc-sub { font-size: 0.74rem; color: var(--medium-gray); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 30px;
  font-size: 0.72rem; font-weight: 600;
}
.chip.acta-si { background: #e7f6ec; color: var(--ok); }
.chip.acta-no { background: #fff4e5; color: var(--warn); }
.chip.acta-nr { background: #f1f2f4; color: #6b7280; }
.chip.plat { background: #eef2ff; color: var(--blue); }

/* Celda de estado del acta con botón de alternar */
.acta-cell { display: inline-flex; align-items: center; gap: 6px; }
.acta-toggle {
  border: none; background: transparent; cursor: pointer; color: #9aa0aa;
  width: 24px; height: 24px; border-radius: 6px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 0.78rem; transition: all .15s;
}
.acta-toggle:hover { background: #f1f2f4; color: #6b7280; }

/* Botón toggle "Ocultar No requiere" */
.btn-toggle-nr {
  display: inline-flex; align-items: center; gap: 7px; height: 40px;
  padding: 0 14px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  font-family: inherit; font-size: 0.82rem; font-weight: 600;
  color: #6b7280; background: #f4f5f7; border: 1px solid #e2e5ea;
  transition: all .18s ease;
}
.btn-toggle-nr:hover { background: #eceef1; color: #4b5563; border-color: #d5d9e0; }
.btn-toggle-nr i { font-size: 0.85rem; }
.btn-toggle-nr.active {
  background: #fdecec; color: var(--red); border-color: #f6c9c9;
  box-shadow: 0 1px 3px rgba(227, 30, 36, 0.12);
}
.btn-toggle-nr.active:hover { background: #fbe0e0; }

.acciones { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; color: var(--medium-gray); display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--red); color: var(--red); }
.icon-btn.ver:hover { border-color: var(--blue); color: var(--blue); }
.icon-btn.ia { border-color: rgba(227,30,36,0.35); color: var(--red); }
.icon-btn.ia:hover { border-color: var(--red); color: #fff; background: var(--red); }
.icon-btn.ia-running { border-color: var(--warn); color: var(--warn); background: #fff4e5; }
.icon-btn.ia-done { border-color: var(--ok); color: #fff; background: var(--ok); }
.icon-btn.ia-done:hover { background: #15803d; }
.icon-btn.ia-error { border-color: var(--red); color: #fff; background: var(--red); }
.icon-btn.video:hover { border-color: var(--purple); color: var(--purple); }
.icon-btn.descargar:hover { border-color: var(--ok); color: var(--ok); }
.icon-btn.eliminar:hover { border-color: var(--red); color: var(--red); background: #fdecec; }

.empty { text-align: center; padding: 46px 20px; color: var(--medium-gray); }
.empty i { font-size: 2.2rem; color: #cfd4dc; margin-bottom: 10px; display: block; }

/* ---------- Footer ---------- */
.footer {
  padding: 20px 28px; border-top: 1px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: auto;
}
.footer img { height: 34px; object-fit: contain; }
.footer img.footer-logo-codeflex { height: 22px; }
.footer .sep { color: #cfd4dc; font-size: 1.3rem; }

/* ============================================================
 * Modal de detalle de reunión (SweetAlert2 custom)
 * ============================================================ */
.det-wrap { text-align: left; font-size: 0.88rem; color: var(--black); }
.det-head {
  display: flex; align-items: flex-start; gap: 14px; padding-bottom: 16px;
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.det-head .det-ico {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--red), #ff5a5f); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.det-head .det-title { font-size: 1.1rem; font-weight: 800; line-height: 1.3; }
.det-head .det-meta { font-size: 0.8rem; color: var(--medium-gray); margin-top: 4px; }
.det-tabs { display: flex; gap: 6px; margin: 16px 0 14px; flex-wrap: wrap; }
.det-tab {
  padding: 7px 14px; border-radius: 30px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--medium-gray);
}
.det-tab.active { background: var(--red); color: #fff; border-color: var(--red); }
.det-panel { display: none; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.det-panel.active { display: block; }

.det-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin-bottom: 12px; }
.det-field label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: #9aa0aa; font-weight: 700; }
.det-field p { font-size: 0.9rem; margin-top: 2px; }

.det-section-title { font-size: 0.82rem; font-weight: 700; color: var(--red); margin: 14px 0 8px; text-transform: uppercase; letter-spacing: 0.03em; }
.det-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.det-list li {
  background: #f6f8fb; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px;
  font-size: 0.85rem; display: flex; gap: 8px; align-items: flex-start;
}
.det-list li i { color: var(--red); margin-top: 3px; font-size: 0.7rem; }
.det-summary { background: #f6f8fb; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; line-height: 1.55; font-size: 0.88rem; }

.det-people { display: flex; flex-wrap: wrap; gap: 8px; }
.det-person {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line);
  border-radius: 30px; padding: 5px 12px 5px 5px;
}
.det-person .dp-av {
  width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 0.68rem; font-weight: 700;
}
.det-person .dp-info { line-height: 1.1; }
.det-person .dp-name { font-size: 0.8rem; font-weight: 600; }
.det-person .dp-mail { font-size: 0.68rem; color: var(--medium-gray); }

.det-block {
  border-left: 3px solid var(--red); background: #fafbfc; border-radius: 0 10px 10px 0;
  padding: 8px 14px; margin-bottom: 8px;
}
.det-block .db-head { font-size: 0.74rem; color: var(--medium-gray); margin-bottom: 3px; }
.det-block .db-speaker { font-weight: 700; color: var(--red); }
.det-block .db-words { font-size: 0.86rem; line-height: 1.5; }

.det-empty { color: #9aa0aa; font-size: 0.85rem; padding: 20px; text-align: center; }

.swal-wide { width: 720px !important; max-width: 94vw !important; }

/* ============================================================
 * Rutas (etiquetas + OneDrive)
 * ============================================================ */
.chip.etq { background: #eef2ff; color: var(--blue); font-family: 'Inter', monospace; }
.chip.etq-none { background: #f1f2f4; color: #9aa0aa; }

.etq-wrap { display: inline-flex; align-items: center; gap: 5px; }
.etq-copy {
  border: 1px solid var(--line); background: #fff; color: var(--medium-gray);
  width: 26px; height: 26px; border-radius: 7px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem;
  transition: all 0.15s;
}
.etq-copy:hover { border-color: var(--blue); color: var(--blue); }
.etq-copy.ok { border-color: var(--ok); color: var(--ok); background: #e7f6ec; }

.rutas-intro {
  color: var(--medium-gray); font-size: 0.9rem; line-height: 1.55;
  margin-bottom: 16px; max-width: 820px;
}
.rutas-intro code, .ruta-form code {
  background: #f1f2f4; padding: 1px 6px; border-radius: 6px; font-size: 0.85em; color: var(--red);
}

/* Celda de ruta en la tabla de reuniones */
.ruta-cell { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.etq-ruta-btn {
  border: 1px solid var(--line); background: #fff; color: var(--medium-gray);
  width: 26px; height: 26px; border-radius: 7px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem;
  transition: all 0.15s;
}
.etq-ruta-btn:hover { border-color: var(--purple); color: var(--purple); background: #f5f0ff; }

.ruta-info { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; }
.ruta-info-none { color: #9aa0aa; font-style: italic; }
.ruta-tag-manual { font-size: 0.62rem; font-weight: 700; color: var(--purple); background: #f3e8ff; padding: 1px 7px; border-radius: 20px; text-transform: uppercase; }
.ruta-tag-auto { font-size: 0.62rem; font-weight: 700; color: var(--ok); background: #e7f6ec; padding: 1px 7px; border-radius: 20px; text-transform: uppercase; }

.ruta-link, .ruta-link-txt {
  color: var(--blue); text-decoration: none; font-size: 0.82rem;
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;
}
.ruta-link:hover, .ruta-link-txt:hover { text-decoration: underline; }
.ruta-carpeta-cell { max-width: 320px; }
.ruta-link-txt { max-width: 300px; }

/* Mini modal de asignación de ruta */
.ras-wrap { text-align: left; }
.ras-intro { font-size: 0.86rem; color: var(--medium-gray); line-height: 1.5; margin-bottom: 12px; }
.ras-group-title { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #9aa0aa; margin: 14px 0 6px; }
.ras-opt {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 8px; cursor: pointer; transition: all 0.15s; background: #fff;
}
.ras-opt:hover { border-color: rgba(227,30,36,0.35); background: #fff7f7; }
.ras-opt input { width: 17px; height: 17px; accent-color: var(--red); cursor: pointer; flex-shrink: 0; }
.ras-opt input:checked ~ .ras-body { color: var(--black); }
.ras-opt:has(input:checked) { border-color: var(--red); background: #fff5f5; box-shadow: 0 2px 8px rgba(227,30,36,0.1); }
.ras-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ras-top { display: flex; align-items: center; gap: 6px; font-size: 0.86rem; flex-wrap: wrap; }
.ras-folder { font-size: 0.76rem; color: var(--blue); display: flex; align-items: center; gap: 5px; }
.ras-prim { font-size: 0.6rem; font-weight: 700; color: var(--ok); background: #e7f6ec; padding: 1px 7px; border-radius: 20px; text-transform: uppercase; }
.ras-none .ras-top { color: var(--medium-gray); }

/* Desplegable "Otras rutas" */
.ras-toggle {
  width: 100%; margin-top: 12px; padding: 11px 14px; border: 1px solid var(--line);
  background: #fafbfc; border-radius: 10px; cursor: pointer; font-family: inherit;
  font-size: 0.86rem; font-weight: 600; color: var(--medium-gray);
  display: flex; align-items: center; justify-content: space-between; transition: all 0.15s;
}
.ras-toggle:hover { border-color: rgba(227,30,36,0.35); color: var(--red); }
.ras-toggle.abierto { border-color: var(--red); color: var(--red); border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.ras-otras {
  max-height: 300px; overflow-y: auto; border: 1px solid var(--line); border-top: none;
  border-radius: 0 0 10px 10px; padding: 10px; background: #fff;
}
.ras-subgrupo { margin-bottom: 10px; }
.ras-sub-titulo {
  font-size: 0.7rem; font-weight: 700; color: var(--blue); text-transform: uppercase;
  letter-spacing: 0.03em; margin: 4px 0 6px; padding-bottom: 3px; border-bottom: 1px solid #eef1f5;
}

/* Formulario del modal de ruta */
.ruta-form { text-align: left; }
.rf-label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--black); margin: 14px 0 4px; }
.rf-req { color: var(--red); }
.rf-hint { font-size: 0.78rem; color: var(--medium-gray); margin-bottom: 6px; line-height: 1.4; }
.rf-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 0.88rem; font-family: inherit; background: #fff; color: var(--black); margin-bottom: 4px;
}
.rf-input:focus { outline: none; border-color: var(--red); }
.rf-preview { margin: 8px 0 4px; font-size: 0.82rem; color: var(--medium-gray); display: flex; align-items: center; gap: 8px; }
.rf-onedrive { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.rf-onedrive-note { font-size: 0.78rem; color: var(--medium-gray); }
.rf-check { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 0.86rem; cursor: pointer; }
.rf-check input { width: 17px; height: 17px; accent-color: var(--red); cursor: pointer; }

/* Carpeta seleccionada en el modal de ruta */
.rf-carpeta-sel {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #f6f8fb; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.rf-carpeta-info { display: flex; align-items: center; gap: 11px; min-width: 0; }
.rf-carpeta-info > i { color: #ffb300; font-size: 1.3rem; flex-shrink: 0; }
.rf-carpeta-info > div { min-width: 0; display: flex; flex-direction: column; }
.rf-carpeta-info b { font-size: 0.92rem; }
.rf-carpeta-path { font-size: 0.72rem; color: var(--medium-gray); word-break: break-all; margin-top: 1px; }
.rf-cambiar {
  flex-shrink: 0; border: 1px solid var(--line); background: #fff; color: var(--medium-gray);
  border-radius: 8px; padding: 7px 12px; font-size: 0.78rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; font-family: inherit; transition: all 0.15s;
}
.rf-cambiar:hover { border-color: #0078D4; color: #0078D4; }
.rf-buscar-btn {
  width: 100%; border: 1.5px dashed #cfd4dc; background: #fafbfc; color: #0078D4;
  border-radius: 12px; padding: 16px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px; font-family: inherit; transition: all 0.15s;
}
.rf-buscar-btn:hover { border-color: #0078D4; background: #f5faff; }

/* Navegador de carpetas de OneDrive */
.od-wrap { text-align: left; }
.od-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.od-tab {
  flex: 1; padding: 9px 12px; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; cursor: pointer; font-size: 0.82rem; font-weight: 600; color: var(--medium-gray);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-family: inherit;
}
.od-tab:hover { border-color: rgba(0,120,212,0.4); color: #0078D4; }
.od-tab.active { background: #0078D4; color: #fff; border-color: #0078D4; }
.od-hint { font-size: 0.82rem; color: var(--medium-gray); margin-bottom: 10px; }
.od-breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 12px; background: #f6f8fb; border: 1px solid var(--line);
  border-radius: 10px; font-size: 0.82rem; margin-bottom: 10px;
}
.od-crumb { cursor: pointer; color: var(--blue); display: inline-flex; align-items: center; gap: 4px; }
.od-crumb:hover { text-decoration: underline; }
.od-sep { color: #b0b5bd; font-size: 0.7rem; }
.od-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.od-toolbar .od-search { flex: 1; margin-bottom: 0; }
.od-check {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; cursor: pointer;
  font-size: 0.82rem; font-weight: 600; color: #6b7280;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f6f8fb;
  transition: all .15s;
}
.od-check:hover { border-color: rgba(0,120,212,0.4); color: #0078D4; }
.od-check input { width: 15px; height: 15px; cursor: pointer; accent-color: #0078D4; }
.od-search {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  transition: border-color .15s;
}
.od-search:focus-within { border-color: rgba(0,120,212,0.5); box-shadow: 0 0 0 3px rgba(0,120,212,0.08); }
.od-search i { color: #9aa0aa; font-size: 0.85rem; }
.od-search input { flex: 1; border: none; outline: none; font-family: inherit; font-size: 0.88rem; background: transparent; color: var(--black); }
.od-list { max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.od-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.od-item:hover { border-color: rgba(0,120,212,0.4); background: #f5faff; }
.od-item-name { display: flex; align-items: center; gap: 9px; font-size: 0.9rem; cursor: pointer; flex: 1; min-width: 0; }
.od-item-name i { color: #ffb300; }
.od-pick { flex-shrink: 0; }
.od-empty { text-align: center; color: #9aa0aa; padding: 24px; font-size: 0.86rem; }
.od-current { margin-top: 10px; font-size: 0.82rem; color: var(--medium-gray); }

/* ============================================================
 * Modal IA + Agentizador
 * ============================================================ */
.ia-modal { text-align: left; }
.ia-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ia-hero-ico {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--red), #ff5a5f); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.ia-hero-title { font-size: 1.15rem; font-weight: 800; }
.ia-hero-sub { font-size: 0.84rem; color: var(--medium-gray); margin-top: 2px; }
.ia-desc { font-size: 0.88rem; line-height: 1.55; color: var(--medium-gray); margin-bottom: 14px; }
.ia-steps-info { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.ia-step-info {
  display: flex; align-items: center; gap: 10px; font-size: 0.86rem;
  background: #f6f8fb; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.ia-step-info i { color: var(--red); width: 18px; text-align: center; }
.ia-ruta-box { font-size: 0.84rem; color: var(--medium-gray); }
.ia-ruta-ok { display: inline-flex; align-items: center; gap: 7px; color: var(--ok); font-weight: 600; margin-top: 4px; }
.ia-ruta-warn { display: flex; align-items: center; gap: 8px; color: var(--warn); background: #fff4e5; border: 1px solid #ffe0b2; border-radius: 10px; padding: 10px 12px; margin-top: 6px; font-size: 0.82rem; }

/* ---------- Consola tipo CMD del agentizador ---------- */
.agent-wrap { text-align: left; border-radius: 12px; overflow: hidden; border: 1px solid #333; }
.agent-hdr {
  background: #2d2d2d; padding: 9px 12px; display: flex; align-items: center; gap: 7px;
}
.agent-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.agent-dot.r { background: #ff5f56; } .agent-dot.y { background: #ffbd2e; } .agent-dot.g { background: #27c93f; }
.agent-hdr-txt { margin-left: 8px; color: #bbb; font-size: 0.76rem; font-family: 'Consolas','Monaco',monospace; }
.agent-console {
  background: #0c0c0c; color: #e0e0e0; padding: 16px; height: 300px; overflow-y: auto;
  font-family: 'Consolas','Monaco','Courier New',monospace; font-size: 0.82rem; line-height: 1.65;
}
.agent-console.done { box-shadow: inset 0 0 0 2px rgba(39,201,63,0.3); }
.ac-line { white-space: pre-wrap; word-break: break-word; }
.ac-cmd { color: #4ec9b0; font-weight: 600; }
.ac-run { color: #ffd479; }
.ac-ok { color: #27c93f; }
.ac-err { color: #ff6b6b; font-weight: 600; }
.ac-dim { color: #888; font-size: 0.78rem; }
.ac-done { color: #27c93f; font-weight: 700; letter-spacing: 1px; }

/* Panel agentizador (viejo, se conserva por compatibilidad) */
.agent-panel { text-align: left; }
.agent-step {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  font-size: 0.88rem; color: var(--medium-gray); transition: all 0.25s;
}
.agent-ico { width: 24px; text-align: center; font-size: 1rem; color: #cfd4dc; }
.agent-step.running { border-color: rgba(227,30,36,0.4); background: #fff7f7; color: var(--black); }
.agent-step.running .agent-ico { color: var(--red); }
.agent-step.done { border-color: rgba(22,163,74,0.4); background: #f2fbf5; color: var(--black); }
.agent-step.done .agent-ico { color: var(--ok); }
.agent-step.error { border-color: rgba(227,30,36,0.5); background: #fdecec; }
.agent-step.error .agent-ico { color: var(--red); }
.agent-log { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.agent-line { font-size: 0.8rem; color: var(--medium-gray); background: #f6f8fb; border-radius: 8px; padding: 6px 10px; }
.agent-line i { color: var(--ok); margin-right: 5px; }
.agent-err { font-size: 0.84rem; color: var(--red); background: #fdecec; border-radius: 8px; padding: 10px 12px; }
.agent-ok {
  font-size: 0.95rem; font-weight: 700; color: var(--ok); background: #e7f6ec;
  border: 1px solid #b7e4c7; border-radius: 10px; padding: 12px 14px; margin-top: 4px;
  display: flex; align-items: center; gap: 8px;
}
.agent-ok i { font-size: 1.1rem; }

/* ---------- Responsive tabla: portátiles (821px - 1200px) ---------- */
@media (min-width: 821px) and (max-width: 1200px) {
  .conv-table thead th { padding: 11px 12px; }
  .conv-table tbody td { padding: 11px 12px; font-size: 0.83rem; }
  .icon-btn { width: 32px; height: 32px; border-radius: 8px; }
  .acciones { gap: 4px; }
  .doc-badge { width: 34px; height: 34px; }
}

/* ---------- Responsive tabla ---------- */
@media (max-width: 820px) {
  .sidebar { width: 100%; height: auto; flex-direction: row; position: static; padding: 10px; justify-content: center; }
  .app-shell { flex-direction: column; }
  .side-logo { display: none; }
  .side-nav { flex-direction: row; }
  .table-wrap { overflow-x: hidden; }
  table.conv-table { min-width: 0; }
  .conv-table thead { display: none; }
  .conv-table tbody td { display: block; border: none; padding: 6px 16px; }
  .conv-table tbody tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; }
  .acciones { justify-content: flex-start; margin-top: 6px; }
  .doc-name { max-width: none; }
  .content { padding: 18px 14px; }
  .det-grid { grid-template-columns: 1fr; }
}


/* ============================================================
 * Tabla de Reuniones estilo consola AWS DynamoDB
 *  - La PÁGINA hace el scroll (no hay scroll interno).
 *  - Barra de paginación + fila de columnas se pegan al borde
 *    superior de la pantalla; las filas pasan por debajo.
 *  - IMPORTANTE: ningún ancestro puede tener overflow distinto de
 *    "visible", si no el position: sticky deja de funcionar.
 * ============================================================ */
.tabla-card {
  --pag-h: 52px;               /* alto de la barra de paginación */
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
}

/* Barra de paginación (fila 1, sticky) */
.tabla-pag-bar {
  position: sticky; top: 0; z-index: 30;
  height: var(--pag-h); box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 16px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
}
.pag-info { font-size: 0.85rem; color: var(--medium-gray); white-space: nowrap; }
.pag-btns { display: flex; align-items: center; gap: 2px; }
.pag-btn {
  min-width: 30px; height: 30px; padding: 0 6px; border: none; background: transparent;
  border-radius: 8px; font-family: inherit; font-size: 0.88rem; color: var(--blue);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.pag-btn:hover:not(:disabled):not(.active) { background: #f1f2f4; }
.pag-btn.active { color: var(--black); font-weight: 800; background: #f1f2f4; cursor: default; }
.pag-btn:disabled { color: #b0b5bd; cursor: not-allowed; }

/* Tabla de reuniones: sin wrapper con overflow, columnas con ancho fijo */
.tabla-card .conv-table { table-layout: fixed; width: 100%; min-width: 0; }
.tabla-card .conv-table col.c-reunion { width: 26%; }
.tabla-card .conv-table col.c-fecha   { width: 11%; }
.tabla-card .conv-table col.c-ruta    { width: 17%; }
.tabla-card .conv-table col.c-part    { width: 11%; }
.tabla-card .conv-table col.c-acta    { width: 15%; }
.tabla-card .conv-table col.c-acc     { width: 20%; }

/* Fila de columnas (fila 2, sticky justo debajo de la paginación) */
.tabla-card .conv-table thead th {
  position: sticky; top: var(--pag-h); z-index: 20;
  background: #fafbfc;
  box-shadow: 0 1px 0 0 var(--line);
  border-bottom: none;
  padding: 12px 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tabla-card .conv-table tbody td { padding: 12px 14px; overflow: hidden; }

/* Que el contenido se adapte al ancho de la columna */
.tabla-card .doc-name-row { min-width: 0; }
.tabla-card .doc-name { max-width: 100%; min-width: 0; }
.tabla-card .ruta-cell { max-width: 100%; min-width: 0; }
.tabla-card .ruta-link, .tabla-card .ruta-link-txt { max-width: 100%; }
.tabla-card .acta-cell { flex-wrap: wrap; }
.tabla-card .acciones { flex-wrap: nowrap; }

/* Esquinas redondeadas abajo sin usar overflow */
.tabla-card .conv-table tbody tr:last-child td:first-child { border-bottom-left-radius: 15px; }
.tabla-card .conv-table tbody tr:last-child td:last-child  { border-bottom-right-radius: 15px; }

@media (max-width: 1100px) {
  .tabla-card .conv-table thead th { font-size: 0.68rem; padding: 11px 10px; }
  .tabla-card .conv-table tbody td { padding: 11px 10px; }
  .tabla-card .icon-btn { width: 28px; height: 28px; border-radius: 7px; font-size: 0.78rem; }
  .tabla-card .acciones { gap: 3px; }
}

/* Móvil: tarjetas, sin fila de columnas */
@media (max-width: 820px) {
  .tabla-card .conv-table { table-layout: auto; }
  .tabla-card .conv-table colgroup { display: none; }
  .tabla-pag-bar { padding: 0 10px; }
  .pag-info { display: none; }
  .pag-btns { margin-left: auto; }
}

/* ---------- Tabla de Rutas (mismo sistema sticky) ---------- */
.tabla-card .conv-table col.r-etq  { width: 20%; }
.tabla-card .conv-table col.r-nom  { width: 22%; }
.tabla-card .conv-table col.r-carp { width: 34%; }
.tabla-card .conv-table col.r-prim { width: 12%; }
.tabla-card .conv-table col.r-acc  { width: 12%; }
.tabla-card .ruta-carpeta-cell { max-width: none; }
.tabla-card .chip.etq { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) {
  .tabla-card .conv-table col { width: auto; }
}
