:root {
    --brand-green-dark: #0f5f3a;
    --brand-green: #2f9e44;
    --brand-lime: #86bf2b;
    --brand-yellow: #f4cd2d;
    --brand-orange: #ea851c;
    --brand-teal: #5bbcae;
    --brand-gray: #52565b;
    --text: #1f2933;
    --muted: #607080;
    --bg: #f4f6ef;
    --card: #ffffff;
    --danger: #b42318;
    --border: #d8ddd0;
    --shadow: 0 12px 30px rgba(15, 95, 58, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Nunito", "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 0% 0%, #f5f9e8 0%, var(--bg) 30%, #eef2eb 100%);
}

h1,
h2,
h3,
h4,
h5 {
    font-family: "Poppins", "Segoe UI", sans-serif;
    letter-spacing: 0.02em;
    margin: 0 0 0.6rem;
    color: var(--brand-green-dark);
}

a {
    color: var(--brand-green-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1280px, 94%);
    margin: 0 auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 0;
    border-radius: 10px;
    padding: 0.62rem 1rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
    text-decoration: none;
}

.btn:focus-visible {
    outline: 3px solid #8ac4ff;
    outline-offset: 2px;
}

.btn-primary {
    background: linear-gradient(140deg, var(--brand-green-dark), var(--brand-green));
    color: #fff;
}

.btn-secondary {
    background: linear-gradient(140deg, var(--brand-yellow), var(--brand-orange));
    color: #2d260a;
}

.btn-neutral {
    background: #eef2eb;
    color: var(--brand-gray);
    border: 1px solid var(--border);
}

.btn-danger {
    background: #d92d20;
    color: #fff;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 0.2rem 0.62rem;
    font-size: 0.74rem;
    font-weight: 700;
}

.badge-admin {
    background: rgba(15, 95, 58, 0.1);
    color: var(--brand-green-dark);
}

.badge-editor {
    background: rgba(244, 205, 45, 0.25);
    color: #725b04;
}

.badge-user {
    background: rgba(91, 188, 174, 0.17);
    color: #226d63;
}

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

.field label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--brand-gray);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 10px;
    padding: 0.6rem 0.72rem;
    font: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--brand-green);
    outline: 2px solid rgba(47, 158, 68, 0.2);
}

.help {
    color: var(--muted);
    font-size: 0.8rem;
}

