/* ============================================================
   GeoVenezuela - Mapa Interactivo
   Paleta: #003366 | #C8102E | #F4F7F6
   Tipografía: Roboto / Open Sans
   ============================================================ */

   :root {
    --primary:        #003366;
    --primary-light:  #004d99;
    --primary-dark:   #001a33;
    --accent:         #C8102E;
    --accent-light:   #e8314f;
    --bg:             #F4F7F6;
    --surface:        #ffffff;
    --surface-2:      #f0f4f8;
    --text:           #1a2535;
    --text-muted:     #6b7a8d;
    --border:         #dde4ed;
    --shadow-sm:      0 2px 8px rgba(0,51,102,.10);
    --shadow-md:      0 6px 24px rgba(0,51,102,.15);
    --shadow-lg:      0 12px 40px rgba(0,51,102,.20);
    --radius:         4px;
    --radius-lg:      12px;
    --radius-pill:    999px;
    --transition:     all .25s cubic-bezier(.4,0,.2,1);
    --navbar-h:       60px;
    --font-main:      'Roboto', 'Open Sans', sans-serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.app-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-h);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    z-index: 1000;
    box-shadow: 0 2px 16px rgba(0,0,0,.25);
    gap: 1rem;
}

/* Brand */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
    text-decoration: none;
}

.brand-icon {
    width: 38px; height: 38px;
    background: rgba(255,255,255,.12);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: white;
    border: 1px solid rgba(255,255,255,.2);
    flex-shrink: 0;
}

.brand-icon svg { width: 22px; height: 22px; }

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: .3px;
}

.brand-subtitle {
    font-size: .68rem;
    color: rgba(255,255,255,.6);
    font-weight: 400;
}

/* Navbar Controls */
.navbar-controls {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

/* Search */
.search-container {
    position: relative;
    flex: 1;
    max-width: 380px;
    min-width: 0;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,.5);
    font-size: .85rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--radius-pill);
    padding: .5rem .85rem .5rem 2.2rem;
    color: white;
    font-size: .875rem;
    font-family: var(--font-main);
    outline: none;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.search-input::placeholder { color: rgba(255,255,255,.45); }

.search-input:focus {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.45);
    box-shadow: 0 0 0 3px rgba(255,255,255,.1);
}

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 2000;
    display: none;
    max-height: 320px;
    overflow-y: auto;
}

.search-results.visible { display: block; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface-2); }

.search-result-icon {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem;
    flex-shrink: 0;
}

