:root {
  --primary: #e07b00;
  --primary-dark: #b85e00;
  --primary-light: #ff8c00;
  --secondary: #888;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ff4500;
  --dark: #000000;
  --light: #0a0a0a;
  --border: #1e1e1e;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --radius: 8px;
  --radius-lg: 12px;
  --glow: 0 0 20px rgba(224,123,0,0.4);
  --bg-body: #000000;
  --bg-card: rgba(10, 10, 10, 0.92);
  --bg-input: rgba(17, 17, 17, 0.8);
  --text-primary: #f0f0f0;
  --text-secondary: #888;
  --table-header-bg: rgba(224, 123, 0, 0.08);
  --table-header-text: #ffb347;
  --focus-shadow: 0 0 0 3px rgba(224, 123, 0, 0.15);
  --sidebar-bg: var(--bg-card);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[data-theme="light"] {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #1e293b;
  --light: #f8fafc;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --bg-body: #f1f5f9;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --table-header-bg: rgba(37, 99, 235, 0.06);
  --table-header-text: #1d4ed8;
  --focus-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  --sidebar-bg: #eef2ff;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-body);
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
  max-width: 100vw;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse 60% 60% at 20% 80%, rgba(224,123,0,0.08) 0%, transparent 70%), var(--bg-body);
  padding: 20px;
  transition: background 0.3s, color 0.3s;
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .login-screen {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

[data-theme="light"] .nav-item:hover {
  background: rgba(37, 99, 235, 0.1);
}

[data-theme="light"] .sidebar-footer {
  border-top-color: #cbd5e1;
}

.login-theme-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
}

.hidden { display: none !important; }

.login-container {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

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

.login-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-secondary);
  transition: color 0.3s;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-primary);
  transition: color 0.3s;
}

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

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

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

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  width: 100%;
  padding-right: 40px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password:hover {
  color: var(--dark);
}

.toggle-password svg {
  width: 20px;
  height: 20px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

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

[data-theme="dark"] .btn-primary {
  color: #000;
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--table-header-bg);
  border-color: var(--primary);
}

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

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

.btn-block {
  width: 100%;
  justify-content: center;
}

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

.error-message {
  color: var(--danger);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
}

.login-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--secondary);
}

.login-footer p { margin: 4px 0; }

.apk-download-link {
  color: var(--secondary);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.apk-download-link:hover {
  color: var(--primary);
}

.login-footer p { margin: 4px 0; }

.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s, background 0.3s;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.sidebar-logo {
  max-width: 100%;
  max-height: 60px;
  display: block;
  margin: 0 auto 10px;
  object-fit: contain;
}

.sidebar-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-light);
}

.user-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-primary);
  background: var(--table-header-bg);
  padding: 6px 12px;
  border-radius: 20px;
  transition: background 0.3s, color 0.3s;
  font-weight: 500;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.nav-item:hover {
  background: var(--table-header-bg);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

[data-theme="dark"] .nav-item.active {
  color: #000;
}

.nav-item .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  transition: border-color 0.3s;
}

.nav-item.logout {
  color: var(--danger);
}

.nav-item.logout:hover {
  background: rgba(239, 68, 68, 0.15);
}

.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  max-width: 100vw;
  overflow-x: hidden;
}

.main-header {
  background: var(--bg-card);
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  overflow-x: hidden;
  max-width: 100%;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--text-primary);
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

.theme-toggle {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: var(--table-header-bg);
  border-color: var(--primary);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.main-header h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.content-area {
  flex: 1;
  padding: 24px;
  background: var(--bg-body);
  overflow-x: hidden;
  max-width: 100%;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
  overflow-x: hidden;
  max-width: 100%;
}

.view-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.3s;
}

.filters-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  max-width: 100%;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 100%;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.search-box .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.search-box.large input {
  padding: 14px 16px 14px 44px;
  font-size: 16px;
}

.search-box.large .icon {
  width: 20px;
  height: 20px;
}

.filter-select {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  min-width: 180px;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.table-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: background 0.3s, border-color 0.3s;
}

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

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.data-table th {
  background: var(--table-header-bg);
  font-weight: 600;
  color: var(--table-header-text);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  color: var(--text-primary);
}

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

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

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

.btn-icon {
  padding: 6px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
}

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

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

.modal-content.modal-large {
  max-width: 700px;
}

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.3s;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
}

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

.modal form {
  padding: 24px;
}

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

.historial-resultados {
  display: grid;
  gap: 20px;
}

.historial-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.historial-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--table-header-bg);
  border-bottom: 1px solid var(--border);
}

