/* CRM Layout - Similar to Dashboard */
.crm-body {
  display: flex;
  min-height: 100vh;
  background: var(--bg-gradient, var(--bg));
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}

/* Sidebar */
.crm-sidebar {
  width: 280px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}

.crm-sidebar .sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.crm-sidebar .sidebar-header .theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
  color: var(--text);
  padding: 0;
  flex-shrink: 0;
}

.crm-sidebar .sidebar-header .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
  transform: scale(1.05);
}

.crm-sidebar .sidebar-header .theme-toggle-btn:active {
  transform: scale(0.95);
}

.crm-sidebar .sidebar-header .logo {
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  transition: color 0.3s ease;
  flex: 1;
}

.crm-sidebar .sidebar-header .logo span {
  color: var(--accent);
  transition: color 0.3s ease;
}

.admin-badge {
  background: var(--accent);
  color: #000;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
  vertical-align: middle;
}

.crm-sidebar .sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.crm-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.crm-sidebar .nav-item:hover {
  background: rgba(255, 106, 0, 0.05);
  color: var(--text);
}

.crm-sidebar .nav-item.active {
  background: rgba(255, 106, 0, 0.1);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.crm-sidebar .nav-icon {
  font-size: 20px;
  width: 24px;
  text-align: center;
}

.crm-sidebar .nav-label {
  font-size: 15px;
}

.crm-sidebar .sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.crm-sidebar .btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.crm-sidebar .btn-logout:hover {
  background: rgba(255, 106, 0, 0.1);
  border-color: var(--accent);
  color: var(--text);
}

/* Main Content */
.crm-main {
  flex: 1;
  margin-left: 280px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.crm-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(20, 20, 22, 0.8);
}

.crm-header .header-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.crm-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.crm-header .header-actions {
  display: flex;
  gap: 12px;
}

.crm-header .btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s ease;
}

.crm-header .btn-icon:hover {
  background: rgba(255, 106, 0, 0.1);
  border-color: var(--accent);
}

/* Content Sections */
.crm-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Welcome Card */
.welcome-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
  text-align: center;
}

.welcome-card h2 {
  font-size: 32px;
  margin: 0 0 8px;
  color: var(--text);
}

.welcome-card p {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-icon {
  font-size: 32px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 106, 0, 0.1);
  border-radius: 12px;
  flex-shrink: 0;
}

.stat-content h3 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--text);
}

.stat-content p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* Quick Actions */
.quick-actions {
  margin-top: 32px;
}

.quick-actions h3 {
  font-size: 20px;
  margin: 0 0 16px;
  color: var(--text);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.action-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  text-align: center;
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.2);
}

.action-icon {
  font-size: 32px;
}

.action-label {
  font-size: 14px;
  font-weight: 600;
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

/* Filters Bar */
.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-input,
.filter-select {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Tables */
.table-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

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

.data-table thead {
  background: rgba(255, 106, 0, 0.05);
}

.data-table th {
  padding: 16px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.data-table tbody tr:hover {
  background: rgba(255, 106, 0, 0.05);
}

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

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

/* Cards Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* Config Sections */
.config-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.config-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.config-card h3 {
  font-size: 20px;
  margin: 0 0 8px;
  color: var(--text);
}

.config-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
}

/* Analytics */
.analytics-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 24px;
}

.chart-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

/* Configs Grid */
.configs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.payment-config-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
}

.payment-config-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.payment-config-card.status-active {
  border-left: 4px solid #10b981;
}

.payment-config-card.status-inactive {
  border-left: 4px solid #ef4444;
}

.payment-config-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.payment-config-header h3 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--text);
}

.payment-method-name {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.payment-config-details {
  margin-bottom: 16px;
}

.payment-config-details p {
  margin: 8px 0;
  font-size: 14px;
  color: var(--text);
}

.payment-config-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
}

.btn-danger {
  background: #ef4444;
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.config-section {
  margin-bottom: 40px;
}

.config-section h3 {
  margin: 0;
  font-size: 20px;
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn:hover {
  background: #e55a00;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.3);
}

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

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
  z-index: 1000;
}

.modal.show {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.modal-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  z-index: 1;
}

.modal-card.large {
  max-width: 800px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 106, 0, 0.1);
  color: var(--text);
}

/* Subscription Management Modal Styles */
.subscription-management-info {
    padding: 0;
}