.search-result-icon.city     { background: #e8f0fe; color: #1967d2; }
.search-result-icon.state    { background: #e6f4ea; color: #1e8e3e; }
.search-result-icon.landmark { background: #fce8e6; color: #d93025; }
.search-result-icon.port     { background: #e4f3fb; color: #0085c7; }

.search-result-info { flex: 1; min-width: 0; }

.search-result-name {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-type {
    font-size: .75rem;
    color: var(--text-muted);
}

/* Layer Switcher Button */
.layer-switcher {
    display: flex;
    align-items: center;
    gap: .4rem;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: var(--radius);
    padding: .45rem .85rem;
    color: white;
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.layer-switcher:hover {
    background: rgba(255,255,255,.22);
}

/* ============================================================
   MAP
   ============================================================ */
#map {
    position: fixed;
    top: var(--navbar-h);
    left: 0; right: 0; bottom: 0;
    z-index: 1;
}

/* Leaflet overrides */
.leaflet-control-zoom { display: none !important; } /* We use custom controls */

.leaflet-popup-content-wrapper {
    background: var(--surface);
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg) !important;
    border: none !important;
    padding: 0 !important;
    overflow: hidden;
    min-width: 200px;
}

.leaflet-popup-content { margin: 0 !important; width: auto !important; }

.leaflet-popup-tip-container { display: none; }

.leaflet-popup-close-button {
    top: 10px !important;
    right: 12px !important;
    color: var(--text-muted) !important;
    font-size: 18px !important;
    line-height: 1 !important;
    padding: 0 !important;
    z-index: 10;
}

.popup-content {
    padding: 1rem 1.1rem 1.1rem;
}

.popup-header {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: .75rem;
}

.popup-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: .8rem;
    flex-shrink: 0;
}

.popup-title { font-size: .95rem; font-weight: 700; color: var(--text); }
.popup-subtitle { font-size: .75rem; color: var(--text-muted); }

.popup-coord {
    font-size: .72rem;
    color: var(--text-muted);
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: .35rem .6rem;
    font-family: 'Roboto Mono', monospace;
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: .5rem;
}

/* ============================================================
   LAYER PANEL
   ============================================================ */
.layer-panel {
    position: fixed;
    top: var(--navbar-h);
    right: 0;
    width: 280px;
    height: calc(100vh - var(--navbar-h));
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 20px rgba(0,0,0,.08);
    z-index: 900;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.layer-panel.open { transform: translateX(0); }

.layer-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.layer-panel-header h3 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.layer-panel-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.layer-panel-close:hover { background: var(--border); color: var(--text); }

.layer-panel-body { flex: 1; overflow-y: auto; padding: .75rem 1rem; }

.layer-section-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: .5rem;
}

.layer-options { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }

.layer-option {
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: .6rem;
    cursor: pointer;
    text-align: center;
    font-size: .75rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
}

.layer-option:hover { border-color: var(--primary-light); color: var(--primary); }

.layer-option.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0,51,102,.05);
}

.layer-thumb {
    width: 100%;
    height: 52px;
    border-radius: 6px;
    margin-bottom: .4rem;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.osm-thumb     { background: linear-gradient(135deg, #aad3df 0%, #f2efe9 50%, #c8e6c9 100%); }
.satellite-thumb { background: linear-gradient(135deg, #2d3748 0%, #4a5568 40%, #2d5a27 100%); }
.topo-thumb    { background: linear-gradient(135deg, #d4c5a9 0%, #b5a892 40%, #8ca682 100%); }
.dark-thumb    { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); }

.layer-check {
    position: absolute;
    top: 5px; right: 5px;
    color: var(--primary);
    font-size: .65rem;
    opacity: 0;
    transition: var(--transition);
}

.layer-option.active .layer-check { opacity: 1; }

.layer-divider { height: 1px; background: var(--border); margin: .75rem 0; }

/* Overlay Toggles */
.overlay-toggle-group { display: flex; flex-direction: column; gap: .45rem; }

.overlay-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem .75rem;
    background: var(--surface-2);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: .8rem;
    font-weight: 500;
    color: var(--text);
}

.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: var(--radius-pill);
    transition: var(--transition);
    cursor: pointer;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px; height: 16px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ============================================================
   INFO PANEL (Right Side)
   ============================================================ */
.info-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 320px;
    max-height: calc(100vh - var(--navbar-h) - 80px);
    background: var(--surface);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    box-shadow: var(--shadow-md);
    z-index: 800;
    transform: translateX(-110%);
    transition: transform .4s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    margin-bottom: 60px;
}

.info-panel.open { transform: translateX(0); }

.info-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 0 calc(var(--radius-lg) - 1px) 0 0;
}

.info-panel-title {
    font-size: .9rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
}

.info-panel-close {
    background: rgba(255,255,255,.15);
    border: none;
    color: white;
    cursor: pointer;
    font-size: .8rem;
    padding: 5px 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.info-panel-close:hover { background: rgba(255,255,255,.25); }

.info-panel-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.info-default { text-align: center; padding: .5rem 0; }

.info-icon-large {
    font-size: 2.5rem;
    color: var(--primary);
    opacity: .25;
    margin-bottom: .75rem;
}

.info-default h4 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: .5rem; }
.info-default p { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }

.info-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    margin-top: 1rem;
}

.info-stat {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: .6rem .4rem;
    text-align: center;
    border: 1px solid var(--border);
}

.info-stat-value { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.info-stat-label { font-size: .68rem; color: var(--text-muted); margin-top: 2px; }

/* Dynamic Info Content */
.info-location-name { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: .25rem; }
.info-location-type { font-size: .75rem; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.info-location-state { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

.info-coords-box {
    background: var(--surface-2);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: .65rem .85rem;
    margin-top: .85rem;
    font-size: .78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.info-coords-box i { color: var(--primary); }

.info-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .75rem;
}

.info-tag {
    background: rgba(0,51,102,.07);
    color: var(--primary);
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    font-size: .72rem;
    font-weight: 600;
    border: 1px solid rgba(0,51,102,.12);
}

/* ============================================================
   ZOOM INDICATOR
   ============================================================ */
.zoom-indicator {
    position: fixed;
    bottom: 52px;
    right: 60px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: .4rem .7rem;
    z-index: 900;
    text-align: center;
    min-width: 90px;
}

.zoom-level { font-size: .78rem; font-weight: 700; color: var(--primary); }
.zoom-detail { font-size: .65rem; color: var(--text-muted); }

/* ============================================================
   CUSTOM CONTROLS
   ============================================================ */
.custom-controls {
    position: fixed;
    right: 12px;
    top: calc(var(--navbar-h) + 12px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 900;
}

.ctrl-btn {
    width: 40px; height: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    font-size: .85rem;
    transition: var(--transition);
}

.ctrl-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.ctrl-btn:active { transform: scale(.96); }

.ctrl-divider {
    height: 1px;
    background: var(--border);
    margin: 3px 4px;
}

/* ============================================================
   COORDINATE DISPLAY
   ============================================================ */
.coord-display {
    position: fixed;
    bottom: 8px;
    right: 12px;
    background: rgba(255,255,255,.92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .3rem .75rem;
    font-size: .72rem;
    color: var(--text-muted);
    font-family: 'Roboto Mono', monospace;
    z-index: 900;
    backdrop-filter: blur(6px);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .6s ease, visibility .6s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content { text-align: center; color: white; }

.loading-spinner {
    width: 64px; height: 64px;
    margin: 0 auto 1rem;
}

.loading-spinner svg { width: 100%; height: 100%; }
.loading-spinner circle { stroke: rgba(255,255,255,.8); }

.loading-map-icon {
    font-size: 2rem;
    margin-bottom: .75rem;
    opacity: .7;
}

.loading-content h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: .4rem; }
.loading-content p { font-size: .875rem; opacity: .65; }

/* ============================================================
   LEAFLET ATTRIBUTION
   ============================================================ */
.leaflet-bottom.leaflet-left { display: none; }
.leaflet-bottom.leaflet-right .leaflet-attribution-flag { display: none !important; }

.leaflet-control-attribution {
    font-size: .65rem !important;
    background: rgba(255,255,255,.8) !important;
    backdrop-filter: blur(4px);
    border-radius: var(--radius) 0 0 0 !important;
}

/* ============================================================
   GEOJSON STATE STYLES (applied via JS)
   ============================================================ */
.leaflet-interactive:focus { outline: none; }

/* ============================================================
   TOOLTIP OVERRIDE
   ============================================================ */
.leaflet-tooltip {
    background: var(--primary) !important;
    border: none !important;
    border-radius: var(--radius) !important;
    color: white !important;
    font-family: var(--font-main) !important;
    font-size: .8rem !important;
    font-weight: 600 !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 5px 10px !important;
    white-space: nowrap !important;
}

.leaflet-tooltip::before { border-top-color: var(--primary) !important; }

/* City Markers */
.city-marker-icon {
    background: white;
    border: 3px solid var(--primary);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    transition: transform .2s ease;
    display: flex; align-items: center; justify-content: center;
}

.city-marker-icon:hover { transform: scale(1.2); }
.city-marker-icon.capital { border-color: var(--accent); background: var(--accent); }
.city-marker-icon.capital i { color: white; }
.city-marker-icon i { color: var(--primary); font-size: .75rem; }

/* Cluster markers */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large { background-clip: padding-box; border-radius: 20px; }

.marker-cluster-small  div { background-color: rgba(0,51,102,.6); }
.marker-cluster-medium div { background-color: rgba(0,77,153,.6); }
.marker-cluster-large  div { background-color: rgba(200,16,46,.6); }

.marker-cluster div { color: white; font-weight: 700; font-size: .8rem; }

/* ============================================================
   SCROLL BAR
   ============================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.35); }


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .brand-subtitle { display: none; }
    .layer-switcher span { display: none; }
    .layer-switcher { padding: .45rem .65rem; }
    .info-panel { width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-left: 1px solid var(--border); border-top: 4px solid var(--primary); margin-bottom: 0; transform: translateY(110%); }
    .info-panel.open { transform: translateY(0); }
    .layer-panel { width: 100%; }
    .zoom-indicator { right: 56px; bottom: 50px; }
}

@media (max-width: 480px) {
    .search-container { max-width: 180px; }
}

/* ============================================================
   MARINE TRAFFIC SIMULATION STYLES
   ============================================================ */
.marine-marker-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
}
.marine-icon {
    transition: transform 0.5s linear;
}

/* Marine Popup Container */
.marine-popup-container .leaflet-popup-content-wrapper {
    border-radius: 4px !important;
    padding: 0 !important;
    overflow: hidden;
}

.marine-popup-container .leaflet-popup-content {
    margin: 0 !important;
    width: 320px !important;
}

.mt-popup {
    font-family: Arial, Helvetica, sans-serif;
    color: #333;
    font-size: 13px;
    background: #fff;
}

.mt-header {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.mt-type-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    font-size: 14px;
}

.mt-flag {
    width: 20px;
    margin-right: 8px;
    border: 1px solid #eee;
}

.mt-title-area {
    flex: 1;
}

.mt-name {
    font-size: 16px;
    font-weight: normal;
    color: #333;
    text-transform: uppercase;
}

.mt-desc {
    font-size: 11px;
    color: #888;
}

.mt-route-info {
    padding: 10px 12px;
}
.mt-route-dest {
    font-size: 14px;
    color: #333;
}

.mt-body-vessel {
    display: flex;
    padding: 0 12px 12px;
    gap: 12px;
}

.mt-vessel-image {
    width: 120px;
    height: 80px;
    background-size: cover;
    background-position: center;
    position: relative;
    border: 1px solid #eee;
}

.mt-watermark {
    position: absolute;
    bottom: 2px;
    left: 4px;
    color: rgba(255,255,255,0.7);
    font-size: 9px;
    font-weight: bold;
}

.mt-vessel-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mt-eta-row {
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mt-eta-row strong {
    color: #333;
}

.mt-progress-bar {
    display: flex;
    align-items: center;
    margin: 8px 0;
}
.mt-progress-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #02a2f5;
}
.mt-progress-dot.end {
    background: #aaa;
}
.mt-progress-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, #02a2f5 50%, #aaa 50%);
    position: relative;
}
.mt-progress-arrow {
    position: absolute;
    top: -4px;
    left: 50%;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid #02a2f5;
}

.mt-route-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.mt-btn-dark, .mt-btn-outline, .mt-btn-primary {
    border: none;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
}
.mt-btn-dark {
    background: #344050;
    color: #fff;
}
.mt-btn-outline {
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
}
.mt-btn-primary {
    background: #0d6efd;
    color: #fff;
}

.mt-nav-grid {
    display: flex;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    padding: 8px 12px;
}
.mt-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #f0f0f0;
    padding-right: 8px;
    margin-right: 8px;
}
.mt-nav-item:last-child {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
}
.mt-label {
    font-size: 10px;
    color: #888;
    margin-bottom: 2px;
}

.mt-buttons {
    padding: 12px;
    display: flex;
    gap: 8px;
}
.mt-btn-group {
    display: flex;
    width: 100%;
}
.mt-btn-group button {
    margin-right: -1px;
    border-radius: 0;
}
.mt-btn-group button:first-child {
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}
.mt-btn-group button:last-child {
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    flex: 1;
}

.mt-footer {
    background: #f9f9f9;
    color: #888;
    font-size: 11px;
    padding: 8px 12px;
    border-top: 1px solid #eee;
}

.mt-body {
    padding: 12px;
    display: flex;
    gap: 12px;
}
.mt-image-placeholder {
    width: 80px; height: 80px;
    border: 1px solid #eee;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; color: #ccc;
    background: #fdfdfd;
}
.mt-actions {
    flex: 1;
    display: flex;
    gap: 12px;
}
.mt-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mt-col strong {
    font-size: 10px; color: #112a46;
}
.mt-col a {
    color: #333;
    text-decoration: none;
    font-size: 11px;
}
.mt-col a:hover {
    color: #0d6efd;
}

/* ============================================================
   BOYAS & TORRES POPUP & MARKER STYLES
   ============================================================ */
.boya-marker-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
}

.boya-popup-container .leaflet-popup-content-wrapper {
    border-radius: 4px !important;
    padding: 0 !important;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0,51,102,.18) !important;
}

.boya-popup-container .leaflet-popup-content {
    margin: 0 !important;
    width: 300px !important;
}

.boya-icon-marker {
    transition: transform 0.2s ease-in-out;
}

.boya-icon-marker:hover {
    transform: scale(1.25);
    z-index: 1000 !important;
}

.boya-tooltip {
    background: #003366 !important;
    border: none !important;
    border-radius: 4px !important;
    color: white !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
}




/* ============================================================
   EMBARCACIONES PROPIAS (FLOTA) STYLES
   ============================================================ */
.unit-item-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0.75rem;
}

.unit-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
    border-color: #10b981;
}

.status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    display: inline-block;
}

