/* ============================================================
   BERLO DESARROLLOS — Components (components.css)
   Pure Vanilla CSS • Bento UI • Floating Header & Command Dock
   ============================================================ */

/* ============================================================
   1. FLOATING APP HEADER (.app-header)
   ============================================================ */
.app-header {
  position: sticky;
  top: 0.75rem;
  z-index: 900;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  transition: all var(--trans-smooth);
}

/* Brand Logo Modus (modus_) */
.app-header .brand-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-decoration: none;
  padding: 0.1rem 0.4rem;
  flex-shrink: 0;
  user-select: none;
  transition: opacity 0.18s ease;
}

.app-header .brand-logo:hover {
  opacity: 0.85;
}

.brand-logo-wrap {
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}

.brand-logo-wrap .logo-text {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-main, 'Plus Jakarta Sans', sans-serif);
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-logo-wrap .logo-char {
  color: var(--logo-text-color, #ffffff);
  transition: color 0.2s ease;
}

/* Light & Dark theme text colors for modus_ */
[data-theme="light"] .brand-logo-wrap .logo-char {
  color: #064fd3;
}
[data-theme="dark"] .brand-logo-wrap .logo-char {
  color: #ffffff;
}

.brand-logo-wrap .logo-cursor {
  display: inline-block;
  color: var(--color-accent, #05f2d4);
  font-family: var(--font-main, 'Plus Jakarta Sans', sans-serif);
  font-weight: 800;
  font-size: 1.55rem;
  line-height: 1;
  margin-left: 1px;
  animation: pulseCursor 1.2s infinite ease-in-out;
  text-shadow: 0 0 10px rgba(5, 242, 212, 0.45);
}

@keyframes pulseCursor {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.18;
  }
}

/* Badge del tenant: va debajo del logo */
.brand-badge,
.brand-badge-below {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  margin-left: 0;
}

[data-theme="light"] .brand-badge,
[data-theme="light"] .brand-badge-below {
  color: #064fd3;
  background: rgba(6, 79, 211, 0.08);
  border: 1px solid rgba(6, 79, 211, 0.2);
}

[data-theme="dark"] .brand-badge,
[data-theme="dark"] .brand-badge-below {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

/* Omni Search Bar */
.ai-search-wrapper {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.ai-search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  transition: all var(--trans-fast);
}

.ai-search-bar:focus-within {
  border-color: var(--color-accent);
  box-shadow: 0 0 14px var(--color-accent-glow);
}

.ai-search-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ai-search-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor !important;
}

.ai-search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.85rem;
}

.ai-search-input::placeholder {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Mic Voice Button */
.search-mic-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--trans-fast);
  z-index: 4;
}

.ai-search-bar .search-mic-btn {
  position: static !important;
  transform: none !important;
  margin-right: 0.15rem;
}

.ai-search-bar .search-mic-btn:hover {
  transform: scale(1.1) !important;
}

.search-mic-btn svg {
  position: static !important;
  transform: none !important;
  left: auto !important;
  top: auto !important;
  width: 14px !important;
  height: 14px !important;
  pointer-events: auto !important;
  display: block;
}

.search-mic-btn:hover {
  color: var(--color-accent);
  background: var(--bg-hover);
  transform: translateY(-50%) scale(1.1);
}

.search-mic-btn.recording,
.btn-icon.recording {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15) !important;
  animation: micPulse 1.2s infinite ease-in-out;
}

@keyframes micPulse {

  0%,
  100% {
    transform: translateY(-50%) scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  50% {
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}

.search-input-wrap>svg:first-child,
.search-input-wrap .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
}

.search-input-wrap .form-control {
  padding-left: 34px !important;
  padding-right: 34px !important;
  width: 100%;
}

.search-shortcut {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Omni Search Results Dropdown */
.omni-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #0d1527;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.85);
  max-height: 420px;
  overflow-y: auto;
  z-index: 1000;
  padding: 0.5rem;
}

[data-theme="light"] .omni-search-dropdown {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.2);
}

.omni-group-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.4rem 0.6rem 0.2rem;
}

.omni-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.82rem;
  transition: all var(--trans-fast);
}

.omni-item:hover {
  background: var(--bg-hover);
  color: var(--color-accent);
}

