﻿/* ============================================================
   Refaccionaria Los Primos - Estilos
   Paleta industrial: negro carbon + naranja seguridad + amarillo
   ============================================================ */
:root {
  --fondo: #0C0D0F;
  --fondo-2: #131518;
  --panel: #15181C;
  --panel-2: #1C2025;
  --panel-3: #23272D;
  --borde: #2A2E35;
  --borde-fuerte: #3A3F47;
  --texto: #F2F3F5;
  --texto-suave: #9AA0A6;
  --acento: #FF6B00;
  --acento-2: #FFC300;
  --ok: #2FBF71;
  --warn: #FFC300;
  --peligro: #D62828;
  --radio: 8px;
  --fuente-titulo: 'Barlow Condensed', 'Oswald', 'Arial Narrow', Impact, sans-serif;
}

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

body {
  font-family: 'Barlow', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--fondo);
  color: var(--texto);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
  background-image:
    radial-gradient(1100px 520px at 78% -12%, rgba(255,107,0,.13), transparent 62%),
    radial-gradient(900px 500px at 5% 108%, rgba(255,195,0,.06), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.020) 0 2px, transparent 2px 7px);
  background-attachment: fixed;
}

/* cinta de precaucion: le da el caracter de taller */
body::after {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 5px;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(45deg,
    var(--acento-2) 0 12px, #141414 12px 24px);
  box-shadow: 0 2px 10px rgba(0,0,0,.6);
}

/* placa antiderrapante de fondo (hexagonos) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.055' stroke-width='1'%3E%3Cpath d='M28 0 L56 16 L56 48 L28 64 L0 48 L0 16 Z'/%3E%3Cpath d='M28 48.5 L56 64.5 L56 96.5 L28 112.5 L0 96.5 L0 64.5 Z'/%3E%3C/g%3E%3C/svg%3E");
}

h1, h2, h3, .titulo {
  font-family: var(--fuente-titulo);
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 700;
}

a { color: var(--acento); }

/* ---------- LOGIN ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  background:
    radial-gradient(circle at 50% 12%, rgba(255,107,0,.20) 0%, transparent 55%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.025) 0 8px, transparent 8px 16px),
    linear-gradient(180deg, #0E1013, #08090A);
}
.login-card {
  position: relative;
  background: linear-gradient(180deg, #1A1D22, #121417);
  border: 1px solid var(--borde-fuerte);
  border-radius: 10px;
  padding: 34px 30px 30px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 26px 70px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.05);
  border-top: 4px solid var(--acento);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.logo-login { width: 118px; height: 118px; display: block; margin: 0 auto 10px; filter: drop-shadow(0 10px 28px rgba(255,107,0,.35)); }
.placa-logo {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--acento), #C24E00);
  color: #101113;
  font-family: var(--fuente-titulo);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .5px;
  box-shadow: 0 8px 22px rgba(255,107,0,.35), inset 0 1px 0 rgba(255,255,255,.35);
}
.login-logo h1 {
  font-size: 34px;
  line-height: 1;
  color: var(--texto);
  letter-spacing: 1.5px;
}
.login-logo span {
  display: block;
  font-size: 11px;
  color: var(--acento);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-top: 8px;
  font-weight: 700;
}

/* ---------- LAYOUT ---------- */
.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; padding-top: 5px; }

.sidebar {
  width: 232px;
  background: linear-gradient(180deg, #16191D 0%, #0D0F11 100%);
  border-right: 1px solid #23262B;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 5px;
  height: calc(100vh - 5px);
  overflow-y: auto;
  box-shadow: 6px 0 24px rgba(0,0,0,.45);
}
.sidebar .marca {
  padding: 20px 18px 18px;
  border-bottom: 1px solid #23262B;
  display: flex;
  align-items: center;
  gap: 11px;
  background: linear-gradient(180deg, rgba(255,107,0,.07), transparent);
}
.sidebar .marca .logo-img {
  width: 44px; height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  filter: drop-shadow(0 4px 12px rgba(255,107,0,.35));
}
.sidebar .marca h2 {
  font-size: 19px;
  line-height: 1;
  letter-spacing: 1px;
}
.sidebar .marca small {
  display: block;
  color: var(--acento);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-weight: 700;
  margin-top: 4px;
}
.sidebar nav { padding: 12px 8px; flex: 1; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--texto-suave);
  text-decoration: none;
  border-radius: 6px;
  margin-bottom: 2px;
  font-family: var(--fuente-titulo);
  font-size: 15px;
  letter-spacing: .8px;
  text-transform: uppercase;
  border-left: 3px solid transparent;
  transition: .15s;
}
.sidebar nav a:hover { background: #1B1F24; color: var(--texto); border-left-color: #3A3F47; }
.sidebar nav a.activo {
  background: linear-gradient(90deg, rgba(255,107,0,.20), rgba(255,107,0,0) 85%);
  color: #fff;
  border-left-color: var(--acento);
}
.sidebar .pie {
  padding: 14px 16px;
  border-top: 1px solid #23262B;
  font-size: 12px;
  color: var(--texto-suave);
  background: rgba(0,0,0,.25);
}
.sidebar .pie strong { color: var(--texto); display: block; font-size: 13px; }
.sidebar .pie a {
  color: var(--acento);
  text-decoration: none;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.contenido {
  margin-left: 232px;
  flex: 1;
  padding: 26px 30px 60px;
  min-width: 0;
}
.encabezado {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--borde);
}
.encabezado h1 {
  font-size: 30px;
  line-height: 1;
  position: relative;
  padding-left: 14px;
}
.encabezado h1::before {
  content: "";
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  width: 5px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--acento), var(--acento-2));
}
.encabezado .sub { color: var(--texto-suave); font-size: 13px; margin-top: 4px; }

