:root {
  --primary: #1e3a8a; /* Azul institucional elegante */
  --primary-light: #3b82f6;
  --primary-dark: #172554;
  --accent: #0284c7;
  --accent-light: #e0f2fe;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-dark: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --urgency-alta: #ef4444;
  --urgency-alta-bg: #fee2e2;
  --urgency-media: #f59e0b;
  --urgency-media-bg: #fef3c7;
  --urgency-baja: #10b981;
  --urgency-baja-bg: #d1fae5;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   TOP NAVIGATION & BRANDING
   ========================================================================== */
.top-nav {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 28px;
  background: var(--accent-light);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.view-switch-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.view-buttons {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 8px;
  gap: 4px;
}

.btn-toggle {
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-toggle.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   BADGES & BUTTONS GENERALES
   ========================================================================== */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-accent {
  background-color: var(--accent-light);
  color: var(--accent);
}

.badge-urgency-alta {
  background-color: var(--urgency-alta-bg);
  color: var(--urgency-alta);
}

.badge-urgency-media {
  background-color: var(--urgency-media-bg);
  color: var(--urgency-media);
}

.badge-urgency-baja {
  background-color: var(--urgency-baja-bg);
  color: var(--urgency-baja);
}

.btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-dark);
  color: var(--text-main);
}
.btn-outline:hover {
  background-color: #f8fafc;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-accent-block {
  width: 100%;
  background-color: #0284c7;
  color: white;
  padding: 10px;
}
.btn-accent-block:hover {
  background-color: #0369a1;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */
.main-container {
  flex: 1;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
}

.view-section {
  display: none;
  flex: 1;
}

.view-section.active {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   MODO 1: SIMULADOR DE OUTLOOK (3 COLUMNAS)
   ========================================================================== */
.outlook-sim-container {
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  gap: 16px;
  flex: 1;
  min-height: calc(100vh - 120px);
}

/* Columna 1: Inbox */
.outlook-inbox-col {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.inbox-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inbox-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.inbox-title h3 {
  font-size: 1rem;
  font-weight: 700;
}

.inbox-count {
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text-muted);
}

.search-bar {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
}
.search-bar input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.85rem;
  outline: none;
}
.search-bar input:focus {
  border-color: var(--primary-light);
}

.email-list {
  flex: 1;
  overflow-y: auto;
}

.email-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.15s ease;
}
.email-item:hover {
  background: #f8fafc;
}
.email-item.active {
  background: #eff6ff;
  border-left: 4px solid var(--primary);
}

.email-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.email-item-sender {
  font-weight: 600;
  font-size: 0.85rem;
}
.email-item-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.email-item-subject {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-item-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Columna 2: Panel de lectura */
.outlook-reading-col {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.reading-pane {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  color: var(--text-muted);
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.email-details-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.email-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.email-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.email-subject-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--primary-dark);
}

.sender-card {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sender-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.sender-info strong {
  display: block;
  font-size: 0.95rem;
}
.sender-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.email-body-text {
  font-size: 0.95rem;
  white-space: pre-wrap;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 30px;
}

.reading-quick-reply-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-top: auto;
}
.reading-quick-reply-box h4 {
  font-size: 0.9rem;
  color: var(--primary);
  margin-bottom: 8px;
}
.reply-textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.88rem;
  margin-bottom: 10px;
  resize: vertical;
}
.reply-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.alert-success {
  margin-top: 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
}

/* Columna 3: BARRA LATERAL DEL ASISTENTE */
.outlook-sidebar-col {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  background: #0f172a;
  color: white;
  padding: 14px 16px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-title h3 {
  font-size: 0.95rem;
  font-weight: 700;
}
.pill-live {
  background: #22c55e;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
}

.sidebar-content {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
}
.card-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
}
.ai-summary {
  font-size: 0.85rem;
  color: #1e293b;
  margin-bottom: 8px;
}
.type-indicator {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.quick-finca-data {
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.finca-data-row {
  display: flex;
  justify-content: space-between;
}
.finca-data-row .lbl {
  color: var(--text-muted);
}
.badge-insurance {
  color: var(--primary);
  font-weight: 600;
}

.action-items-list {
  list-style: none;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.action-items-list li {
  position: relative;
  padding-left: 18px;
  color: #1e293b;
}
.action-items-list li::before {
  content: "➔";
  position: absolute;
  left: 0;
  color: var(--primary-light);
}

.quick-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.quick-buttons-grid .btn {
  font-size: 0.78rem;
  padding: 6px;
}

/* ==========================================================================
   MODO 2: PANEL CENTRAL DEL ADMINISTRADOR
   ========================================================================== */
.dashboard-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
}
.dash-tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}
.dash-tab:hover {
  color: var(--primary);
}
.dash-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.dash-tab-pane {
  display: none;
  flex: 1;
}
.dash-tab-pane.active {
  display: block;
}

/* Pestaña 1: Fincas */
.dashboard-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  min-height: 500px;
}
.communities-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}
.communities-selector-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.community-card-select {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.community-card-select:hover {
  background: #f8fafc;
  border-color: var(--primary-light);
}
.community-card-select.active {
  background: #eff6ff;
  border-color: var(--primary);
}
.community-timeline-pane {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
}

/* Pestaña 2: Redactor Legal */
.legal-generator-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
}
.generator-controls-card, .generator-preview-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
}
.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.form-group {
  margin-bottom: 14px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.form-select, .form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
}
.form-select:focus, .form-input:focus {
  border-color: var(--primary-light);
  outline: none;
}
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.doc-output-textarea {
  width: 100%;
  height: 520px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  background: #f8fafc;
  resize: vertical;
}

