/* ─── Variabler ─────────────────────────────────────────────────────────────── */
:root {
    --blue:        #2563eb;
    --blue-dark:   #1d4ed8;
    --blue-light:  #eff6ff;
    --gray-50:     #f9fafb;
    --gray-100:    #f3f4f6;
    --gray-200:    #e5e7eb;
    --gray-400:    #9ca3af;
    --gray-500:    #6b7280;
    --gray-700:    #374151;
    --gray-900:    #111827;
    --green:       #16a34a;
    --red:         #dc2626;
    --radius:      0.75rem;
    --shadow:      0 1px 3px rgba(0,0,0,.1);
    --shadow-md:   0 4px 12px rgba(0,0,0,.1);
}

/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: system-ui, -apple-system, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ─── Layout ─────────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 100;
}
.site-header .container {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.site-logo { font-size: 1.4rem; font-weight: 800; color: var(--blue); }
.site-nav { display: flex; gap: 1.5rem; font-size: .9rem; color: var(--gray-500); }
.site-nav a:hover { color: var(--blue); }

/* ─── Main & Footer ──────────────────────────────────────────────────────────── */
.site-main { padding: 2rem 0 4rem; }
.site-footer {
    border-top: 1px solid var(--gray-200);
    text-align: center;
    padding: 2rem;
    font-size: .85rem;
    color: var(--gray-400);
}

/* ─── Hero ───────────────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 4rem 1rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900; line-height: 1.15; }
.hero h1 span { color: var(--blue); }
.hero p { font-size: 1.15rem; color: var(--gray-500); margin: 1rem auto; max-width: 520px; }
.hero-cta {
    display: inline-block; margin-top: 1.5rem;
    background: var(--blue); color: #fff;
    font-size: 1.05rem; font-weight: 600;
    padding: .85rem 2rem; border-radius: var(--radius);
    transition: background .2s;
}
.hero-cta:hover { background: var(--blue-dark); }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; margin-top: 3.5rem; }
.feature-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.feature-card .emoji { font-size: 2rem; margin-bottom: .75rem; }
.feature-card h3 { font-weight: 700; margin-bottom: .35rem; }
.feature-card p { font-size: .9rem; color: var(--gray-500); }

/* ─── Listsida ───────────────────────────────────────────────────────────────── */
.page-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 1.5rem; }
.listings-layout { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; align-items: start; }
@media (max-width: 768px) { .listings-layout { grid-template-columns: 1fr; } }

.filter-panel { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.filter-panel h2 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.filter-group { margin-bottom: 1rem; }
.filter-group label { display: block; font-size: .85rem; color: var(--gray-500); margin-bottom: .35rem; }
.filter-group select,
.filter-group input[type=text],
.filter-group input[type=number] {
    width: 100%; border: 1px solid var(--gray-200); border-radius: .5rem;
    padding: .5rem .75rem; font-size: .9rem; background: #fff;
    transition: border-color .15s;
}
.filter-group select:focus,
.filter-group input:focus { outline: none; border-color: var(--blue); }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.btn-reset { width: 100%; margin-top: .5rem; background: none; border: none; color: var(--gray-400); font-size: .85rem; cursor: pointer; text-decoration: underline; }
.btn-reset:hover { color: var(--red); }
.btn-primary {
    display: block; width: 100%; text-align: center;
    background: var(--blue); color: #fff; font-weight: 600;
    padding: .65rem; border-radius: .5rem; border: none; cursor: pointer;
    margin-top: .75rem; font-size: .95rem; transition: background .2s;
}
.btn-primary:hover { background: var(--blue-dark); }

.results-count { font-size: .9rem; color: var(--gray-400); margin-bottom: 1rem; }
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.25rem; }
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--gray-400); }
.empty-state a { color: var(--blue); text-decoration: underline; }