[data-theme="light"] .omni-item:hover {
  color: var(--color-primary);
}

.omni-report-banner {
  background: linear-gradient(135deg, rgba(6, 79, 211, 0.18) 0%, rgba(5, 242, 212, 0.12) 100%);
  border: 1px solid rgba(5, 242, 212, 0.3);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all var(--trans-fast);
}

.omni-report-banner:hover {
  border-color: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(5, 242, 212, 0.15);
}

/* AI Assistant Suggested Actions Grid */
.ai-suggested-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-top: 0.65rem;
}

.ai-suggested-card {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  text-align: left;
  transition: all var(--trans-fast);
}

.ai-suggested-card:hover {
  background: var(--bg-hover);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .ai-suggested-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 14px rgba(6, 79, 211, 0.12);
}

.ai-card-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-card-title {
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 1px;
}

.ai-card-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.header-action-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.45rem;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans-fast);
  position: relative;
}

.header-action-btn:hover {
  color: var(--text-main);
  background: var(--bg-hover);
  border-color: var(--border-glass);
}

.header-action-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor !important;
}

/* User pill in header */
.header-user-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.65rem 0.25rem 0.25rem;
  border-radius: var(--radius-pill);
  background: var(--bg-hover);
  border: 1px solid var(--border-glass);
  text-decoration: none;
  color: var(--text-main);
  transition: all var(--trans-fast);
}

.header-user-pill:hover {
  background: var(--bg-active);
  border-color: var(--color-primary-glow);
}

.header-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User Workload Status Circle (Breathing Pulse) */
.user-workload-indicator {
  width: 9px;
  height: 9px;
  min-width: 9px;
  border-radius: 50%;
  background: var(--workload-optima, #10b981);
  display: inline-block;
  margin-left: 3px;
  margin-right: 2px;
  box-shadow: 0 0 6px var(--workload-optima, rgba(16, 185, 129, 0.6));
  animation: workloadBreathe 2.8s infinite ease-in-out;
  transition: all 0.3s ease;
}

.user-workload-indicator[data-nivel="optima"] {
  background: var(--workload-optima) !important;
  box-shadow: 0 0 6px var(--workload-optima) !important;
}
.user-workload-indicator[data-nivel="moderada"] {
  background: var(--workload-moderada) !important;
  box-shadow: 0 0 6px var(--workload-moderada) !important;
}
.user-workload-indicator[data-nivel="elevada"] {
  background: var(--workload-elevada) !important;
  box-shadow: 0 0 6px var(--workload-elevada) !important;
}
.user-workload-indicator[data-nivel="critica"] {
  background: var(--workload-critica) !important;
  box-shadow: 0 0 6px var(--workload-critica) !important;
}
.user-workload-indicator[data-nivel="extrema"] {
  background: var(--workload-extrema) !important;
  box-shadow: 0 0 6px var(--workload-extrema) !important;
}

@keyframes workloadBreathe {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }

  50% {
    transform: scale(1.25);
    opacity: 1;
    filter: brightness(1.2);
  }
}

.user-workload-indicator.carga-dot-pulse {
  animation: cargaCriticaPulse 1.1s infinite ease-in-out !important;
}

@keyframes cargaCriticaPulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6);
  }

  50% {
    transform: scale(1.35);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0);
  }
}

/* ============================================================
   2. FLOATING COMMAND DOCK (.floating-command-dock)
   ============================================================ */
.floating-command-dock {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: 95vw;
  transition: transform var(--trans-smooth), opacity var(--trans-smooth);
}

.dock-container {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-dock);
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  min-width: 52px;
  min-height: 48px;
  transition: all var(--trans-fast);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  position: relative;
}

.dock-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor !important;
  transition: transform var(--trans-bounce);
}

.dock-item .dock-label {
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
}

.dock-item:hover {
  color: var(--text-main);
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.dock-item:hover svg {
  transform: scale(1.1);
}

.dock-item.active {
  color: var(--color-accent);
  background: var(--bg-active);
  font-weight: 700;
}

[data-theme="light"] .dock-item.active {
  color: var(--color-primary);
  background: var(--color-primary-soft);
}

.dock-item.active svg {
  stroke: currentColor !important;
}

.dock-divider {
  width: 1px;
  height: 24px;
  background: var(--border-glass);
  margin: 0 0.2rem;
}

/* Flyout Navigation Menu / Modal */
.bento-flyout-menu {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px) scale(0.95);
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-dock);
  padding: 1.25rem;
  width: 90vw;
  max-width: 580px;
  z-index: 1050;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transition: all var(--trans-smooth);
}

