:root {
    --bg: #080808;
    --panel: #111111;
    --panel-soft: #181818;
    --line: #2b2b2b;
    --line-strong: #454545;
    --text: #f4f4f4;
    --muted: #a3a3a3;
    --gold: #d4a63a;
    --gold-soft: #efd17d;
    --green: #7b9f3a;
    --danger: #d66b6b;
    --success: #77ba78;
    --sidebar-width: 278px;
    --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', Arial, sans-serif;
    line-height: 1.55;
}

a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: #fff1bf; }

button, input, select, textarea { font: inherit; }

img { display: block; max-width: 100%; }

.skip-link {
    position: fixed;
    left: 10px;
    top: -60px;
    z-index: 1000;
    padding: 10px 14px;
    background: var(--gold);
    color: #000;
    border-radius: 8px;
}
.skip-link:focus { top: 10px; }

.site-shell {
    width: min(1540px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    background: #0b0b0b;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 20px;
    border-right: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(212,166,58,.09) 0, rgba(212,166,58,0) 245px),
        linear-gradient(0deg, rgba(78,118,109,.08) 0, rgba(78,118,109,0) 310px),
        #0d0d0d;
    display: flex;
    flex-direction: column;
    z-index: 50;
    overflow-y: auto;
}

.agpha-sidebar-brand {
    padding: 2px 4px 0;
}

.agpha-sidebar-logo-link {
    display: block;
    width: 100%;
    color: inherit;
}

.agpha-sidebar-logo {
    width: 142px;
    max-height: 116px;
    margin: 0 auto 16px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0,0,0,.5));
}

.agpha-sidebar-name {
    color: #f2f2f2;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
}

.mission-stack {
    margin-top: 20px;
    border-top: 1px solid var(--line);
}

.mission-stack span {
    display: block;
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
    color: var(--gold);
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    letter-spacing: 2.5px;
}

.weis-sidebar-module {
    margin-top: 24px;
    padding: 15px 14px 13px;
    border: 1px solid rgba(111,157,146,.32);
    border-radius: 15px;
    background:
        linear-gradient(135deg, rgba(111,157,146,.12), rgba(212,166,58,.035)),
        #111;
}

.weis-module-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.weis-module-brand:hover {
    color: #fff;
}

.weis-module-mark {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    border: 1px solid var(--gold);
    border-radius: 13px 4px 13px 4px;
    color: var(--gold);
    background: rgba(0,0,0,.28);
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 800;
    box-shadow: inset 0 0 0 3px rgba(212,166,58,.06);
}

.weis-module-copy {
    min-width: 0;
}

.weis-module-name {
    display: block;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 2.5px;
    line-height: 1.1;
}

.weis-module-subtitle {
    display: block;
    margin-top: 3px;
    color: #a9c8c0;
    font-size: 11px;
    letter-spacing: .6px;
}

.weis-module-label {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(111,157,146,.28);
    color: #83aa9f;
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    text-align: center;
}

.primary-nav {
    margin-top: 22px;
    display: grid;
    gap: 6px;
}

.nav-section-label {
    margin: 0 12px 4px;
    color: #72998f;
    font-family: 'Orbitron', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.8px;
}

.nav-section-label--admin {
    margin-top: 13px;
}