/* Pestaña 3: Agenda */
.calendar-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}
.calendar-list-card, .calendar-tips-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
}
.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.calendar-events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.event-item-card {
  padding: 14px;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  background: #f8fafc;
}
.event-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.event-item-title {
  font-weight: 700;
  font-size: 0.95rem;
}
.event-item-date {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}
.event-item-loc {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.tip-box {
  background: #fefce8;
  border: 1px solid #fef08a;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-top: 10px;
  line-height: 1.4;
}

/* Pestaña 4: Consultorio Chat */
.chat-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  height: 600px;
  overflow: hidden;
}
.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.message-bubble {
  display: flex;
  gap: 10px;
  max-width: 80%;
}
.message-bubble.assistant {
  align-self: flex-start;
}
.message-bubble.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.msg-content {
  background: #f1f5f9;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}
.message-bubble.user .msg-content {
  background: var(--primary);
  color: white;
}
.chat-input-bar {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
}
.chat-input-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  outline: none;
}
.chat-quick-suggestions {
  padding: 8px 20px 14px;
  display: flex;
  gap: 8px;
}
.suggestion-chip {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.75rem;
  cursor: pointer;
}
.suggestion-chip:hover {
  background: #e2e8f0;
}

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-card {
  background: white;
  width: 500px;
  max-width: 90%;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}
.modal-body {
  padding: 20px;
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}

/* Timeline Finca */
.timeline-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.timeline-item {
  border-left: 2px solid var(--primary-light);
  padding-left: 14px;
  position: relative;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}
.timeline-title {
  font-weight: 600;
  font-size: 0.9rem;
}
.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.timeline-desc {
  font-size: 0.85rem;
  color: #334155;
  margin-top: 4px;
}

/* ==========================================================================
   PANTALLA DE BLOQUEO DE SEGURIDAD (PIN)
   ========================================================================== */
.lock-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.lock-card {
  background: white;
  width: 420px;
  max-width: 90%;
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.lock-icon {
  font-size: 40px;
  margin-bottom: 8px;
}
.lock-card h2 {
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.lock-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.pin-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.pin-input-group input {
  flex: 1;
  text-align: center;
  font-size: 1.2rem;
  letter-spacing: 4px;
  padding: 10px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  outline: none;
}
.pin-input-group input:focus {
  border-color: var(--primary);
}
.lock-remember {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-align: left;
}
.pin-error {
  color: #ef4444;
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 8px;
}
.pin-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 14px;
  background: #f8fafc;
  padding: 8px;
  border-radius: 6px;
}

/* ==========================================================================
   PESTAÑA DE AJUSTES Y CONFIGURACIÓN (WhatsApp, BOE, Correo, Seguridad)
   ========================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}
.settings-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.settings-title-group {
  display: flex;
  gap: 10px;
}
.settings-icon {
  font-size: 24px;
}
.settings-card-header h3 {
  font-size: 1.05rem;
  color: var(--primary-dark);
}
.settings-body-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* WhatsApp QR Box */
.qr-connection-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}
.qr-display {
  background: #f8fafc;
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  width: 100%;
  padding: 20px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mock-qr-code {
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: inline-block;
  margin-bottom: 10px;
}
.qr-instructions {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: left;
}
.qr-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}
.qr-actions .btn {
  flex: 1;
}

/* Sincronización Stats */
.sync-stats-box {
  display: flex;
  gap: 16px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.stat-item {
  flex: 1;
  text-align: center;
}
.stat-number {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Documentos de la Comunidad */
.docs-vault-section {
  margin-top: 24px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
}
.docs-vault-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.docs-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.doc-file-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.doc-file-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.doc-file-title {
  font-size: 0.85rem;
  font-weight: 600;
}
.doc-file-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.doc-file-summary {
  font-size: 0.78rem;
  color: #475569;
  margin-top: 4px;
  line-height: 1.3;
}

/* ==========================================================================
   MICRÓFONO Y DICTADO DE VOZ EN EL PC (Web Speech API)
   ========================================================================== */
.btn-mic {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  font-size: 1.2rem;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-mic:hover {
  background: #e2e8f0;
}
.btn-mic.recording {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  animation: pulse-mic 1.2s infinite;
}
@keyframes pulse-mic {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}