.historial-card-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.historial-card-info p {
  font-size: 13px;
  color: var(--secondary);
}

.historial-card-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-modelo { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge-estatus-recibida { background: rgba(107, 114, 128, 0.15); color: #6b7280; }
.badge-estatus-en-diagnostico { background: rgba(37, 99, 235, 0.15); color: #2563eb; }
.badge-estatus-pendiente-prueba { background: rgba(217, 119, 6, 0.15); color: #d97706; }
.badge-estatus-en-prueba { background: rgba(124, 58, 237, 0.15); color: #7c3aed; }
.badge-estatus-entregada { background: rgba(5, 150, 105, 0.15); color: #059669; }
.badge-estatus-no-reparable { background: rgba(220, 38, 38, 0.15); color: #dc2626; }
.badge-estatus-reparada { background: rgba(5, 150, 105, 0.15); color: #059669; }
.badge-estatus-repuestos { background: rgba(107, 114, 128, 0.15); color: #6b7280; }
.badge-estatus-en-revision { background: rgba(37, 99, 235, 0.15); color: #2563eb; }
.badge-estatus-por-testear { background: rgba(217, 119, 6, 0.15); color: #d97706; }
.badge-estatus-prestada { background: rgba(161, 98, 7, 0.15); color: #a16207; }
.badge-estatus-funcional { background: rgba(22, 101, 52, 0.15); color: #166534; }
.badge-ubicacion { background: rgba(71, 85, 105, 0.15); color: #475569; }

.historial-card-body {
  padding: 20px;
}

.historial-timeline {
  position: relative;
  padding-left: 24px;
}

.historial-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.historial-item {
  position: relative;
  padding-bottom: 20px;
}

.historial-item:last-child {
  padding-bottom: 0;
}

.historial-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid white;
}

.historial-item-prueba::before {
  background: #4dc455 !important;
}

.prueba-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: #4dc455;
  padding: 2px 8px;
  border-radius: 10px;
  margin-right: 6px;
}

.checkbox-group {
  margin-bottom: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #4dc455;
  cursor: pointer;
}

.historial-fecha {
  font-size: 12px;
  color: var(--secondary);
  margin-bottom: 4px;
}

.historial-texto {
  font-size: 14px;
  color: var(--text-primary);
}

.historial-card-actions {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: background 0.3s, border-color 0.3s;
}

.stat-card.total {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #000;
}

.stat-card.total .stat-label {
  color: rgba(255,255,255,0.8);
}

.stat-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
  transition: color 0.3s;
}

.stat-card.total h3 {
  color: white;
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 36px;
  font-weight: 700;
}

.stat-label {
  font-size: 14px;
  color: var(--secondary);
}

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

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--table-header-bg);
  border-radius: 8px;
  transition: background 0.3s;
}

.stat-item-label {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.stat-item-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.3s;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  transition: color 0.3s;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 16px;
}

.historial-detalle-wrapper {
  padding: 24px;
}

.historial-detalle-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.historial-info-item.descripcion {
  grid-column: 1 / -1;
}

.historial-info-item.descripcion .historial-descripcion-texto {
  text-align: center;
}

.historial-card-info p {
  text-align: center;
}

.historial-titulo-seccion {
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
}

.historial-sin-registros {
  color: var(--text-secondary);
  font-style: italic;
}

.historial-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.historial-item-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.btn-historial-icon {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-historial-icon:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
}

.btn-historial-icon.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.historial-acciones {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 900px) {
  .historial-detalle-info {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .historial-detalle-info {
    grid-template-columns: 1fr;
  }
  .historial-detalle-wrapper {
    padding: 16px;
  }
}

@media (min-width: 1200px) {
  .modal-content.modal-large {
    max-width: 900px;
  }
}

@media (max-width: 1024px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .filters-bar {
    flex-direction: column;
  }

  .filter-select {
    width: 100%;
  }
}

.desktop-table {
  display: table;
}

#usuarios-view .data-table th:nth-child(1),
#usuarios-view .data-table td:nth-child(1) {
  width: 60px;
  text-align: center;
}

#usuarios-view .data-table th:nth-child(5),
#usuarios-view .data-table td:nth-child(5) {
  width: 140px;
}

#usuarios-view .data-table th:nth-child(6),
#usuarios-view .data-table td:nth-child(6) {
  width: 120px;
  text-align: center;
}

.mobile-cards {
  display: none;
}

.log-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: background 0.3s, border-color 0.3s;
}

.log-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.log-card-date {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.log-card-user {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  background: var(--table-header-bg);
  padding: 4px 10px;
  border-radius: 20px;
}

.log-card-action {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 4px;
}

.log-card-details {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-word;
}

.cards-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.mobile-cards {
  display: none;
}

.inventory-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
}

.inventory-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}

.inventory-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding-left: 2px;
}

.inventory-card-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.inventory-card-serial {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-card-modelo-text {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.inventory-card-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.inventory-card-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 calc(50% - 6px);
  min-width: 100px;
}

.inventory-card-field.full-width {
  flex: 1 1 100%;
}

.inventory-card-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.inventory-card-value {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.inventory-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.inventory-card-company {
  min-width: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.inventory-card .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.inventory-card-status {
  flex: 0 0 auto;
  text-align: center;
  margin-top: 1px;
}

.inventory-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #eef2f7;
  margin-top: 2px;
}

.inventory-card-actions .btn-icon {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.inventory-card-actions .btn-icon:hover {
  background: var(--primary);
}

.inventory-card-actions .btn-icon.danger {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .btn {
    padding: 8px 12px;
    font-size: 12px;
  }

  .btn .icon {
    width: 14px;
    height: 14px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    width: 60%;
    max-width: 60%;
  }

  [data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, rgba(0,0,0,0.95) 0%, rgba(5,5,10,0.92) 100%);
    backdrop-filter: blur(8px);
  }

  [data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
  }

  [data-theme="light"] .sidebar .nav-item {
    color: #94a3b8;
  }

  [data-theme="light"] .sidebar .nav-item:hover {
    color: #f1f5f9;
    background: rgba(255,255,255,0.08);
  }

  [data-theme="light"] .sidebar .nav-item.active {
    color: #fff;
  }

  [data-theme="light"] .sidebar .user-badge,
  [data-theme="light"] .sidebar-header h2 {
    color: #e2e8f0;
  }

  [data-theme="light"] .sidebar-footer {
    border-top-color: rgba(255,255,255,0.1);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
  }

  .menu-toggle svg {
    width: 24px;
    height: 24px;
  }

  .main-header {
    padding: 12px 16px;
    flex-wrap: wrap;
  }

  .main-header h1 {
    font-size: 16px;
    flex: 1;
  }

  .content-area {
    padding: 16px;
  }

  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .view-header h2 {
    font-size: 20px;
  }

  .view-header .btn {
    width: auto;
    justify-content: center;
    padding: 10px 16px;
    font-size: 13px;
  }

  .view-header .btn .icon {
    width: 16px;
    height: 16px;
  }

  .view-header {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
  }

  .filters-bar {
    flex-direction: column;
    gap: 12px;
  }

  .search-box {
    width: 100%;
  }

  .filter-select {
    width: 100%;
  }

.table-container {
    display: none;
  }

  .desktop-table {
    display: none;
  }

  .mobile-cards {
    display: grid;
    gap: 14px;
  }

  .cards-container {
    grid-template-columns: 1fr;
  }

  .inventory-card {
    padding: 16px;
  }

  .inventory-card-row {
    gap: 12px;
  }

  .inventory-card-field {
    flex: 1 1 calc(50% - 6px);
    min-width: 100px;
  }

  .inventory-card-field.full-width {
    flex: 1 1 100%;
  }

.cards-container.mobile-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0;
  }

  .inventory-card {
    padding: 16px;
    border-radius: 8px;
  }

  .inventory-card-row {
    gap: 10px;
  }

  .inventory-card-field {
    flex: 1 1 calc(50% - 5px);
    min-width: 80px;
  }

  .inventory-card-field.full-width {
    flex: 1 1 100%;
  }

  .inventory-card-header {
    flex-wrap: nowrap;
  }

  .inventory-card-serial {
    font-size: 14px;
    font-weight: 700;
  }

  .inventory-card-modelo-text {
    font-size: 10px;
  }

  .inventory-card-value {
    font-size: 12px;
    color: var(--text-secondary);
  }

  .inventory-card-meta {
    align-items: flex-start;
  }

  .inventory-card-company {
    font-size: 12px;
    line-height: 1.35;
  }

  .inventory-card-status {
    max-width: 44%;
    white-space: normal;
  }

  .inventory-card .badge {
    padding: 4px 8px;
    font-size: 10px;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    font-size: 11px;
    min-width: 600px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 6px;
    white-space: nowrap;
  }

  .action-buttons {
    flex-direction: column;
    gap: 4px;
  }

  .btn-icon {
    padding: 8px;
  }

  .modal-content {
    width: 95%;
    max-width: none;
    margin: 10px;
    max-height: 90vh;
    border-radius: 12px;
  }

  .modal-header {
    padding: 16px;
  }

  .modal form {
    padding: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column;
    gap: 8px;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 28px;
  }

  .historial-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .historial-card-badges {
    width: 100%;
  }

  .historial-card-actions {
    flex-direction: column;
  }

  .historial-card-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .print-historial {
    padding: 20px;
  }

  .print-info-simple {
    flex-direction: column;
    gap: 16px;
  }

  .print-timeline {
    padding-left: 20px;
  }

  .print-item {
    padding-bottom: 16px;
  }
}

@media print {
  body {
    background: white;
    margin: 0;
    padding: 0;
  }

  .app-container,
  .modal,
  .print-area:not(#print-area) {
    display: none !important;
  }

  #print-area {
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
    z-index: 9999;
  }

  .print-historial {
    font-family: 'Inter', sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 15px;
  }

  .print-info-row {
    flex-wrap: nowrap;
    gap: 20px;
  }

  .print-logo-bottom {
    position: absolute;
    bottom: 15px;
    left: 15px;
  }

  .print-logo-bottom img {
    max-width: 80px !important;
    max-height: 35px !important;
  }

  .print-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #1e293b;
  }

  .print-header h1 {
    font-size: 24px;
    color: #1e293b;
    margin-bottom: 8px;
  }

  .print-header p {
    font-size: 14px;
    color: #64748b;
  }

  .print-logo-center {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
  }

  .print-logo-center img {
    max-width: 180px;
    max-height: 70px;
    display: block;
    margin: 0 auto;
  }

  .print-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-input);
    border-radius: 8px;
  }

  .print-info-simple {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-input);
    border-radius: 8px;
  }

  .print-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .print-info-left,
  .print-info-right,
  .print-info-center {
    display: flex;
    flex-direction: column;
  }

  .print-info-left {
    text-align: left;
    flex: 1;
  }

  .print-info-center {
    text-align: center;
    flex: 0 0 auto;
    padding: 0 20px;
  }

  .print-info-right {
    text-align: right;
    flex: 1;
  }

  .print-info-item {
    display: flex;
    flex-direction: column;
  }

  .print-info-label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .print-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
  }

  .print-timeline {
    position: relative;
    padding-left: 24px;
  }

  .print-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
  }

  .print-item {
    position: relative;
    padding-bottom: 24px;
    page-break-inside: avoid;
  }

  .print-item:last-child {
    padding-bottom: 0;
  }

  .print-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
  }

  .print-fecha {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
  }

  .print-texto {
    font-size: 14px;
    color: #1e293b;
    line-height: 1.6;
  }

  .print-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
  }
}

