/* ===========================================================
   LakbayG Dashboard
=========================================================== */

:root{

    --primary:#4C6B54;
    --primaryDark:#37513D;

    --bg:#F6F8FA;

    --white:#fff;

    --border:#E4E7EB;

    --text:#2C3E50;

    --gray:#7B8794;

    --danger:#EF4A3A;

    --success:#2ECC71;

    --shadow:0 15px 35px rgba(0,0,0,.12);

    --radius:20px;

}

*{

    margin:0;

    padding:0;

    box-sizing:border-box;

    font-family: 'Signika Negative', 'Segoe UI', Tahoma, sans-serif;

}

body{

    display:flex;

    background:var(--bg);

    overflow:hidden;

    height:100vh;

}

/* ========================================= */

.sidebar{

    width:300px;
    flex-shrink:0;

    background: #3B5643 url("../images/bg-dark.jpg") center center / cover no-repeat;

    color:white;
    position:relative;

    z-index:5000;
    display:flex;

    flex-direction:column;

    justify-content:space-between;

    padding:22px;

}

.logo{

    display:flex;

    align-items:center;

    gap:12px;

    margin-bottom:45px;

}

.logo i{

    font-size: 41px;

}

.logo h1{

    font-size: 41px;

}

nav{

    display:flex;

    flex-direction:column;

    gap:12px;

}

nav a{

    color:white;

    text-decoration:none;

    display:flex;

    align-items:center;

    gap:14px;

    padding:14px;

    border-radius:14px;

    transition:.25s;

}

nav a:hover{

    background:rgba(255,255,255,.15);

}

nav a.active{

    background:white;

    color:var(--primary);

    font-weight:600;

}

#logoutBtn{

    border:none;

    background:var(--danger);

    color:white;

    padding:14px;

    border-radius:14px;

    cursor:pointer;

    font-weight:600;

    transition:.3s;

}

#logoutBtn:hover{

    transform:translateY(-2px);

}

/* ========================================= */

.main{

    flex:1;
    z-index:1;
    position:relative;

    overflow:hidden;

}

/* ========================================= */

header{

    height:83px;

    background:white;

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:0 32px;

    border-bottom:1px solid var(--border);

    z-index:100;

    position:relative;

}

header h1{

    color:var(--text);

}

header p{

    color:var(--gray);

}

.gps-status{

    color:var(--success);

    display:flex;

    align-items:center;

    gap:10px;

    font-weight:600;

}

.dot{

    width:12px;

    height:12px;

    border-radius:50%;

    background:var(--success);

    animation:pulse 1.5s infinite;

}

@keyframes pulse{

    0%{

        transform:scale(1);

    }

    50%{

        transform:scale(1.5);

        opacity:.4;

    }

    100%{

        transform:scale(1);

    }

}

/* ========================================= */

.map-container{

    position:relative;

    width:100%;

    height:calc(100vh - 83px);

}

#map{

    width:100%;

    height:100%;

}

/* ========================================= */

.planner{

    position:absolute;

    top:25px;

    left:22px;

    width:360px;

    max-height:calc(100vh - 240px);

    overflow:auto;

    background:rgba(255,255,255,.96);

    backdrop-filter:blur(14px);

    border-radius:22px;

    box-shadow:var(--shadow);

    padding:22px;

    z-index:4000;

}

.planner h2{

    color:var(--text);

    margin-bottom:20px;

}

.input-group{

    margin-bottom:18px;

}

.input-group label{

    display:block;

    font-size: 16px;

    margin-bottom:8px;

    color:var(--primary);

    font-weight:600;

}

.input-group input{

    width:100%;

    border:1px solid var(--border);

    border-radius:12px;

    padding:14px;

    outline:none;

}

/* ========================================= */

.summary{

    display:grid;

    grid-template-columns:1fr 1fr;

    gap:12px;

    margin-bottom:15px;

}

.summary div{

    background:#EEF6EF;

    border-radius:15px;

    text-align:center;

    padding:16px;

}

.summary small{

    color:var(--gray);

}

.summary h3{

    margin-top:5px;

    color:var(--primary);

}


#planBtn,
#startTravelBtn{

    width:100%;

    border:none;

    border-radius:14px;

    padding:15px;

    font-size: 17px;

    font-weight:600;

    cursor:pointer;

    transition:.25s;

}

