:root {
  --tl-dark: #12131c;       /* sidebar / superficies oscuras */
  --tl-dark-2: #1a1c29;     /* hover / superficies oscuras secundarias */
  --tl-accent: #f97316;     /* naranja principal */
  --tl-accent-dark: #ea580c;
  --tl-accent-2: #0ea5e9;   /* celeste secundario (links/info) */
  --tl-success: #16a34a;
  --tl-danger: #dc2626;
  --tl-warning: #d97706;
  --tl-bg: #f3f4f7;         /* fondo general del contenido */
  --tl-border: #e5e7eb;
  --tl-text-muted: #6b7280;
  --tl-radius: 14px;
  --tl-radius-sm: 10px;
}

body {
  background: var(--tl-bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: #1f2330;
}

h1, h2, h3, h4, h5, h6, .navbar-brand { letter-spacing: -.01em; }

/* ---------- Login ---------- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 20% 20%, #1f2233 0%, var(--tl-dark) 55%, #000 140%);
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.login-card .brand {
  text-align: center;
  margin-bottom: 1.5rem;
}
.login-card .brand i {
  font-size: 2.2rem;
  color: var(--tl-accent);
}
.login-card .brand h1 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: .4rem 0 0;
  color: var(--tl-dark);
}
.login-card .brand small {
  color: var(--tl-text-muted);
}

/* ---------- Layout general ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--tl-border);
  position: sticky;
  top: 0;
  z-index: 1030;
  padding-top: .6rem;
  padding-bottom: .6rem;
}
.topbar .navbar-brand {
  color: #12131c !important;
  font-weight: 800;
}
.topbar .navbar-brand i { color: var(--tl-accent); }
.topbar .btn-outline-light {
  color: #374151;
  border-color: var(--tl-border);
}
.topbar .btn-outline-light:hover {
  background: var(--tl-bg);
  color: #12131c;
  border-color: var(--tl-border);
}
.topbar .text-light { color: #374151 !important; }
.topbar a.text-light:hover { color: var(--tl-accent) !important; }

.layout {
  display: flex;
  min-height: calc(100vh - 56px);
}
.sidebar {
  width: 250px;
  background: var(--tl-dark);
  flex-shrink: 0;
  padding: 1rem .85rem;
}
.sidebar .nav-link {
  color: #a3a7bd;
  padding: .62rem .9rem;
  font-size: .93rem;
  border-radius: var(--tl-radius-sm);
  margin-bottom: .15rem;
  transition: background .15s ease, color .15s ease;
}
.sidebar .nav-link i { width: 22px; display: inline-block; text-align: center; }
.sidebar .nav-link:hover {
  background: var(--tl-dark-2);
  color: #fff;
}
.sidebar .nav-link.active {
  background: var(--tl-accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(249,115,22,.35);
}
.sidebar-submenu {
  background: transparent;
  border-left: 2px solid var(--tl-dark-2);
  margin-left: .95rem;
  padding-left: .3rem;
}
.sidebar-submenu .nav-link {
  padding: .55rem .8rem;
  font-size: .87rem;
}
.sidebar [data-bs-toggle="collapse"] {
  text-transform: uppercase;
  font-size: .74rem;
  letter-spacing: .06em;
  color: #6b7085;
  font-weight: 700;
  padding: .9rem .9rem .4rem;
}
.sidebar [data-bs-toggle="collapse"]:hover { color: #fff; background: transparent; }
.sidebar [data-bs-toggle="collapse"] .bi-chevron-down {
  transition: transform .2s ease;
  font-size: .7rem;
}
.sidebar [data-bs-toggle="collapse"][aria-expanded="true"] .bi-chevron-down {
  transform: rotate(180deg);
}

/* Widget de cotización del dólar dentro de la sidebar */
.sidebar-dolar {
  background: var(--tl-dark-2);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--tl-radius-sm);
  padding: .8rem .9rem;
  margin-bottom: 1rem;
  font-size: .82rem;
}
.sidebar-dolar .sidebar-dolar-titulo {
  color: #8b8fa3;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sidebar-dolar .sidebar-dolar-fila {
  display: flex;
  justify-content: space-between;
  color: #d1d3e0;
  margin-top: .3rem;
}
.sidebar-dolar .sidebar-dolar-fila strong { color: #fff; }
.sidebar-dolar .sidebar-dolar-venta { color: var(--tl-accent); }
.sidebar-dolar .sidebar-dolar-compra { color: var(--tl-success); }

.content {
  flex: 1;
  padding: 1.6rem;
  max-width: 100%;
  overflow-x: auto;
}

@media (max-width: 991px) {
  .sidebar {
    position: fixed;
    left: -250px;
    top: 56px;
    bottom: 0;
    z-index: 1020;
    overflow-y: auto;
    transition: left .2s ease;
  }
  .sidebar.show { left: 0; }
}

/* ---------- Tarjetas de estadísticas ---------- */
.stat-card {
  background: #fff;
  border-radius: var(--tl-radius);
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--tl-border);
  box-shadow: 0 4px 14px rgba(18,19,28,.05);
  height: 100%;
  overflow: hidden;
}
.stat-card .stat-num {
  font-size: clamp(1.15rem, 4.2vw, 1.9rem);
  font-weight: 800;
  color: #12131c;
  line-height: 1.15;
  overflow-wrap: break-word;
  word-break: break-word;
}
.stat-card .stat-label {
  color: var(--tl-text-muted);
  font-size: clamp(.72rem, 2.4vw, .82rem);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-weight: 600;
}
.stat-card i {
  font-size: 1.1rem;
  color: #fff;
  background: var(--tl-accent);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .5rem;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .stat-card { padding: .9rem 1rem; }
}