@page {
  size: letter;
  margin: 0.5in;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.hidden {
  display: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.1);
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.panel-form {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  padding: 24px;
}

.form-result {
  color: var(--success);
  font-weight: 600;
  margin-top: 12px;
}

/* Premium dark technology skin - DISABLED for theme toggle */
/* :root {
  --primary: #42e8ff;
  --primary-dark: #0891b2;
  --primary-light: #67e8f9;
  --secondary: #8aa8b8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ff4d6d;
  --dark: #eaf8ff;
  --light: #050a12;
  --border: rgba(103, 232, 249, 0.16);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.5);
}

body {
  color: #eaf8ff;
  background:
    radial-gradient(circle at 15% 15%, rgba(66, 232, 255, 0.10), transparent 30%),
    radial-gradient(circle at 85% 5%, rgba(224, 123, 0, 0.10), transparent 28%),
    #050a12;
}

.login-screen {
  background:
    linear-gradient(rgba(66, 232, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(66, 232, 255, 0.035) 1px, transparent 1px),
    #050a12;
  background-size: 42px 42px;
}

.login-container,
.main-header,
.table-container,
.historial-card,
.stat-card,
.panel-form,
.modal-content,
.inventory-card {
  background: rgba(8, 18, 32, 0.86);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.login-header h1,
.view-header h2,
.main-header h1,
.modal-header h3,
.stat-value {
  color: #f4fbff;
}

.login-header p,
.form-group label,
.historial-card-info p,
.stat-label,
.stat-item-label,
.empty-state {
  color: var(--secondary);
}

.sidebar {
  background: linear-gradient(180deg, rgba(3, 7, 13, 0.98), rgba(8, 18, 32, 0.98));
  border-right: 1px solid var(--border);
}

.nav-item.active {
  background: linear-gradient(135deg, #42e8ff, #2563eb);
  color: #001018;
  font-weight: 800;
}

.content-area,
.main-content {
  background: transparent;
}

.form-group input,
.form-group select,
.form-group textarea,
.search-box input,
.filter-select {
  background: rgba(3, 7, 13, 0.7);
  border-color: var(--border);
  color: #eaf8ff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(66, 232, 255, 0.12);
}

/* DISABLED: Premium dark tech skin leftovers */
/*
.data-table th {
  background: rgba(66, 232, 255, 0.08);
  color: #9eefff;
}

.data-table td {
  color: #eaf8ff;
}

.data-table tbody tr:hover,
.historial-card-header,
.stat-item {
  background: rgba(66, 232, 255, 0.055);
}

.btn-primary,
.menu-toggle {
  background: linear-gradient(135deg, #42e8ff, #2563eb);
  color: #001018;
  font-weight: 800;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #67e8f9, #3b82f6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #d7f5ff;
  border: 1px solid var(--border);
}

.badge-modelo {
  background: rgba(66, 232, 255, 0.14);
  color: #8ff3ff;
}
*/

/* JemcoTech Negro/Naranja theme override - DISABLED for theme toggle */
/* :root {
  --primary: #e07b00;
  --primary-dark: #b85e00;
  --primary-light: #ff8c00;
  --secondary: #888;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ff4500;
  --dark: #f0f0f0;
  --light: #0a0a0a;
  --border: #1e1e1e;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.5);
  --glow: 0 0 20px rgba(224,123,0,0.4);
}

body {
  color: #f0f0f0;
  background:
    radial-gradient(ellipse 60% 60% at 20% 80%, rgba(224, 123, 0, 0.08), transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 20%, rgba(255, 69, 0, 0.05), transparent 60%),
    #000000;
}

.login-screen {
  background:
    radial-gradient(ellipse 60% 60% at 20% 80%, rgba(224, 123, 0, 0.08), transparent 70%),
    #000000;
}

.login-container,
.main-header,
.table-container,
.historial-card,
.stat-card,
.panel-form,
.modal-content,
.inventory-card {
  background: rgba(10, 10, 10, 0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.login-header h1,
.view-header h2,
.main-header h1,
.modal-header h3,
.stat-value {
  color: #f0f0f0;
}

.sidebar {
  background: linear-gradient(180deg, #000000, #0a0a0a);
  border-right: 1px solid var(--border);
}

.nav-item.active {
  background: linear-gradient(135deg, #e07b00, #ff8c00) !important;
  color: #000 !important;
  font-weight: 800 !important;
}

.form-group input,
.form-group select,
.form-group textarea,
.search-box input,
.filter-select {
  background: rgba(17, 17, 17, 0.8);
  border-color: var(--border);
  color: #f0f0f0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(224, 123, 0, 0.15);
}

.data-table th {
  background: rgba(224, 123, 0, 0.08);
  color: #ffb347;
}

.data-table td {
  color: #f0f0f0;
}

.data-table tbody tr:hover,
.historial-card-header,
.stat-item {
  background: rgba(224, 123, 0, 0.05);
}

.btn-primary,
.menu-toggle {
  background: linear-gradient(135deg, #e07b00, #ff8c00) !important;
  color: #000 !important;
  font-weight: 800 !important;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff8c00, #e07b00) !important;
  box-shadow: var(--glow);
}

.badge-modelo {
  background: rgba(224, 123, 0, 0.14) !important;
  color: #ffb347 !important;
}

.inventory-card::before {
  background: #e07b00;
}

.spinner {
  border-top-color: #e07b00;
}
*/

/* To-Do Module Styles */
.todo-container { display: flex; flex-direction: column; gap: 20px; overflow-x: hidden; max-width: 100%; }
.todo-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; overflow-x: hidden; max-width: 100%; }
.todo-view-toggle { display: flex; gap: 8px; flex-wrap: wrap; max-width: 100%; }
.todo-view-toggle .btn { min-width: 80px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-view-toggle .btn.active { background: var(--primary); color: #000; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.todo-day-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; transition: background 0.3s, border-color 0.3s; overflow-x: hidden; max-width: 100%; }
.todo-day-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); overflow-x: hidden; max-width: 100%; }
.todo-day-header h4 { color: var(--primary); font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-day-header .todo-count { font-size: 12px; color: var(--text-secondary); background: var(--table-header-bg); padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); transition: background 0.2s; border-bottom: 1px solid var(--border); overflow-x: hidden; max-width: 100%; }
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: var(--table-header-bg); }
.todo-item.completed .todo-title { text-decoration: line-through; color: var(--text-secondary); }
.todo-checkbox { width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.2s; }
.todo-checkbox:hover { border-color: var(--primary); }
.todo-checkbox.checked { background: var(--primary); border-color: var(--primary); }
.todo-checkbox.checked::after { content: '✓'; color: #000; font-size: 12px; font-weight: 700; }
.todo-content { flex: 1; min-width: 0; overflow: hidden; }
.todo-title { font-size: 14px; color: var(--text-primary); font-weight: 500; margin-bottom: 2px; transition: color 0.3s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-description { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-due-date { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }
.todo-due-date.overdue { color: var(--danger); font-weight: 600; }
.todo-actions { display: flex; gap: 6px; flex-shrink: 0; overflow-x: hidden; max-width: 100%; }
.todo-empty { text-align: center; padding: 40px 20px; color: var(--text-secondary); overflow-x: hidden; max-width: 100%; }
.todo-empty svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }
.todo-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; overflow-x: hidden; max-width: 100%; }
.todo-week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; overflow-x: hidden; max-width: 100%; }
.todo-week-day { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 8px; min-height: 120px; transition: background 0.3s, border-color 0.3s; overflow-x: hidden; max-width: 100%; }
.todo-week-day.today { border-color: var(--primary); background: var(--table-header-bg); }
.todo-week-day-header { text-align: center; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); overflow: hidden; max-width: 100%; }
.todo-week-day-name { font-size: 11px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-week-day-date { font-size: 18px; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-week-day.today .todo-week-day-date { color: var(--primary); }
.todo-week-tasks { display: flex; flex-direction: column; gap: 6px; overflow-x: hidden; max-width: 100%; }
.todo-week-task { font-size: 11px; padding: 6px 8px; background: var(--table-header-bg); border-radius: 4px; color: var(--text-primary); cursor: pointer; transition: background 0.2s; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.todo-week-task:hover { background: color-mix(in srgb, var(--primary) 20%, transparent); }
.todo-week-task.completed { text-decoration: line-through; opacity: 0.5; }

@media (max-width: 900px) {
  .todo-week-grid { grid-template-columns: 1fr; }
  .todo-week-day { min-height: auto; }
  .todo-form-row { grid-template-columns: 1fr; }
  .todo-view-toggle { width: 100%; }
  .todo-view-toggle .btn { flex: 1; }
}

.todo-summary-bar { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; overflow-x: hidden; max-width: 100%; }
.todo-summary-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 24px; text-align: center; flex: 1; min-width: 120px; transition: background 0.3s, border-color 0.3s; overflow-x: hidden; max-width: 100%; }
.todo-summary-item.delayed { border-color: var(--danger); }
.todo-summary-value { display: block; font-size: 28px; font-weight: 700; color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-summary-item.delayed .todo-summary-value { color: var(--danger); }
.todo-summary-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.billing-management-section { margin-top: 32px; overflow-x: hidden; max-width: 100%; }
.billing-management-section h3 { color: var(--primary); font-size: 18px; margin-bottom: 16px; }

/* Tabla de facturacion - columnas ajustadas */
#facturacion-tbody td:nth-child(1) { /* Codigo */
  font-weight: 600;
  white-space: nowrap;
}
#facturacion-tbody td:nth-child(2) { /* Tipo */
  white-space: nowrap;
  max-width: 100px;
}
#facturacion-tbody td:nth-child(3) { /* Cliente */
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#facturacion-tbody td:nth-child(4) { /* Serial */
  white-space: nowrap;
  max-width: 120px;
}
#facturacion-tbody td:nth-child(5) { /* Valor */
  white-space: nowrap;
  text-align: right;
}
#facturacion-tbody td:nth-child(6) { /* Garantia */
  white-space: nowrap;
  text-align: center;
}
#facturacion-tbody td:nth-child(7) { /* Expiracion */
  white-space: nowrap;
  font-size: 12px;
}
#facturacion-tbody td:nth-child(8) { /* Acciones */
  white-space: nowrap;
  width: 80px;
}

