/* TecNytte Tracker — paleta del logo: teal del wordmark + azul del pin */
:root {
    --tn-blue: #0e7a88;
    --tn-blue-dark: #0a5d69;
    --tn-teal: #00a3b0;
    --tn-teal-dark: #00838e;
    --tn-pin: #1b4f9c;
    --tn-bg: #eef7f8;
    --tn-card: #ffffff;
    --tn-text: #0d3d45;
    --tn-muted: #5a7a80;
    --tn-line: #d4e8eb;
    --tn-radius: 18px;
    --tn-shadow: 0 10px 28px rgba(10, 93, 105, 0.12);
}

body {
    background: var(--tn-bg) !important;
    color: var(--tn-text);
    font-family: "Open Sans", "Segoe UI", sans-serif;
}
body.login-page {
    background: transparent !important;
}

/* NAVBAR — una sola fila */
.navbar.navbar-default {
    background: linear-gradient(135deg, #0a5d69 0%, #0e7a88 55%, #00a3b0 140%) !important;
    background-color: #0e7a88 !important;
    border: none !important;
    min-height: 52px !important;
    height: 52px;
    overflow: visible;
    box-shadow: 0 4px 16px rgba(10, 93, 105, 0.28);
}
.navbar .container-fluid.tn-navbar,
.tn-navbar {
    display: flex;
    flex-wrap: nowrap !important;
    align-items: center;
    height: 52px;
    padding-left: 8px;
    padding-right: 8px;
    gap: 8px;
}
.navbar-btn {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
.show-menu {
    margin-top: 0 !important;
}
.btn.back-btn.show-menu {
    margin-top: 0 !important;
}
.tn-navbar .show-menu {
    margin: 0 !important;
    flex: 0 0 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.tn-navbar .show-menu i {
    color: #fff;
    font-size: 20px;
}
.tn-navbar-title {
    flex: 1 1 auto;
    min-width: 0;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    color: #fff !important;
    font-size: 18px;
    font-weight: 700;
    line-height: 36px;
}
.tn-navbar-title #page_title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
}
.tn-navbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    margin-left: auto;
}
.tn-navbar-actions a {
    display: flex;
    align-items: center;
}
.tn-navbar-hidden {
    position: absolute;
    left: -9999px;
    width: 0;
    height: 0;
    overflow: hidden;
}
#map_layer.navbar-btn {
    border: 0;
    border-radius: 18px;
    background-color: rgba(255, 255, 255, 0.16);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23ffffff' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 6px;
    color: #fff;
    height: 32px;
    padding: 0 26px 0 10px;
    width: auto !important;
    min-width: 108px;
    max-width: 148px;
    margin: 0 !important;
    appearance: none;
    -webkit-appearance: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#map_layer option {
    color: #0d3d45;
    background: #fff;
}
#unidades-s img,
#whatsapp-s img {
    width: 32px !important;
    height: 32px !important;
    object-fit: contain;
    background: #fff;
    border-radius: 50% !important;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* MENU + BIENVENIDA */