#planBtn{

    background:var(--primary);

    color:white;

    margin-top:10px;

}

#planBtn:hover{

    background:var(--primaryDark);

}

#startTravelBtn{

    background:var(--success);
    
    color:white;

    margin-top:12px;

}

#startTravelBtn:disabled{

    background:#C9D2D8;

    cursor:not-allowed;

}
.modal-overlay{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.45);

    display:none;

    justify-content:center;

    align-items:center;

    z-index:99999;

}

.arrival-modal{

    width:420px;

    background:white;

    padding:35px;

    border-radius:20px;

    text-align:center;

    box-shadow:0 25px 60px rgba(0,0,0,.25);

}

.arrival-modal i{

    font-size: 80px;

    color:#2ECC71;

    margin-bottom:20px;

}

#startTravelBtn:not(:disabled):hover{

    filter:brightness(.95);

}

/* ===========================
   Bottom Sheet
=========================== */

#trackingSheet{

    position:absolute;

    left:0;

    right:0;

    bottom:0;

    height:120px;

    background:white;

    border-radius:30px 30px 0 0;

    z-index:2000;

}

/* collapsed */

#trackingSheet.collapsed{

    height:110px;

}

/* ===========================
   Drag Handle
=========================== */

#dragHandle{

    width:70px;

    height:6px;

    background:#D5D5D5;

    border-radius:20px;

    margin:14px auto;

    cursor:grab;

}

#dragHandle:active{

    cursor:grabbing;

}


/* ===========================
   Header
=========================== */

.sheet-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:25px;

}

.sheet-header h2{

    color:var(--text);

}

.sheet-header i{

    color:var(--primary);

    margin-right:8px;

}


/* ===========================
   Grid
=========================== */

.tracking-grid{

    display:grid;

    grid-template-columns:repeat(3,1fr);

    gap:20px;

}

.tracking-grid div{

    background:#F5F7FA;

    border-radius:16px;

    padding:18px;

    text-align:center;

    transition:.25s;

}

.tracking-grid div:hover{

    transform:translateY(-3px);

}

.tracking-grid small{

    color:var(--gray);

}

.tracking-grid h2{

    margin-top:8px;

    color:var(--primary);

    font-size: 25px;

}
/* ===========================
   Live Tracking Vehicle
=========================== */

.tracking-vehicle {

    display: flex;

    justify-content: center;

    align-items: center;

    height: 58px;

    margin-top: 8px;

    margin-bottom: 8px;

}

#trackingVehicleIcon {

    width: 52px;

    height: 52px;

    object-fit: contain;

}
/* ===========================
   Progress Bar
=========================== */

.progress {

    position: relative;

    width: 100%;

    height: 14px;

    border-radius: 50px;

    background: #E4E7EB;

    overflow: visible;

    margin-top: 28px;

}

#progressBar {

    width: 0%;

    height: 100%;

    border-radius: 50px;

    background: linear-gradient(
        90deg,
        #4C6B54,
        #69C779
    );

    transition: width .35s ease;

}

.tracking-vehicle-icon {

    position: absolute;

    top: 50%;

    left: 0%;

    width: 46px;

    height: 46px;

    object-fit: contain;

    transform: translate(-50%, -50%);

    z-index: 5;

    pointer-events: none;

    transition:
        left .35s ease;

}

/* ===========================
   Cancel Button
=========================== */

#cancelTrip{

    margin-top:25px;

    border:none;

    background:var(--danger);

    color:white;

    border-radius:14px;

    padding:15px;

    font-size: 17px;

    font-weight:600;

    cursor:pointer;

    transition:.25s;

}

#cancelTrip:hover{

    background:#D63B2A;

}

/* ===========================
   Scroll if expanded
=========================== */

#trackingSheet{

    position:absolute;

    left:0;

    right:0;

    bottom:0;

    height:110px;

    background:#fff;

    border-radius:28px 28px 0 0;

    box-shadow:0 -10px 30px rgba(0,0,0,.15);

    transition:height .2s ease;

    overflow:hidden;

    /* must sit above .planner (4000) so the raised sheet is not covered,
       but below .sidebar (5000) */
    z-index:4500;

}