.primary-nav a {
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #d2d2d2;
    font-size: 14px;
    font-weight: 600;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.primary-nav a:hover {
    color: #fff;
    border-color: rgba(111,157,146,.24);
    background: rgba(111,157,146,.075);
}

.primary-nav a.active {
    color: #fff;
    border-color: rgba(111,157,146,.24);
    background: linear-gradient(90deg, rgba(111,157,146,.16), rgba(255,255,255,.025));
    box-shadow: inset 3px 0 0 #7fa99f;
}

.back-to-agpha {
    margin-top: auto;
    padding: 17px 4px 2px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.back-to-agpha:hover {
    color: var(--gold-soft);
}

.page-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mobile-header { display: none; }

.main-content {
    width: 100%;
    max-width: 1220px;
    margin: 0 auto;
    padding: 28px 32px 50px;
    flex: 1;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 32px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.hero {
    position: relative;
    min-height: 310px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        linear-gradient(90deg, rgba(5,5,5,.93) 0%, rgba(5,5,5,.72) 48%, rgba(5,5,5,.22) 100%),
        url('../images/weis-sunset.jpg') center/cover;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
    align-items: center;
}

.hero-copy { padding: 38px 44px; }

.eyebrow {
    color: var(--gold);
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.hero h1,
.page-heading h1 {
    margin: 10px 0 12px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    line-height: 1.08;
}

.hero h1 { font-size: clamp(34px, 5vw, 64px); max-width: 860px; }
.hero p { max-width: 720px; color: #d1d1d1; font-size: 17px; }

.hero-badge {
    justify-self: center;
    width: 190px;
    aspect-ratio: 1;
    border: 1px solid rgba(212,166,58,.55);
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    display: grid;
    place-items: center;
    text-align: center;
    box-shadow: 0 0 0 12px rgba(0,0,0,.2);
}

.hero-badge strong {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 35px;
    letter-spacing: 3px;
    color: var(--gold);
}

.hero-badge span { display: block; max-width: 130px; color: #ddd; font-size: 12px; }

.search-panel {
    margin-top: 20px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
}

.search-form {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) minmax(150px, 1fr) auto;
    gap: 11px;
}

.input,
.select,
.textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: #090909;
    color: var(--text);
    padding: 11px 13px;
    outline: none;
}

.textarea { min-height: 130px; resize: vertical; }

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212,166,58,.13);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: var(--gold);
    color: #070707;
    font-weight: 800;
    cursor: pointer;
}

.button:hover { color: #000; background: #e3b84d; }
.button-secondary { background: #232323; color: #fff; border-color: var(--line-strong); }
.button-secondary:hover { background: #303030; color: #fff; }
.button-danger { background: #6f2525; color: #fff; }
.button-small { min-height: 36px; padding: 7px 11px; font-size: 13px; }

.section-heading {
    margin: 34px 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
}

.section-heading h2 {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
}
.section-heading p { margin: 0; color: var(--muted); }

.wetland-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.wetland-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    transition: transform .18s ease, border-color .18s ease;
}

.wetland-card:hover { transform: translateY(-3px); border-color: #5b5134; }

.card-image {
    height: 180px;
    background: linear-gradient(135deg, #262626, #111);
    overflow: hidden;
}
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder { height: 100%; display: grid; place-items: center; color: #686868; font-family: 'Orbitron', sans-serif; }

.card-body { padding: 18px; }
.card-body h3 { margin: 0 0 6px; font-family: 'Orbitron', sans-serif; font-size: 18px; }
.card-body p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 7px; }

.chip,
.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: #c9c9c9;
    font-size: 11px;
}
.status-published { border-color: #345d36; color: #9bd39d; }
.status-draft { border-color: #735f2b; color: #e5c768; }
.status-archived { color: #9c9c9c; }

.empty-state,
.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 24px;
}
.empty-state { text-align: center; color: var(--muted); }

.page-heading {
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}
.page-heading h1 { font-size: clamp(30px, 4vw, 48px); }
.page-heading p { margin: 5px 0 0; color: var(--muted); }

.detail-hero {
    min-height: 300px;
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    background: var(--panel);
    display: grid;
    grid-template-columns: 1.25fr .75fr;
}
.detail-hero-image { min-height: 300px; background: #181818; }
.detail-hero-image img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero-copy { padding: 34px; display: flex; flex-direction: column; justify-content: center; }
.detail-hero-copy h1 { margin: 7px 0; font-family: 'Orbitron', sans-serif; font-size: clamp(30px, 4vw, 49px); }
.detail-hero-copy p { color: var(--muted); }

.detail-tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 18px 0;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(12,12,12,.94);
    backdrop-filter: blur(8px);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.detail-tabs a { padding: 8px 11px; border-radius: 8px; color: #d2d2d2; font-size: 13px; }
.detail-tabs a:hover { background: var(--panel-soft); color: #fff; }

.detail-section { scroll-margin-top: 85px; margin-top: 18px; }
.detail-section h2 { margin: 0 0 15px; font-family: 'Orbitron', sans-serif; font-size: 23px; color: var(--gold-soft); }

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.info-item { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #0c0c0c; }
.info-item dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.info-item dd { margin: 5px 0 0; color: #eee; font-weight: 600; }

.prose { color: #dedede; }
.prose p:first-child { margin-top: 0; }
.empty-note { color: #777; font-style: italic; }

.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gallery-item { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #111; }
.gallery-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gallery-caption { padding: 9px; color: var(--muted); font-size: 12px; }

#wetland-map,
.map-large {
    width: 100%;
    height: min(72vh, 760px);
    min-height: 460px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.map-note { margin-top: 10px; color: var(--muted); font-size: 13px; }

.alert { margin-bottom: 18px; padding: 12px 15px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel); }
.alert-success { border-color: #315a33; color: #a8d9aa; }
.alert-error { border-color: #6a3030; color: #f0a7a7; }
.alert-info { border-color: #5a512e; color: #e6cd7a; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-field { min-width: 0; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { display: block; margin-bottom: 6px; color: #d5d5d5; font-size: 13px; font-weight: 700; }
.form-help { margin-top: 5px; color: var(--muted); font-size: 12px; }
.form-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 20px; }

.login-wrap { width: min(520px, 100%); margin: 70px auto; }
.login-card { padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); }
.login-card h1 { margin-top: 0; font-family: 'Orbitron', sans-serif; }

.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; }
.admin-header h1 { margin: 0; font-family: 'Orbitron', sans-serif; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.metric-card { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }
.metric-card span { display: block; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; margin-top: 4px; font-family: 'Orbitron', sans-serif; font-size: 28px; color: var(--gold); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th, .data-table td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.data-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; background: #0e0e0e; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td { font-size: 14px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 7px; }

.admin-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 17px; }
.admin-tabs a { padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; color: #ccc; font-size: 13px; }
.admin-tabs a.active, .admin-tabs a:hover { border-color: var(--gold); color: #fff; }

.code-note { padding: 13px; border: 1px dashed var(--line-strong); border-radius: 10px; background: #090909; color: #c5c5c5; font-family: Consolas, monospace; font-size: 13px; }

@media (max-width: 1120px) {
    .wetland-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero { grid-template-columns: 1fr; }
    .hero-badge { display: none; }
}

@media (max-width: 860px) {
    .site-shell { display: block; }
    .sidebar {
        position: fixed;
        inset: 58px auto 0 0;
        width: min(310px, 88vw);
        height: calc(100vh - 58px);
        transform: translateX(-105%);
        transition: transform .2s ease;
        box-shadow: 20px 0 60px rgba(0,0,0,.55);
    }
    .sidebar.is-open { transform: translateX(0); }
    .mobile-header {
        position: sticky;
        top: 0;
        z-index: 60;
        height: 58px;
        padding: 0 16px;
        border-bottom: 1px solid var(--line);
        background: rgba(9,9,9,.96);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .mobile-header a { color: #fff; font-family: 'Orbitron', sans-serif; letter-spacing: 2px; }
    .menu-button { padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: #151515; color: #fff; }
    .main-content { padding: 20px 16px 40px; }
    .site-footer { padding: 18px 16px; flex-direction: column; }
    .detail-hero { grid-template-columns: 1fr; }
    .detail-hero-image { min-height: 230px; }
}

@media (max-width: 620px) {
    .hero { min-height: 360px; }
    .hero-copy { padding: 28px 22px; }
    .hero h1 { font-size: 36px; }
    .search-form { grid-template-columns: 1fr; }
    .wetland-grid, .info-grid, .gallery-grid, .form-grid, .form-grid-3, .metric-grid { grid-template-columns: 1fr; }
    .form-field.full { grid-column: auto; }
    .section-heading, .admin-header { align-items: stretch; flex-direction: column; }
    .detail-hero-copy { padding: 24px; }
    .detail-tabs { overflow-x: auto; flex-wrap: nowrap; }
    #wetland-map, .map-large { min-height: 400px; height: 65vh; }
}
