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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background-color: #1a1a2e;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-toggle {
    display: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 0.75rem 0;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    display: block;
    color: #e0e0e0;
    text-decoration: none;
    padding: 0.75rem 1rem;
    transition: background-color 0.2s, color 0.2s;
}

.nav-menu a:hover {
    background-color: #16213e;
    color: #fff;
}

.nav-menu li.active > a {
    border-left: 3px solid #e94560;
    padding-left: calc(1rem - 3px);
    background-color: #16213e;
    color: #fff;
}

/* Dropdown */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #1a1a2e;
    min-width: 120px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    padding: 0.5rem 1rem;
}

.sub-dropdown-container {
    position: relative;
}

.sub-dropdown {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background-color: #1a1a2e;
    min-width: 120px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.sub-dropdown-container:hover .sub-dropdown {
    display: block;
}

.sub-dropdown a {
    padding: 0.5rem 1rem;
}

/* Header */
.page-header {
    height: 125px;
    width: 100%;
    background: linear-gradient(135deg, #0f3460, #16213e);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 1.5rem;
}

.logo {
    height: 90px;
    width: auto;
}

.header-info h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.header-info p {
    font-size: 0.9rem;
    opacity: 0.85;
}

/* Main content */
.content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Flash messages */
.flash {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-weight: 500;
}

.flash-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Cards */
.salidas-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.salida-card {
    display: flex;
    gap: 1rem;
    background: white;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.salida-card-col {
    display: flex;
    flex-direction: column;
}

.salida-card-col.izq {
    width: 250px;
    min-width: 250px;
    gap: 0.35rem;
}

.salida-card-col.centro {
    flex: 1;
    justify-content: center;
    gap: 0.35rem;
}

.salida-card-col.der {
    width: 150px;
    min-width: 150px;
    justify-content: center;
    gap: 0.35rem;
    text-align: right;
}

.salida-fecha {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.salida-hora {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.25rem;
}

.mapa-mini {
    width: 200px;
    height: 200px;
    border-radius: 4px;
    background: #e9ecef;
}

.mapa-placeholder {
    width: 200px;
    height: 200px;
    background: #e9ecef;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.9rem;
}

.salida-trayecto {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f3460;
    text-decoration: none;
    text-align: justify;
}

.salida-trayecto:hover {
    text-decoration: underline;
}

.salida-bici {
    font-size: 0.9rem;
    color: #555;
}

.dato-item {
    font-size: 0.9rem;
}

.dato-label {
    font-weight: 600;
    color: #555;
}

/* Index layout: sidebar + main */
.index-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.resumen-sidebar {
    width: 260px;
    min-width: 260px;
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 5rem;
}

.resumen-sidebar h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0f3460;
}

.resumen-periodo {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.resumen-periodo:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.resumen-periodo h4 {
    font-size: 0.85rem;
    color: #0f3460;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.resumen-periodo p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.resumen-periodo strong {
    font-size: 1.1rem;
}

.index-main {
    flex: 1;
    min-width: 0;
}

/* Mensual layout */
.mensual-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.mensual-main {
    flex: 1;
    min-width: 0;
}

.mensual-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendario {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendario th {
    background: #1a1a2e;
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.calendario td {
    border: 1px solid #ddd;
    vertical-align: top;
    height: 100px;
    padding: 0.25rem;
}

.cal-vacio {
    background: #f9f9f9;
}

.cal-dia {
    background: white;
}

.cal-con-salida {
    background: #f0f4ff;
}

.cal-numero {
    font-weight: 700;
    font-size: 0.8rem;
    color: #333;
    margin-bottom: 0.2rem;
}

.cal-salida {
    margin-bottom: 0.15rem;
}

.cal-enlace {
    text-decoration: none;
    display: block;
    background: #e8edf5;
    border-radius: 3px;
    padding: 0.15rem 0.25rem;
    font-size: 0.65rem;
    line-height: 1.2;
    transition: background 0.2s;
}

.cal-enlace:hover {
    background: #d0d9e8;
}

.cal-desc {
    font-weight: 600;
    color: #0f3460;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-dist {
    color: #555;
}

@media (max-width: 900px) {
    .mensual-layout {
        flex-direction: column;
    }

    .calendario td {
        height: 60px;
        font-size: 0.65rem;
        padding: 0.15rem;
    }

    .cal-desc {
        white-space: normal;
        font-size: 0.6rem;
    }

    .cal-dist {
        font-size: 0.55rem;
    }

    .cal-dia, .cal-vacio {
        display: none;
    }

    .calendario, .calendario thead, .calendario tbody, .calendario tr {
        display: block;
    }

    .calendario th {
        display: none;
    }

    .mensual-main .calendario {
        display: none;
    }

    .mensual-main::after {
        content: '';
        display: block;
    }
}

.mensual-mobile-list {
    display: none;
}

@media (max-width: 900px) {
    .mensual-mobile-list {
        display: block;
    }

    .mensual-mobile-list .salida-card {
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 900px) {
    .index-layout {
        flex-direction: column;
    }
    .resumen-sidebar {
        width: 100%;
        min-width: unset;
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .resumen-sidebar h3 {
        grid-column: 1 / -1;
    }
    .resumen-periodo {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }
}

/* Resumen cards */
.resumen-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.resumen-card {
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.resumen-card h2 {
    margin-bottom: 0.75rem;
}

.resumen-card h2 a {
    color: #0f3460;
    text-decoration: none;
}

.resumen-card h2 a:hover {
    text-decoration: underline;
}

.resumen-card p {
    margin-bottom: 0.25rem;
}

/* Detalle ruta */
.detalle-ruta {
    display: flex;
    gap: 2rem;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.detalle-grid {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.detalle-mapa-contenedor {
    flex: 1;
    min-width: 0;
}

.mapa-detalle {
    width: 100%;
    height: 500px;
    border-radius: 4px;
}

.detalle-sidebar {
    width: 330px;
    min-width: 330px;
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.detalle-sidebar h3 {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0f3460;
}

.detalle-descripcion {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f3460;
    margin-bottom: 0.25rem;
}

.detalle-fecha {
    font-size: 0.9rem;
    color: #555;
}

.detalle-hora {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.75rem;
}

.perfil-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin-top: 1rem;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.perfil-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn-perfil {
    padding: 0.25rem 0.75rem;
    background: #0f3460;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
}

.btn-perfil:hover {
    background: #16213e;
}

.perfil-chart {
    width: 100%;
    height: 300px;
}

.perfil-chart svg {
    display: block;
}

.detalle-notas {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.detalle-notas h3 {
    margin-bottom: 0.5rem;
}

/* Tablas */
.datos-tabla {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.datos-tabla th, .datos-tabla td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.datos-tabla th {
    font-weight: 600;
    background-color: #cccccf;
    color: black;
}

.datos-tabla td.td-centro,
.datos-tabla th.td-centro {
    text-align: center;
}

.tramos-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tramos-section h3 {
    margin-bottom: 1rem;
}

/* Formularios */
.form-container {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox label {
    margin-bottom: 0;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: #0f3460;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #16213e;
}

.btn-danger {
    background-color: #c0392b;
}

.btn-danger:hover {
    background-color: #a93226;
}

.acciones-ruta {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-icon {
    padding: 0.5rem;
    font-size: 1.2rem;
    width: auto;
    aspect-ratio: 1;
    line-height: 1;
}

.dropdown-acciones {
    position: relative;
}

.dropdown-acciones-btn {
    width: 100%;
    cursor: pointer;
}

.dropdown-acciones-content {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    background-color: #0f3460;
    min-width: 180px;
    box-shadow: 0 -4px 8px rgba(0,0,0,0.2);
    border-radius: 4px;
    overflow: hidden;
    z-index: 100;
}

.dropdown-acciones:hover .dropdown-acciones-content {
    display: block;
}

.dropdown-acciones-content a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.dropdown-acciones-content a:hover {
    background-color: #16213e;
}

.strava-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: #fc4c02;
    text-decoration: none;
    font-weight: 500;
}

.strava-link:hover {
    text-decoration: underline;
}

.qr-container {
    text-align: center;
    margin: 1rem 0;
}

.qr-container img {
    max-width: 200px;
}

.empty {
    text-align: center;
    color: #888;
    padding: 2rem;
    font-style: italic;
}

code {
    background-color: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-info {
    font-size: 0.9rem;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    .nav-menu.active {
        display: flex;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        padding-left: 1rem;
    }

    .sub-dropdown {
        position: static;
        box-shadow: none;
        padding-left: 1rem;
    }

    .page-header {
        height: auto;
        padding: 1rem;
        flex-wrap: wrap;
    }

    .logo {
        height: 60px;
    }

    .salida-card {
        flex-direction: column;
    }

    .salida-card-col.izq {
        width: 100%;
        min-width: unset;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .mapa-placeholder {
        width: 200px;
        height: 200px;
    }

    .salida-card-col.centro {
        text-align: center;
    }

    .salida-card-col.der {
        width: 100%;
        min-width: unset;
        text-align: center;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    .detalle-grid {
        flex-direction: column;
    }

    .detalle-sidebar {
        width: 100%;
        min-width: unset;
    }

    .mapa-detalle {
        width: 100%;
        height: 300px;
    }

    .perfil-chart {
        height: 250px;
        max-width: 100%;
        overflow: hidden;
    }

    .perfil-chart svg {
        max-width: 100% !important;
        height: auto !important;
    }

    #tramo-perfil-chart svg {
        max-width: 100% !important;
        height: auto !important;
    }

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

    .tramos-section {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tramos-section .datos-tabla {
        font-size: 0.8rem;
        min-width: 600px;
    }

    .tramos-section .datos-tabla th,
    .tramos-section .datos-tabla td {
        padding: 0.35rem 0.4rem;
        white-space: nowrap;
    }
}

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

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

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

.modal-content h2 {
    margin-bottom: 1rem;
}

.modal-lg {
    max-width: 800px;
}

.tramo-modal-grid {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.tramo-info {
    width: 300px;
    min-width: 300px;
}

.tramo-mapa {
    flex: 1;
    height: 300px;
    border-radius: 4px;
}

.tramo-link {
    color: #0f3460;
    text-decoration: underline;
    cursor: pointer;
}

.tramo-link:hover {
    color: #16213e;
}

@media (max-width: 768px) {
    .tramo-modal-grid {
        flex-direction: column;
    }
    .tramo-info {
        width: 100%;
        min-width: unset;
    }
    .tramo-mapa {
        width: 100%;
        height: 250px;
    }
}

.tramo-historico {
    margin-top: 1.5rem;
}

.tramo-historico h3 {
    margin-bottom: 0.75rem;
}

.tramo-filtros {
    margin-bottom: 0.75rem;
}

.tramo-filtros label {
    font-weight: 500;
}

.tramo-filtros select {
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.total-registros {
    margin-left: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    background-color: #eef;
}

.sort-icon {
    font-size: 0.75rem;
}

#tramo-historico-tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

#tramo-historico-tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

#tramo-historico-tbody tr:hover {
    background-color: #e8edf5;
}

#tramo-historico-tbody tr.tramo-actual {
    background-color: #d4edda !important;
    font-weight: 600;
}

#tramo-historico-tabla thead th {
    background-color: #1a1a2e;
    color: white;
}

.minimapa-sitio {
    width: 150px;
    height: 150px;
    border-radius: 4px;
    background: #e9ecef;
    margin: 0 auto;
}

.sitios-container {
    overflow-x: auto;
}

.sitios-container .datos-tabla td {
    vertical-align: middle;
}

.sitios-container .datos-tabla th:nth-child(3) {
    width: 160px;
}

#sitios-tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

#sitios-tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

#sitios-tbody tr:hover {
    background-color: #e8edf5;
}

#bicis-tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

#bicis-tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

#bicis-tbody tr:hover {
    background-color: #e8edf5;
}

.sitios-filtro {
    margin-bottom: 1rem;
}

.sitios-filtro label {
    font-weight: 500;
}

.sitios-filtro .form-control {
    margin-left: 0.5rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.btn-descargar {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    background: #1a6b3c;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
}

.btn-descargar:hover {
    background: #145530;
    color: #fff;
    text-decoration: none;
}

.sitio-edit-grid {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.sitio-edit-form {
    flex: 1;
    min-width: 300px;
}

.sitio-edit-mapa {
    width: 400px;
    height: 350px;
    border-radius: 4px;
}

@media (max-width: 800px) {
    .sitio-edit-grid {
        flex-direction: column;
    }
    .sitio-edit-mapa {
        width: 100%;
        height: 300px;
    }
}

.anual-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.anual-main {
    flex: 1;
    min-width: 0;
}

.resumen-anual {
    background: linear-gradient(135deg, #0f3460, #16213e);
    color: white;
}

.resumen-anual h3 {
    border-bottom-color: #e63946;
    color: white;
}

.resumen-anual .resumen-periodo p {
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.resumen-anual .resumen-periodo strong {
    color: #e63946;
}

.resumen-anual .resumen-periodo h4 {
    color: #baf2e5;
}

@media (max-width: 900px) {
    .anual-layout {
        flex-direction: column;
    }
    .anual-main {
        width: 100%;
    }
}

.perfil-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 600px;
}

.perfil-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.perfil-card h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0f3460;
    color: #0f3460;
}

.perfil-card-danger {
    border: 2px solid #c0392b;
}

.perfil-card-danger h2 {
    border-bottom-color: #c0392b;
    color: #c0392b;
}

.perfil-estado {
    font-weight: 600;
    font-size: 0.95rem;
}

.perfil-estado-activo {
    color: #155724;
}

.perfil-estado-inactivo {
    color: #888;
}

.perfil-advertencia {
    color: #721c24;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f8d7da;
    border-radius: 4px;
}

.tabla-container {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tabla-filtros-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.tabla-filtros {
    background: #f0f4ff;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #d0d9e8;
}

.tabla-filtros h3 {
    margin-bottom: 0.75rem;
    color: #0f3460;
    font-size: 0.95rem;
}

.filtro-indicador {
    font-size: 0.8rem;
    font-weight: 400;
    color: #c0392b;
}

.filtro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .filtro-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .filtro-grid {
        grid-template-columns: 1fr;
    }
}

.filtro-fecha-grupo {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.filtro-fecha-grupo select {
    flex: 0 0 auto;
    width: 80px;
}

.filtro-fecha-grupo input {
    flex: 1;
    min-width: 0;
}

.tabla-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #666;
}

.tabla-paginacion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.pag-info {
    font-size: 0.9rem;
    color: #555;
}

#salidas-tabla th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

#salidas-tabla th.sortable:hover {
    background-color: #a0a0a6;
}

.sort-icon {
    font-size: 0.7rem;
    margin-left: 0.2rem;
}

#salidas-tabla th.sort-asc,
#salidas-tabla th.sort-desc {
    color: #0f3460;
}

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

#salidas-tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

#salidas-tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

#salidas-tbody tr:hover {
    background-color: #e8edf5;
}

#salidas-tbody a {
    color: #0f3460;
    text-decoration: none;
    font-weight: 600;
}

#salidas-tbody a:hover {
    text-decoration: underline;
}

.form-control-sm {
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
}

.minimapa-tramo {
    width: 200px;
    height: 150px;
    border-radius: 4px;
    background: #e9ecef;
    margin: 0 auto;
}

#tramos-tabla th.td-derecha {
    text-align: right;
}

#tramos-tabla th.sortable {
    cursor: pointer;
    user-select: none;
}

#tramos-tabla th.sortable:hover {
    background-color: #a0a0a6;
}

#tramos-tabla th.sort-asc,
#tramos-tabla th.sort-desc {
    color: #0f3460;
}

#tramos-tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

#tramos-tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

#tramos-tbody tr:hover {
    background-color: #e8edf5;
}

.editar-tramo-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.editar-tramo-form {
    width: 280px;
    min-width: 280px;
    background: white;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.editar-tramo-form h3 {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0f3460;
    color: #0f3460;
}

.editar-tramo-form input[readonly] {
    background-color: #e9ecef;
    color: #495057;
}

.editar-tramo-derecha {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.editar-tramo-mapa {
    width: 100%;
    height: 350px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.editar-tramo-derecha .perfil-container {
    margin-top: 0;
}

.campo-lectura {
    padding: 0.4rem 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
}

.mensaje-estado {
    font-size: 0.9rem;
    color: #666;
}

.mensaje-vacio {
    text-align: center;
    color: #888;
    padding: 3rem 1rem;
    font-size: 1.1rem;
}

.mensaje-vacio a {
    color: #0f3460;
}

@media (max-width: 768px) {
    .editar-tramo-layout {
        flex-direction: column;
    }
    .editar-tramo-form {
        width: 100%;
        min-width: unset;
    }
    .editar-tramo-mapa {
        width: 100%;
        height: 250px;
    }
}
