/* ==========================================================================
   CREAFIX - ESTILOS PRINCIPALES (SISTEMA DE DISEÑO PREMIUM)
   ========================================================================== */

/* 1. VARIABLES Y VARIABLES DE COLORES (MODO OSCURO PREDETERMINADO) */
:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Paleta de Colores Especiales */
  --bg-main: #0f172a;        /* Slate 900 */
  --bg-sidebar: #0b0f19;     /* Slate 950 muy oscuro */
  --bg-card: rgba(30, 41, 59, 0.7); /* Slate 800 semi-transparente */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.04);
  
  /* Accent Colors */
  --primary: #6366f1;        /* Indigo 500 */
  --primary-hover: #4f46e5;  /* Indigo 600 */
  --primary-glow: rgba(99, 102, 241, 0.15);
  
  --secondary: #06b6d4;      /* Cyan 500 */
  --secondary-hover: #0891b2;/* Cyan 600 */
  
  --success: #10b981;        /* Emerald 500 */
  --success-glow: rgba(16, 185, 129, 0.15);
  
  --warning: #f59e0b;        /* Amber 500 */
  --danger: #ef4444;         /* Red 500 */
  --danger-hover: #dc2626;   /* Red 600 */
  
  /* Text Colors */
  --text-primary: #f8fafc;   /* Slate 50 */
  --text-secondary: #94a3b8; /* Slate 400 */
  --text-muted: #64748b;     /* Slate 500 */
  --text-dark: #1e293b;      /* Slate 800 */
  
  --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px 0 rgba(99, 102, 241, 0.2);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 280px;
}

/* 2. REGLAS GENERALES Y RESET */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.dark-theme {
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
}

/* 3. ESTRUCTURA SPA */
.hidden {
  display: none !important;
}

/* --- ESTILO LOGIN --- */
.login-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.login-glow-1 {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  top: -10%;
  left: -10%;
  z-index: 1;
}

.login-glow-2 {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, transparent 70%);
  bottom: -10%;
  right: -10%;
  z-index: 1;
}

.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-main);
  transition: var(--transition);
}

.login-header {
  text-align: center;
  margin-bottom: 35px;
}

.login-logo-svg {
  width: 200px;
  height: 50px;
  margin-bottom: 10px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  margin-top: 5px;
}

.login-footer {
  text-align: center;
  margin-top: 35px;
  color: var(--text-muted);
  font-size: 12px;
}

/* --- WRAPPER DE LA APP --- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* BARRA LATERAL (SIDEBAR) */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: var(--transition);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

.brand-logo {
  max-width: 100%;
  max-height: 48px;
  object-fit: contain;
}

.sidebar-user {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
}

.avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: bold;
  font-size: 16px;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

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

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition);
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--primary-glow);
  color: var(--text-primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.nav-icon {
  font-size: 18px;
}

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

/* ÁREA CENTRAL DE CONTENIDO */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0; /* Evita desborde de tablas flexibles */
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  min-height: 80px;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
}

.app-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}

.date-display {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.view-container {
  padding: 40px;
  flex: 1;
}

/* 4. COMPONENTES DEL DASHBOARD */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 35px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-main);
  transition: var(--transition);
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
}

.metric-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.metric-purple { background: rgba(99, 102, 241, 0.1); color: var(--primary); }
.metric-blue { background: rgba(6, 182, 212, 0.1); color: var(--secondary); }
.metric-yellow { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.metric-green { background: rgba(16, 185, 129, 0.1); color: var(--success); }

.metric-data {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
  margin-top: 2px;
}

.dashboard-layouts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.dash-block {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-main);
  min-width: 0;
}

.dash-block h3 {
  font-size: 18px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary);
  padding-left: 12px;
}

/* 5. DISEÑO DE FORMULARIOS, CAMPOS Y ENTRADAS */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background-color: rgba(15, 23, 42, 0.8);
}

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