#page_menu.page-menu,
#page_menu {
    padding: 0 !important;
    background: var(--tn-bg) !important;
    border-radius: 0 !important;
}
.menu-block {
    display: block !important;
    background: var(--tn-bg) !important;
    box-shadow: none !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.tn-hero {
    background: linear-gradient(160deg, #0a5d69 0%, #0e7a88 48%, #00a3b0 120%);
    border-radius: 0 0 28px 28px;
    padding: 18px 16px 26px;
    color: #fff;
    position: relative;
    z-index: 5;
    overflow: visible;
    box-shadow: 0 10px 24px rgba(10, 93, 105, 0.28);
}
.tn-hero-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tn-hero-menu {
    flex: 0 0 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    font-size: 20px;
    margin-top: -10px;
}
.tn-hero-copy {
    flex: 1 1 auto;
    min-width: 0;
}
.tn-hero-kicker {
    font-size: 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    opacity: 0.8;
    font-weight: 600;
}
.tn-hero-title {
    margin: 2px 0 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
}
.tn-hero-name {
    margin-top: 2px;
    font-size: 15px;
    font-weight: 600;
    opacity: 0.95;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tn-hero-user {
    text-align: center;
    flex: 0 0 auto;
    position: relative;
    z-index: 4;
}
.tn-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #fff;
    color: #0e7a88;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
    margin: 0 auto;
    position: relative;
    text-decoration: none !important;
}
.tn-avatar-dot {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #00a3b0;
    border: 2px solid #fff;
}
.tn-avatar-name {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tn-banner {
    z-index: 1;
    margin: -8px 14px 0;
    background: #fff;
    border-radius: 18px;
    padding: 12px 12px 12px 14px;
    box-shadow: var(--tn-shadow);
    position: relative;
    overflow: hidden;
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.tn-banner p {
    margin: 0;
    flex: 1 1 auto;
    color: var(--tn-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}
.tn-banner-img {
    flex: 0 0 42%;
    width: 42%;
    max-width: 168px;
    height: 72px;
    object-fit: cover;
    object-position: center;
    border-radius: 14px;
    display: block;
}
.tn-profile-menu {
    display: none;
    position: absolute;
    top: 62px;
    right: 0;
    min-width: 168px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(10, 93, 105, 0.18);
    overflow: hidden;
    z-index: 20;
    text-align: left;
}
.tn-profile-menu.is-open {
    display: block;
}
.tn-profile-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    color: var(--tn-text) !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    border-bottom: 1px solid #eef4f5;
}
.tn-profile-menu a:last-child {
    border-bottom: 0;
}
.tn-profile-menu a i {
    color: var(--tn-teal-dark);
    width: 16px;
    text-align: center;
}
.tn-profile-menu a.tn-profile-logout {
    color: #c0392b !important;
}
.tn-profile-menu a.tn-profile-logout i {
    color: #c0392b;
}
.tn-section-title {
    padding: 16px 16px 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--tn-blue-dark);
}
.page-menu ul.menu {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100% !important;
    padding: 8px 14px 8px !important;
    margin: 0 !important;
    float: none !important;
    list-style: none;
}
.page-menu ul.menu:before,
.page-menu ul.menu:after {
    display: none !important;
    content: none !important;
}
.page-menu ul.menu li {
    width: auto !important;
    float: none !important;
    padding: 0 !important;
    min-width: 0;
}
.page-menu ul.menu li a {
    height: 100%;
    min-height: 104px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px !important;
    border-radius: 18px !important;
    background: #fff !important;
    color: var(--tn-text) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.2;
    box-shadow: var(--tn-shadow) !important;
    border: 1px solid rgba(14, 122, 136, 0.10);
}
.page-menu ul.menu li a:hover,
.page-menu ul.menu li a:active {
    opacity: 1 !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(14, 122, 136, 0.16) !important;
}
.page-menu .menu-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(180deg, #e7f6f8 0%, #d4eef1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.page-menu .menu-icon {
    width: 34px !important;
    height: 34px !important;
    max-width: 34px;
    object-fit: contain;
    display: block;
}
.page-menu .menu-label {
    display: block;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.page-menu .button-block {
    display: flex !important;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px auto 24px !important;
    padding: 0 14px;
}
.page-menu .button-block a {
    background: #fff;
    color: var(--tn-blue) !important;
    border: 1px solid var(--tn-line);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
.page-menu .button-block a.logout-btn {
    background: var(--tn-blue);
    color: #fff !important;
    border-color: var(--tn-blue);
}
.page-menu .button-block:empty {
    display: none !important;
}

/* BOTONES / INPUTS */
.btn.btn-blue {
    background: linear-gradient(135deg, #0e7a88 0%, #00a3b0 100%) !important;
    border-color: #0e7a88 !important;
    border-radius: 999px !important;
    font-weight: 600;
    box-shadow: 0 6px 14px rgba(14, 122, 136, 0.28);
}
.btn.back-btn {
    border-radius: 999px !important;
}
.form-control,
.input-group-addon {
    border-radius: 14px !important;
    border-color: var(--tn-line) !important;
}
.form-control:focus {
    border-color: var(--tn-teal) !important;
    box-shadow: 0 0 0 3px rgba(0, 163, 176, 0.16);
}

/* FORMULARIOS */
#page_history,
#page_cmd,
#page_settings,
#page_places,
#page_reports,
#page_events,
#page_share_location,
#page_reporte_ida_vuelta {
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 8px !important;
}
#page_places {
    position: relative;
    padding: 8px 8px 72px !important;
    background: var(--tn-bg) !important;
}
.tn-form-card {
    background: #fff;
    border-radius: 22px;
    padding: 16px 14px 12px;
    box-shadow: var(--tn-shadow);
}
.tn-form-card .form-group {
    margin-bottom: 12px;
}
.tn-form-card .row.vertical-align {
    min-height: 42px;
}
.tn-form-card .col-xs-6:first-child {
    font-size: 13px;
    font-weight: 700;
    color: var(--tn-blue-dark);
    padding-right: 8px;
}
.tn-form-card .form-control {
    height: 40px;
    border-radius: 22px !important;
    background: #f4f7fb;
    border: 1px solid #e4eaf2 !important;
    box-shadow: none;
    font-size: 13px;
}
.tn-form-card .input-group-addon {
    background: #f4f7fb;
    border-radius: 0 22px 22px 0 !important;
    color: var(--tn-blue);
}
.tn-form-card .input-group .form-control {
    border-radius: 22px 0 0 22px !important;
}
.tn-form-card .btn.dropdown-toggle:not(.btn-blue) {
    height: 42px;
    border-radius: 22px !important;
    background: #fff;
    border: 1px solid #e4eaf2;
    color: var(--tn-blue-dark);
    font-weight: 600;
}
.tn-form-card .btn.dropdown-toggle:not(.btn-blue):active,
.tn-form-card .btn.dropdown-toggle:not(.btn-blue):hover {
    background: #f4f7fb;
    color: var(--tn-blue);
}
.tn-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}
.tn-form-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--tn-line);
}
.tn-form-head-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0e7a88 0%, #00a3b0 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex: 0 0 42px;
    box-shadow: 0 6px 14px rgba(14, 122, 136, 0.22);
}
.tn-form-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--tn-blue-dark);
    line-height: 1.2;
}
.tn-form-head p {
    margin: 3px 0 0;
    font-size: 12px;
    color: var(--tn-muted);
    line-height: 1.35;
}
.tn-btn-primary {
    background: linear-gradient(135deg, #0e7a88 0%, #00a3b0 100%) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 22px !important;
    height: 42px;
    font-weight: 700;
    width: 100%;
    box-shadow: 0 6px 14px rgba(14, 122, 136, 0.25);
}
.tn-btn-ghost {
    background: #fff !important;
    color: var(--tn-blue) !important;
    border: 1.5px solid var(--tn-line) !important;
    border-radius: 22px !important;
    height: 42px;
    font-weight: 700;
    width: 100%;
}
.tn-form-card h4 {
    margin: 4px 0 12px;
    font-size: 13px;
    font-weight: 700;
    color: var(--tn-teal-dark);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* OBJETOS */
.objects-container {
    background: linear-gradient(180deg, #0e7a88 0%, #0a5d69 100%) !important;
    border-radius: 18px !important;
}
.objects-title i {
    color: var(--tn-blue) !important;
}

/* BOTTOM PANEL */
#bottom_panel {
    border-top: 0 !important;
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    box-shadow: 0 -8px 24px rgba(10, 93, 105, 0.16) !important;
}
.datalist-object-name {
    background: linear-gradient(135deg, #0e7a88 0%, #0a5d69 100%) !important;
    height: auto !important;
}
#bottom_panel_datalist.datalist {
    position: relative;
    max-height: none !important;
    overflow: hidden !important;
    padding: 6px 0 8px 6px;
    background: #fff;
}
#bottom_panel .datalist-item-list {
    height: 120px !important;
    min-height: 120px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    flex-direction: column !important;
    flex-wrap: wrap !important;
    align-content: flex-start !important;
    padding: 0 28px 0 0 !important;
    scrollbar-width: thin;
    scrollbar-color: #0e7a88 #e7f6f8;
}
#bottom_panel .datalist-item {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    flex: 0 0 36px !important;
    line-height: 36px !important;
    margin-bottom: 4px !important;
    padding: 0 8px !important;
    border-bottom: none !important;
    border-radius: 8px !important;
    box-sizing: border-box;
    width: 210px;
    min-width: 210px;
}
#bottom_panel .datalist-item:last-child {
    border-bottom: none !important;
}
.datalist-item.even {
    background-color: #b7e4ea !important;
}
.datalist-item.odd {
    background-color: #e7f6f8 !important;
}
.datalist-item-name {
    color: #0a5d69 !important;
    font-weight: 700;
    line-height: 36px;
}
.datalist-item-value {
    color: #123940 !important;
    font-weight: 600;
    line-height: 36px;
}
.tn-datalist-swipe-hint {
    display: none;
    position: absolute;
    top: 6px;
    right: 0;
    bottom: 8px;
    width: 46px;
    pointer-events: none;
    z-index: 3;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.88) 45%, #ffffff 100%);
}
#bottom_panel_datalist.tn-can-swipe:not(.tn-swiped-end) .tn-datalist-swipe-hint {
    display: flex;
}
.tn-datalist-swipe-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #0e7a88;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 3px 10px rgba(10, 93, 105, 0.28);
    animation: tnSwipeHint 1.35s ease-in-out infinite;
}
.tn-datalist-swipe-icon i {
    margin: 0;
    color: #fff;
}
@keyframes tnSwipeHint {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(5px); opacity: 0.72; }
}