.bento-flyout-menu.open {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0) scale(1);
}

.flyout-category-title {
  grid-column: 1 / -1;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  padding: 0.25rem 0.5rem;
  margin-top: 0.25rem;
}

[data-theme="light"] .flyout-category-title {
  color: var(--color-primary);
}

.flyout-card-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
  padding: 0.75rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  transition: all var(--trans-fast);
}

.flyout-card-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--color-accent);
  transform: translateY(-2px);
}

.flyout-card-item.active {
  background: var(--bg-active);
  border-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 700;
}

[data-theme="light"] .flyout-card-item.active {
  background: var(--color-primary-soft);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.flyout-card-item svg {
  width: 20px;
  height: 20px;
  stroke: currentColor !important;
}

.flyout-card-item span {
  font-size: 0.75rem;
  font-weight: 600;
}

/* Tareas & Soporte Flyout Variant */
.tareas-flyout-menu {
  max-width: 340px;
  grid-template-columns: repeat(2, 1fr);
  padding: 1rem;
}

.flyout-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--trans-fast);
}

.flyout-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* ============================================================
   3. BENTO GRID ARCHITECTURE (.bento-grid, .bento-card)
   ============================================================ */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
  width: 100%;
}

.bento-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all var(--trans-smooth);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.bento-card:hover {
  border-color: var(--border-card-hover);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* Spans */
.col-12 {
  grid-column: span 12;
}

.col-11 {
  grid-column: span 11;
}

.col-10 {
  grid-column: span 10;
}

.col-9 {
  grid-column: span 9;
}

.col-8 {
  grid-column: span 8;
}

.col-7 {
  grid-column: span 7;
}

.col-6 {
  grid-column: span 6;
}

.col-5 {
  grid-column: span 5;
}

.col-4 {
  grid-column: span 4;
}

.col-3 {
  grid-column: span 3;
}

.col-2 {
  grid-column: span 2;
}

.col-1 {
  grid-column: span 1;
}

.row-span-2 {
  grid-row: span 2;
}

.row-span-3 {
  grid-row: span 3;
}

@media (max-width: 1200px) {
  .col-9 {
    grid-column: span 12;
  }

  .col-4 {
    grid-column: span 6;
  }

  .col-3 {
    grid-column: span 6;
  }

  .col-2 {
    grid-column: span 6;
  }

  .row-span-2,
  .row-span-3 {
    grid-row: auto;
  }
}

@media (max-width: 1024px) {

  .col-11,
  .col-10,
  .col-9,
  .col-8,
  .col-7,
  .col-6,
  .col-5,
  .col-4,
  .col-3,
  .col-2 {
    grid-column: span 6;
  }

  .row-span-2,
  .row-span-3 {
    grid-row: auto;
  }
}

@media (max-width: 768px) {

  .col-11,
  .col-10,
  .col-9,
  .col-8,
  .col-7,
  .col-6,
  .col-5,
  .col-4,
  .col-3,
  .col-2,
  .col-1 {
    grid-column: span 12;
  }

  .row-span-2,
  .row-span-3 {
    grid-row: auto;
  }
}

/* Bento Hero Highlight Card */
.bento-hero {
  background: radial-gradient(circle at 90% 10%, rgba(6, 79, 211, 0.15) 0%, transparent 65%), var(--bg-card);
  border: 1px solid var(--border-card);
}

[data-theme="dark"] .bento-hero {
  background: radial-gradient(circle at 90% 10%, rgba(5, 242, 212, 0.12) 0%, rgba(6, 79, 211, 0.08) 50%, transparent 80%), var(--bg-card);
}

/* Bento Metric Tile */
.bento-metric {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.metric-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
}

.metric-tag.positive {
  background: var(--success-light);
  color: var(--success);
}

.metric-tag.warning {
  background: var(--warning-light);
  color: var(--warning);
}

.metric-tag.danger {
  background: var(--danger-light);
  color: var(--danger);
}

[data-theme="light"] .metric-tag.positive {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

[data-theme="light"] .metric-tag.warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

[data-theme="light"] .metric-tag.danger {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.metric-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.metric-value {
  font-size: clamp(1.75rem, 1.4rem + 1vw, 2.4rem);
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.metric-sparkline {
  flex-shrink: 0;
  width: 90px;
  height: 32px;
}

/* Bento Quick Actions */
.bento-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.75rem;
}

.bento-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 0.95rem;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--trans-fast);
}

.bento-action-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-2px);
}

