﻿:root {
    --bg: #f3f6f4;
    --surface: #ffffff;
    --primary: #0057a8;
    --primary-dark: #17324d;
    --green: #009246;
    --red: #ce2b37;
    --accent: #e6b422;
    --text: #1d2733;
    --muted: #62707d;
    --ok: #1f7a3a;
    --err: #a81b26;
    --border: #dce4dd;
    --soft: #f8faf8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(180deg, #fbfcfb 0%, var(--bg) 100%);
    color: var(--text);
}

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

.site-header {
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 22px rgba(29, 39, 51, 0.06);
}

.nav-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0;
    gap: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: var(--primary-dark);
}

.brand-logo {
    width: 102px;
    height: auto;
    display: block;
    background: transparent;
    border: 0;
    border-radius: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

.brand-text {
    display: grid;
    line-height: 1.1;
}

.brand-text strong {
    font-size: 1.05rem;
    letter-spacing: 0.2px;
}

.brand-text small {
    font-size: 0.8rem;
    color: var(--muted);
}

nav {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

nav a {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
    padding: 0.48rem 0.7rem;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

nav a:hover {
    background: #edf5ef;
    color: var(--green);
}

.main-content {
    padding: 1.3rem 0 2rem;
}

.hero {
    background:
        linear-gradient(130deg, rgba(23, 50, 77, 0.97) 0%, rgba(0, 87, 168, 0.9) 58%, rgba(0, 146, 70, 0.78) 100%);
    color: #fff;
    border-radius: 8px;
    padding: 1.4rem;
    margin-bottom: 1rem;
    box-shadow: 0 10px 30px rgba(0, 54, 105, 0.2);
}

.admin-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    background: #17324d;
    color: #fff;
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    border-left: 6px solid var(--green);
    box-shadow: 0 12px 26px rgba(23, 50, 77, 0.18);
}

.admin-hero h1 {
    margin-bottom: 0.35rem;
}

.admin-hero p:last-child {
    margin-bottom: 0;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.hero-tag {
    margin: 0 0 0.3rem;
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
}

.hero h1 {
    margin-bottom: 0.4rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.8rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0.55rem 0.85rem;
    border-radius: 7px;
    font-weight: 700;
}

.btn-mini {
    padding: 0.34rem 0.55rem;
    border-radius: 7px;
    font-size: 0.84rem;
}

.btn-light {
    background: #fff;
    color: var(--primary-dark);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.btn-outline {
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #fff;
}

.btn-outline-dark {
    border: 1px solid #9db3c9;
    color: var(--primary-dark);
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 8px 20px rgba(29, 39, 51, 0.045);
}

.ai-card {
    border-left: 6px solid var(--green);
    background: #fbfdfb;
}

.ai-meta {
    color: var(--muted);
    margin-bottom: 0;
}

.narrow {
    max-width: 500px;
    margin: 1rem auto;
}

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

.login-grid {
    align-items: start;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-grid .card:first-child {
    grid-column: 1 / -1;
}

.admin-workbench {
    display: grid;
    grid-template-columns: minmax(280px, 1.2fr) minmax(240px, 0.9fr) minmax(180px, 0.7fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-layout {
    grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.35fr);
    align-items: start;
}

.two-cols {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.four-cols {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.list-item {
    border-bottom: 1px dashed var(--border);
    padding: 0.6rem 0;
}

.list-item:last-child {
    border-bottom: 0;
}

.news-thumb {
    width: 100%;
    max-height: 170px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.55rem;
    border: 1px solid var(--border);
}

.news-cover {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.cover-preview {
    display: grid;
    gap: 0.55rem;
}

.cover-preview img {
    width: 100%;
    max-height: 210px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
}

.compact-row,
.attachment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px dashed var(--border);
}

.compact-row:last-child,
.attachment-row:last-child {
    border-bottom: 0;
}

.compact-row div,
.attachment-row a {
    display: grid;
    gap: 0.15rem;
}

.compact-row small,
.attachment-row small,
.field-help {
    color: var(--muted);
    font-size: 0.84rem;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    text-align: left;
    padding: 0.58rem 0.48rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.94rem;
}

th {
    color: var(--primary-dark);
    background: var(--soft);
    font-size: 0.82rem;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin-top: 0;
}

ul {
    margin: 0;
    padding-left: 1rem;
}

form {
    display: grid;
    gap: 0.7rem;
}

label {
    display: grid;
    gap: 0.3rem;
    font-weight: 600;
}

input,
select,
textarea,
button {
    padding: 0.56rem 0.63rem;
    border-radius: 7px;
    border: 1px solid #b9c9da;
    font: inherit;
}

textarea {
    resize: vertical;
    min-height: 110px;
}

button {
    background: var(--accent);
    border: 0;
    color: #2a2205;
    font-weight: 800;
    cursor: pointer;
}

button:hover {
    filter: brightness(0.98);
}

.btn-danger {
    background: var(--red);
    color: #fff;
    border: 0;
}

.month-filter {
    display: flex;
    align-items: end;
    gap: 0.6rem;
}

.dashboard-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
}

.stats .big,
.stats-home .big {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--primary);
}

.stats-home .small {
    font-size: 1.05rem;
}

.stat-card {
    border-top: 4px solid var(--primary);
}

.stat-card h2 {
    font-size: 0.96rem;
    margin-bottom: 0.35rem;
}

.stat-card small {
    color: var(--muted);
}

.alert {
    padding: 0.6rem;
    border-radius: 8px;
    margin: 0.5rem 0;
    font-weight: 700;
}

.success {
    background: #e8f7ed;
    color: var(--ok);
}

.error {
    background: #ffecef;
    color: var(--err);
}

.info {
    background: #eaf2ff;
    color: #1b4f9c;
}

.site-footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
    background: #fff;
}

.site-footer .container {
    padding: 0.8rem 0;
}

.event-link {
    color: var(--primary-dark);
    text-decoration: none;
}

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

.program-text {
    white-space: normal;
    line-height: 1.5;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.section-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

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

.section-subtitle {
    color: var(--muted);
    margin-top: 0;
}

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

.admin-toolbar h1 {
    margin-bottom: 0;
}

.news-detail {
    max-width: 850px;
    margin: 0 auto 1rem;
}

.attachments-list {
    display: grid;
    gap: 0.6rem;
}

.attachment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--primary-dark);
    text-decoration: none;
    background: #f8fbff;
}

.attachment-card:hover {
    border-color: #9db3c9;
}

.portal-health {
    display: grid;
    grid-template-columns: repeat(2, minmax(90px, 1fr));
    gap: 0.6rem;
}

.portal-health div {
    display: grid;
    gap: 0.18rem;
    padding: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--soft);
}

.portal-health span {
    color: var(--muted);
    font-size: 0.84rem;
}

.portal-health strong {
    color: var(--primary-dark);
    font-size: 1.25rem;
}

.score-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 0.26rem 0.5rem;
    border-radius: 999px;
    background: #edf5ef;
    color: var(--green);
    font-weight: 800;
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0.7rem 0;
}

.filters-form input,
.filters-form select {
    min-width: 150px;
}

.inline-filter {
    display: inline-flex;
}

.request-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 0.75rem;
    background: var(--soft);
}

.request-card:last-child {
    margin-bottom: 0;
}

.request-actions {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(110px, 0.7fr) auto;
    align-items: end;
    gap: 0.55rem;
    margin-top: 0.6rem;
}

.bar-list {
    display: grid;
    gap: 0.65rem;
}

.bar-row {
    display: grid;
    grid-template-columns: minmax(130px, 0.8fr) minmax(120px, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
}

.bar-row span {
    color: var(--muted);
}

.bar-track {
    height: 10px;
    background: #e9eee9;
    border-radius: 999px;
    overflow: hidden;
}

.bar-track div {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--primary));
    border-radius: inherit;
}

