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

:root {
    /* GREEN brand colors */
    --dss-brand: #009b4b;
    --dss-brand-strong: #0a5f2c;
    --dss-brand-mid: #11783a;
    --dss-accent: #3aa570;
    --dss-muted: #5fdc64;
    --dss-surface: #d2ffdc;
    --dss-brand-gradient: linear-gradient(135deg, #11783a 0%, #009b4b 100%);
    --dss-accent-gradient: linear-gradient(135deg, #0a5f2c 0%, #3aa570 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(0, 155, 75, 0.25);
}

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

.btn-outline-primary {
    color: var(--dss-brand-strong);
    border: 1px solid rgba(0, 155, 75, 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);
}

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

.app-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0a5f2c 0%, #11783a 45%, #009b4b 100%);
    color: #fff;
    padding: 1.5rem;
    border-right: none;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 15px 0 40px rgba(0, 155, 75, 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;
    filter: drop-shadow(0 14px 30px rgba(0, 155, 75, 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: #009b4b;
    background: rgba(0, 155, 75, 0.08);
    color: #0a5f2c;
}

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

.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(0, 155, 75, 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 {
    max-width: 100%;
    height: auto;
    display: block;
}

.logo-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    border-radius: 1rem;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.98), rgba(210, 255, 220, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 25px 55px rgba(0, 155, 75, 0.45);
    backdrop-filter: blur(10px);
}

/* ============================================================
   Messages Banner (inline flash at top of main content)
   ============================================================ */

.messages-banner {
    position: relative;
    z-index: 100;
    margin: 0 0 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.messages-banner__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.925rem;
    line-height: 1.5;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    animation: messagesBannerSlideIn 0.3s ease-out;
}

.messages-banner__item .messages-banner__icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.1rem;
    opacity: 0.85;
}

.messages-banner__content {
    flex: 1;
    min-width: 0;
}

.messages-banner__close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 0;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.35rem;
    transition: opacity 120ms ease, background 120ms ease;
}

.messages-banner__close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

/* Tag variants */
.messages-banner__item--info {
    background: linear-gradient(135deg, #009b4b 0%, #3aa570 100%);
    color: #fff;
}

.messages-banner__item--success {
    background: linear-gradient(135deg, #009b4b 0%, #2ecc71 100%);
    color: #fff;
}

.messages-banner__item--warning {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
    color: #1a1a1a;
}

.messages-banner__item--error,
.messages-banner__item--danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
}

.messages-banner__item--info .messages-banner__close,
.messages-banner__item--success .messages-banner__close {
    color: #fff;
}

.messages-banner__item--warning .messages-banner__close {
    color: #1a1a1a;
}

@keyframes messagesBannerSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991.98px) {
    .messages-banner__item {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

.profile-wide-container {
    max-width: 1800px;
}

.logout-form-wrapper {
    display: contents;
}