[data-theme="light"] .bento-action-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.bento-action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor !important;
}

/* ============================================================
   4. BUTTONS & UI CONTROLS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--trans-fast);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor !important;
}

.btn-primary {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 4px 14px var(--color-primary-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--color-primary-glow);
}

.btn-accent {
  background: var(--color-accent);
  color: #070c18;
  border-color: var(--color-accent);
  font-weight: 700;
  box-shadow: 0 4px 14px var(--color-accent-glow);
}

.btn-accent:hover:not(:disabled) {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--color-accent-glow);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-main);
  border-color: var(--border-card);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-card-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-main);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.75rem 1.6rem;
  font-size: 1rem;
}

.btn-icon {
  padding: 0.5rem;
  border-radius: 50%;
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--color-accent);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--trans-fast), opacity var(--trans-fast);
}

.btn-link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

[data-theme="light"] .btn-link {
  color: var(--color-primary);
}

[data-theme="light"] .btn-link:hover {
  color: var(--color-primary-hover);
}

/* ============================================================
   5. BADGES & CHIPS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge svg {
  width: 12px;
  height: 12px;
  stroke: currentColor !important;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}

.badge-default {
  background: var(--bg-hover);
  color: var(--text-muted);
}

.badge-primary {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.badge-secondary {
  background: var(--color-accent-soft);
  color: var(--color-accent-hover);
}

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

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

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

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

/* Task / Project States */
.badge-borrador,
.badge-pendiente,
.badge-baja {
  background: var(--bg-hover);
  color: var(--text-muted);
}

.badge-enviado,
.badge-media,
.badge-info {
  background: var(--info-light);
  color: var(--info);
}

.badge-aprobado,
.badge-activo,
.badge-completado {
  background: var(--success-light);
  color: var(--success);
}