.confirm-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(23, 50, 77, 0.48);
    z-index: 40;
}

.confirm-modal[hidden] {
    display: none;
}

.confirm-dialog {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--border);
    padding: 1rem;
    box-shadow: 0 20px 60px rgba(23, 50, 77, 0.28);
}

.status-approved {
    background: #e8f7ed;
    color: #1f7a3a;
}

.status-rejected {
    background: #ffecef;
    color: #a81b26;
}

.actions-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
}

.top-gap {
    margin-top: 0.6rem;
}

.status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-in_elaboration {
    background: #eef2f8;
    color: #40566f;
}

.status-pending_validation {
    background: #fff6db;
    color: #7a5a00;
}

.status-published {
    background: #e8f7ed;
    color: #1f7a3a;
}

@media (max-width: 760px) {
    .nav-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .brand {
        justify-content: center;
    }

    nav {
        justify-content: center;
        flex-wrap: wrap;
    }

    .dashboard-head {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-hero,
    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-actions {
        justify-content: stretch;
    }

    .admin-actions .btn {
        flex: 1;
    }

    .admin-grid,
    .admin-workbench,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-grid .card:first-child {
        grid-column: auto;
    }

    .compact-row,
    .attachment-row,
    .attachment-card,
    .request-actions,
    .bar-row {
        align-items: flex-start;
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .filters-form {
        align-items: stretch;
    }

    .filters-form input,
    .filters-form select,
    .filters-form button,
    .filters-form .btn {
        width: 100%;
    }

    .month-filter {
        flex-direction: column;
        align-items: stretch;
    }
}