.subscription-management-info .info-section {
    margin-bottom: 24px;
}

.subscription-management-info .info-section h4 {
    margin-bottom: 16px;
    color: var(--text);
    font-size: 1.1rem;
}

.subscription-management-info .info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.subscription-management-info .info-grid > div {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.subscription-management-info .info-grid > div:last-child {
    border-bottom: none;
}

.subscription-management-info .info-grid strong {
    color: var(--muted);
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subscription-management-info .actions-section {
    margin-top: 24px;
}

.subscription-management-info .actions-section h4 {
    margin-bottom: 16px;
    color: var(--text);
    font-size: 1.1rem;
}

.subscription-management-info .actions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subscription-management-info .action-item {
    transition: all 0.2s;
}

.subscription-management-info .action-item:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.subscription-management-info .action-item.success {
    border-left: 4px solid #10b981;
}

.subscription-management-info .action-item.warning {
    border-left: 4px solid #f59e0b;
}

.subscription-management-info .action-item.danger {
    border-left: 4px solid #ef4444;
}

.subscription-management-info .action-item.muted {
    border-left: 4px solid var(--muted);
    opacity: 0.7;
}

.alert {
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
}

.alert strong {
    display: block;
    margin-bottom: 8px;
}

.alert p {
    margin: 0;
    font-size: 0.9rem;
}

.modal-card h3 {
  margin: 0 0 24px;
  font-size: 24px;
  color: var(--text);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-badge.inactive {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.status-badge.pending {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 8px;
}

.action-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.action-buttons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.action-btn.edit {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.action-btn.edit:hover {
  background: rgba(59, 130, 246, 0.3);
}

.action-btn.delete {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.3);
}

.action-btn.view {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.action-btn.view:hover {
  background: rgba(16, 185, 129, 0.3);
}

/* Inner Tabs (para sección de suscripciones) */
.inner-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.inner-tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 12px 20px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
}

.inner-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 106, 0, 0.05);
}

.inner-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.inner-tab-content {
  display: none;
}

.inner-tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Product Badge */
.product-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 106, 0, 0.2);
  color: var(--accent);
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  .crm-sidebar {
    width: 240px;
  }
  
  .crm-main {
    margin-left: 240px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .actions-grid {
    grid-template-columns: 1fr;
  }
  
  .analytics-content {
    grid-template-columns: 1fr;
  }
}

/* Usuarios - Estilos específicos */
.role-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(102, 126, 234, 0.2);
  color: #667eea;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal;
  margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.service-item {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.service-select {
  flex: 1;
  min-width: 200px;
}

.service-item input[type="number"] {
  flex: 1;
  min-width: 150px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-small:hover {
  background: rgba(255, 106, 0, 0.9);
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 106, 0, 0.1);
}

.btn-icon.danger:hover {
  background: rgba(239, 68, 68, 0.1);
}

.pagination {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.pagination-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pagination-controls button {
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.pagination-controls button:hover:not(:disabled) {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.pagination-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-controls button.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.pagination-info {
  color: var(--muted);
  font-size: 14px;
}

.required {
  color: #ef4444;
}

@media (max-width: 640px) {
  .crm-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .crm-sidebar.open {
    transform: translateX(0);
  }
  
  .crm-main {
    margin-left: 0;
  }
  
  .crm-content {
    padding: 16px;
  }
  
  .service-item {
    flex-direction: column;
    align-items: stretch;
  }
  
  .service-select,
  .service-item input[type="number"] {
    width: 100%;
    min-width: auto;
  }
}

/* ===============================================
   DOCUMENTOS SECTION
   =============================================== */

.documents-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.documents-filters {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
}

.filter-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.filter-select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s;
}

.filter-select:hover {
  border-color: var(--accent);
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.1);
}

.documents-folders {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 24px;
}

.documents-folders h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.folder-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.folder-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.15);
}

.folder-card.active {
  border-color: var(--accent);
  background: rgba(255, 106, 0, 0.1);
}

.folder-icon {
  font-size: 48px;
}

.folder-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.folder-date {
  font-size: 12px;
  color: var(--muted);
}

.documents-list-container {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 24px;
}

.documents-list-container h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.documents-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.document-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}

.document-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(255, 106, 0, 0.1);
}

.document-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.document-info {
  flex: 1;
  min-width: 0;
}