.badge-en_proceso,
.badge-pausado,
.badge-alta {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-rechazado,
.badge-urgente {
  background: var(--danger-light);
  color: var(--danger);
}

/* ── Light Mode Badges (WCAG 2.2 AA Contrast & Premium Aesthetics) ── */
[data-theme="light"] .badge-default,
[data-theme="light"] .badge-borrador,
[data-theme="light"] .badge-pendiente,
[data-theme="light"] .badge-baja {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

[data-theme="light"] .badge-primary {
  background: rgba(6, 79, 211, 0.08);
  color: #064fd3;
  border: 1px solid rgba(6, 79, 211, 0.22);
}

[data-theme="light"] .badge-secondary {
  background: #f0fdfa;
  color: #0d9488;
  border: 1px solid #99f6e4;
}

[data-theme="light"] .badge-success,
[data-theme="light"] .badge-aprobado,
[data-theme="light"] .badge-activo,
[data-theme="light"] .badge-completado {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

[data-theme="light"] .badge-warning,
[data-theme="light"] .badge-en_proceso,
[data-theme="light"] .badge-pausado,
[data-theme="light"] .badge-alta {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

[data-theme="light"] .badge-danger,
[data-theme="light"] .badge-rechazado,
[data-theme="light"] .badge-urgente {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

[data-theme="light"] .badge-info,
[data-theme="light"] .badge-enviado,
[data-theme="light"] .badge-media {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* ============================================================
   6. FORMS & INPUTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.95rem;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.5;
  transition: all var(--trans-fast);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
  background: var(--bg-input);
}

[data-theme="light"] .form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.form-control:disabled {
  background: var(--bg-hover);
  color: var(--text-muted);
  cursor: not-allowed;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  padding-right: 2.5rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.form-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.form-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 640px) {

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   7. TABLES & LISTINGS
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  background: var(--bg-card);
}

table.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead th {
  padding: 0.85rem 1.15rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
  text-align: left;
}

.table tbody td {
  padding: 0.95rem 1.15rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-card);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background var(--trans-fast);
}

.table tbody tr:hover {
  background: var(--bg-hover);
}

.table .col-actions {
  text-align: right;
  white-space: nowrap;
}

/* Progress bar inside cards */
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--bg-hover);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
  border-radius: var(--radius-pill);
  transition: width var(--trans-smooth);
}

/* ============================================================
   8. NOTIFICATIONS & MODALS
   ============================================================ */
.notif-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 17px;
  height: 17px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
  border: 1.5px solid var(--bg-surface);
  line-height: 1;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: -8px;
  width: 360px;
  max-width: 92vw;
  background: rgba(13, 20, 36, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  z-index: 1050;
  overflow: hidden;
  animation: notifPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: top right;
}

[data-theme="light"] .notif-dropdown {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.15), 0 4px 16px rgba(15, 23, 42, 0.06);
}

@keyframes notifPopIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.notif-dd-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.notif-dd-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.notif-dd-title svg {
  color: var(--color-accent);
}

[data-theme="light"] .notif-dd-title svg {
  color: var(--color-primary);
}

.notif-btn-readall {
  background: transparent;
  border: 1px solid transparent;
  color: var(--color-accent);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--trans-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.notif-btn-readall:hover {
  background: rgba(5, 242, 212, 0.1);
  border-color: rgba(5, 242, 212, 0.2);
  color: var(--color-accent-hover);
}

[data-theme="light"] .notif-btn-readall {
  color: var(--color-primary);
}

[data-theme="light"] .notif-btn-readall:hover {
  background: rgba(6, 79, 211, 0.08);
  border-color: rgba(6, 79, 211, 0.15);
}

.notif-list-container,
.notif-list {
  max-height: 350px;
  overflow-y: auto;
  padding: 6px 0;
  overscroll-behavior: contain;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  margin: 3px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-main);
  transition: all var(--trans-fast);
  position: relative;
}

.notif-item:hover {
  background: var(--bg-hover);
  transform: translateX(2px);
}

.notif-item.no-leida {
  background: rgba(6, 79, 211, 0.08);
}

[data-theme="light"] .notif-item.no-leida {
  background: rgba(6, 79, 211, 0.04);
}

.notif-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.notif-icon-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.notif-icon-info {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.notif-icon-primary {
  background: rgba(139, 92, 246, 0.12);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.notif-icon-success {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.notif-icon-purple {
  background: rgba(168, 85, 247, 0.14);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.28);
}

.notif-content-wrap {
  flex: 1;
  min-width: 0;
}

.notif-titulo {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.38;
  margin-bottom: 3px;
  word-break: break-word;
}

.notif-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.notif-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 6px var(--color-accent);
  flex-shrink: 0;
  margin-top: 6px;
}

[data-theme="light"] .notif-unread-dot {
  background: var(--color-primary);
  box-shadow: 0 0 6px rgba(6, 79, 211, 0.4);
}

.notif-empty-state {
  padding: 28px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.notif-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.notif-empty-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.notif-dd-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  width: 100%;
  transition: all var(--trans-fast);
}

.notif-footer-link:hover {
  background: rgba(5, 242, 212, 0.08);
  color: var(--color-accent-hover);
}

[data-theme="light"] .notif-footer-link {
  color: var(--color-primary);
}

[data-theme="light"] .notif-footer-link:hover {
  background: rgba(6, 79, 211, 0.06);
  color: var(--color-primary-hover);
}

.notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
  margin-top: 5px;
}

/* ============================================================
   8. NOTIFICATIONS & MODALS (SOLID HIGH LEGIBILITY)
   ============================================================ */

/* Modal Backdrop Overlay */
.modal-overlay,
div.modal {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(4, 7, 16, 0.82) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  z-index: 2000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

[data-theme="light"] .modal-overlay,
[data-theme="light"] div.modal {
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

.modal-overlay.hidden,
div.modal.hidden {
  display: none !important;
}

/* Modal Window Container / Box */
.modal-box,
.modal-content,
.modal-container,
.modal-dialog,
.modal-overlay>.modal,
.modal>.card,
.modal>.modal-content {
  background: #0d1527 !important;
  /* Rich solid obsidian in dark mode */
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
  width: 100% !important;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 10;
  color: var(--text-main);
  animation: modalZoomIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-theme="light"] .modal-box,
[data-theme="light"] .modal-content,
[data-theme="light"] .modal-container,
[data-theme="light"] .modal-dialog,
[data-theme="light"] .modal-overlay>.modal,
[data-theme="light"] .modal>.card,
[data-theme="light"] .modal>.modal-content {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05) !important;
}

@keyframes modalZoomIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Modal Header */
.modal-header,
.modal>.card>div:first-child,
.modal-content>div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .modal-header,
[data-theme="light"] .modal>.card>div:first-child,
[data-theme="light"] .modal-content>div:first-child {
  border-bottom: 1px solid #e2e8f0;
}

.modal-title,
.modal-header h2,
.modal-header h3,
.modal-box h2,
.modal-content h2,
.modal-content h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.01em;
}

/* Modal Close Button */
.modal-close,
.modal .modal-header .btn-icon,
.modal-box .btn-icon,
.modal-content .btn-icon {
  background: transparent !important;
  border: none !important;
  cursor: pointer;
  color: var(--text-muted) !important;
  padding: 6px !important;
  border-radius: 50% !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans-fast);
  line-height: 1;
}