/* HELPDESK */
.helpdesk-container {
    background: linear-gradient(180deg, #f5f8fd 0%, #e8eef8 100%) !important;
}
.main-title,
.section-title h4 {
    color: var(--tn-blue-dark) !important;
}

/* LOGIN — imagen a pantalla completa, formulario compacto */
body.login-page {
    height: 100%;
    min-height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
    overflow-y: auto;
    background: transparent !important;
}
body.login-page::before {
    display: none !important;
    content: none !important;
    background: none !important;
}
.tn-login-bg {
    position: fixed !important;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    z-index: 0;
    background-color: #0a4a6e;
    background-size: cover !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    pointer-events: none;
}
.tn-login-screen {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 32px 18px 18px;
    box-sizing: border-box;
}
.tn-login-brand {
    text-align: center;
    margin: 8px 0 18px;
    background: transparent !important;
}
body.login-page .logo {
    width: 220px !important;
    max-width: 72vw;
    height: auto;
    margin: 0 auto;
    display: block;
    background: transparent !important;
    mix-blend-mode: multiply;
    opacity: 0.96;
}
.tn-login-tagline {
    margin: 8px 0 0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
body.login-page #form {
    background: rgba(255, 255, 255, 0.96) !important;
    border-radius: 24px !important;
    padding: 18px 16px 14px !important;
    margin: 0 auto !important;
    width: 100%;
    max-width: 380px;
    overflow: visible !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}
body.login-page #form .input-group {
    margin-bottom: 12px;
    width: 100%;
}
body.login-page #form .form-control {
    height: 44px;
    border-radius: 14px !important;
    background: #f4fbfc;
}
body.login-page .input-group-addon {
    background: #e7f6f8 !important;
    color: var(--tn-blue);
    border-radius: 14px 0 0 14px !important;
    border-color: var(--tn-line) !important;
}
.tn-login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tn-text);
}
.tn-login-remember input {
    width: 16px;
    height: 16px;
    margin: 0;
}
body.login-page .login-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    margin: 0 0 10px;
    border-radius: 999px !important;
    font-weight: 700;
    text-align: center;
    float: none !important;
}
.tn-login-highlight {
    margin: 2px 0 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--tn-teal-dark);
    background: linear-gradient(180deg, #e8f8fa 0%, #f4fcfd 100%);
    border: 1px solid #cceef1;
    border-radius: 14px;
    padding: 10px 12px;
}
.tn-login-support {
    text-align: center;
    margin: 4px 0 0;
}
.tn-login-support p {
    margin: 0;
    font-size: 11px;
    color: var(--tn-muted);
}
.tn-login-support b {
    color: var(--tn-teal);
    font-size: 12px;
}
body.login-page .licence-tecnytte {
    position: static !important;
    right: auto !important;
    bottom: auto !important;
    margin-top: auto;
    padding: 16px 0 6px;
    text-align: center;
    font-size: 11px !important;
    color: #fff !important;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
body.login-page .licence-tecnytte p {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
body.login-page .licence-tecnytte .img-licence {
    width: 22px !important;
    height: auto;
    vertical-align: middle;
}
body.login-page .a-licence {
    color: #fff !important;
    font-weight: 700;
}

.leaflet-bar a,
.leaflet-control a {
    border-radius: 10px !important;
}

@media (max-width: 360px) {
    .tn-hero-title { font-size: 18px; }
    .page-menu ul.menu li a {
        min-height: 96px;
        font-size: 11px !important;
    }
    #map_layer.navbar-btn { max-width: 128px; min-width: 96px; }
}

/* Unificar restos de verde antiguo con paleta del logo */
.menu-trigger,
.menu-item:active {
    background: linear-gradient(135deg, #0e7a88 0%, #0a5d69 100%) !important;
}
#bottom_panel {
    border-top-color: #0e7a88 !important;
}
.datalist::-webkit-scrollbar-thumb {
    background: #0e7a88 !important;
}
.datalist::-webkit-scrollbar-thumb:hover {
    background: #0a5d69 !important;
}
.navbar-fixed-bottom.navbar-default {
    background: linear-gradient(135deg, #0e7a88 0%, #0a5d69 100%) !important;
}
#places_navbar {
    min-height: 56px !important;
    height: 56px;
    padding: 0 6px;
    border: 0 !important;
}
#places_navbar .container-fluid,
#places_navbar .row {
    display: flex;
    align-items: center;
    height: 56px;
    margin: 0;
    padding: 0;
}
#places_navbar .width33 {
    float: none !important;
    width: auto !important;
    flex: 1;
    text-align: center;
}
#places_navbar .btn {
    background: transparent !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    height: 48px;
    width: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 700;
}
.markers-panel,
.routes-panel,
.zones-panel {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    padding: 16px 14px 18px !important;
    margin-bottom: 12px;
    min-height: calc(100vh - 196px);
    background: #fff !important;
    border-radius: 22px;
    box-shadow: var(--tn-shadow);
    z-index: 1;
}