.document-name {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.document-meta {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.document-description {
  margin: 8px 0 0 0;
  font-size: 14px;
  color: var(--text);
  opacity: 0.8;
}

.document-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 16px;
  padding: 0;
}

.btn-icon:hover {
  background: rgba(255, 106, 0, 0.1);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.05);
}

.btn-icon:active {
  transform: scale(0.95);
}

/* Responsive para documentos */
@media (max-width: 768px) {
  .documents-filters {
    flex-direction: column;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .folders-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .document-card {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .document-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ===============================================
   KANBAN BOARD - TAREAS
   =============================================== */

.kanban-board-full {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.kanban-column {
  background: transparent;
  border-radius: 12px;
}

.kanban-column-header {
  background: var(--card);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid var(--border);
}

.kanban-column-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.kanban-count {
  background: var(--accent);
  color: #000;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
}

.kanban-items {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kanban-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: move;
  transition: all 0.2s;
  position: relative;
}

.kanban-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  border-color: var(--accent);
}

.kanban-item.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.kanban-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px 0;
}

.kanban-item-body {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.kanban-item-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.kanban-item-priority {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 11px;
}

.kanban-item-priority.baja {
  background: #6b7280;
  color: white;
}

.kanban-item-priority.media {
  background: #f59e0b;
  color: white;
}

.kanban-item-priority.alta {
  background: #ef4444;
  color: white;
}

.kanban-item-priority.urgente {
  background: #dc2626;
  color: white;
}

.kanban-item-due {
  color: var(--muted);
  font-size: 11px;
}

.kanban-item-due.overdue {
  color: #ef4444;
  font-weight: bold;
}

.kanban-item-due.today {
  color: #f59e0b;
  font-weight: bold;
}

.kanban-item-meta {
  color: var(--muted);
  font-size: 11px;
}

.kanban-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  font-size: 14px;
}

/* Drag and Drop States */
.kanban-column.drag-over {
  background: rgba(255, 106, 0, 0.05);
  border: 2px dashed var(--accent);
}

.tasks-view {
  margin-top: 20px;
}

/* Responsive Kanban */
@media (max-width: 1200px) {
  .kanban-board-full {
    grid-template-columns: 1fr;
  }
  
  .kanban-column {
    margin-bottom: 24px;
  }
}

@media (max-width: 768px) {
  .kanban-board-full {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .kanban-item {
    padding: 10px;
  }
  
  .kanban-item-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Toggle Switch Styles */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent, #ff6a00);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}


/* ============================================ */
/* BASE DE CONOCIMIENTO */
/* ============================================ */

.knowledge-base-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 200px);
}

.kb-sidebar {
    width: 300px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    overflow-y: auto;
}

.kb-sidebar h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: var(--text);
}

.kb-folder-item {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.kb-folder-item:hover {
    background: rgba(255, 106, 0, 0.1);
    border-color: var(--accent);
}

.kb-folder-item.active {
    background: rgba(255, 106, 0, 0.2);
    border-color: var(--accent);
}

.kb-folder-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kb-folder-icon {
    font-size: 20px;
}

.kb-folder-name {
    flex: 1;
    font-weight: 500;
    color: var(--text);
}

.kb-folder-count {
    font-size: 12px;
    color: var(--muted);
}

.kb-subfolders {
    margin-left: 30px;
    margin-top: 8px;
}

.kb-subfolder {
    font-size: 14px;
}

.kb-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.kb-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.kb-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    overflow-y: auto;
    flex: 1;
}

.kb-article-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.kb-article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kb-article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.kb-article-content {
    padding: 15px;
}

.kb-article-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.kb-article-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.kb-article-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.kb-article-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.kb-article-summary {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 10px;
}

.kb-article-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.kb-article-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

/* ============================================ */
/* TICKETS MEJORADOS */
/* ============================================ */

.ticket-view-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ticket-view-section {
    padding: 15px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.ticket-view-section h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: var(--text);
}

.ticket-view-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item strong {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
}

.ticket-note-item,
.ticket-message-item {
    padding: 12px;
    margin-bottom: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.note-header,
.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--muted);
}

.note-author,
.message-author {
    font-weight: 600;
    color: var(--text);
}

.note-content,
.message-content {
    color: var(--text);
    line-height: 1.5;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.checkbox-label:hover {
    background: rgba(255, 106, 0, 0.1);
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