.modal-close:hover,
.modal .modal-header .btn-icon:hover,
.modal-box .btn-icon:hover,
.modal-content .btn-icon:hover {
  color: var(--text-main) !important;
  background: var(--bg-hover) !important;
  transform: scale(1.1);
}

/* Modal Body */
.modal-body {
  padding: 1.5rem;
}

/* Form Controls inside Modals (Maximum Sharpness & Readability) */
.modal .form-control,
.modal-box .form-control,
.modal-content .form-control,
.modal-container .form-control,
.modal select,
.modal input[type="text"],
.modal input[type="date"],
.modal input[type="number"],
.modal input[type="email"],
.modal input[type="password"],
.modal input[type="file"],
.modal textarea {
  background: #080e1d !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) inset;
}

.modal .form-control:focus,
.modal-box .form-control:focus,
.modal-content .form-control:focus,
.modal select:focus,
.modal input:focus,
.modal textarea:focus {
  border-color: var(--color-accent) !important;
  box-shadow: 0 0 0 3px rgba(5, 242, 212, 0.22) !important;
  background: #0a1122 !important;
}

[data-theme="light"] .modal .form-control,
[data-theme="light"] .modal-box .form-control,
[data-theme="light"] .modal-content .form-control,
[data-theme="light"] .modal-container .form-control,
[data-theme="light"] .modal select,
[data-theme="light"] .modal input,
[data-theme="light"] .modal textarea {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05) inset;
}

[data-theme="light"] .modal .form-control:focus,
[data-theme="light"] .modal-box .form-control:focus,
[data-theme="light"] .modal-content .form-control:focus,
[data-theme="light"] .modal select:focus,
[data-theme="light"] .modal input:focus,
[data-theme="light"] .modal textarea:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px rgba(6, 79, 211, 0.15) !important;
  background: #ffffff !important;
}

/* Modal Labels */
.modal .form-label,
.modal-box .form-label,
.modal-content .form-label,
.modal label {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: var(--text-secondary) !important;
  margin-bottom: 0.4rem !important;
  display: block;
}

/* Modal Footer */
.modal-footer {
  padding: 1.15rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .modal-footer {
  border-top: 1px solid #e2e8f0;
  background: rgba(0, 0, 0, 0.01);
}

/* Kanban */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }
}

.kanban-col {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.kanban-col-header {
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-card);
  background: var(--bg-hover);
}

.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kanban-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.kanban-col[data-estado="pendiente"] .kanban-col-dot {
  background: var(--state-pendiente);
}

.kanban-col[data-estado="en_proceso"] .kanban-col-dot {
  background: var(--state-en-proceso);
}

.kanban-col[data-estado="en_revision"] .kanban-col-dot {
  background: var(--state-en-revision);
}

.kanban-col[data-estado="completado"] .kanban-col-dot {
  background: var(--state-completado);
}

.kanban-cards {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 80px;
}

.task-card {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  cursor: grab;
  transition: all var(--trans-fast);
}

.task-card:hover {
  border-color: var(--border-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Page Header Title */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: var(--text-xl);
  font-weight: 800;
}

.page-header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ============================================================
   9. EMPTY STATES & PROJECT CARDS
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--text-muted);
  gap: 0.75rem;
  width: 100%;
}

.empty-state svg {
  width: 42px !important;
  height: 42px !important;
  stroke: var(--text-muted) !important;
  opacity: 0.35;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 320px;
}

.project-card {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: all var(--trans-fast);
  text-decoration: none;
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.project-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.project-client {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ============================================================
   10. BENTO PROFILE HERO & VAULT ARCHITECTURE (Berlo Flow)
   ============================================================ */
.bento-profile-hero {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.bento-profile-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
}

.profile-main-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-width: 280px;
}

.profile-avatar-box {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-primary) 0%, #1e3a8a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
  border: 2px solid var(--border-card);
  box-shadow: 0 8px 24px var(--color-primary-glow);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .profile-avatar-box {
  border-color: rgba(5, 242, 212, 0.25);
}

.profile-title-area h1 {
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.85rem);
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.4rem 0;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-chips-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.info-chip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  background: var(--bg-hover);
  border: 1px solid var(--border-card);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--trans-fast);
}

.info-chip-link:hover {
  background: var(--bg-active);
  color: var(--color-primary);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

[data-theme="dark"] .info-chip-link:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.info-chip-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.profile-stats-pills {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.profile-stat-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0.5rem 1rem;
  background: var(--bg-hover);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  min-width: 110px;
}

.profile-stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.profile-stat-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

/* ── Modern Bento Info List ──────────────────────────────── */
.bento-info-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bento-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-hover);
  border: 1px solid var(--border-card);
  font-size: 0.825rem;
  gap: 0.75rem;
  transition: all var(--trans-fast);
}

.bento-info-row:hover {
  border-color: var(--border-card-hover);
}

.bento-info-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.bento-info-label svg {
  width: 15px;
  height: 15px;
  color: var(--color-primary);
}

[data-theme="dark"] .bento-info-label svg {
  color: var(--color-accent);
}

.bento-info-val {
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
  word-break: break-all;
}

/* ── Vault Cards (Obsidian / High Tech) ──────────────────── */
.vault-bento-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.vault-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  gap: 1rem;
  transition: all var(--trans-smooth);
}

.vault-item-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(5, 242, 212, 0.1);
  transform: translateY(-1px);
}

[data-theme="light"] .vault-item-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 16px var(--color-primary-soft);
}

.vault-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-card);
}

[data-theme="dark"] .vault-icon-box {
  background: rgba(5, 242, 212, 0.12);
  color: var(--color-accent);
  border-color: rgba(5, 242, 212, 0.25);
}

.vault-icon-box svg {
  width: 18px;
  height: 18px;
}

.vault-name-text {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-main);
}

.vault-user-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* ── Tab Pills Modern ────────────────────────────────────── */
.bento-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.bento-tab-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  cursor: pointer;
  transition: all var(--trans-fast);
  white-space: nowrap;
}

.bento-tab-pill:hover {
  color: var(--text-main);
  background: var(--bg-hover);
  border-color: var(--border-card-hover);
}

.bento-tab-pill.active {
  color: #ffffff;
  background: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 4px 14px var(--color-primary-glow);
}

[data-theme="dark"] .bento-tab-pill.active {
  color: #070c18;
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 4px 14px var(--color-accent-glow);
}

/* ── Asistente MiA: Animación Pensando / Generando Reporte ── */
.ai-thinking-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.85rem 1.15rem;
  background: var(--bg-hover);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  max-width: 88%;
  align-self: flex-start;
  animation: fadeIn 0.25s ease forwards;
}

.ai-thinking-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(5, 242, 212, 0.12);
  color: var(--color-accent, #05f2d4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: pulseSpark 1.6s infinite ease-in-out;
}

@keyframes pulseSpark {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(5, 242, 212, 0);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 12px rgba(5, 242, 212, 0.4);
  }
}

.ai-thinking-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-thinking-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 2px;
}

.ai-thinking-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent, #05f2d4);
  display: inline-block;
  animation: bounceDot 1.4s infinite ease-in-out both;
}

.ai-thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-thinking-dots span:nth-child(2) { animation-delay: -0.16s; }
.ai-thinking-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes bounceDot {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.4;
  }
  40% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.ai-thinking-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ============================================================
   12. TABULAR PAGINATION COMPONENT (.pagination-toolbar)
   ============================================================ */
.pagination-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card, #0d1424);
  border: 1px solid var(--border-card, rgba(255, 255, 255, 0.08));
  border-top: none;
  border-radius: 0 0 var(--radius-lg, 18px) var(--radius-lg, 18px);
  font-size: 0.82rem;
  color: var(--text-muted, #94a3b8);
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  transition: all var(--trans-fast);
}

[data-theme="light"] .pagination-toolbar {
  background: #ffffff;
  border-color: var(--border, #e2e8f0);
}

.pagination-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.pagination-info {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted, #94a3b8);
}

.pagination-info strong {
  color: var(--text-main, #ffffff);
  font-weight: 700;
}

.pagination-per-page {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.pagination-per-page-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.pagination-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.pagination-select {
  appearance: none;
  background: var(--bg-input, #070c18);
  border: 1px solid var(--border-card, rgba(255, 255, 255, 0.12));
  color: var(--text-main, #ffffff);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.3rem 1.8rem 0.3rem 0.65rem;
  border-radius: var(--radius-pill, 999px);
  outline: none;
  cursor: pointer;
  transition: all var(--trans-fast);
}

[data-theme="light"] .pagination-select {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.pagination-select:focus,
.pagination-select:hover {
  border-color: var(--color-primary, #064fd3);
}

.pagination-select option {
  background: #0d1424;
  color: #ffffff;
}

[data-theme="light"] .pagination-select option {
  background: #ffffff;
  color: #0f172a;
}

.pagination-select-icon {
  position: absolute;
  right: 8px;
  pointer-events: none;
  color: var(--text-muted);
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 32px;
  height: 32px;
  padding: 0 0.5rem;
  border-radius: 8px;
  background: var(--bg-input, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-card, rgba(255, 255, 255, 0.08));
  color: var(--text-muted, #94a3b8);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--trans-fast);
  text-decoration: none;
  user-select: none;
}

[data-theme="light"] .pagination-btn {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-hover, rgba(6, 79, 211, 0.08));
  color: var(--color-primary, #064fd3);
  border-color: var(--color-primary, #064fd3);
}

.pagination-btn.active {
  background: var(--color-primary, #064fd3) !important;
  color: #ffffff !important;
  border-color: var(--color-primary, #064fd3) !important;
  box-shadow: 0 2px 8px var(--color-primary-glow, rgba(6, 79, 211, 0.35));
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 32px;
  color: var(--text-muted);
  font-weight: 700;
}

/* ============================================================
   RICH TEXT CONTENT (Presupuestos, Propuestas, Documentos)
   ============================================================ */
.rich-text-content {
  color: var(--text-secondary);
  line-height: 1.7;
}

.rich-text-content h1,
.rich-text-content h2,
.rich-text-content h3,
.rich-text-content h4,
.rich-text-content h5,
.rich-text-content h6 {
  color: var(--text-main) !important;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.rich-text-content p {
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.rich-text-content strong,
.rich-text-content b {
  color: var(--text-main) !important;
  font-weight: 700;
}

.rich-text-content ul,
.rich-text-content ol {
  padding-left: 1.4rem;
  margin-bottom: 0.85rem;
}

.rich-text-content li {
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
}

.rich-text-content a {
  color: var(--color-accent);
  text-decoration: underline;
}

/* Forzar sobreescritura de colores inline rígidos generados por editores (Quill, copiado/pegado con color: rgb(34,34,34) o negros) en modo oscuro */
[data-theme="dark"] .rich-text-content [style*="color"],
:not([data-theme="light"]) .rich-text-content [style*="color"] {
  color: inherit !important;
}

[data-theme="dark"] .rich-text-content strong,
[data-theme="dark"] .rich-text-content b,
:not([data-theme="light"]) .rich-text-content strong,
:not([data-theme="light"]) .rich-text-content b {
  color: var(--text-main) !important;
}