#trackingSheet::-webkit-scrollbar{

    width:6px;

}

#trackingSheet::-webkit-scrollbar-thumb{

    background:#D6D9DD;

    border-radius:20px;

}
/* =========================================
   TRAVEL PLANNER MINIMIZE / MAXIMIZE
========================================= */

.planner h2.planner-title {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    margin-bottom: 20px;
}


/* Title */

.planner-title-text {

    display: flex;

    align-items: center;

    gap: 8px;

    min-width: 0;
}


/* Toggle button */

.planner-toggle {

    flex: 0 0 auto;

    width: 34px;
    height: 34px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: none;

    border-radius: 10px;

    background: #EEF6EF;

    color: var(--primary);

    cursor: pointer;

    font-size: 16px;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}


/* Hover */

.planner-toggle:hover {

    background: #DCEBDD;

}


/* Click animation */

.planner-toggle:active {

    transform: scale(0.94);

}


/* =========================================
   MINIMIZED PLANNER
========================================= */

.planner.minimized {

    width: 360px;

    max-height: none;

    overflow: hidden;

    padding-bottom: 14px;

}


/* Remove spacing underneath title */

.planner.minimized h2.planner-title {

    margin-bottom: 0;

}


/* Hide planner contents */

.planner.minimized > :not(.planner-title) {

    display: none;

}
/* =========================================
   CONSISTENT DASHBOARD INTERFACE
========================================= */

body {
    display: block;
    width: 100%;
    min-height: 100vh;
    background-color: #579268;

    background-image: url("../images/background.jpg");

    background-size: cover;

    background-position: center center;

    background-repeat: no-repeat;

    background-attachment: fixed;
    overflow: hidden;
}

body,
body * {
    font-family: 'Signika Negative', 'Segoe UI', Tahoma, sans-serif;
}

/* MAIN */

.main {
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* TOP BAR */

.top-bar {
    width: 100%;
    height: 48px;
    padding: 0;
    background: transparent;
    border: none;

    display: flex;
    align-items: center;
    justify-content: center;

    position: relative;
    z-index: 10;
}

/* MENU BUTTON */

.menu-btn {
    position: absolute;
    left: 17px;
    top: 17px;

    width: 32px;
    height: 32px;

    border: none;
    background: transparent;

    color: white;
    font-size: 26px;
    cursor: pointer;
}

/* TOP LOGO */

.top-bar .logo {
    margin: 0;
    color: white;

    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 33px;
    font-weight: bold;

    text-shadow: 0 2px 2px rgba(0,0,0,0.15);
}

.top-bar .logo,
.top-bar .logo * {
    font-family: 'Signika Negative', 'Segoe UI', Tahoma, sans-serif;
}

.top-bar .logo i {
    font-size: 31px;
}

/* GPS STATUS */

.gps-status {
    position: absolute;
    right: 20px;

    color: white;
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 16px;
    font-weight: bold;
}

/* MAP CARD */

.map-container {
    width: calc(100% - 24px);
    height: calc(100vh - 52px);

    margin: 0 auto;

    border-radius: 28px 28px 0 0;
    overflow: hidden;

    background: #fffdf4;
    box-shadow: 0 3px 15px rgba(0,0,0,0.12);
}

/* TRAVEL PLANNER */

.planner {
    top: 18px;
    left: 18px;

    background: rgba(255,253,244,0.97);

    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* LIVE TRACKING */

#trackingSheet {
    padding: 0 22px 24px;

    background: #fffdf4;

    border-radius: 28px 28px 0 0;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.12);
}

/* SIDEBAR */

.sidebar {
    position: fixed;
    top: 0;
    left: -320px;

    width: 300px;
    height: 100vh;

    padding: 25px;

    background: #3B5643 url("../images/bg-dark.jpg") center center / cover no-repeat;
    color: white;

    z-index: 99999;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    transition: left 0.3s ease;
}

.sidebar.open {
    left: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 40px;

    color: white;
}

.sidebar-logo i {
    font-size: 34px;
}

