:root {
    --green-900: #263f13;
    --green-700: #477719;
    --green-500: #72ad22;
    --lime: #a7cf36;
    --cream: #f7f8ef;
    --ink: #1f2a1a;
    --muted: #66705d;
    --line: #dfe6d5;
    --white: #ffffff;
    --danger: #b43d2c;
    --shadow: 0 16px 40px rgba(38, 63, 19, .12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--cream);
}

a {
    color: inherit;
}

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

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: rgba(247, 248, 239, .94);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-grid {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand img {
    width: 170px;
}

nav {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    font-weight: 700;
    color: var(--green-900);
}

.admin-link {
    color: var(--green-700);
}

.hero {
    background: linear-gradient(115deg, rgba(38, 63, 19, .92), rgba(71, 119, 25, .86)), url("/assets/img/logo-vilares.png") right 8% center / 380px auto no-repeat;
    color: var(--white);
}

.hero-inner {
    min-height: 430px;
    display: flex;
    align-items: center;
}

.hero h1 {
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    line-height: 1;
    max-width: 760px;
    margin: 0 0 18px;
}

.hero p {
    max-width: 620px;
    font-size: 1.13rem;
    line-height: 1.6;
}

.eyebrow {
    color: var(--lime);
    font-weight: 800;
    text-transform: uppercase;
    font-size: .78rem;
    margin: 0 0 8px;
}

.button {
    border: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 18px;
    background: var(--green-700);
    color: var(--white);
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    border-radius: 8px;
}

.button:hover {
    background: var(--green-900);
}

.button.secondary {
    color: var(--green-900);
    background: #e8f0d7;
}

.band {
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

.split {
    display: grid;
    grid-template-columns: .75fr 1.25fr;
    gap: 48px;
    padding: 54px 0;
}

h1, h2, h3 {
    color: var(--green-900);
}

.hero h1 {
    color: var(--white);
}

.split h2,
.section-title h2,
.admin-title h1 {
    margin: 0;
    font-size: 2rem;
}

.guidelines {
    color: var(--muted);
    line-height: 1.7;
    font-size: 1rem;
}

.section {
    padding: 56px 0 72px;
}

.section-title {
    margin-bottom: 24px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.tool-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tool-image,
.detail-image {
    aspect-ratio: 4 / 3;
    background: #edf3df;
    display: grid;
    place-items: center;
    color: var(--green-700);
    font-size: 4rem;
    font-weight: 800;
}

.tool-image {
    position: relative;
    overflow: hidden;
}

.tool-image img,
.detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tool-body {
    padding: 18px;
}

.availability-note {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: rgba(38, 63, 19, .92);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: .84rem;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
}

.tool-body h3 {
    margin: 0 0 8px;
}

.tool-body p,
.tool-detail p {
    color: var(--muted);
    line-height: 1.55;
}

.tool-meta,
.info-row,
.form-help {
    color: var(--muted);
    font-size: .92rem;
    margin: 12px 0;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 22px 0;
    color: var(--muted);
}

.page-grid {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 28px;
    padding: 42px 0;
}

.tool-detail,
.form-panel,
.admin-panel,
.login-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.form-panel h2,
.tool-detail h1 {
    margin-top: 0;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
    color: var(--green-900);
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    font: inherit;
    color: var(--ink);
    background: var(--white);
}

textarea {
    resize: vertical;
}

form {
    display: grid;
    gap: 16px;
}

.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.alert {
    border-radius: 8px;
    padding: 12px 14px;
    background: #e8f0d7;
    color: var(--green-900);
    margin-bottom: 18px;
}

.alert.error {
    background: #fae5e0;
    color: var(--danger);
}

.success-screen,
.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.success-screen {
    text-align: center;
}

.success-screen img,
.login-card img {
    width: 210px;
    margin: 0 auto 20px;
}

.login-card {
    width: min(430px, 100%);
}

.admin-body {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
    background: #f3f6ea;
}

.admin-sidebar {
    background: var(--green-900);
    color: var(--white);
    padding: 24px 18px;
}

.admin-logo img {
    width: 170px;
    margin-bottom: 28px;
    background: var(--cream);
    border-radius: 8px;
    padding: 8px;
}

.admin-sidebar nav {
    display: grid;
    gap: 8px;
}

.admin-sidebar a {
    color: var(--white);
    text-decoration: none;
    padding: 10px;
    border-radius: 8px;
}

.admin-sidebar a:hover {
    background: rgba(255, 255, 255, .12);
}

.admin-main {
    padding: 30px;
    min-width: 0;
}

.admin-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stats-grid div {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.stats-grid strong {
    display: block;
    font-size: 2rem;
    color: var(--green-700);
}

.stats-grid span {
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    border-bottom: 1px solid var(--line);
    padding: 12px;
    vertical-align: middle;
}

th {
    color: var(--green-900);
    background: #f5f8ed;
}

.status {
    display: inline-block;
    background: #e8f0d7;
    color: var(--green-900);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .86rem;
    font-weight: 800;
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.actions form,
.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.actions button,
.inline-form button {
    border: 0;
    background: #fae5e0;
    color: var(--danger);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}

.inline-form button {
    background: var(--green-700);
    color: var(--white);
}

.narrow {
    max-width: 780px;
}

.stack-form {
    max-width: 680px;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check-line input {
    width: auto;
}

.filter-form,
.report-form {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.report-form {
    margin-bottom: 22px;
}

.empty-state {
    padding: 28px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
}

@media (max-width: 900px) {
    .split,
    .page-grid,
    .admin-body {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }

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

@media (max-width: 620px) {
    .header-grid,
    .admin-title,
    .actions,
    .inline-form {
        align-items: stretch;
        flex-direction: column;
    }

    nav {
        gap: 12px;
    }

    .hero {
        background-size: 240px auto;
        background-position: right -55px bottom 22px;
    }

    .hero-inner {
        min-height: 500px;
        align-items: start;
        padding-top: 50px;
    }

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

    .tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .tool-body {
        padding: 12px;
    }

    .tool-body h3 {
        font-size: 1rem;
    }

    .tool-body p,
    .tool-meta {
        font-size: .84rem;
    }

    .tool-card .button {
        width: 100%;
        min-height: 40px;
        padding: 10px;
        font-size: .9rem;
    }

    .availability-note {
        left: 6px;
        right: 6px;
        bottom: 6px;
        padding: 6px;
        font-size: .68rem;
    }

    .admin-main {
        padding: 18px;
    }
}