/* HISTORIAL — mapa, pines, reproducción y barra inferior */
body.tn-history-on #sos-float-btn {
    bottom: 148px;
}

.tn-hist-pin {
    background: transparent !important;
    border: 0 !important;
}
.tn-hist-pin-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #fff;
    font: 700 12px/1 "Open Sans", "Segoe UI", sans-serif;
    box-shadow: 0 4px 10px rgba(10, 93, 105, 0.28);
    border: 2px solid #fff;
}
.tn-hist-start .tn-hist-pin-dot { background: #43b83f; }
.tn-hist-end .tn-hist-pin-dot { background: #e8362c; }
.tn-hist-stop .tn-hist-pin-dot { background: #0e7a88; }
.tn-hist-event .tn-hist-pin-dot { background: #f0a202; }

#history_playback {
    left: 12px !important;
    right: 12px !important;
    bottom: 64px !important;
    width: auto !important;
    background: #fff !important;
    border-radius: 18px !important;
    padding: 8px 12px !important;
    box-shadow: 0 10px 24px rgba(10, 93, 105, 0.18) !important;
}
#history_playback .container-fluid {
    padding: 0;
}
#history_playback .row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
}
#history_playback a {
    width: 40px;
    height: 40px;
    margin: 0 !important;
    border-radius: 50%;
    background: #0e7a88;
    color: #fff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(14, 122, 136, 0.28);
}
#history_playback a i {
    top: 0;
    color: #fff;
}
#history_playback a.tn-hist-pause {
    background: #00838e;
}
#history_playback a.tn-hist-stop {
    background: #e8362c;
    box-shadow: 0 4px 10px rgba(232, 54, 44, 0.28);
}
#history_playback select.form-control {
    width: auto;
    min-width: 64px;
    height: 36px !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #eef7f8 !important;
    color: #0a5d69 !important;
    font-weight: 700;
    box-shadow: none !important;
}

