@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600;1,700&display=swap');

:root {
  --bg-main: #0A0A0D;
  --bg-card: #121217;
  --bg-card-subtle: #181822;
  --bg-card-hover: #1C1C28;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-emerald: rgba(16, 185, 129, 0.3);

  --text-main: #F3F4F6;
  --text-muted: #9CA3AF;
  --text-dim: #64748B;

  --emerald-400: #34D399;
  --emerald-500: #10B981;
  --emerald-600: #059669;
  --emerald-bg: rgba(16, 185, 129, 0.1);

  --cyan-400: #22D3EE;
  --cyan-bg: rgba(6, 182, 212, 0.1);

  --amber-400: #FBBF24;
  --amber-bg: rgba(245, 158, 11, 0.1);

  --font-sans: 'Chakra Petch', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* HugeIcons font icon helper (idéntico a biopower-frontend) */
i[class*="hgi-"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  font-style: normal;
}

[class^="hgi-"], [class*=" hgi-"], i.hugeicons, .hugeicons {
  font-family: 'hugeicons-font', 'hgi-stroke-rounded' !important;
}

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

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

/* CONTAINER CON TAMAÑO ORIGINAL Y PROPORCIONADO */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content {
  flex: 1;
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
}

.font-mono {
  font-family: var(--font-mono) !important;
}

.font-bold {
  font-weight: 700;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

/* NAVBAR & HEADER SHINE (BioPower Style) */
.navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(10, 10, 13, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.65rem 0;
}

.header-shine::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(20, 184, 166, 0.7), rgba(6, 182, 212, 0.5), transparent);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
}

.brand-badge {
  font-size: 0.725rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--emerald-400);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* STATUS BADGE */
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

.pulse-dot.live {
  background-color: var(--emerald-400);
  box-shadow: 0 0 8px var(--emerald-400);
}

.pulse-dot.demo {
  background-color: var(--amber-400);
  box-shadow: 0 0 8px var(--amber-400);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.725rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
}

.badge-live {
  background: var(--emerald-bg);
  color: var(--emerald-400);
  border: 1px solid var(--border-emerald);
}

.badge-demo {
  background: var(--amber-bg);
  color: var(--amber-400);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* USER SESSION PILL */
.user-session-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.775rem;
  font-weight: 600;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

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

.btn-primary {
  background: var(--emerald-500);
  color: #04251B;
}

.btn-primary:hover {
  background: var(--emerald-400);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.18);
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.6rem;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

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

.stat-card-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.stat-card-glow.highlight {
  background: linear-gradient(90deg, transparent, var(--emerald-400), transparent);
}

.stat-highlight {
  background: linear-gradient(180deg, #131E18 0%, var(--bg-card) 100%);
  border-color: var(--border-emerald);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

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

.stat-icon-wrap {
  color: var(--text-dim);
  display: flex;
  align-items: center;
}

.stat-icon-wrap.fuel {
  color: var(--emerald-400);
}

.stat-value {
  font-size: 2.1rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.stat-highlight .stat-value {
  color: var(--emerald-400);
}

.stat-unit {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0;
}

.stat-meta {
  font-size: 0.775rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
}

/* PANEL CARD */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #FFFFFF;
}

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

/* SEARCH */
.search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-grow: 1;
  max-width: 480px;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.search-input {
  width: 100%;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.55rem 0.85rem 0.55rem 2.3rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s ease;
}

.search-input:focus {
  border-color: var(--emerald-400);
}

.search-clear-btn {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  transition: color 0.15s ease;
}

.search-clear-btn:hover {
  color: var(--text-main);
}

.search-result-count {
  font-size: 0.775rem;
  color: var(--emerald-400);
  font-weight: 600;
  white-space: nowrap;
}

.no-results-cell {
  padding: 3rem 1rem !important;
  text-align: center;
  color: var(--text-muted);
}

.no-results-icon {
  font-size: 1.75rem;
  margin-bottom: 0.4rem;
}

.no-results-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.no-results-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* DATA TABLE SCROLLABLE */
.table-responsive {
  width: 100%;
  max-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

/* Custom sleek scrollbar para la tabla */
.table-responsive::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-responsive::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.4);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #16161F;
  color: var(--text-muted);
  font-size: 0.725rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table th:first-child {
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

.data-table th:last-child {
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.data-table td {
  padding: 1rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.data-table tr.table-row:hover td {
  background-color: var(--bg-card-hover);
}

/* CAMPOS DE LA TABLA */
.carrier-name {
  color: #FFFFFF;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.cuit-text {
  color: #CBD5E1;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.driver-text {
  color: #E2E8F0;
  font-size: 0.875rem;
  font-weight: 500;
}

.phone-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--cyan-400);
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.phone-link:hover {
  color: #67E8F9;
  text-decoration: underline;
}

/* KM DISPLAY HORIZONTAL */
.km-val {
  color: #FFFFFF;
  font-size: 1.05rem;
  font-weight: 700;
}

.unit-val {
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.25rem;
}

/* GASOIL DISPLAY LIMPIO Y HORIZONTAL (SOLO TEXTO) */
.gasoil-inline {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.3rem;
  background: transparent;
  border: none;
  padding: 0;
  white-space: nowrap;
}

.gasoil-num {
  color: var(--emerald-400);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.gasoil-unit {
  color: var(--emerald-500);
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-trips {
  display: inline-block;
  background: transparent;
  color: var(--text-main);
  border: none;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
}

.empty-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: #FFFFFF;
  margin-bottom: 0.4rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

/* FOOTER */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 1.25rem 0;
  font-size: 0.75rem;
  color: var(--text-dim);
  background: rgba(10, 10, 13, 0.6);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ratio-note {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-dim);
}

.ratio-note code {
  color: var(--emerald-400);
  font-family: var(--font-mono);
}

.status-indicator.online {
  color: var(--emerald-400);
}

.status-indicator.warning {
  color: var(--amber-400);
}

/* MODAL DE SESIÓN SSO */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: 100%;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #FFFFFF;
}

.modal-body {
  padding: 1.5rem;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.modal-steps {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: #CBD5E1;
}

.modal-steps code {
  color: var(--cyan-400);
  background: rgba(0, 0, 0, 0.4);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-family: var(--font-mono);
}

.modal-label {
  display: block;
  font-size: 0.775rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.modal-input {
  width: 100%;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.65rem 0.85rem;
  font-size: 0.85rem;
  outline: none;
  margin-bottom: 1.25rem;
  transition: border-color 0.15s ease;
}

.modal-input:focus {
  border-color: var(--emerald-400);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}