.sidebar-logo h1 {
    font-family: 'Signika Negative', 'Segoe UI', Tahoma, sans-serif;
    font-size: 37px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar nav a {
    color: white;
    text-decoration: none;

    display: flex;
    align-items: center;
    gap: 14px;

    padding: 14px;
    border-radius: 12px;

    transition: 0.2s;
}

.sidebar nav a:hover {
    background: rgba(255,255,255,0.15);
}

.sidebar nav a.active {
    background: white;
    color: #4f805d;
    font-weight: bold;
}

/* LOGOUT */

#sidebarLogout {
    width: 100%;

    border: none;
    background: #b65b5b;
    color: white;

    padding: 14px;
    border-radius: 12px;

    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

#sidebarLogout:hover {
    background: #a44e4e;
}

/* SIDEBAR OVERLAY */

.sidebar-overlay {
    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.35);

    z-index: 9999;

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* MOBILE */

@media (max-width: 700px) {

    .gps-text {
        display: none;
    }

    .gps-status {
        right: 17px;
    }

    .map-container {
        width: calc(100% - 16px);
        height: calc(100vh - 50px);
    }

    .planner {
        top: 12px;
        left: 12px;

        width: calc(100% - 24px);
        max-height: calc(100vh - 180px);
    }

    #trackingSheet {
        padding-left: 14px;
        padding-right: 14px;
    }

    .tracking-grid {
        gap: 8px;
    }

    .tracking-grid div {
        padding: 12px 6px;
    }

    .tracking-grid h2 {
        font-size: 20px;
    }
}
/* =========================================
   LOCATION SEARCH
========================================= */

.location-search {
    position: relative;
}

.destination-suggestions {
    position: absolute;

    top: calc(100% + 6px);
    left: 0;
    right: 0;

    max-height: 230px;
    overflow-y: auto;

    background: #fffdf4;

    border: 1px solid #d8e1da;
    border-radius: 12px;

    box-shadow: 0 8px 25px rgba(0,0,0,0.18);

    z-index: 10000;
}

.destination-suggestions[hidden] {
    display: none;
}

.suggestion-item {
    width: 100%;

    display: flex;
    align-items: flex-start;
    gap: 10px;

    border: none;
    border-bottom: 1px solid #edf0ed;

    background: transparent;

    padding: 12px;

    color: #2c3e50;
    text-align: left;

    cursor: pointer;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item:focus {
    background: #edf5ef;
    outline: none;
}

.suggestion-item i {
    color: #4f805d;
    margin-top: 4px;
}

.suggestion-title {
    display: block;

    color: #405749;

    font-size: 16px;
    font-weight: bold;
}

.suggestion-address {
    display: block;

    margin-top: 3px;

    color: #7b8794;
    font-size: 14px;
    line-height: 1.35;
}

.suggestion-empty {
    padding: 13px;

    color: #7b8794;
    font-size: 15px;
    text-align: center;
}

.location-message {
    display: block;

    min-height: 17px;

    margin-top: 7px;

    color: #62786a;

    /* helper note — deliberately kept at the smaller size */
    font-size: 11px;
}

.location-message.error {
    color: #b65050;
}

/* Make the Tarlac border easy to see */

.tarlac-boundary-label {
    color: #a94c4c;
    font-size: 14px;
    font-weight: bold;

    background: #fffdf4;

    border: 1px solid #b65b5b;
    border-radius: 5px;

    padding: 3px 7px;
}

.pin-location {
    margin-top: 8px;
    padding: 9px 12px;
    border: 1px solid #4b7057;
    border-radius: 10px;
    background: #edf6ef;
    color: #4b7057;
    font: inherit;
    font-size: 15px;
    cursor: pointer;
}

.pin-location:hover:not(:disabled) {
    background: #dcebdd;
}

.pin-location:disabled,
.input-group input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.live-origin-button {
    width: 100%;

    margin-top: 8px;

    padding: 9px 12px;

    border: 1px solid #4b7057;

    border-radius: 10px;

    background: #edf6ef;

    color: #4b7057;

    font: inherit;

    font-size: 14px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.15s ease;
}

.live-origin-button:hover:not(:disabled) {
    background: #dcebdd;
}

.live-origin-button:active:not(:disabled) {
    transform: scale(0.98);
}

.live-origin-button:disabled {
    opacity: 0.55;

    cursor: not-allowed;
}

.destination-suggestions .suggestion-item {
    white-space: normal;
    text-align: left;
}

.destination-suggestions .suggestion-item:focus-visible {
    outline: 2px solid #4b7057;
    outline-offset: -2px;
}

/* Sequential planning and independent GPS */

.pin-location {
    width: 100%;
}

.pin-location.active {
    background: #4b7057;
    color: white;
}

.pin-location.active:hover:not(:disabled) {
    background: #37513d;
}

#map.pinning {
    cursor: crosshair;
}