@media (max-width: 1100px) {
  #facturacion-tbody td:nth-child(3) { max-width: 120px; }
  #facturacion-tbody td:nth-child(4) { max-width: 100px; }
  #facturacion-tbody td:nth-child(7) { font-size: 11px; }
}

.stats-chart-section { margin-top: 32px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; transition: background 0.3s, border-color 0.3s; overflow-x: hidden; max-width: 100%; }
.stats-chart-section h3 { color: var(--primary); font-size: 18px; margin-bottom: 16px; }
.chart-controls { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; max-width: 100%; }
.chart-controls .btn { min-width: 80px; white-space: nowrap; }
.chart-controls .btn.active { background: var(--primary); color: #000; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.chart-container { position: relative; height: 300px; overflow-x: hidden; max-width: 100%; }

.billing-dynamic-fields { display: none; overflow-x: hidden; max-width: 100%; }
.billing-dynamic-fields .form-group { display: block; }

.billing-repair-fields { display: none; overflow-x: hidden; max-width: 100%; }
.billing-repair-fields .form-group { display: block; }

/* ===== FORMULARIO FACTURACION COMPACTO ===== */
.billing-form-compact {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  transition: background 0.3s, border-color 0.3s;
  overflow-x: hidden;
  max-width: 100%;
}

.billing-form-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.billing-form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  margin: 0;
}

.billing-form-row {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  flex-wrap: wrap;
  overflow-x: hidden;
  max-width: 100%;
}

.billing-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.billing-field label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  transition: color 0.3s;
}

.billing-field input,
.billing-field select,
.billing-field textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, background 0.3s, color 0.3s;
  width: 100%;
  min-height: 42px;
}

.billing-field input:focus,
.billing-field select:focus,
.billing-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-shadow);
}

.billing-field-type {
  flex: 0 0 200px;
}

.billing-field-serial {
  flex: 0 0 200px;
}

.billing-field-serial input {
  max-width: 200px;
}

.billing-field-customer {
  flex: 1 1 260px;
}

.billing-field-date {
  flex: 0 0 170px;
}

.billing-field-date input[type="date"] {
  padding: 10px 14px;
  font-size: 14px;
}

.billing-field-date input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.5;
  filter: none;
}

.billing-field-date input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.billing-field-days {
  flex: 0 0 140px;
}

.billing-field-days input {
  max-width: 140px;
  text-align: center;
}

.billing-field-console {
  flex: 0 0 170px;
}

.billing-field-model {
  flex: 0 0 200px;
}

.billing-field-failure {
  flex: 1 1 260px;
}

.billing-field-parts {
  flex: 0 0 200px;
}

.billing-field-value {
  flex: 0 0 180px;
}

