/*
 * Estilo propio del sistema, encima de la plantilla Argon: tipografía, tablas, formularios y carga.
 * Va después de argon-dashboard.css; aquí solo se ajusta, no se redefine la plantilla.
 */

/* ---------- Tipografía ---------- */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter/inter-latin-wght-normal.woff2") format("woff2");
}

:root {
    --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --ph-texto: #1f2a44;
    --ph-texto-suave: #5b6780;
    --ph-linea: #e6e9f0;
    --ph-fondo-suave: #f6f7fb;
    --ph-primario: #3d5af1;
}

body {
    font-family: var(--bs-font-sans-serif);
    font-size: 0.9rem;
    color: var(--ph-texto);
    font-feature-settings: "cv11", "ss01";   /* 1 y a de un solo trazo: se leen mejor en folios y RFC */
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--bs-font-sans-serif);
    color: var(--ph-texto);
    letter-spacing: -0.01em;
}

h5, .h5 { font-size: 1.05rem; font-weight: 650; }
h6, .h6 { font-size: 0.92rem; font-weight: 650; }

/* Los textos de apoyo de la plantilla eran muy chicos y muy claros */
.text-xxs { font-size: 0.72rem !important; }
.text-xs { font-size: 0.8rem !important; }
.text-sm { font-size: 0.875rem !important; }
.text-secondary { color: var(--ph-texto-suave) !important; }
label, .form-label, .form-control-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ph-texto-suave);
    margin-bottom: 0.3rem;
}

/* Cifras alineadas en columna: importes, folios, fechas */
table, .form-control, .badge, input, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- Encabezado y tarjetas ---------- */
.min-height-300 { min-height: 170px !important; }      /* la franja de color ocupaba media pantalla */
.navbar-main { padding-top: 0.35rem; padding-bottom: 0.35rem; }
.container-fluid.py-4 { padding-top: 0.75rem !important; }

.card {
    border: 1px solid var(--ph-linea);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(31, 42, 68, 0.04), 0 4px 16px rgba(31, 42, 68, 0.05);
}
.card .card-header { padding: 1rem 1.25rem; }
.card .card-body { padding: 1rem 1.25rem; }

/* ---------- Tablas ---------- */
.table { color: var(--ph-texto); margin-bottom: 0; }

.table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--ph-fondo-suave);
    color: var(--ph-texto-suave) !important;
    opacity: 1 !important;
    font-size: 0.68rem !important;
    font-weight: 650 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.6rem 0.6rem !important;
    border-bottom: 1px solid var(--ph-linea) !important;
    white-space: nowrap;
    text-align: left;
}

.table td,
.table tbody th {
    padding: 0.5rem 0.6rem !important;
    font-size: 0.8rem;
    border-bottom: 1px solid var(--ph-linea);
    vertical-align: middle;
    white-space: nowrap;          /* un dato por renglón; las columnas largas llevan .text-wrap */
    text-align: left;
}
.table td.text-wrap { white-space: normal !important; min-width: 9rem; }
.table td:first-child, .table th:first-child { padding-left: 1rem !important; }