.planner-scope,
.gps-message {
    display: block;

    /* helper notes — deliberately kept at the smaller size */
    font-size: 11px;
    line-height: 1.6;
    color: #536558;
    margin: 8px 0 12px;
}

.gps-button {
    border-color: #1e70b4;
    color: #1e70b4;
    background: #eef6ff;
}

.gps-status[data-state="idle"] .dot {
    background: #ddd;
    animation: none;
}

.gps-status[data-state="error"] .dot {
    background: #ffd1ca;
    animation: none;
}

.gps-status[data-state="outside"] .dot {
    background: #ffd36b;
}

.gps-status[data-state="active"] .dot {
    background: #79ee9c;
}

.planner {
    max-height: calc(100dvh - 215px);
}

.planner .destination-suggestions {
    position: relative;
    top: auto;
    margin-top: 6px;
    max-height: 190px;
}

.input-group input:focus-visible,
button:focus-visible,
#dragHandle:focus-visible {
    outline: 3px solid #1e70b4;
    outline-offset: 2px;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

#trackingSheet {
    overflow-y: auto;
}

#dragHandle {
    touch-action: none;
    min-height: 12px;
}

.arrival-modal {
    max-width: calc(100vw - 32px);
}

/* ===========================
   Destination Reached Buttons
=========================== */

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
    min-height: 48px;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}

#saveTrip {
    background: #22C55E;
    color: white;
}

#saveTrip:hover {
    background: #16A34A;
}

#discardTrip {
    background: #E5E7EB;
    color: #1F2937;
}

#discardTrip:hover {
    background: #D1D5DB;
}

.summary h3 {
    font-size: 18px;
    overflow-wrap: anywhere;
}

@media (max-width: 700px) {
    .planner {
        max-height: calc(100dvh - 190px);
    }

    .planner.minimized {
        width: calc(100% - 72px);
    }

    .sheet-header h2 {
        font-size: 22px;
    }

    /* Destination popup buttons */
    .modal-buttons {
        gap: 10px;
        width: 100%;
    }

    .modal-buttons button {
        min-height: 52px;
        padding: 14px 12px;
        font-size: 16px;
    }

    .arrival-modal {
        width: calc(100vw - 28px);
        padding: 28px 20px;
    }
}

/* ===========================================================
   BRAND ASSETS (logo mark + wordmark)
   White versions sit on the green sidebar,
   green versions sit on the white top bar.
=========================================================== */

.sidebar-logo,
.admin-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.sidebar-logo .brand-icon,
.admin-logo .brand-icon {
    width: 54px;
    height: auto;
    display: block;
}

.sidebar-logo .brand-name,
.admin-logo .brand-name {
    width: 140px;
    max-width: 100%;
    height: auto;
    display: block;
}

header .logo,
.top-bar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

header .logo .brand-icon,
.top-bar .logo .brand-icon {
    width: 34px;
    height: auto;
    display: block;
}

header .logo .brand-name,
.top-bar .logo .brand-name {
    width: 120px;
    height: auto;
    display: block;
}


/* ===========================================================
   TYPEFACE — Signika (Google Fonts, OFL)
   Loaded via <link> in each page head.
=========================================================== */

html,
body,
button,
input,
select,
textarea {
    font-family: 'Signika Negative', 'Segoe UI', Tahoma, sans-serif;

    /* SemiBold is the base weight for this design */
    font-weight: 600;
}

/* ===========================================================
   FROM / TO FIELDS + PASSENGER SELECTS
=========================================================== */