.billing-field-observations {
  flex: 1 1 280px;
}

.billing-field-notes {
  flex: 0 0 240px;
}

.billing-field-full {
  flex: 1 1 100%;
}

.billing-field-full textarea {
  min-height: 80px;
  resize: vertical;
}

.billing-field textarea {
  min-height: 44px;
  resize: vertical;
  line-height: 1.5;
}

/* Ocultar campos de venta/reparacion segun tipo */
.billing-form-compact .billing-sale-field { display: none; }
.billing-form-compact .billing-repair-field { display: none; }
.billing-form-compact .billing-repair-fields { display: none; }
.billing-form-compact .billing-luvaga-field { display: none; }

.billing-form-compact.show-sale .billing-sale-field { display: flex; }
.billing-form-compact.show-repair .billing-repair-field { display: flex; }
.billing-form-compact.show-repair .billing-repair-fields { display: flex; }
.billing-form-compact.show-luvaga .billing-luvaga-field { display: flex; }
.billing-form-compact.show-luvaga .billing-field-serial { display: none; }
.billing-form-compact.show-luvaga .billing-field-customer { display: none; }
.billing-form-compact.show-luvaga .billing-field-value { display: none; }
.billing-form-compact.show-luvaga .billing-field-observations { display: none; }
.billing-form-compact.show-luvaga .billing-field-notes { display: none; }
.billing-form-compact.show-luvaga .billing-repair-fields { display: none; }