textarea.form-control {
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-align-end {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-top: 30px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-text {
  font-size: 12px;
  margin-top: 5px;
}

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

/* 6. BOTONES */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  gap: 8px;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-success {
  background-color: var(--success);
  color: white;
}

.btn-success:hover {
  background-color: #0d9488;
  transform: translateY(-1px);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: var(--danger-hover);
  transform: translateY(-1px);
}

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

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

.btn-block {
  display: flex;
  width: 100%;
}

.btn-xs {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Barra de acciones (superior de vistas) */
.action-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.action-bar .search-box {
  flex: 1;
}

.action-bar .filter-box {
  min-width: 180px;
}

/* 7. TABLAS */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-main);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.table th {
  background-color: rgba(15, 23, 42, 0.5);
  padding: 16px 24px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 14px;
  vertical-align: middle;
}

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

.table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* 8. BADGES Y ESTADOS */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

/* Estados de Taller */
.badge-recibido { background-color: rgba(94, 234, 212, 0.15); color: #2dd4bf; }
.badge-diagnostico { background-color: rgba(216, 180, 254, 0.15); color: #c084fc; }
.badge-en_progreso { background-color: rgba(99, 102, 241, 0.15); color: #818cf8; }
.badge-espera_repuestos { background-color: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.badge-listo { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-entregado { background-color: rgba(148, 163, 184, 0.15); color: #94a3b8; }

/* Estados de Facturación */
.badge-para_facturar { background-color: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-facturado { background-color: rgba(6, 182, 212, 0.15); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-pagado { background-color: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-abono { background-color: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-mantenimiento { background-color: rgba(139, 92, 246, 0.15); color: #a27ffb; border: 1px solid rgba(139, 92, 246, 0.3); }

/* Tipos de Cliente */
.badge-mensual { background-color: rgba(99, 102, 241, 0.15); color: #a5b4fc; }
.badge-eventual { background-color: rgba(14, 116, 144, 0.15); color: #67e8f9; }

/* Estado Usuario / General */
.badge-activo { background-color: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-inactivo { background-color: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-role { background-color: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }

/* 9. VENTANAS MODALES */
.modal {
  display: none; /* Oculto por defecto */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: #1e293b; /* Slate 800 */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 30px;
}

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

.modal-medium {
  max-width: 500px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 15px;
}

.modal-header h2 {
  font-size: 20px;
  color: var(--text-primary);
}

.modal-close {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--danger);
}

.modal-footer {
  margin-top: 25px;
  border-top: 1px solid var(--border-light);
  padding-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 10. ELEMENTOS DINÁMICOS Y COMPONENTES EXTRAS */

/* Tabs para estados de Taller */
.tab-filters {
  display: flex;
  background-color: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background-color: var(--primary);
  color: white;
}

/* Feed de actividades del dashboard */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feed-item {
  display: flex;
  gap: 16px;
  padding: 10px;
  margin-bottom: 6px;
  border-radius: var(--border-radius);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.2s ease;
}

.feed-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

.feed-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.feed-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.feed-content {
  display: flex;
  flex-direction: column;
}

.feed-title {
  font-weight: 600;
  font-size: 14px;
}

.feed-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Sección de materiales dinámicos en los formularios */
.materials-section {
  background-color: rgba(15, 23, 42, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 20px;
}

.materials-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.materials-header h4 {
  font-size: 14px;
  font-weight: 600;
}

.materials-rows-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.material-row {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1fr 40px;
  gap: 10px;
  align-items: center;
}

.btn-remove-row {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  transition: var(--transition);
}

.btn-remove-row:hover {
  color: var(--danger);
}

/* Fichador de Cronometro / Horas */
.timer-card {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr;
  gap: 16px;
  background-color: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  align-items: center;
}

.timer-section {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.time-input-group {
  flex: 1;
}

.time-input-group label {
  font-size: 11px;
  margin-bottom: 6px;
}

.btn-timer {
  padding: 10px 14px;
  font-size: 13px;
  height: 44px;
  white-space: nowrap;
}

.calculated-duration {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--secondary);
  border-left: 1px solid var(--border-color);
  padding-left: 15px;
}

/* Selector de clientes con filtro rapido en servicios */
.select-label-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.client-quick-filters {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-filter {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.badge-filter.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Pre-visualizador de texto de whatsapp/telegram */
.text-preview-box {
  margin-top: 15px;
  margin-bottom: 20px;
}

.pre-message-view {
  background-color: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: monospace;
  font-size: 12px;
  color: #34d399; /* Verde codigo */
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
}

.share-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.btn-share-wa {
  background-color: #25d366; /* Verde Whatsapp */
  color: white;
  font-weight: 700;
}

.btn-share-wa:hover {
  background-color: #128c7e;
}

.btn-share-tg {
  background-color: #0088cc; /* Azul Telegram */
  color: white;
  font-weight: 700;
}

.btn-share-tg:hover {
  background-color: #006699;
}

/* Configuracion de logos */
.logo-preview-box {
  width: 100%;
  height: 120px;
  background-color: rgba(15,23,42,0.5);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  padding: 15px;
}

.logo-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-main);
}

.settings-card h3 {
  margin-bottom: 10px;
}

.settings-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.system-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 8px;
}

.info-row:last-child {
  border-bottom: none;
}

.billing-summary-banner {
  display: flex;
  gap: 24px;
  background-color: rgba(99,102,241,0.04);
  border: 1px solid var(--border-color);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.billing-summary-card {
  display: flex;
  flex-direction: column;
}

.billing-summary-card .label {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
}

.billing-summary-card .value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
}

.billing-summary-card .price-tag {
  color: var(--success);
}

.alerts-notify-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

/* 11. ANIMACIONES */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* 12. DISEÑO RESPONSIVO (MOBILE Y TABLET) */
@media (max-width: 992px) {
  .dashboard-layouts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-wrapper {
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    width: 280px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    border-right: 1px solid var(--border-color);
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.4);
  }
  
  .sidebar-brand {
    padding: 15px;
    min-height: auto;
  }
  
  .sidebar-user {
    padding: 15px;
  }
  
  .sidebar-nav {
    padding: 15px;
  }
  
  .sidebar-nav ul {
    flex-direction: column;
    gap: 8px;
  }
  
  .nav-item {
    padding: 12px 16px;
    font-size: 14px;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background-color: #0f172a; /* Fondo sólido oscuro para evitar transparencias al hacer scroll */
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    min-height: 60px;
  }

  .view-container {
    padding: 15px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Forzar que las tarjetas de metrica se apilen en una sola columna en pantallas moviles */
  .metrics-grid {
    grid-template-columns: 1fr !important;
    gap: 15px;
    margin-bottom: 20px;
  }

  /* Evitar desbordes de los bloques contenedores */
  .dashboard-layouts {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr !important;
  }

  .dash-block {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 16px;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .action-bar .search-box, 
  .action-bar .filter-box,
  .action-bar .tab-filters {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .timer-card {
    grid-template-columns: 1fr;
  }
  
  .calculated-duration {
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding-left: 0;
    padding-top: 15px;
  }
  
  .share-buttons-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   13. ESTILOS DE IMPRESIÓN (PRINT PREVIEW / TICKETS FISICOS Y PDF)
   ========================================================================== */
.print-only {
  display: none;
}

@media print {
  /* Ocultar toda la interfaz del navegador y el dashboard */
  body * {
    visibility: hidden;
  }
  
  /* Mostrar solamente el area de impresion */
  #print-area, #print-area * {
    visibility: visible;
  }
  
  #print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    display: block !important;
    background-color: white !important;
    color: black !important;
    font-family: 'Inter', sans-serif;
  }
  
  /* Resetear estilos oscuros para impresion */
  body, html {
    background: white !important;
    color: black !important;
  }

  /* Formato del ticket de taller e informes */
  .print-ticket {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    font-size: 13px;
    line-height: 1.4;
    color: #1a202c;
  }
  
  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #2d3748;
    padding-bottom: 20px;
    margin-bottom: 20px;
  }
  
  .print-logo {
    max-height: 60px;
  }
  
  .print-title {
    text-align: right;
  }
  
  .print-title h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 4px;
    text-transform: uppercase;
  }
  
  .print-title span {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
  }
  
  .print-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 25px;
  }
  
  .print-details-card {
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    padding: 16px;
  }
  
  .print-details-card h4 {
    font-size: 13px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 10px;
    text-transform: uppercase;
    color: #2d3748;
  }
  
  .print-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
  }
  
  .print-row strong {
    color: #4a5568;
  }
  
  .print-block {
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 25px;
  }
  
  .print-block h4 {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 10px;
    text-transform: uppercase;
  }
  
  .print-block p {
    font-size: 13px;
    color: #2d3748;
    white-space: pre-wrap;
  }
  
  .print-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    margin-bottom: 25px;
  }
  
  .print-table th {
    border-bottom: 2px solid #2d3748;
    padding: 8px 12px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
  }
  
  .print-table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .print-total-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 15px;
    margin-bottom: 40px;
  }
  
  .print-total-row {
    display: flex;
    gap: 20px;
    font-size: 14px;
    margin-bottom: 6px;
  }
  
  .print-grand-total {
    font-size: 18px;
    font-weight: 700;
    border-top: 2px solid #2d3748;
    padding-top: 6px;
    margin-top: 6px;
  }
  
  .print-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    margin-top: 60px;
    text-align: center;
  }
  
  .signature-box {
    border-top: 1px dashed #718096;
    padding-top: 10px;
    font-size: 12px;
    color: #4a5568;
  }
  
  .print-footer {
    text-align: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 15px;
    margin-top: 40px;
    font-size: 11px;
    color: #718096;
  }
}

/* --- ESTILOS DE AUTOCOMPLETADO (COMBOBOX) --- */
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #1e293b; /* Slate 800 */
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1200;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  margin-top: 4px;
}

.autocomplete-item {
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  transition: var(--transition);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background-color: rgba(99, 102, 241, 0.15); /* Light primary glow */
  color: var(--text-primary);
}

/* --- ESTILOS SIDEBAR COLAPSABLE --- */
.app-wrapper.sidebar-hidden .sidebar {
  transform: translateX(-100%);
}

.app-wrapper.sidebar-hidden .main-content {
  margin-left: 0;
}

/* Transición suave para colapsar sidebar */
.sidebar {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- DETALLES DE VISUALIZACIÓN EN MODAL --- */
.detail-view-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--text-primary);
}

.detail-view-section {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 15px;
}

.detail-view-section:last-child {
  border-bottom: none;
}

.detail-view-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

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

.detail-view-field {
  font-size: 14px;
}

.detail-view-field strong {
  color: var(--text-secondary);
}

.detail-view-text {
  background-color: rgba(0, 0, 0, 0.15);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  white-space: pre-wrap;
  border-left: 3px solid var(--primary);
}

/* --- ESTILOS DE BANNER DE TIMER ACTIVO --- */
.active-timers-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 24px 16px 24px;
}

.active-timers-container:empty {
  display: none;
}

.active-timer-item {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.95) 0%, rgba(49, 16, 66, 0.95) 100%);
  border: 1.5px solid var(--primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 6px 20px -4px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  z-index: 100;
  animation: slideDown 0.3s ease-out;
}

.active-timer-item.timer-remote {
  border-color: var(--secondary);
  background: linear-gradient(135deg, rgba(16, 35, 66, 0.95) 0%, rgba(20, 50, 70, 0.95) 100%);
}

.active-timer-item .timer-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  min-width: 0;
  flex: 1;
}

.active-timer-item .timer-info .timer-icon {
  font-size: 18px;
  animation: pulse 1.5s infinite;
  flex-shrink: 0;
}

.active-timer-item .timer-info .timer-details {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
}

.active-timer-item .timer-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 12px;
}

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

@keyframes pulse {
  0% { opacity: 0.3; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0.3; transform: scale(0.95); }
}

/* --- ESTILOS EXCLUSIVOS PARA IMPRESIÓN DE REPORTES --- */
@media print {
  body.printing-report * {
    visibility: visible !important;
  }

  body.printing-report .sidebar,
  body.printing-report .app-header,
  body.printing-report .active-timers-container,
  body.printing-report #view-reports .action-bar,
  body.printing-report .modal {
    display: none !important;
  }

  body.printing-report .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
    background: white !important;
    color: black !important;
  }

  body.printing-report .view-container {
    padding: 0 !important;
  }

  body.printing-report #view-reports {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white !important;
    color: black !important;
  }

  body.printing-report #view-reports .metrics-grid {
    display: flex !important;
    gap: 30px !important;
    margin-bottom: 20px !important;
    border-bottom: 2px solid #2d3748 !important;
    padding-bottom: 10px !important;
  }

  body.printing-report #view-reports .metric-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: black !important;
  }

  body.printing-report #view-reports .metric-icon {
    display: none !important;
  }

  body.printing-report #view-reports .metric-value {
    color: black !important;
    font-size: 18px !important;
  }

  body.printing-report #view-reports .table-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  body.printing-report #view-reports table {
    color: black !important;
    border-collapse: collapse !important;
    width: 100% !important;
  }

  body.printing-report #view-reports th {
    background-color: #f1f5f9 !important;
    color: black !important;
    border-bottom: 2px solid #cbd5e1 !important;
    font-size: 12px !important;
  }

  body.printing-report #view-reports td {
    border-bottom: 1px solid #e2e8f0 !important;
    color: black !important;
    font-size: 11px !important;
    padding: 8px 10px !important;
  }

  body.printing-report #view-reports th:last-child,
  body.printing-report #view-reports td:last-child {
    display: none !important;
  }
}