.route-fields {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

/* the connector rail: dot -> line -> pin */
.route-rail {
    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 22px 0 26px;
    flex-shrink: 0;
}

.rail-dot,
.rail-pin {
    width: 11px;
    height: 11px;

    border: 2px solid var(--primary);
    border-radius: 50%;

    flex-shrink: 0;
}

.rail-pin {
    border-radius: 2px;
    background: var(--primary);
}

.rail-line {
    width: 2px;
    flex: 1;

    background: repeating-linear-gradient(
        to bottom,
        var(--primary) 0 4px,
        transparent 4px 8px
    );
}

.route-inputs {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* floating label sitting on the field border */
.route-inputs .field,
.passenger-fields .field {
    position: relative;
    min-width: 0;
}

.route-inputs .field > label {
    position: absolute;
    top: -7px;
    left: 12px;
    z-index: 2;

    padding: 0 6px;

    background: #fffdf4;

    font-size: 13px;
    color: var(--gray);
}

.route-inputs .location-search input {
    width: 100%;
    padding: 14px 42px 14px 14px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: transparent;
    font-size: 16px;
    color: var(--text);
}

.route-inputs .location-search input:focus {
    outline: none;
    border-color: var(--primary);
}

/* pin button now lives inside the field */
.route-inputs .pin-location {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);

    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 8px;

    background: transparent;
    color: var(--primary);

    cursor: pointer;
    font-size: 17px;
}

.route-inputs .pin-location:hover:not(:disabled) {
    background: rgba(76, 107, 84, 0.12);
}

.route-inputs .pin-location:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* passenger selects */
.passenger-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;

    margin-bottom: 16px;
}

.passenger-fields .field > label {
    display: block;
    margin-bottom: 5px;

    font-size: 13px;
    color: var(--gray);
}

.passenger-select {
    width: 100%;
    padding: 12px 14px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: transparent;
    font-size: 16px;
    color: var(--text);

    cursor: pointer;
}

.passenger-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* keep the suggestion dropdown clear of the pin button */
.route-inputs .destination-suggestions {
    z-index: 10;
}


/* ===========================================================
   PLANNER — wider on laptop / desktop
   Phones keep the full-width rule in the max-width:700 block.
=========================================================== */

@media (min-width: 1280px) {

    .planner {
        width: 420px;
    }

    .planner.minimized {
        width: 420px;
    }
}

/* number box shown when "More than 4..." is picked */
.passenger-custom {
    margin-top: 8px;
}

.passenger-custom[hidden] {
    display: none;
}

.route-guide {
    margin-top: 12px;
    padding: 13px 15px;

    border: 1px solid #d3dfd6;
    border-radius: 10px;

    background: #f7faf8;

    font-size: 13px;
    line-height: 1.5;
}


.route-guide strong {
    display: block;

    margin-bottom: 7px;

    color: #315f41;
}


.route-guide ol {
    margin:
        0 0 8px 20px;

    padding: 0;
}


.route-guide li {
    margin-bottom: 4px;
}


.route-guide p {
    margin: 8px 0 0;

    padding-top: 8px;

    border-top:
        1px solid #dce5df;

    color: #52675a;

    font-weight: 600;
}


.fare-basis {
    display: block;

    margin-top: 3px;

    color: #69786e;

    font-size: 11px;
}

/* ===========================================================
   PASSENGER CATEGORY BREAKDOWN
   One row per discount category, plus the split tricycle fare.
=========================================================== */

.category-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.category-row {
    display: grid;
    grid-template-columns: 1fr 78px 38px;
    gap: 8px;
    align-items: center;
}


/* the first row always takes whatever is left over */
.category-row.base {
    grid-template-columns: 1fr 78px;
}


.category-row .category-count {
    width: 100%;
    padding: 12px 8px;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: transparent;
    font-size: 15px;
    text-align: center;
    color: var(--text);
}


.category-row .category-count:focus {
    outline: none;
    border-color: var(--primary);
}


.category-row .category-count[readonly] {
    background: #EEF6EF;
    color: #52675a;
    cursor: default;
}


.remove-category {
    display: flex;
    align-items: center;
    justify-content: center;

    height: 38px;
    padding: 0;

    border: 1px solid var(--border);
    border-radius: 10px;

    background: transparent;
    color: #a05252;

    font-size: 14px;
    cursor: pointer;
}


.remove-category:hover:not(:disabled) {
    border-color: #a05252;
    background: #fbf0f0;
}