/* ---------- TARJETAS ---------- */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card, .panel {
  background: linear-gradient(180deg, #171A1F 0%, #131518 100%);
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  padding: 18px;
  position: relative;
  box-shadow: 0 6px 22px rgba(0,0,0,.35);
  margin-bottom: 16px;
}
.card::after, .panel::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  border-radius: var(--radio) var(--radio) 0 0;
  background: linear-gradient(90deg, var(--acento), rgba(255,107,0,0) 70%);
  opacity: .8;
}
.card h3, .panel h2 {
  font-size: 13px;
  letter-spacing: 1.4px;
  color: var(--texto-suave);
  margin-bottom: 12px;
  font-weight: 600;
}
.panel h2 { font-size: 16px; color: var(--texto); }
.kpi {
  font-family: var(--fuente-titulo);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.kpi.chico { font-size: 24px; }
.kpi.verde { color: var(--ok); }
.kpi.rojo { color: var(--peligro); }
.kpi.amarillo { color: var(--acento-2); }

/* ---------- FORMULARIOS ---------- */
label {
  display: block;
  font-size: 11px;
  color: var(--texto-suave);
  margin-bottom: 5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
}
input, select, textarea {
  width: 100%;
  background: #0F1114;
  border: 1px solid var(--borde);
  color: var(--texto);
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--acento);
  box-shadow: 0 0 0 3px rgba(255,107,0,.16);
  background: #12151A;
}
input::placeholder { color: #5C636C; }
textarea { resize: vertical; min-height: 70px; }
.campo { margin-bottom: 14px; }
.fila { display: flex; gap: 12px; flex-wrap: wrap; }
.fila > .campo { flex: 1; min-width: 140px; }

/* ---------- BOTONES ---------- */
.btn, .boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 6px;
  border: 1px solid var(--borde-fuerte);
  background: linear-gradient(180deg, #242930, #1A1E23);
  color: var(--texto);
  font-family: var(--fuente-titulo);
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover, .boton:hover { background: #2C323A; border-color: #4A5058; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primario {
  background: linear-gradient(180deg, #FF7A14, #E05D00);
  border-color: #FF8C33;
  color: #14100B;
  box-shadow: 0 3px 12px rgba(255,107,0,.30), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primario:hover { background: linear-gradient(180deg, #FF8A2B, #EE6600); filter: none; }
.btn-ok {
  background: linear-gradient(180deg, #35CC7A, #23974F);
  border-color: #46D98A;
  color: #08150D;
}
.btn-ok:hover { filter: brightness(1.08); }
.btn-peligro {
  background: linear-gradient(180deg, #E43232, #B01C1C);
  border-color: #E94B4B;
  color: #fff;
}
.btn-chico { padding: 5px 11px; font-size: 13px; letter-spacing: .6px; }
.btn-bloque { width: 100%; }

/* ---------- TABLAS ---------- */
.tabla-wrap {
  background: #131518;
  border: 1px solid var(--borde);
  border-radius: var(--radio);
  overflow: auto;
}
table, .tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left;
  padding: 11px 14px;
  background: #191C21;
  color: var(--texto-suave);
  font-family: var(--fuente-titulo);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  border-bottom: 2px solid rgba(255,107,0,.45);
  white-space: nowrap;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(42,46,53,.7);
  vertical-align: middle;
}
tbody tr:hover { background: rgba(255,107,0,.045); }
tbody tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.vacio {
  text-align: center;
  color: var(--texto-suave);
  padding: 34px 14px;
  font-style: italic;
}

/* ---------- ETIQUETAS ---------- */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.tag-ok { background: rgba(47,191,113,.14); color: #55D992; border-color: rgba(47,191,113,.35); }
.tag-warn { background: rgba(255,195,0,.14); color: var(--acento-2); border-color: rgba(255,195,0,.35); }
.tag-peligro { background: rgba(214,40,40,.16); color: #FF7B7B; border-color: rgba(214,40,40,.40); }
.tag-info { background: rgba(255,107,0,.14); color: #FFA45C; border-color: rgba(255,107,0,.35); }
.tag-gris { background: rgba(154,160,166,.14); color: var(--texto-suave); border-color: rgba(154,160,166,.28); }

/* ---------- MODAL ---------- */
.modal-fondo {
  position: fixed;
  inset: 0;
  background: rgba(5,6,7,.82);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  overflow-y: auto;
}
.modal-fondo.abierto { display: flex; }
.modal {
  background: linear-gradient(180deg, #191C21, #121417);
  border: 1px solid var(--borde-fuerte);
  border-radius: 10px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.75);
}
.modal.ancho { max-width: 900px; }
.modal-cab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--borde);
  position: sticky;
  top: 0;
  background: #191C21;
  z-index: 2;
  border-top: 3px solid var(--acento);
}
.modal-cab h2 { font-size: 20px; letter-spacing: 1px; }
.modal-cab button {
  background: none;
  border: none;
  color: var(--texto-suave);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-cab button:hover { color: var(--acento); }
.modal-cuerpo { padding: 22px; }
.modal-pie {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--borde);
  position: sticky;
  bottom: 0;
  background: #16191D;
}

/* ---------- AVISOS ---------- */
.aviso {
  padding: 11px 15px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid transparent;
  border-left-width: 4px;
}
.aviso-error { background: rgba(214,40,40,.10); border-color: rgba(214,40,40,.45); color: #FF9A9A; }
.aviso-ok { background: rgba(47,191,113,.10); border-color: rgba(47,191,113,.45); color: #6FE3A8; }

/* ---------- TOAST ---------- */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 13px 20px;
  border-radius: 6px;
  font-family: var(--fuente-titulo);
  font-size: 16px;
  letter-spacing: .8px;
  text-transform: uppercase;
  z-index: 999;
  opacity: 0;
  transform: translateY(14px);
  transition: .25s;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
#toast.visible { opacity: 1; transform: translateY(0); }
#toast.exito { background: var(--ok); color: #06170D; }
#toast.error { background: var(--peligro); color: #fff; }

/* ---------- UTILIDADES ---------- */
.acciones { display: flex; gap: 6px; flex-wrap: wrap; }
.texto-suave { color: var(--texto-suave); }
.small { font-size: 12px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.oculto { display: none !important; }
.centro { text-align: center; }
.barra-busqueda, .buscador { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.barra-busqueda input, .buscador input { flex: 1; min-width: 200px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 820px) {
  .layout { flex-direction: column; padding-top: 5px; }

  .sidebar {
    position: sticky;
    top: 5px;
    width: 100%;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    border-right: none;
    border-bottom: 1px solid #23262B;
    overflow: hidden;
    z-index: 40;
    background: linear-gradient(180deg, #16191D, #101214);
  }
  .sidebar .marca {
    padding: 7px 12px;
    border-bottom: 1px solid #23262B;
    flex: 0 0 auto;
    gap: 8px;
    background: none;
  }
  .sidebar .marca .logo-img { width: 30px; height: 30px; flex: 0 0 30px; }
  .sidebar .marca h2 { font-size: 14px; letter-spacing: .5px; }
  .sidebar .marca small { display: none; }

  .sidebar nav {
    display: flex;
    width: 100%;
    padding: 4px 6px;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .sidebar nav a {
    flex: 0 0 auto;
    padding: 8px 10px;
    margin: 0;
    font-size: 13px;
    letter-spacing: .5px;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: 6px 6px 0 0;
    white-space: nowrap;
  }
  .sidebar nav a span { display: inline; }
  .sidebar nav a.activo {
    background: none;
    border-bottom-color: var(--acento);
    color: #fff;
  }
  .sidebar .pie { display: none; }

  .contenido { margin-left: 0; padding: 14px 12px 44px; }
  .encabezado { margin-bottom: 14px; padding-bottom: 10px; }
  .encabezado h1 { font-size: 23px; padding-left: 11px; }
  .encabezado h1::before { width: 4px; }
  .encabezado .sub { font-size: 12px; }
  .barra-busqueda { gap: 8px; }
  .barra-busqueda input, .barra-busqueda select { min-width: 100%; }
  .kpi { font-size: 28px; }
  .card, .panel { padding: 14px; }
  .modal { max-width: 100%; }

  /* tabla de ordenes: en celular se ocultan columnas secundarias */
  #tabla-servicios th:nth-child(2), #tabla-servicios td:nth-child(2),
  #tabla-servicios th:nth-child(6), #tabla-servicios td:nth-child(6),
  #tabla-servicios th:nth-child(7), #tabla-servicios td:nth-child(7) {
    display: none;
  }
  #tabla-servicios th, #tabla-servicios td { padding: 7px 6px; font-size: 11.5px; }
  #tabla-servicios th:nth-child(8), #tabla-servicios td:nth-child(8),
  #tabla-servicios th:nth-child(9), #tabla-servicios td:nth-child(9) { display: none; }
  #tabla-servicios tr[data-estado="pendiente"] td:first-child { border-left: 3px solid #FFC300; }
  #tabla-servicios tr[data-estado="en_proceso"] td:first-child { border-left: 3px solid #FF6B00; }
  #tabla-servicios tr[data-estado="terminado"] td:first-child { border-left: 3px solid #2FBF71; }
  #tabla-servicios tr[data-estado="entregado"] td:first-child { border-left: 3px solid #3A4048; }
  #tabla-servicios td:first-child { white-space: nowrap; }
  #tabla-servicios td .tag { font-size: 10px; padding: 2px 6px; }
}