.billing-form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-top: 8px;
}

.billing-form-actions .btn-primary {
  padding: 12px 36px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 8px;
}

.billing-form-actions .btn-secondary {
  padding: 12px 24px;
  font-size: 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.billing-form-actions .btn-secondary:hover {
  background: var(--table-header-bg);
  border-color: var(--primary);
  color: var(--text-primary);
}

/* Modal de edicion de facturacion */
#modal-billing-edit .form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

#modal-billing-edit .form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#modal-billing-edit .form-group label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: color 0.3s;
}

#modal-billing-edit .form-group input,
#modal-billing-edit .form-group select,
#modal-billing-edit .form-group textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, background 0.3s, color 0.3s;
}

#modal-billing-edit .form-group input:focus,
#modal-billing-edit .form-group select:focus,
#modal-billing-edit .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus-shadow);
}

#modal-billing-edit .form-group textarea {
  resize: vertical;
  min-height: 60px;
}

@media (max-width: 600px) {
  #modal-billing-edit .form-row {
    flex-direction: column;
    gap: 12px;
  }
}

/* Responsive */
@media (max-width: 1200px) {
  .billing-field-type { flex: 0 0 185px; }
  .billing-field-serial { flex: 0 0 185px; }
  .billing-field-date { flex: 0 0 160px; }
  .billing-field-days { flex: 0 0 130px; }
  .billing-field-console { flex: 0 0 160px; }
  .billing-field-model { flex: 0 0 180px; }
  .billing-field-value { flex: 0 0 165px; }
  .billing-field-parts { flex: 0 0 180px; }
  .billing-field-notes { flex: 0 0 220px; }
}