.remove-category:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


.add-category {
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;

    border: 1px dashed var(--border);
    border-radius: 10px;

    background: transparent;
    color: var(--primary);

    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}


.add-category:hover:not(:disabled) {
    border-color: var(--primary);
    background: #f3f9f4;
}


.add-category:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}


.party-hint,
.party-share {
    display: block;
    margin-top: 6px;

    color: #69786e;
    font-size: 12px;
}


.party-hint.error {
    color: #b3261e;
}


/* ===========================================================
   FARE BREAKDOWN LIST
=========================================================== */

.fare-breakdown {
    margin: -6px 0 15px;
    padding: 11px 14px;

    border: 1px solid #d3dfd6;
    border-radius: 10px;

    background: #f7faf8;

    font-size: 13px;
    line-height: 1.5;
}


.fare-breakdown[hidden] {
    display: none;
}


.fare-breakdown-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}


.fare-breakdown-row.total {
    margin-top: 6px;
    padding-top: 6px;

    border-top: 1px solid #dce5df;

    font-weight: 600;
    color: #315f41;
}


.fare-breakdown-row.muted {
    color: #69786e;
}

#tricycleFareRow {
    grid-template-columns: 1fr;
}

#tricycleFareRow[hidden] {
    display: none;
}

/* FARE MATRIX INFO BUTTON */
.fare-summary-card {
    position: relative;
}


.fare-matrix-info {

    position: absolute;

    top: 8px;
    right: 8px;

    width: 25px;
    height: 25px;

    border: 2px solid #d33;

    border-radius: 50%;

    background: white;

    color: #d33;

    font-size: 16px;

    font-weight: 800;

    line-height: 1;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 0;
}


.fare-matrix-info:hover {

    background: #d33;

    color: white;
}

/* FARE MATRIX POPUP */

.fare-matrix-overlay {

    position: fixed;

    inset: 0;

    z-index: 100000;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        rgba(0, 0, 0, 0.65);
}

.fare-matrix-overlay[hidden] {

    display: none !important;
}


.fare-matrix-popup {

    position: relative;

    width:
        min(92vw, 750px);

    max-height:
        90vh;

    padding: 22px;

    overflow-y: auto;

    background: white;

    border-radius: 20px;

    text-align: center;

    box-shadow:
        0 25px 60px
        rgba(0, 0, 0, 0.30);
}


.fare-matrix-popup h2 {

    margin:
        0
        45px
        18px;

    color:
        var(--primary);
}


.fare-matrix-popup img {

    display: block;

    width: 100%;

    height: auto;

    max-height: 72vh;

    margin: 0 auto;

    object-fit: contain;

    border-radius: 12px;
}


.fare-matrix-close {

    position: absolute;

    top: 10px;
    right: 14px;

    width: 40px;
    height: 40px;

    border: none;

    background: transparent;

    color: #555;

    font-size: 32px;

    font-weight: 700;

    line-height: 1;

    cursor: pointer;
}


.fare-matrix-close:hover {

    color: #d33;
}

/* ===========================================================
   LIVE UPDATE NOTICE (admin saved fares / routes)
=========================================================== */

.live-toast {
    position: fixed;
    left: 50%;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 20px);

    max-width: calc(100vw - 32px);
    padding: 12px 18px;

    border-radius: 12px;
    background: #2d5a3d;
    color: #ffffff;

    font-size: 15px;
    text-align: center;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);

    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;

    z-index: 20000;
    pointer-events: none;
}

.live-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}


/* ===========================================================
   PHONES: use the height you can actually see
   100vh on mobile includes the area behind the browser's address and
   bottom bars, which pushed Logout off-screen and the map's centre
   below the visible area. 100dvh follows the visible height.
=========================================================== */

@supports (height: 100dvh) {
    body {
        height: 100dvh;
        min-height: 100dvh;
    }

    .main {
        height: 100dvh;
    }

    .map-container {
        height: calc(100dvh - 52px);
    }

    .sidebar {
        height: 100dvh;
    }
}

@media (max-width: 700px) {
    @supports (height: 100dvh) {
        .map-container {
            height: calc(100dvh - 50px);
        }
    }
}