#history_navbar.navbar-fixed-bottom {
    min-height: 56px !important;
    height: 56px;
    padding: 0;
    border: 0 !important;
    background: linear-gradient(135deg, #0a5d69 0%, #0e7a88 55%, #00a3b0 140%) !important;
    box-shadow: 0 -8px 24px rgba(10, 93, 105, 0.2);
}
#history_navbar .container-fluid {
    padding: 0 6px;
    height: 56px;
}
#history_navbar .row {
    display: flex;
    align-items: center;
    height: 56px;
    margin: 0;
}
#history_navbar .width33 {
    float: none !important;
    width: auto !important;
    flex: 1;
    text-align: center;
}
#history_navbar a,
#history_navbar a.btn,
#history_navbar a.btn-default {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: 48px;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #fff !important;
    font-size: 11px;
    font-weight: 700;
    text-shadow: none !important;
}
#history_navbar a i {
    font-size: 16px;
    color: #fff;
}

.graph-panel,
.details-panel,
.fuel-panel {
    background: #eef7f8 !important;
    padding-top: 16px !important;
}
.fuel-panel {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 56px;
    overflow: auto;
    padding: 12px 10px 18px !important;
    z-index: 20;
}
.details-panel .panel-default {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(10, 93, 105, 0.1);
}
.details-panel .panel-heading {
    background: linear-gradient(135deg, #0e7a88 0%, #00a3b0 100%) !important;
    color: #fff;
    border: 0;
    font-weight: 700;
}
.details-panel .list-group-item {
    border-color: #d4e8eb;
}

/* EVENTOS — tarjetas en lugar de tabla */
.tn-event-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 12px;
    margin: 0 0 4px;
    -webkit-overflow-scrolling: touch;
}
.tn-event-filters button {
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    height: 34px;
    padding: 0 12px;
    background: #eef7f8;
    color: #0a5d69;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.tn-event-filters button span {
    display: inline-block;
    min-width: 16px;
    margin-left: 4px;
    opacity: 0.7;
}
.tn-event-filters button.is-on {
    background: linear-gradient(135deg, #0e7a88 0%, #00a3b0 100%);
    color: #fff;
}
.tn-event-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 12px;
}
.tn-event-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 12px 10px;
    background: #fff;
    border: 1px solid #d4e8eb;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(10, 93, 105, 0.08);
    text-decoration: none !important;
    color: inherit;
}
.tn-event-card:hover,
.tn-event-card:focus {
    background: #f7fcfd;
}
.tn-event-ico {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    color: #fff;
    background: #0e7a88;
}
.tn-event-alert .tn-event-ico { background: #e8362c; }
.tn-event-geo .tn-event-ico { background: #43b83f; }
.tn-event-speed .tn-event-ico { background: #f0a202; }
.tn-event-alert {
    border-color: #f7c1bd;
    background: linear-gradient(180deg, #fff8f7 0%, #fff 72%);
}
.tn-event-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tn-event-body strong {
    font-size: 14px;
    color: #0d3d45;
    line-height: 1.25;
}
.tn-event-body small {
    font-size: 12px;
    color: #5a7a80;
}
.tn-event-body em {
    font-style: normal;
    font-size: 11px;
    color: #00838e;
    font-weight: 700;
}
.tn-event-go {
    color: #9bb8bc;
    font-size: 12px;
}
.tn-event-empty {
    margin: 18px 8px;
    text-align: center;
    color: #5a7a80;
    font-size: 13px;
}

/* GRÁFICO DE HISTORIAL */
.graph-panel {
    background: #eef7f8 !important;
    padding: 14px 12px 12px !important;
}
.graph-controls {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px !important;
    background: #fff;
    border-radius: 16px;
    padding: 8px 10px;
    box-shadow: 0 6px 16px rgba(10, 93, 105, 0.08);
}
.graph-controls-left,
.graph-controls-right {
    float: none !important;
    display: flex;
    align-items: center;
    gap: 6px;
}
.graph-controls-left .form-control {
    height: 36px !important;
    border-radius: 999px !important;
    background: #eef7f8 !important;
    border: 0 !important;
    font-weight: 700;
    color: #0a5d69;
}
.graph-controls-right a {
    width: 34px;
    height: 34px;
    margin: 0 !important;
    border-radius: 10px;
    background: #eef7f8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.graph-controls-right a img {
    width: 14px;
    opacity: 0.75;
}
.graph-panel-plot {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(10, 93, 105, 0.08);
    min-height: 260px;
}
.graph-panel-label {
    background: rgba(10, 93, 105, 0.92);
    color: #fff;
    border-radius: 10px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
}
.canvasjs-chart-credit {
    display: none !important;
}

.tn-fuel-wrap { max-width: 640px; margin: 0 auto; }
.tn-fuel-hero {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #fff;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 8px 20px rgba(10, 93, 105, 0.08);
    margin-bottom: 12px;
}
.tn-fuel-hero-text { flex: 1; min-width: 0; }
.tn-fuel-current {
    font-size: 26px;
    font-weight: 800;
    color: #0a5d69;
    line-height: 1.1;
}
.tn-fuel-sub { margin-top: 4px; font-size: 12px; color: #5a7a80; }
.tn-fuel-kpis { display: flex; gap: 8px; margin-top: 10px; }
.tn-fuel-kpi {
    flex: 1;
    border-radius: 12px;
    padding: 8px 10px;
}
.tn-fuel-kpi b { display: block; font-size: 15px; }
.tn-fuel-kpi span { font-size: 11px; text-transform: uppercase; }
.tn-fuel-kpi.fill { background: #e8f8ef; color: #1b7a46; }
.tn-fuel-kpi.theft { background: #fdecec; color: #b42318; }
.tn-fuel-list {
    background: #fff;
    border-radius: 16px;
    padding: 10px 12px 6px;
    margin-bottom: 10px;
    box-shadow: 0 8px 20px rgba(10, 93, 105, 0.08);
}
.tn-fuel-list-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.tn-fuel-list.fill .tn-fuel-list-title { color: #1b7a46; }
.tn-fuel-list.theft .tn-fuel-list-title { color: #b42318; }
.tn-fuel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 2px;
    border-top: 1px solid #e8f1f2;
    text-decoration: none !important;
    color: inherit;
}
.tn-fuel-amt { min-width: 78px; font-weight: 800; font-size: 14px; }
.tn-fuel-list.fill .tn-fuel-amt { color: #1b7a46; }
.tn-fuel-list.theft .tn-fuel-amt { color: #b42318; }
.tn-fuel-meta {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    color: #5a7a80;
    min-width: 0;
}
.tn-fuel-meta b { color: #0d3d45; font-weight: 700; }
.tn-fuel-empty,
.tn-fuel-empty-row {
    padding: 18px 8px;
    text-align: center;
    color: #5a7a80;
    font-size: 13px;
}
