@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* WHEATBIOME brand colors (extracted from https://www.wheatbiome-project.eu/) */
    --dss-brand: #f79321;
    --dss-brand-strong: #d47a0e;
    --dss-brand-mid: #e8850f;
    --dss-accent: #483217;
    --dss-muted: #6b6358;
    --dss-surface: #faf6f1;
    --dss-brand-gradient: linear-gradient(135deg, #d47a0e 0%, #f79321 100%);
    --dss-accent-gradient: linear-gradient(135deg, #2e1f0e 0%, #483217 100%);
}

body {
    font-family: 'Inter', 'Manrope', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dss-surface);
    color: #0f172a;
    min-height: 100vh;
    word-break: normal;
    overflow-wrap: normal;
}

.card,
.alert {
    overflow-wrap: break-word;
    word-break: break-word;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    line-height: 1.35;
    flex-wrap: nowrap;
    min-width: 0;
}

.btn .icon {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
}

.btn .btn-label {
    display: inline-flex;
    white-space: normal;
    text-align: center;
}

.btn-primary,
.btn-primary:focus {
    background-image: var(--dss-brand-gradient);
    border: none;
    color: #fff;
    box-shadow: 0 10px 30px rgba(247, 147, 33, 0.25);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-outline-primary {
    color: var(--dss-brand-strong);
    border: 1px solid rgba(247, 147, 33, 0.5);
}

.btn-outline-primary:hover {
    color: #fff;
    background-image: var(--dss-brand-gradient);
    border-color: transparent;
}

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

.page-wrapper {
    flex: 1 1 auto;
    padding: 1.5rem;
}

.card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 1rem;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.auth-card {
    background: rgba(236, 212, 165, 0.87);
    border: 1px solid rgba(236, 212, 165, 0.5) !important;
    box-shadow: 0 24px 70px rgba(72, 50, 23, 0.14) !important;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 260px;
    background: var(--dss-accent-gradient);
    color: #fff;
    padding: 1.5rem;
    border-right: none;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 15px 0 40px rgba(212, 122, 14, 0.35);
}

.text-muted-50 {
    color: rgba(255, 255, 255, 0.5);
}

.app-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.app-sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: background 120ms ease, color 120ms ease;
}

.app-sidebar__link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.app-sidebar__link.is-active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.app-sidebar__link .icon {
    width: 18px;
    height: 18px;
}

.app-main {
    flex: 1;
    background: var(--dss-surface);
    padding: 2rem;
    overflow-y: auto;
}

.app-main.app-main--map {
    padding: 0;
}

.map-viewport {
    position: relative;
    min-height: 100vh;
    z-index: 1;
}

.map-panel-stack--left {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1010;
}

.map-panel {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px);
    color: #0f172a;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: none;
    width: min(320px, calc(100% - 2.5rem));
    max-width: calc(100% - 2.5rem);
    z-index: 1010;
}

@media (max-width: 767.98px) {
    .map-panel {
        position: static;
        width: 100%;
        margin-bottom: 1rem;
    }
}

.map-panel__eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: rgba(15, 23, 42, 0.6);
    margin: 0 0 0.25rem 0;
}

.map-panel__subtitle {
    font-size: 0.84rem;
    color: rgba(15, 23, 42, 0.65);
    margin: 0;
    line-height: 1.35;
}

.auth-logo {
    height: 60px;
    width: auto;
    max-width: 100%;
    filter: drop-shadow(0 14px 30px rgba(139, 90, 31, 0.4));
}

.auth-logo--full {
    display: block;
    margin: 0 auto;
}

.map-panel--fields {
    position: relative;
    width: 250px;
    max-width: 320px;
}

.map-panel--photo,
.map-panel.map-panel--photo {
    top: 5.6rem;
    left: 1.5rem;
    width: 300px;
    max-width: calc(100% - 2.5rem);
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.map-panel--actions {
    position: relative;
    width: 250px;
    max-width: 300px;
}

.map-panel--results {
    top: 7.5rem;
    right: 1.5rem;
    width: 280px;
    max-width: calc(100% - 2.5rem);
}

.map-panel--modes {
    top: 1.5rem;
    right: 1.5rem;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    padding: 0.5rem;
    width: auto;
    max-width: none;
    display: flex;
    flex-direction: row;
}

.map-panel--modes .map-mode-group {
    display: flex;
    flex-direction: row;
    gap: 0.4rem;
}

.map-layer-option {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 0.5rem;
    color: #0f172a;
    padding: 0.3rem 0.6rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    flex: 0 1 auto;
    font-size: 0.78rem;
    transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.map-layer-option.is-active {
    border-color: var(--dss-brand);
    background: rgba(247, 147, 33, 0.12);
    color: var(--dss-brand-strong);
}

.map-panel--empty {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.map-popup {
    min-width: 180px;
}

.map-popup__result {
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(15, 23, 42, 0.12);
}

.map-popup__result ul {
    margin: 0.35rem 0 0;
}

.map-popup__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.map-panel--zoom {
    right: 1.5rem;
    bottom: 1.5rem;
    width: auto;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
}

.map-zoom-btn {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.2);
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.map-zoom-btn:hover {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
    padding-inline: 1.1rem;
    white-space: nowrap;
}

.btn-icon .icon {
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    margin-right: 0.45rem;
}

.btn-icon .btn-label {
    display: inline-block;
    flex: 0 1 auto;
}

.card-table {
    padding: 0;
}

.card-table .card-header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    margin-bottom: 0;
}

.card-body--flush {
    padding: 0;
}

.card-table .table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.card-table .table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(15, 23, 42, 0.55);
    background-color: rgba(241, 245, 249, 0.6);
    border-color: rgba(15, 23, 42, 0.05);
}

.card-table .table tbody td {
    vertical-align: middle;
    border-color: rgba(15, 23, 42, 0.04);
}

.card-table__empty {
    padding: 2rem;
    text-align: center;
}

@media (max-width: 991.98px) {
    .app-shell {
        position: relative;
    }

    .app-sidebar {
        position: fixed;
        z-index: 999;
        height: 100vh;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 200ms ease;
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(139, 90, 31, 0.45);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 150ms ease;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        visibility: visible;
    }

    .app-main {
        padding: 1.25rem;
    }
}

.app-topbar__logo {
    width: min(100%, 210px);
    height: auto;
    display: block;
}

.logo-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.35rem;
    border-radius: 1rem;
    background: rgba(236, 212, 165, 0.87);
    border: 1px solid rgba(236, 212, 165, 0.37);
    box-shadow: 0 25px 55px rgba(212, 122, 14, 0.45);
    backdrop-filter: blur(10px);
}