/* ─── Listing Card ───────────────────────────────────────────────────────────── */
.listing-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; display: block; }
.listing-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.listing-card__img { position: relative; height: 190px; overflow: hidden; background: var(--gray-100); }
.listing-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.listing-card:hover .listing-card__img img { transform: scale(1.04); }
.listing-card__badge {
    position: absolute; top: .6rem; left: .6rem;
    background: var(--blue); color: #fff;
    font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: 99px;
}
.listing-card__body { padding: 1rem; }
.listing-card__price { font-size: 1.2rem; font-weight: 800; }
.listing-card__fee { font-size: .8rem; color: var(--gray-400); }
.listing-card__title { font-weight: 600; margin: .3rem 0 .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-card__address { font-size: .85rem; color: var(--gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-card__meta { display: flex; gap: 1rem; font-size: .85rem; color: var(--gray-500); margin-top: .65rem; }

/* ─── Detaljsida ─────────────────────────────────────────────────────────────── */
.back-link { display: inline-block; font-size: .9rem; color: var(--blue); margin-bottom: 1.25rem; }
.back-link:hover { text-decoration: underline; }
.detail-hero { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin-bottom: 2rem; box-shadow: var(--shadow-md); }
.detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; align-items: start; }
@media (max-width: 860px) { .detail-layout { grid-template-columns: 1fr; } }
.detail-badge { display: inline-block; background: var(--blue-light); color: var(--blue); font-size: .8rem; font-weight: 600; padding: .25rem .75rem; border-radius: 99px; margin-bottom: .75rem; }
.detail-title { font-size: 2rem; font-weight: 900; line-height: 1.2; }
.detail-address { color: var(--gray-500); margin: .4rem 0 1.5rem; }
.detail-section-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .5rem; }
.detail-description { color: var(--gray-700); line-height: 1.75; }
.detail-sidebar { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.detail-price { font-size: 2rem; font-weight: 900; }
.detail-fee { font-size: .9rem; color: var(--gray-400); margin-bottom: 1rem; }
.detail-facts { border-top: 1px solid var(--gray-100); padding-top: 1rem; }
.detail-facts dt { font-size: .85rem; color: var(--gray-400); }
.detail-facts dd { font-weight: 600; margin-bottom: .6rem; }
.btn-source { display: block; text-align: center; background: var(--blue); color: #fff; font-weight: 600; padding: .85rem; border-radius: .75rem; margin-top: 1.25rem; transition: background .2s; }
.btn-source:hover { background: var(--blue-dark); }

/* ─── Formulär ───────────────────────────────────────────────────────────────── */
.form-page { max-width: 560px; margin: 0 auto; }
.form-page h1 { font-size: 1.75rem; font-weight: 900; margin-bottom: .4rem; }
.form-page .sub { color: var(--gray-500); margin-bottom: 2rem; }
.form-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); }
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: .9rem; font-weight: 500; margin-bottom: .4rem; }
.form-group input { width: 100%; border: 1px solid var(--gray-200); border-radius: .5rem; padding: .6rem .9rem; font-size: .95rem; transition: border-color .15s; }
.form-group input:focus { outline: none; border-color: var(--blue); }
.alert { padding: 1rem 1.25rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .95rem; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ─── Admin ───────────────────────────────────────────────────────────────────── */
.admin-row { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; box-shadow: var(--shadow); }
.admin-row__info p { font-weight: 600; word-break: break-all; }
.admin-row__info small { color: var(--gray-400); font-size: .82rem; }
.admin-row__actions { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.badge { font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: 99px; }
.badge-pending  { background: #fefce8; color: #854d0e; }
.badge-approved { background: #f0fdf4; color: #166534; }
.badge-rejected { background: #fef2f2; color: #991b1b; }
.btn-approve { color: var(--green); font-size: .85rem; background: none; border: none; cursor: pointer; text-decoration: underline; }
.btn-reject  { color: var(--red);   font-size: .85rem; background: none; border: none; cursor: pointer; text-decoration: underline; }