@media (max-width: 900px) {
  .billing-form-compact {
    padding: 24px;
    gap: 24px;
  }

  .billing-form-section {
    gap: 14px;
  }

  .billing-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: flex-start;
  }

  .billing-field-customer,
  .billing-field-full,
  .billing-field-observations,
  .billing-field-notes {
    grid-column: 1 / -1;
  }

  .billing-field,
  .billing-field-type,
  .billing-field-serial,
  .billing-field-date,
  .billing-field-days,
  .billing-field-console,
  .billing-field-model,
  .billing-field-failure,
  .billing-field-parts,
  .billing-field-value {
    flex: none;
  }

  .billing-field-serial input,
  .billing-field-days input {
    max-width: 100%;
  }

  .billing-form-actions {
    flex-direction: column;
  }

  .billing-form-actions .btn-primary,
  .billing-form-actions .btn-secondary {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .billing-form-compact {
    padding: 20px;
    gap: 20px;
  }

  .billing-field input,
  .billing-field select,
  .billing-field textarea {
    padding: 12px 16px;
    font-size: 15px;
  }

  .billing-field label {
    font-size: 13px;
  }
}

/* ===== TARJETAS FACTURACION MOBILE ===== */
.billing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  transition: background 0.3s, border-color 0.3s;
}

.billing-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.billing-card-code {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.billing-card-type {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--table-header-bg);
  color: var(--primary);
  border-radius: 4px;
  font-weight: 600;
}

.billing-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.billing-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.billing-card-label {
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.03em;
}

.billing-card-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

.billing-card-valor {
  color: var(--success);
  font-weight: 700;
  font-size: 14px;
}

.billing-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

/* ===== TARJETAS USUARIOS MOBILE ===== */
.usuario-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  transition: background 0.3s, border-color 0.3s;
}

.usuario-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.usuario-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.usuario-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.usuario-card-username {
  font-size: 12px;
  color: var(--text-secondary);
}

.usuario-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.usuario-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

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

.usuario-card-value {
  color: var(--text-primary);
  font-weight: 500;
}

.usuario-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

/* ===== TODO SUMMARY BAR FIX ===== */
.todo-summary-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  overflow-x: auto;
}

.todo-summary-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  text-align: center;
  flex: 1 1 0;
  min-width: 70px;
  max-width: 140px;
}

.todo-summary-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.todo-summary-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== INVENTORY CARD TEXT COLORS (LUGAVA) ===== */
.inventory-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  transition: background 0.3s, border-color 0.3s;
}

.inventory-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.inventory-card-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inventory-card-serial {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.inventory-card-modelo-text {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

.inventory-card-row {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}

.inventory-card-field {
  flex: 1;
}

.inventory-card-field.full-width {
  flex: 1 1 100%;
}

.inventory-card-label {
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 2px;
}

.inventory-card-value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.inventory-card-meta {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.inventory-card-company {
  font-size: 12px;
  color: var(--text-secondary);
}

.inventory-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

/* ===== TABLE & PANEL DARK/LIGHT SUPPORT ===== */
.table-container,
.panel-form,
.modal-content,
.stat-card,
.historial-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

.data-table th {
  background: var(--table-header-bg);
  color: var(--table-header-text);
  transition: background 0.3s, color 0.3s;
}

.data-table td {
  color: var(--text-primary);
  border-bottom-color: var(--border);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

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

.form-group input,
.form-group select,
.form-group textarea,
.search-box input,
.filter-select {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-primary);
  transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.form-group label {
  color: var(--text-secondary);
}

/* ===== RESPONSIVE MAIN HEADER ===== */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .main-header {
    padding: 10px 16px;
  }

  .main-header h1 {
    font-size: 15px;
  }

  .content-area {
    padding: 16px;
  }

  .theme-toggle {
    padding: 6px;
  }

  .theme-toggle svg {
    width: 18px;
    height: 18px;
  }
}

/* ===== RESPONSIVE TABLES ===== */
@media (max-width: 900px) {
  .desktop-table {
    display: none;
  }

  .cards-container.mobile-cards {
    display: grid;
  }
}

@media (min-width: 901px) {
  .cards-container.mobile-cards {
    display: none;
  }
}