/* the menu scrolls if it's ever taller than the screen, so Logout is always reachable */
.sidebar {
    overflow-y: auto;
    padding-bottom: calc(25px + env(safe-area-inset-bottom, 0px));
}

/* ⌖ recentre button, matches the zoom buttons */
.recenter-control a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #2d5a3d;
    font-size: 15px;
    background: #ffffff;
}

.recenter-control a:hover {
    background: #f1f6f2;
}

/* Show / hide jeepney and TODA icons (sits left of the zoom buttons) */
.leaflet-top.leaflet-right .marker-toggle-control {
    clear: none;
    margin-right: 8px;
}

/* the recenter button stays under the zoom buttons */
.leaflet-top.leaflet-right .recenter-control {
    clear: right;
}

.marker-toggle-control {
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.marker-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    background: #ffffff;
    cursor: pointer;
    position: relative;
}

.marker-toggle-btn + .marker-toggle-btn {
    border-top: 1px solid #ccc;
}

.marker-toggle-btn:hover {
    background: #f1f6f2;
}

.marker-toggle-btn:focus-visible {
    outline: 2px solid #2d5a3d;
    outline-offset: -2px;
}

.marker-toggle-btn img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    pointer-events: none;
}

.marker-toggle-btn.is-off img {
    opacity: 0.35;
    filter: grayscale(1);
}

/* slash over a hidden type */
.marker-toggle-btn.is-off::after {
    content: "";
    position: absolute;
    width: 28px;
    height: 2px;
    background: #c0392b;
    transform: rotate(-45deg);
    border-radius: 2px;
}

/* one-finger drag works on the map on phones */
#map {
    touch-action: none;
}

/* Name label shown when hovering a TODA / jeepney icon */
.leaflet-tooltip.map-hover-label {
    padding: 6px 10px;
    border: 0;
    border-radius: 8px;
    background: #2d5a3d;
    color: #ffffff;
    font-size: 13px;
    line-height: 1.35;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

.leaflet-tooltip.map-hover-label small {
    color: #d8eadc;
    font-size: 11.5px;
}

.leaflet-tooltip-top.map-hover-label::before {
    border-top-color: #2d5a3d;
}

/* Short label beside the show / hide icon buttons */
.marker-toggle-btn::before {
    content: attr(data-tip);
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    transform: translateY(-50%);
    padding: 5px 9px;
    border-radius: 6px;
    background: #2d5a3d;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    z-index: 1001;
}

.marker-toggle-btn:hover::before,
.marker-toggle-btn:focus-visible::before,
.marker-toggle-btn.tip-visible::before {
    opacity: 1;
    visibility: visible;
}

/* Phones: the Travel Guide card covers the space left of the zoom
   buttons, so the show / hide buttons go under the zoom buttons */
@media (max-width: 700px) {
    .leaflet-top.leaflet-right .marker-toggle-control {
        clear: right;
        margin-right: 10px;
    }
}

/* same size as the zoom + / - buttons */
.marker-toggle-btn {
    width: 30px;
    height: 30px;
}

.marker-toggle-btn img {
    width: 24px;
    height: 24px;
}

.marker-toggle-btn.is-off::after {
    width: 26px;
}

/* Guests: the Logout button becomes "Log in / Sign up" */
#sidebarLogout.guest-login {
    background: #2d5a3d;
}

#sidebarLogout.guest-login:hover {
    background: #23482f;
}

/* Guests: "Log in / Sign up" popup */
.guest-modal i {
    color: #2d5a3d;
    font-size: 64px;
}

.guest-modal h2 {
    margin: 0 0 8px;
    color: #2d5a3d;
}

.guest-modal p {
    color: #4b5563;
    line-height: 1.45;
}

.guest-modal-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

.guest-modal-btn.primary {
    background: #2d5a3d;
    color: #ffffff;
}

.guest-modal-btn.primary:hover {
    background: #23482f;
}

.guest-modal-btn.secondary {
    background: #e2efe5;
    color: #2d5a3d;
}

.guest-modal-btn.secondary:hover {
    background: #d2e6d7;
}

.guest-modal-close {
    margin-top: 14px;
    background: none;
    border: none;
    color: #6b7280;
    font-size: 15px;
    cursor: pointer;
    text-decoration: underline;
}