.flash-wrap {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.flash {
    border-radius: 10px;
    padding: 0.62rem 0.86rem;
    font-weight: 700;
}

.flash.success {
    background: rgba(47, 158, 68, 0.15);
    color: #1f6d2f;
}

.flash.error {
    background: rgba(217, 45, 32, 0.14);
    color: #8b2118;
}

.flash.info {
    background: rgba(91, 188, 174, 0.18);
    color: #1a6f63;
}

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.table-wrap {
    overflow: auto;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

table.data-table th,
table.data-table td {
    border-bottom: 1px solid #e7ebdf;
    padding: 0.72rem;
    text-align: left;
    vertical-align: top;
}

table.data-table th {
    background: #f3f7ef;
    color: #385542;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

table.data-table tr:hover td {
    background: #fbfdf8;
}

.actions {
    display: inline-flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.empty-state {
    padding: 1rem;
    border: 1px dashed var(--border);
    border-radius: 10px;
    color: var(--muted);
    background: #f8fbf2;
}

.site-header {
    background: linear-gradient(90deg, var(--brand-green-dark), #1d8a4a 55%, #72b936);
    color: #fff;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
}

.brand-title {
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.public-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #f1f6e8 100%);
    border-bottom: 1px solid #dbe2d1;
}

.public-hero::before {
    content: "";
    position: absolute;
    top: -160px;
    right: -130px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: conic-gradient(from 30deg, var(--brand-yellow), var(--brand-orange), var(--brand-lime), var(--brand-green), var(--brand-teal));
    opacity: 0.12;
}

.hero-content {
    position: relative;
    display: grid;
    gap: 1rem;
    padding: 1.6rem 0 1.3rem;
}

.hero-content p {
    margin: 0;
    max-width: 920px;
    color: #395049;
}

.public-main {
    padding: 1.4rem 0 2rem;
}

.filter-panel {
    padding: 1rem;
    margin-bottom: 1rem;
}

.filter-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.filter-grid-small {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-panel {
    padding: 0.8rem;
}

.selection-panel {
    padding: 0.8rem 1rem;
    margin-bottom: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.drill-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1rem;
}

.drill-card {
    padding: 0.8rem;
}

.drill-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.drill-head h3 {
    margin: 0;
}

.drill-head small {
    color: #5b6d5f;
    font-weight: 700;
}

.table-scroll {
    max-height: 390px;
    overflow: auto;
    border: 1px solid #e1e7d7;
    border-radius: 10px;
}

table.interactive-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 320px;
}

table.interactive-table th,
table.interactive-table td {
    border-bottom: 1px solid #e5ebdd;
    padding: 0.64rem;
    text-align: left;
    vertical-align: top;
}

table.interactive-table th {
    background: #f3f7ef;
    color: #385542;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

table.interactive-table tbody tr {
    cursor: pointer;
}

table.interactive-table tbody tr:hover td {
    background: #f8fcf4;
}

table.interactive-table tbody tr.selected td {
    background: #e6f3db;
    color: #214a34;
}

.cell-muted {
    color: #667785;
}

.skills-panel {
    padding: 0.8rem;
}

.advanced-search-panel {
    margin-top: 1rem;
}

.advanced-search-panel h3 {
    margin-bottom: 0.35rem;
}

.action-link {
    font-weight: 800;
    border: 0;
    background: none;
    color: var(--brand-green-dark);
    cursor: pointer;
    padding: 0;
}

.action-link:hover {
    text-decoration: underline;
}

.summary-strip {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.metric-chip {
    border-radius: 999px;
    padding: 0.32rem 0.72rem;
    background: #edf4df;
    color: #375038;
    font-weight: 700;
    font-size: 0.82rem;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(7, 27, 20, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    overflow-y: auto;
}

.modal.show {
    display: flex;
}

.modal-mask {
    position: absolute;
    inset: 0;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    z-index: 1;
}

.modal-card {
    position: relative;
    z-index: 2;
    width: min(860px, 100%);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(8, 35, 24, 0.35);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #e2e9d7;
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f6faef 100%);
}

.modal-body {
    padding: 1rem 1.1rem 1.2rem;
}

.detail-grid {
    display: grid;
    gap: 0.9rem;
}

.detail-item h4 {
    margin-bottom: 0.2rem;
    font-size: 0.92rem;
    color: #2b5f3f;
}

.detail-item .content {
    border: 1px solid #e6ecd8;
    border-radius: 10px;
    padding: 0.8rem;
    background: #fbfdf8;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 264px 1fr;
}

.admin-sidebar {
    background: linear-gradient(180deg, #0f5f3a 0%, #187043 65%, #2c8e45 100%);
    color: #ecfff0;
    padding: 1rem 0.8rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.admin-brand {
    margin-bottom: 1.1rem;
}

.admin-brand h2 {
    color: #fff;
    margin: 0;
    font-size: 1.2rem;
}

.admin-brand small {
    opacity: 0.88;
}

.admin-nav {
    display: grid;
    gap: 0.3rem;
}

.admin-nav a {
    color: #effbee;
    padding: 0.56rem 0.72rem;
    border-radius: 10px;
    font-weight: 700;
    transition: background-color 0.18s ease;
}

.admin-nav a.active,
.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
}

.admin-sidebar-footer {
    margin-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 0.8rem;
    font-size: 0.86rem;
}

.admin-content {
    padding: 1rem 1.2rem 1.6rem;
}

.admin-topbar {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}

.admin-title {
    margin: 0;
}

.top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card {
    background: #fff;
    border: 1px solid #dce3cf;
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.stats-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    border: 1px solid #e2e9d4;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fcee 100%);
    padding: 0.9rem;
}

.stat-card strong {
    font-size: 1.6rem;
    color: var(--brand-green-dark);
}

.form-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
    grid-column: 1 / -1;
}

.form-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bulk-table input,
.bulk-table select,
.bulk-table textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.45rem 0.5rem;
    font: inherit;
    background: #fff;
}

.bulk-table textarea {
    min-width: 220px;
    resize: vertical;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: radial-gradient(circle at 20% 15%, #ecf8da 0%, #edf4f0 45%, #e2ece8 100%);
}

.login-card {
    width: min(520px, 100%);
    background: #fff;
    border: 1px solid #dae3d0;
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 1.2rem;
}

.login-head {
    margin-bottom: 1rem;
}

.login-head p {
    margin: 0;
    color: #5b6c77;
}

.quick-filters {
    margin-bottom: 0.8rem;
}

@media (max-width: 1180px) {
    .filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .filter-grid-small {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .drill-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .drill-grid {
        grid-template-columns: 1fr;
    }

    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        height: auto;
        position: static;
    }

    .admin-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 720px) {
    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-grid-small {
        grid-template-columns: 1fr;
    }

    .admin-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }

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

    .admin-content {
        padding: 0.8rem;
    }
}
