:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #667085;
    --line: #d9e0ea;
    --primary: #0f8b8d;
    --primary-dark: #096a6b;
    --accent: #f3b33d;
    --danger: #c24141;
    --ok: #168152;
    --shadow: 0 16px 40px rgba(23, 32, 51, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--site-background);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header,
.site-footer,
.section,
.flash {
    width: min(1120px, calc(100% - 32px));
    margin-inline: auto;
}

.site-header {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
    background: rgba(245, 247, 251, .78);
    border-bottom: 1px solid rgba(217, 224, 234, .72);
}

.brand,
.nav,
.meta,
.actions,
.listing-info,
.category-row {
    display: flex;
    align-items: center;
}

.brand {
    gap: 10px;
    font-weight: 800;
    font-size: 20px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
}

.nav {
    gap: 16px;
    color: var(--muted);
    font-weight: 650;
    flex-wrap: wrap;
}

.nav a:hover {
    color: var(--ink);
}

.hero {
    padding: 54px 0 28px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
    gap: 28px;
    align-items: stretch;
}

.hero-copy {
    padding: 28px 0;
}

.eyebrow {
    color: var(--primary-dark);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: .08em;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.08;
}

h1 {
    max-width: 760px;
    font-size: clamp(38px, 7vw, 72px);
}

h2 {
    font-size: 28px;
}

h3 {
    font-size: 18px;
}

p {
    color: var(--muted);
}

.hero-panel,
.panel,
.listing-card,
.auth-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero-panel {
    min-height: 340px;
    padding: 26px;
    display: grid;
    align-content: end;
    background:
        linear-gradient(140deg, rgba(15,139,141,.94), rgba(23,32,51,.78)),
        url("https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?auto=format&fit=crop&w=900&q=80");
    background-size: cover;
    background-position: center;
    color: #fff;
}

.hero-panel p {
    color: rgba(255, 255, 255, .82);
}

.search-box {
    margin-top: 26px;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr auto;
    gap: 10px;
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

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

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

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
}

.button,
button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.button:hover,
button:hover {
    background: var(--primary-dark);
}

.button-dark {
    background: var(--ink);
}

.button-light {
    background: #eef3f6;
    color: var(--ink);
}

.button-danger {
    background: var(--danger);
}

.section {
    padding: 26px 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 18px;
}

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

.listing-card {
    overflow: hidden;
}

.listing-image {
    height: 170px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #e7f3f2, #fff4db);
    color: var(--primary-dark);
    font-size: 48px;
    font-weight: 900;
}

.listing-photo {
    width: 100%;
    object-fit: cover;
}

.listing-hero-photo {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.listing-large-placeholder {
    min-height: 360px;
    border-radius: 8px;
}

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.thumb-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.listing-body {
    padding: 16px;
}

.price {
    color: var(--primary-dark);
    font-size: 22px;
    font-weight: 900;
}

.meta {
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 10px;
    background: #edf6f6;
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 13px;
}

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

.category-row {
    justify-content: space-between;
    padding: 15px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 800;
}

.panel,
.auth-card {
    padding: 22px;
}

.demo-logins {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

.actions {
    gap: 8px;
    flex-wrap: wrap;
}

.sticky-panel {
    position: sticky;
    top: 92px;
}

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

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

.stack-form {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.inline-form,
.admin-row-form,
.compact-filter {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form {
    margin-top: 12px;
}

.check-row {
    display: inline-flex;
    grid-auto-flow: column;
    align-items: center;
    gap: 8px;
    min-height: auto;
}

.check-row input {
    width: auto;
    min-height: auto;
}

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

.stat {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.stat span {
    display: block;
    color: var(--muted);
    font-weight: 750;
}

.stat strong {
    display: block;
    margin-top: 6px;
    font-size: 34px;
}

.table-wrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.preset-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.preset-preview {
    min-height: 120px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

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

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: #f8fafc;
}

td small {
    color: var(--muted);
}

td input,
td select {
    min-height: 38px;
}

.auth-wrap {
    width: min(480px, calc(100% - 32px));
    margin: 48px auto;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) 340px;
    gap: 22px;
    align-items: start;
}

.listing-info {
    justify-content: space-between;
    gap: 14px;
    margin: 14px 0;
}

.description {
    white-space: pre-wrap;
    color: var(--ink);
}

.flash {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 750;
}

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

.flash-error {
    color: var(--danger);
    background: #fdecec;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    color: var(--muted);
    padding: 36px 0;
}

@media (max-width: 840px) {
    .site-header,
    .site-footer,
    .section-head,
    .nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-grid,
    .search-box,
    .split,
    .form-grid {
        grid-template-columns: 1fr;
    }

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

    .sticky-panel {
        position: static;
    }
}

@media (max-width: 560px) {
    .grid,
    .categories,
    .stats-grid,
    .thumb-grid,
    .preset-grid {
        grid-template-columns: 1fr;
    }

    .nav {
        width: 100%;
    }

    .nav a {
        width: 100%;
    }
}