/* Password toggle wrapper */
.password-toggle-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-toggle-wrapper .form-control {
  padding-right: 44px; /* Espacio para el icono */
}

.password-toggle-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 16px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.password-toggle-btn:hover {
  color: var(--text-primary);
}

/* ==========================================
   NUEVAS CLASES: MÓDULO SOLICITUDES
   ========================================== */
.badge-pendiente { background-color: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-derivada { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-cancelada { background-color: rgba(239, 68, 68, 0.15); color: #f87171; }
.badge-privada { background-color: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }
.badge-publica { background-color: rgba(99, 102, 241, 0.15); color: #818cf8; }

.badge-container-sidebar {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sidebar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  line-height: 1;
}

.sidebar-badge.badge-primary {
  background-color: #6366f1;
  color: #ffffff;
}

.sidebar-badge.badge-danger {
  background-color: #ef4444;
  color: #ffffff;
  animation: pulse-red-sidebar 2s infinite;
}

.solicitud-old {
  background-color: rgba(245, 158, 11, 0.05) !important;
  border-left: 3px solid #f59e0b !important;
}

@keyframes pulse-red-sidebar {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Panel de accesos rapidos responsivo */
.quick-actions-panel {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  width: 100%;
}

.quick-actions-panel .btn {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  padding: 12px 20px;
  font-size: 14px;
  min-height: 48px;
}

@media (max-width: 768px) {
  .quick-actions-panel {
    flex-direction: column;
    gap: 10px;
  }
  .quick-actions-panel .btn {
    width: 100%;
    min-width: 0;
  }
}