/* ---------- Tablas y tarjetas de contenido ---------- */
.card-tl {
  background: #fff;
  border-radius: var(--tl-radius);
  border: 1px solid var(--tl-border);
  box-shadow: 0 4px 14px rgba(18,19,28,.05);
}
.table-tl thead th {
  background: #f8f9fb;
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 700;
  color: var(--tl-text-muted);
  border-bottom: 1px solid var(--tl-border);
  padding-top: .85rem;
  padding-bottom: .85rem;
}
.table-tl td, .table-tl th { vertical-align: middle; border-color: var(--tl-border); }
.table-tl tbody tr:hover { background: #fafafa; }

/* Columnas fijas para tablas anchas con scroll horizontal (ej: Reparaciones) */
.col-sticky-left {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  box-shadow: 2px 0 4px rgba(0,0,0,.06);
}
.col-sticky-right {
  position: sticky;
  right: 0;
  background: #fff;
  z-index: 2;
  box-shadow: -2px 0 4px rgba(0,0,0,.06);
}
.table-tl tbody tr:hover .col-sticky-left,
.table-tl tbody tr:hover .col-sticky-right {
  background: #fafafa;
}

/* ---------- Botones ---------- */
.btn { border-radius: var(--tl-radius-sm); font-weight: 600; }
.btn-sm { border-radius: 8px; }
.btn-primary {
  background: var(--tl-accent);
  border-color: var(--tl-accent);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--tl-accent-dark);
  border-color: var(--tl-accent-dark);
}
.btn-outline-primary {
  color: var(--tl-accent);
  border-color: var(--tl-accent);
}
.btn-outline-primary:hover {
  background: var(--tl-accent);
  border-color: var(--tl-accent);
}
.btn-link { color: var(--tl-accent); }

/* ---------- Badges (estados tipo pill) ---------- */
.badge {
  border-radius: 999px;
  font-weight: 600;
  padding: .4em .75em;
  font-size: .74rem;
  letter-spacing: .01em;
}

/* ---------- Formularios ---------- */
.form-control, .form-select {
  border-radius: var(--tl-radius-sm);
  border-color: var(--tl-border);
}
.form-control:focus, .form-select:focus {
  border-color: var(--tl-accent);
  box-shadow: 0 0 0 .2rem rgba(249,115,22,.15);
}
.form-control-sm, .form-select-sm { border-radius: 8px; }

/* ---------- Paginación ---------- */
.pagination .page-link {
  border-radius: 8px;
  margin: 0 2px;
  border-color: var(--tl-border);
  color: #374151;
}
.pagination .page-item.active .page-link {
  background: var(--tl-accent);
  border-color: var(--tl-accent);
}

.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 5px; top: 4px; bottom: 4px;
  width: 2px;
  background: var(--tl-border);
}
.timeline-item { position: relative; margin-bottom: 1.1rem; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--tl-accent);
}