.table tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { background-color: #f3f5fd; --bs-table-accent-bg: transparent; }

/* El texto de los renglones venía en negrita gris y diminuto */
.table td p, .table td h6, .table td span:not(.badge) { color: inherit; }
.table td p.text-xs, .table td .text-xs { font-size: 0.8rem !important; font-weight: 400 !important; }
.table td h6.text-sm, .table td .text-sm { font-size: 0.8rem !important; }
.table td h6.text-sm { font-weight: 600; }

/* Importes y cantidades a la derecha; acciones al final, sin partirse */
.table td.text-end, .table th.text-end, .table .ph-num { text-align: right !important; }
.table td.text-center, .table th.text-center { text-align: center !important; }
.table td:last-child { white-space: nowrap; }
.table td:last-child a { padding: 0.3rem 0.4rem; border-radius: 0.4rem; display: inline-block; }
.table td:last-child a:hover { background: #e9edfb; }
.table td:last-child a i { font-size: 0.95rem; }
.table td:last-child .text-secondary i, .table td:last-child i.text-secondary { color: var(--ph-texto-suave) !important; }

/* Botones dentro de un renglón (estatus de viaje, etc.): compactos */
.table td .btn { margin-bottom: 0; padding: 0.25rem 0.6rem; font-size: 0.72rem; box-shadow: none; }

.table-responsive { border-radius: 0.5rem; }

/* ---------- Etiquetas de estatus ---------- */
.badge {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
    padding: 0.35em 0.65em;
    border-radius: 0.4rem;
}
.badge.bg-gradient-success { background: #e3f6ec !important; color: #12794a !important; }
.badge.bg-gradient-warning { background: #fff3da !important; color: #94610a !important; }
.badge.bg-gradient-danger { background: #fde7e9 !important; color: #b3261e !important; }
.badge.bg-gradient-info { background: #e3f0fd !important; color: #17568f !important; }
.badge.bg-gradient-secondary { background: #eceff5 !important; color: #46516a !important; }
.badge.bg-gradient-primary { background: #e7ebfe !important; color: #2f45c5 !important; }

/* ---------- Formularios y botones ---------- */
.form-control, .form-select {
    font-size: 0.9rem;
    color: var(--ph-texto);
    border-color: #d5dae6;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}
.form-control::placeholder { color: #9aa4b8; }
.form-control:focus, .form-select:focus { border-color: var(--ph-primario); box-shadow: 0 0 0 3px rgba(61, 90, 241, 0.15); }
.form-control:disabled, .form-control[readonly], .form-select:disabled {
    background-color: var(--ph-fondo-suave);
    color: var(--ph-texto);
    -webkit-text-fill-color: var(--ph-texto);
    opacity: 1;
}

.btn {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    border-radius: 0.5rem;
    box-shadow: none;
}
.btn:hover:not(.btn-icon-only) { transform: none; box-shadow: 0 2px 6px rgba(31, 42, 68, 0.12); }
.btn.bg-gradient-primary, .btn-primary { background: var(--ph-primario) !important; border-color: var(--ph-primario); }

/* ---------- Paginación ---------- */
.pagination { margin: 0.75rem 0 0.25rem; }
.pagination .page-link {
    width: 2rem; height: 2rem; font-size: 0.8rem; font-weight: 600;
    border-radius: 0.5rem !important; border-color: var(--ph-linea); color: var(--ph-texto-suave);
}
.pagination .page-item.active .page-link { background: var(--ph-primario); border-color: var(--ph-primario); color: #fff; box-shadow: none; }

/* ---------- Menú lateral ---------- */
.sidenav .navbar-nav .nav-link { font-size: 0.875rem; color: var(--ph-texto); }
.sidenav .navbar-nav .nav .nav-link { font-size: 0.84rem; color: var(--ph-texto-suave); }
.sidenav .navbar-nav .nav-link.active { font-weight: 650; color: var(--ph-texto); background: #eef1fe; }
.sidenav .navbar-nav .nav .nav-link.active { color: var(--ph-primario); background: transparent; }
.sidenav .sidenav-mini-icon { display: none; }   /* las letras sueltas (C, E, U…) no aportaban */

/* ---------- Carga: barra delgada arriba en vez de la pantalla completa ---------- */
#ph-progreso {
    position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 3000;
    background: linear-gradient(90deg, #f5a623, #d0343f);
    opacity: 0; transition: width 0.25s ease, opacity 0.3s ease;
    pointer-events: none;
}
#ph-progreso.activa { opacity: 1; width: 75%; transition: width 8s cubic-bezier(0.1, 0.6, 0.2, 1), opacity 0.1s; }
#ph-progreso.lista { opacity: 0; width: 100%; }

/* "Cargando…" y los avisos del sistema: una pastilla arriba al centro, nunca una ventana a la derecha */
#ph-cargando, #ph-aviso {
    position: fixed; top: 14px; left: 50%; transform: translate(-50%, -10px); z-index: 3001;
    display: flex; align-items: center; gap: 9px; max-width: min(92vw, 560px);
    padding: 8px 18px; border-radius: 22px; background: #1f2a44; color: #fff;
    font-size: 0.82rem; font-weight: 600; line-height: 1.3; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
}
#ph-cargando.activo, #ph-aviso.activo { opacity: 1; transform: translate(-50%, 0); }
#ph-aviso.activo { pointer-events: auto; cursor: pointer; }
#ph-cargando i {
    flex: none; width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
    border-radius: 50%; animation: ph-gira 0.7s linear infinite;
}
#ph-aviso i { flex: none; font-size: 0.95rem; }
#ph-aviso.ph-aviso-success { background: #1f7a4d; }
#ph-aviso.ph-aviso-error { background: #b3261e; }
#ph-aviso.ph-aviso-warning { background: #a65f00; }
@keyframes ph-gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #ph-cargando i { animation-duration: 2s; } }

.footer { position: static; width: auto; height: auto; padding: 1rem 0 0.25rem; }

/* ---------- Logo del menú ---------- */
.sidenav-header { height: auto; padding: 1.25rem 1rem 1rem; text-align: center; }
.sidenav-header .navbar-brand { display: block; padding: 0; margin: 0; }
.navbar-vertical .navbar-brand .navbar-brand-img { max-height: 3.75rem !important; max-width: 82% !important; width: auto; height: auto; }
.navbar-vertical.navbar-expand-xs .navbar-collapse { height: calc(100vh - 9.5rem); }

/* El recuadro azul al dar clic en una sección del menú */
.sidenav .nav-link:focus { outline: 0; box-shadow: none; }
.sidenav .nav-link:focus-visible { outline: 2px solid rgba(61, 90, 241, 0.35); outline-offset: -2px; }

/* ---------- Filtros con buscador (Choices) ---------- */
.choices { margin-bottom: 0; font-size: 0.875rem; }
.choices .choices__inner {
    min-height: 0; padding: 0.42rem 2rem 0.42rem 0.75rem !important;
    background: #fff; border: 1px solid #d5dae6; border-radius: 0.5rem; font-size: 0.875rem;
}
.choices.is-focused .choices__inner, .choices.is-open .choices__inner { border-color: var(--ph-primario); box-shadow: 0 0 0 3px rgba(61, 90, 241, 0.15); }
.choices .choices__list--single { padding: 0; }
.choices .choices__list--single .choices__item { color: var(--ph-texto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.choices .choices__placeholder { opacity: 1; color: #9aa4b8; }

/* La lista se abre por encima de la tabla, con su buscador arriba */
.choices .choices__list--dropdown {
    z-index: 1060; margin-top: 4px; min-width: 100%; width: max-content; max-width: min(28rem, 90vw);
    border: 1px solid var(--ph-linea); border-radius: 0.6rem; overflow: hidden;
    box-shadow: 0 12px 32px rgba(31, 42, 68, 0.16);
    opacity: 1; transform: none; padding: 0; display: none;
}
.choices .choices__list--dropdown.is-active { display: block; }
.choices .choices__list--dropdown:before { display: none; }
.choices[data-type*='select-one'] .choices__list--dropdown .choices__input {
    display: block; width: 100%; margin: 0; padding: 0.6rem 0.75rem; font-size: 0.875rem;
    border: 0; border-bottom: 1px solid var(--ph-linea); background: var(--ph-fondo-suave); color: var(--ph-texto);
}
.choices .choices__list--dropdown .choices__list { max-height: 17rem; padding: 0.25rem; }
.choices .choices__list--dropdown .choices__item,
.choices .choices__list--dropdown .choices__item--selectable {
    padding: 0.45rem 0.65rem !important; font-size: 0.84rem; color: var(--ph-texto);
    border-radius: 0.4rem; word-break: normal; overflow-wrap: anywhere; white-space: normal; line-height: 1.3;
}
.choices .choices__list--dropdown .choices__item--selectable:after { display: none !important; }   /* "Press to select" */
.choices .choices__list--dropdown .choices__item--selectable.is-highlighted { background: #eef1fe; color: var(--ph-texto); }
.choices .choices__list--dropdown .choices__item.has-no-results, .choices .choices__list--dropdown .choices__item.has-no-choices { color: var(--ph-texto-suave); }

/* Menú por áreas: secciones y opciones */
.ph-menu > .nav-item > .nav-link { margin: 0 0.5rem; border-radius: 0.5rem; }
.ph-menu .nav .nav-link { padding: 0.4rem 0.75rem; margin: 0 0.5rem 0 0; border-radius: 0.4rem; white-space: normal; }
.ph-menu .nav .nav-link:hover { background: #f3f5fd; }
.ph-menu .nav .nav-link.active { background: #eef1fe; font-weight: 650; }
.ph-menu .nav .nav-link.active .sidenav-normal { color: var(--ph-primario); }
.ph-menu .icon i { color: var(--ph-primario) !important; }

/* ---------- Tablero de inicio ---------- */
.ph-dato { text-decoration: none; transition: box-shadow 0.15s ease, transform 0.15s ease; }
.ph-dato:hover { box-shadow: 0 6px 20px rgba(31, 42, 68, 0.1); transform: translateY(-1px); }
.ph-dato-titulo { font-size: 0.78rem; font-weight: 650; color: var(--ph-texto-suave); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.35rem; }
.ph-dato-numero { font-size: 1.7rem; font-weight: 700; line-height: 1.15; color: var(--ph-texto); margin-bottom: 0.2rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ph-dato-pie { font-size: 0.8rem; color: var(--ph-texto-suave); margin-bottom: 0; }
.ph-barra { height: 0.5rem; background: var(--ph-fondo-suave); border-radius: 1rem; overflow: hidden; margin-top: 0.25rem; }
.ph-barra span { display: block; height: 100%; background: var(--ph-primario); border-radius: 1rem; min-width: 2px; }
.ph-barra span.ph-barra-roja { background: #d0343f; }
.ph-tablero tr[role="button"] { cursor: pointer; }

/* ---------- Celular ---------- */
@media (max-width: 767.98px) {
    .container-fluid { padding-left: 0.75rem; padding-right: 0.75rem; }
    .card .card-header, .card .card-body { padding: 0.85rem 0.9rem; }
    .card-header .d-lg-flex .ms-auto { margin-top: 0.6rem !important; }
    .ph-dato-numero { font-size: 1.45rem; }
    .table td, .table tbody th { padding: 0.5rem 0.5rem !important; }
    .navbar-main { margin-left: 0.75rem !important; margin-right: 0.75rem !important; }
}

/* Formulario de empleado en una sola página (antes eran 5 pasos): todas las secciones a la vista */
.ph-form-corrido .multisteps-form__form { height: auto !important; }
.ph-form-corrido .multisteps-form__panel { position: static; height: auto; opacity: 1; visibility: visible; margin-bottom: 1rem; scroll-margin-top: 5rem; }
.ph-form-corrido .js-btn-prev, .ph-form-corrido .js-btn-next { display: none !important; }
.ph-form-corrido .button-row { margin-top: 0.5rem !important; }
.ph-form-barra { position: sticky; top: 0.5rem; z-index: 20; }

/* Campana de avisos del encabezado */
.ph-campana-cuenta { position: absolute; top: -8px; right: -10px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; color: #fff; font-size: 0.65rem; font-weight: 700; line-height: 17px; text-align: center; }
.ph-campana-cuenta.ph-campana-vista { background: rgba(255, 255, 255, 0.35) !important; }
.ph-campana-lista { width: 340px; max-width: calc(100vw - 2rem); max-height: 70vh; overflow-y: auto; margin-top: 0.6rem !important; }
.ph-campana-aviso { text-decoration: none; }
.ph-campana-aviso:hover { background: #f5f7fb; }
.ph-campana-icono { flex: 0 0 30px; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; }

/* ---------- Listados en tarjetas: cada registro es una tarjeta separada (clase .ph-tarjetas en la tabla) ---------- */
.table-responsive:has(> .ph-tarjetas) { background: var(--ph-fondo-suave); padding: 0.25rem 0.9rem 0.4rem !important; border-radius: 0 0 0.75rem 0.75rem; }
.table.ph-tarjetas { border-collapse: separate; border-spacing: 0 0.5rem; }
.table.ph-tarjetas thead th { position: static; background: transparent; border-bottom: 0 !important; padding: 0.35rem 0.75rem 0 !important; }
.table.ph-tarjetas tbody td,
.table.ph-tarjetas tbody th { background: #fff; border-top: 1px solid var(--ph-linea); border-bottom: 1px solid var(--ph-linea) !important; padding: 0.65rem 0.75rem !important; }
.table.ph-tarjetas tbody td:first-child { border-left: 1px solid var(--ph-linea); border-radius: 0.75rem 0 0 0.75rem; padding-left: 1rem !important; }
.table.ph-tarjetas tbody td:last-child { border-right: 1px solid var(--ph-linea); border-radius: 0 0.75rem 0.75rem 0; }
.table.ph-tarjetas tbody td:only-child { border-radius: 0.75rem; }
.table.ph-tarjetas.table-hover > tbody > tr:hover > * { background-color: #fff; border-color: #b9c4f5 !important; }
.table.ph-tarjetas tbody tr { transition: transform 0.12s ease; }
.table.ph-tarjetas tbody tr:hover { transform: translateY(-1px); }
.table.ph-tarjetas tbody tr.opacity-6 td { background: #fafbfd; }

/* Timbres disponibles (INPROSA) en el encabezado */
.ph-timbres { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.65rem; border-radius: 1rem; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 0.78rem; white-space: nowrap; }
.ph-timbres strong { font-weight: 700; }
.ph-timbres-pocos { background: #fff3cd; color: #7a4b00; }
.ph-timbres { text-decoration: none; }
.ph-timbres:hover { background: rgba(255, 255, 255, 0.28); color: #fff; }
.ph-timbres-pocos:hover { background: #ffe9a8; color: #7a4b00; }
.ph-timbres-comprar { margin-left: 0.4rem; padding-left: 0.5rem; border-left: 1px solid rgba(255, 255, 255, 0.4); font-weight: 600; }
.ph-timbres-pocos .ph-timbres-comprar { border-left-color: rgba(122, 75, 0, 0.35); }

/* Los menús desplegables cerrados no se animan: el tema los "cerraba" con animación al cargar cada página
   y se veían un instante (la lista de la campana y el menú del usuario aparecían y se iban solos) */
.dropdown .dropdown-menu:not(.show),
.dropup .dropdown-menu:not(.show) { animation: none !important; opacity: 0 !important; visibility: hidden !important; }

/* Ayuda dentro del sistema: panel lateral de la pantalla y centro de ayuda */
.ph-ayuda { width: 420px; max-width: 100vw; }
.ph-ayuda .btn-close { background: none; opacity: 0.6; font-size: 1rem; }
.ph-ayuda-duda { border: 1px solid var(--ph-linea); border-radius: 0.5rem; padding: 0.45rem 0.7rem; margin-bottom: 0.4rem; }
.ph-ayuda-duda summary { cursor: pointer; }
.ph-ayuda-indice:hover { color: var(--ph-primario) !important; }

/* ---------- Llantas: la unidad vista desde arriba, con sus ejes ---------- */
.ph-ejes { max-width: 430px; padding: 0.75rem 1rem 1rem; background: var(--ph-fondo-suave, #f6f7fb); border-radius: 1rem; }
.ph-eje { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 14px; }
.ph-eje:last-child { margin-bottom: 0; }
.ph-eje-barra { flex: 1 1 auto; min-width: 70px; height: 8px; border-radius: 4px; background: #c9d0de; position: relative; margin: 0 4px; }
.ph-eje-barra span { position: absolute; top: -17px; left: 0; right: 0; text-align: center; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; color: #8392ab; }
.ph-llanta {
    flex: none; width: 62px; height: 74px; border-radius: 12px; border: 2px solid transparent; padding: 4px 2px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; color: #fff; transition: transform 0.1s ease;
}
.ph-llanta:hover { transform: translateY(-2px); }
.ph-llanta-pos { font-size: 0.6rem; font-weight: 700; opacity: 0.85; }
.ph-llanta-num { font-size: 0.7rem; font-weight: 700; word-break: break-all; text-align: center; }
.ph-llanta-bien { background: #2d6a4f; }
.ph-llanta-ojo { background: #c77700; }
.ph-llanta-mal { background: #b3261e; }
.ph-llanta-vacia { background: #fff; border: 2px dashed #b8c1d1; color: #8392ab; }
.ph-llanta-vacia .ph-llanta-num { font-size: 1.1rem; }
.ph-llanta-elegida { border: 2px solid var(--ph-primario, #3d5af1); box-shadow: 0 0 0 3px rgba(61, 90, 241, 0.25); }
.ph-punto { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }
