* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background: #f4f5f1;
    color: #2f342d;
}

button,
input {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}


/* =========================
   PAGE
========================= */

.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* =========================
   HEADER
========================= */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #dfe3da;
}

.header-inner {
    max-width: 1500px;
    margin: 0 auto;
    padding: 26px 30px;
}

.site-header h1 {
    margin: 0;
    color: #26351f;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}


/* =========================
   MAIN
========================= */

.app-layout {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 24px 30px 50px;

    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 24px;

    flex: 1;
}


/* =========================
   SIDEBAR
========================= */

.sidebar {
    background: #ffffff;
    border: 1px solid #dfe3da;
    border-radius: 10px;

    overflow: hidden;

    height: fit-content;
    max-height: calc(100vh - 150px);

    position: sticky;
    top: 20px;

    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.sidebar-top {
    display: flex;
    align-items: stretch;

    background: #eeeeeb;
    border-bottom: 1px solid #d6d9d2;
}

.sidebar-tabs {
    display: flex;
    flex: 1;
}

.sidebar-tab {
    flex: 1;

    border: 0;
    background: transparent;

    padding: 15px 12px;

    cursor: pointer;

    color: #596054;

    font-size: 14px;
    font-weight: 700;

    transition: all .2s ease;
}

.sidebar-tab:hover {
    background: #e5e7e1;
}

.sidebar-tab.active {
    background: #3f5135;
    color: #ffffff;
}


.search-button {
    width: 52px;

    border: 0;
    border-left: 1px solid #d6d9d2;

    background: #e7e8e4;

    cursor: pointer;

    font-size: 17px;

    transition: background .2s ease;
}

.search-button:hover {
    background: #dfe2dc;
}


/* =========================
   SEARCH
========================= */

.search-box {
    display: none;

    padding: 12px;

    background: #f8f9f6;
    border-bottom: 1px solid #e0e2dd;
}

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

.search-box input {
    width: 100%;

    padding: 10px 12px;

    border: 1px solid #ccd2c8;
    border-radius: 6px;

    outline: none;

    background: #ffffff;
}

.search-box input:focus {
    border-color: #7a9a60;
    box-shadow: 0 0 0 2px rgba(122,154,96,.12);
}


/* =========================
   SIDEBAR PANELS
========================= */

.sidebar-panel {
    display: none;
}

.sidebar-panel.active {
    display: block;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 14px 16px;

    background: #dfe2dc;

    color: #293527;

    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .5px;

    border-bottom: 1px solid #cdd1c8;
}

.panel-heading strong {
    font-size: 13px;
}

#locationCount {
    background: #66755d;
    color: white;

    border-radius: 20px;

    padding: 3px 8px;

    font-size: 11px;
}


/* =========================
   LOCATION LIST
========================= */

.location-list {
    overflow-y: auto;

    max-height: calc(100vh - 255px);
}

.location-card {
    width: 100%;

    display: flex;
    flex-direction: column;

    text-align: left;

    border: 0;
    border-bottom: 1px solid #eceeea;

    background: #ffffff;

    padding: 13px 16px;

    cursor: pointer;

    transition:
        background .15s ease,
        border-left .15s ease;
}

.location-card:hover {
    background: #f4f7f1;
}

.location-card.active {
    background: #edf3e9;
    border-left: 4px solid #6f8f59;
    padding-left: 12px;
}

.location-card-name {
    font-size: 15px;
    font-weight: 700;

    color: #30372e;
}

.location-card-meta {
    margin-top: 3px;

    font-size: 12px;

    color: #777d75;
}


/* =========================
   CALENDAR
========================= */

.calendar-list {
    overflow-y: auto;

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

    padding: 8px;
}

.calendar-card {
    display: flex;
    flex-direction: column;

    width: 100%;

    border: 1px solid #dfe5d8;
    border-left: 4px solid #7a9a60;

    border-radius: 6px;

    background: #ffffff;

    padding: 13px;

    margin-bottom: 8px;

    text-align: left;

    cursor: pointer;

    transition: all .2s ease;
}

.calendar-card:hover {
    background: #f4f8ef;
    border-color: #aebe9f;
    transform: translateY(-1px);
}

.calendar-card.today {
    background: #edf5e6;
    border-left-color: #3f5932;
}

.calendar-date {
    color: #4f683f;

    font-size: 12px;
    font-weight: 700;

    margin-bottom: 5px;
}

.calendar-card span:not(.calendar-date) {
    font-size: 14px;
    font-weight: 700;

    color: #333a31;
}

.calendar-card small {
    margin-top: 3px;

    color: #777d75;
}


/* =========================
   MAIN CONTENT
========================= */

.main-content {
    min-width: 0;
}


/* =========================
   EMPTY STATE
========================= */

.empty-state {
    min-height: 600px;

    display: flex;
    flex-direction: column;

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

    text-align: center;

    background: #ffffff;

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

    color: #70766d;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state h2 {
    margin: 0 0 8px;

    color: #35422f;
}

.empty-state p {
    max-width: 420px;

    line-height: 1.6;

    margin: 0;
}


/* =========================
   LOCATION DETAILS
========================= */

.location-details {
    display: none;

    background: #ffffff;

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

    overflow: hidden;

    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    padding: 25px 28px;

    background: #f7f8f5;

    border-bottom: 1px solid #dfe3da;
}

.details-kommun {
    color: #7a8175;

    font-size: 13px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: .7px;

    margin-bottom: 5px;
}

.details-header h2 {
    margin: 0;

    color: #293626;

    font-size: 28px;
}

.close-details {
    width: 34px;
    height: 34px;

    border: 0;
    border-radius: 50%;

    background: #e5e8e1;

    color: #515950;

    font-size: 23px;
    line-height: 1;

    cursor: pointer;
}

.close-details:hover {
    background: #d9ddd5;
}


/* =========================
   INFORMATION + MAP
========================= */

.details-grid {
    display: grid;

    grid-template-columns: minmax(280px, .9fr) minmax(400px, 1.1fr);

    gap: 0;
}

.details-information {
    padding: 28px;

    border-right: 1px solid #e1e4df;
}

.information-section {
    margin-bottom: 26px;
}

.information-section h3 {
    margin: 0 0 9px;

    color: #34442d;

    font-size: 16px;
}

.information-section p {
    margin: 0;

    color: #555c53;

    font-size: 14px;

    line-height: 1.65;
}

.date-box {
    display: inline-block;

    padding: 10px 13px;

    background: #e3ebd9;

    border-radius: 5px;

    color: #405532;

    font-size: 13px;
    font-weight: 600;
}


/* =========================
   BUTTONS
========================= */

.action-buttons {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.route-button,
.secondary-button {
    width: 100%;

    padding: 11px 14px;

    border-radius: 5px;

    text-align: left;

    cursor: pointer;

    font-weight: 600;

    transition: all .2s ease;
}

.route-button {
    border: 1px solid #6c8957;

    background: #718f5d;

    color: #ffffff;
}

.route-button:hover {
    background: #5f7d4d;
}

.secondary-button {
    border: 1px solid #d6dbd3;

    background: #f7f8f6;

    color: #50574e;
}

.secondary-button:hover {
    background: #edf0eb;
}

.route-status {
    margin-top: 12px;

    font-size: 13px;

    color: #687064;

    line-height: 1.5;
}


/* =========================
   MAP
========================= */

.map-column {
    min-width: 0;

    background: #eef1ec;
}

.map-title {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 12px 16px;

    background: #e8ebe5;

    border-bottom: 1px solid #d9ddd6;

    color: #3c4937;

    font-size: 13px;
    font-weight: 700;
}

.map-title small {
    color: #7a8178;

    font-size: 10px;
    font-weight: 400;
}

#locationMap {
    width: 100%;
    height: 540px;
}


/* =========================
   FOOTER
========================= */

.site-footer {
    margin-top: auto;

    background: #111511;

    color: #d8dcd6;
}

.footer-inner {
    max-width: 1500px;
    margin: 0 auto;

    padding: 25px 30px;

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

    gap: 20px;

    font-size: 13px;
}

.site-footer a {
    color: #ffffff;

    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}


/* =========================
   LEAFLET
========================= */

.leaflet-container {
    font-family: inherit;
}

.leaflet-popup-content a {
    color: #63834f;
    font-weight: 700;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 900px) {

    .app-layout {
        grid-template-columns: 1fr;

        padding: 15px;
    }

    .sidebar {
        position: relative;
        top: auto;

        max-height: none;
    }

    .location-list,
    .calendar-list {
        max-height: 350px;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .details-information {
        border-right: 0;
        border-bottom: 1px solid #e1e4df;
    }

    #locationMap {
        height: 400px;
    }
}


@media (max-width: 600px) {

    .header-inner {
        padding: 20px;
    }

    .site-header h1 {
        font-size: 23px;
    }

    .app-layout {
        padding: 10px;
    }

    .details-header {
        padding: 20px;
    }

    .details-header h2 {
        font-size: 23px;
    }

    .details-information {
        padding: 20px;
    }

    .footer-inner {
        padding: 20px;

        flex-direction: column;
        align-items: flex-start;
    }

    #locationMap {
        height: 350px;
    }
}