* {
    box-sizing: border-box;
}

:root {
    --bg: #f2f6f9;
    --panel: #ffffff;
    --text: #1f2933;
    --muted: #5b6b7a;
    --line: #d8e0e8;
    --brand: #2667ff;
    --brand-strong: #1749bf;
    --ok: #1f9d55;
    --error: #c53030;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background: linear-gradient(165deg, #eef4fb 0%, #f7fafc 45%, #e9f1f7 100%);
}

/* ── Modern nav ── */
/* ── Site nav ── */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #1a3a5c;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.site-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.2rem;
    height: 60px;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.site-brand:hover {
    opacity: 0.95;
}

.site-brand-logo {
    height: 54px;
    max-height: 56px;
    width: auto;
    display: block;
}

.site-brand-text {
    line-height: 1;
}

/* Desktop: show links, hide toggle */
.site-nav-toggle {
    display: none;
}

.site-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s;
}

.site-nav-links a:hover {
    background: rgba(255,255,255,0.18);
}

.site-nav-links a.active {
    background: rgba(255,255,255,0.25);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
}

/* Tablet: hide text labels, keep icons */
@media (max-width: 820px) {
    .site-nav-links a .nav-label { display: none; }
    .site-nav-links a { padding: 8px 10px; }
}

/* Mobile: show toggle, hide links until open */
@media (max-width: 600px) {
    .site-brand-logo {
        height: 46px;
        max-height: 48px;
    }

    .site-brand-text {
        font-size: 1.05rem;
    }

    .site-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255,255,255,0.15);
        border: 1px solid rgba(255,255,255,0.3);
        color: #fff;
        font-size: 1.3rem;
        width: 42px;
        height: 42px;
        border-radius: 8px;
        cursor: pointer;
        flex-shrink: 0;
    }

    .site-nav-toggle:hover {
        background: rgba(255,255,255,0.25);
    }

    .site-nav-links {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        z-index: 999;
        background: #1a3a5c;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px;
        border-top: 1px solid rgba(255,255,255,0.2);
        box-shadow: 0 6px 20px rgba(0,0,0,0.5);
    }

    .site-nav-links.open {
        display: flex;
    }

    .site-nav-links a {
        padding: 14px 16px;
        border-radius: 8px;
        font-size: 1rem;
        color: #ffffff;
    }

    .site-nav-links a .nav-label {
        display: inline;
    }
}
/* ── End site nav ── */

.container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 0.8rem 2rem;
    display: grid;
    gap: 1rem;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.9rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.card h2 {
    margin-top: 0;
    font-size: 1.05rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.8rem;
}

.metric-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.metric-value {
    margin: 0.2rem 0 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.7rem;
    align-items: end;
}

label {
    display: grid;
    gap: 0.25rem;
    font-size: 0.9rem;
    color: var(--muted);
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    background: #ffffff;
}

textarea {
    resize: vertical;
    min-height: 110px;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.6rem;
}

.btn {
    border: none;
    background: var(--brand);
    color: #ffffff;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--brand-strong);
}

.btn-secondary {
    background: #6b7c8e;
}

.btn-secondary:hover {
    background: #556474;
}

.btn-danger {
    background: #c53030;
}

.btn-danger:hover {
    background: #9f2525;
}

.row-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.row-actions form {
    margin: 0;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.home-banner {
 /*   width: 100%; */
    overflow: hidden;
    line-height: 0;
}

.home-banner-image {
 /*   width: 100%;
    height: clamp(180px, 22vw, 320px);*/
    height: 400px;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.home-hero-copy {
    max-width: 920px;
}

.home-hero-copy h1 {
    margin: 0 0 0.8rem;
    font-size: clamp(1.5rem, 2.7vw, 2.3rem);
    line-height: 1.2;
}

.home-hero-copy p {
    margin: 0 0 0.9rem;
    color: #2a3e52;
    font-size: 1rem;
    line-height: 1.65;
    max-width: 74ch;
}

.home-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.home-benefits h2,
.home-faq h2,
.home-final-cta h2 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.2rem, 2vw, 1.7rem);
    line-height: 1.25;
}

.home-benefit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.home-benefit-card {
    border: 1px solid #d6e1ec;
    border-radius: 12px;
    padding: 0.85rem;
    background: linear-gradient(180deg, #f8fbff 0%, #eef5fb 100%);
}

.home-benefit-card h3 {
    margin: 0 0 0.45rem;
    font-size: 1.03rem;
}

.home-benefit-card p {
    margin: 0;
    color: #354b61;
    line-height: 1.55;
}

.home-testimonial {
    border-left: 4px solid var(--brand);
    background: linear-gradient(120deg, #f6f9ff 0%, #edf4ff 100%);
}

.home-testimonial-quote {
    margin: 0;
    font-size: clamp(1.05rem, 1.8vw, 1.3rem);
    line-height: 1.55;
    color: #23384c;
    font-weight: 600;
}

.home-testimonial-author {
    margin: 0.65rem 0 0;
    color: #4a6177;
    font-size: 0.95rem;
}

.home-faq-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.home-faq-grid article {
    border: 1px solid #dce6f0;
    border-radius: 12px;
    padding: 0.8rem;
    background: #fbfdff;
}

.home-faq-grid h3 {
    margin: 0 0 0.45rem;
    font-size: 0.98rem;
}

.home-faq-grid p {
    margin: 0;
    color: #3b5369;
    line-height: 1.55;
}

.home-final-cta {
    background: linear-gradient(135deg, #f8fbff 0%, #eaf4ff 100%);
    border-color: #cfe0f2;
}

.home-final-cta p {
    margin: 0;
    color: #2d445a;
    line-height: 1.55;
}

.contact-card {
    max-width: 760px;
}

.contact-intro {
    margin: 0 0 0.9rem;
    color: #3a5268;
    line-height: 1.6;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th,
td {
    border: 1px solid var(--line);
    padding: 0.4rem 0.45rem;
    text-align: left;
    font-size: 0.86rem;
    white-space: nowrap;
}

td.note-cell {
    white-space: normal;
    min-width: 280px;
}

th {
    background: #edf3f8;
}

.totals-row {
    font-weight: 700;
    background: #f1f8ff;
}

.message {
    margin: 0 0 0.8rem;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
}

.message.ok {
    color: var(--ok);
    background: #e7f8ee;
}

.message.error {
    color: var(--error);
    background: #fdeaea;
}

.chart-wrap {
    max-width: 500px;
    margin: 0;
}

.chart-wrap.half-size {
    max-width: 250px;
}

@media (max-width: 640px) {
    .site-header {
        padding: 0.75rem;
    }

    .site-header h1 {
        font-size: 1rem;
    }

    nav a {
        font-size: 0.83rem;
    }

    .container {
        margin-top: 0.7rem;
        padding: 0 0.45rem 1rem;
    }

    .home-banner {
        margin-top: -0.7rem;
        margin-bottom: 0.75rem;
    }

    .home-banner-image {
        height: clamp(140px, 36vw, 220px);
    }

    .home-benefit-grid,
    .home-faq-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 0.7rem;
    }

    .entry-form {
        grid-template-columns: 1fr;
    }

    table {
        min-width: 620px;
    }
}