.status-operativa {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-mantenimiento {
    background: #fff8e1;
    color: #f57f17;
}

.status-inoperativa {
    background: #ffebee;
    color: #c62828;
}

/* Modal styles (copiado y adaptado) */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.maint-modal {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.modal-backdrop.active .maint-modal {
    transform: scale(1);
}

.modal-header {
    background: #003366;
    color: #ffffff;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-title h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
}

.modal-title p {
    font-size: 0.75rem;
    opacity: 0.8;
    margin: 2px 0 0 0;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.15rem;
    cursor: pointer;
    opacity: 0.8;
    transition: 0.2s;
}

.modal-close-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.modal-content-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.modal-footer {
    padding: 0.75rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

.btn-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* Novedades list inside modal */
.failure-entry {
    background: #f8fafc;
    border-left: 4px solid #ef4444;
    padding: 10px;
    border-radius: 0 6px 6px 0;
    border-top: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 10px;
}

.failure-entry.is-read {
    border-left-color: #64748b;
    background: #fafbfc;
}

.failure-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 6px;
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 4px;
}

.failure-text {
    font-size: 0.8rem;
    color: #1e293b;
    line-height: 1.45;
    white-space: pre-wrap;
}

/* Toggles de superposición específicos */
.toggle-switch input:checked + .toggle-slider.slider-mantenimiento { background: #10b981 !important; }
.toggle-switch input:checked + .toggle-slider.slider-equipos { background: #f59e0b !important; }
.toggle-switch input:checked + .toggle-slider.slider-operadores { background: #8eb4e3 !important; }
.toggle-switch input:checked + .toggle-slider.slider-ports-general { background: #0f172a !important; }
.toggle-switch input:checked + .toggle-slider.slider-ports-commercial { background: #059669 !important; }
.toggle-switch input:checked + .toggle-slider.slider-ports-oilgas { background: #d97706 !important; }
.toggle-switch input:checked + .toggle-slider.slider-ports-industrial { background: #0284c7 !important; }

