/* ══════════════════════════════════════════════════════════════════
   SSHK Hälsoregister – Publik sida
   Grafisk profil: Svenska Sennenhundklubben 2024
   Mobile-first
   ══════════════════════════════════════════════════════════════════ */

/* ── Variabler – SSHK grafisk manual 2024 ─────────────────────── */
:root {
    /* Primärfärger */
    --color-red:          #ab192d;   /* SSHK Röd – dominerande */
    --color-red-dark:     #8a1424;   /* Mörkare röd för hover */
    --color-yellow:       #f5c65d;   /* SSHK Gul */
    --color-yellow-light: #faecc0;   /* Gul, ljus ton */

    /* Sekundärfärger */
    --color-green:        #1b5633;   /* SSHK Grön – används sparsamt */
    --color-blue:         #002f87;   /* SSHK Blå – används sparsamt */

    /* Neutraler */
    --color-ink:          #212122;   /* Ink Black */
    --color-white:        #fdfbf3;   /* Sennen Vit */
    --color-bg:           #fdfbf3;
    --color-surface:      #ffffff;
    --color-border:       #e0d8cc;
    --color-border-light: #ece8e0;
    --color-text:         #212122;
    --color-text-muted:   #5a5550;
    --color-text-light:   #9c9590;

    /* Notiser */
    --color-error:        #ab192d;
    --color-error-bg:     #fdf0ee;
    --color-info-bg:      #fef9ec;
    --color-info:         #7a5200;

    /* Typsnitt – SSHK standard */
    --font-heading: 'Open Sans', sans-serif;
    --font-body:    'Roboto', sans-serif;
    --font-mono:    'Courier New', Courier, monospace;

    --radius:    5px;
    --radius-lg: 10px;
    --shadow:    0 2px 8px rgba(33,33,34,.09);
    --shadow-md: 0 4px 20px rgba(33,33,34,.13);

    --container: 1200px;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-weight: 300;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--color-red); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--color-red-dark); }
img { max-width: 100%; display: block; }

/* ── Container ────────────────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1rem;
}
@media (min-width: 640px) {
    .container { padding: 0 1.5rem; }
}

/* ── Header ───────────────────────────────────────────────────── */
.site-header {
    background: var(--color-red);
    border-bottom: 4px solid var(--color-yellow);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem 1rem;
    gap: 1rem;
    min-height: 64px;
}

@media (min-width: 640px) {
    .header-inner { padding: .6rem 1.5rem; }
}

.site-logo {
    display: flex;
    align-items: center;
    gap: .85rem;
    text-decoration: none;
    flex-shrink: 0;
}

.site-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.logo-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    color: var(--color-yellow);
    letter-spacing: .01em;
    text-transform: uppercase;
}

.logo-sub {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: .75rem;
    color: rgba(253,251,243,.75);
    letter-spacing: .04em;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.nav-link {
    color: rgba(253,251,243,.85);
    font-family: var(--font-heading);
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    transition: color .15s;
}
.nav-link:hover { color: var(--color-yellow); text-decoration: none; }

/* ── Hamburgermeny ──────────────────────────────── */
.header-nav { position: relative; }

.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(245,198,93,.45);
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: border-color .15s, background .15s;
    flex-shrink: 0;
}
.hamburger-btn:hover {
    border-color: var(--color-yellow);
    background: rgba(245,198,93,.12);
}

.hamburger-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .2s ease, opacity .15s ease;
    transform-origin: center;
}

.hamburger-btn.is-open .hamburger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.is-open .hamburger-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.is-open .hamburger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hamburger-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 270px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(33,33,34,.18);
    z-index: 500;
    overflow: hidden;
    padding: .4rem 0;
}

.hmenu-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1.1rem;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: .9rem;
    color: var(--color-text);
    text-decoration: none;
    transition: background .12s, color .12s;
    line-height: 1;
}
.hmenu-item svg:first-child {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--color-text-muted);
    transition: color .12s;
}
.hmenu-item:hover {
    background: var(--color-surface-alt, #f7f4ee);
    color: var(--color-red);
    text-decoration: none;
}
.hmenu-item:hover svg:first-child { color: var(--color-red); }

.hmenu-item--active {
    color: var(--color-red);
    background: var(--color-yellow-light);
}
.hmenu-item--active svg:first-child { color: var(--color-red); }

.hmenu-item--highlight {
    color: var(--color-red);
    font-weight: 700;
}
.hmenu-item--highlight svg:first-child { color: var(--color-red); }

.hmenu-item--logout { color: var(--color-text-muted); }
.hmenu-item--logout:hover { color: var(--color-red); background: #fdecea; }

.hmenu-external {
    width: 12px;
    height: 12px;
    margin-left: auto;
    flex-shrink: 0;
    opacity: .35;
}

.hmenu-divider {
    height: 1px;
    background: var(--color-border-light);
    margin: .3rem 0;
}

.hamburger-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 499;
    background: transparent;
}
.hamburger-overlay.is-visible { display: block; }

/* ── Main ─────────────────────────────────────────────────────── */
.site-main { flex: 1; padding: 2rem 0 3rem; }

/* ── Rapportera-blänkare ───────────────────────────────────────── */
.report-cta {
    background: var(--color-yellow-light);
    border-top: 3px solid var(--color-yellow);
}

.report-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.report-cta-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.report-cta-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
    line-height: 1;
}

.report-cta-text strong {
    display: block;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: .95rem;
    color: var(--color-text);
    margin-bottom: .2rem;
}

.report-cta-text span {
    font-size: .85rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.report-cta-btn {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    padding: .65rem 1.25rem;
    background: var(--color-red);
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .875rem;
    border-radius: var(--radius);
    text-decoration: none;
    transition: background .15s;
}
.report-cta-btn:hover {
    background: var(--color-red-dark);
    text-decoration: none;
    color: #fff;
}

@media (max-width: 639px) {
    .report-cta-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .report-cta-btn { width: 100%; justify-content: center; }
}

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
    background: var(--color-red-dark);
    border-top: 3px solid var(--color-yellow);
    padding: 1.25rem 0;
}

.footer-copy {
    color: rgba(253,251,243,.5);
    font-size: .8rem;
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 400;
}

/* ── Knappar ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .65rem 1.5rem;
    font-family: var(--font-heading);
    font-size: .95rem;
    font-weight: 700;
    border-radius: var(--radius);
    border: 2px solid transparent;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .1s;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: .02em;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--color-red);
    color: var(--color-white);
    border-color: var(--color-red);
}
.btn-primary:hover {
    background: var(--color-red-dark);
    border-color: var(--color-red-dark);
    color: var(--color-white);
    text-decoration: none;
}

.btn-full { width: 100%; }

/* ── Formulär ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .8rem;
    color: var(--color-text-muted);
    margin-bottom: .4rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.form-input {
    width: 100%;
    padding: .75rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
}
.form-input:focus {
    outline: none;
    border-color: var(--color-red);
    box-shadow: 0 0 0 3px rgba(171,25,45,.12);
}
.form-input.is-error { border-color: var(--color-error); }

/* ── Notices ──────────────────────────────────────────────────── */
.notice {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    font-size: .9rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid;
    font-family: var(--font-heading);
}
.notice-error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border-color: var(--color-error);
}
.notice-info {
    background: var(--color-info-bg);
    color: var(--color-info);
    border-color: var(--color-yellow);
}

/* ══════════════════════════════════════════════════════════════════
   INLOGGNINGSSIDA
   ══════════════════════════════════════════════════════════════════ */
.login-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 1rem;
    gap: 1rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem 2rem;
    border-top: 5px solid var(--color-red);
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--color-border-light);
}

.login-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.login-logo-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    color: var(--color-red);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .04em;
    line-height: 1.3;
}

.login-logo-sub {
    font-family: var(--font-heading);
    font-weight: 600;
    font-style: italic;
    font-size: .85rem;
    color: var(--color-text-muted);
    text-align: center;
}

.login-desc {
    text-align: center;
    color: var(--color-text-muted);
    font-size: .9rem;
    margin-bottom: 1.75rem;
    line-height: 1.6;
}

.login-form { margin-bottom: 1rem; }

.login-info-banner {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    background: var(--color-info-bg);
    border: 1px solid #d4b86a;
    border-left: 4px solid var(--color-yellow);
    border-radius: var(--radius-lg);
    max-width: 420px;
    width: 100%;
}

.login-info-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: .05rem;
}

.login-info-banner p {
    font-size: .875rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0;
}

.login-help {
    text-align: center;
    font-size: .8rem;
    color: var(--color-text-light);
    margin-top: 1.25rem;
}

/* ══════════════════════════════════════════════════════════════════
   STARTSIDA (INLOGGAD)
   ══════════════════════════════════════════════════════════════════ */
.home-wrap { max-width: 720px; margin: 0 auto; }

.home-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0 2rem;
    border-bottom: 2px solid var(--color-yellow);
    margin-bottom: 2.5rem;
}

.hero-logo-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    flex-shrink: 0;
}

.hero-text {}

.hero-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.875rem;
    color: var(--color-red);
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: .01em;
}

.hero-club {
    font-family: var(--font-heading);
    font-weight: 600;
    font-style: italic;
    font-size: .95rem;
    color: var(--color-text-muted);
    margin-top: .2rem;
    margin-bottom: .75rem;
}

.hero-desc {
    color: var(--color-text-muted);
    font-size: .95rem;
}

@media (min-width: 640px) {
    .hero-title { font-size: 2.25rem; }
}

@media (max-width: 480px) {
    .home-hero { flex-direction: column; text-align: center; }
    .hero-logo-img { width: 72px; height: 72px; }
}

/* ── Ny stats-layout: 2/3 + 1/3 ─────────────────────────────── */
.stats-row-new {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

/* Vänster box – 2/3 */
.stat-card-wide {
    flex: 2;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-top: 3px solid var(--color-red);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-card-wide-top {
    display: flex;
    align-items: baseline;
    gap: .75rem;
}

.stat-card-wide-top .stat-number {
    font-size: 2rem;
    line-height: 1;
}

.stat-card-wide-top .stat-label {
    font-size: .75rem;
}

/* Rasfördelning */
.stat-breed-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.stat-breed-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 3.5rem;
    align-items: center;
    gap: .75rem;
}

.stat-breed-name {
    font-family: var(--font-heading);
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-breed-bar-wrap {
    width: 100%;
    height: 6px;
    background: var(--color-border-light);
    border-radius: 99px;
    overflow: hidden;
    min-width: 60px;
}

.stat-breed-bar {
    height: 100%;
    background: var(--color-red);
    border-radius: 99px;
    opacity: .7;
    min-width: 2px;
}

.stat-breed-count {
    font-family: var(--font-heading);
    font-size: .8rem;
    font-weight: 700;
    color: var(--color-text-muted);
    white-space: nowrap;
    text-align: right;
}

/* Höger box – 1/3 */
.stat-card-narrow {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-top: 3px solid var(--color-red);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.stat-mini {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.25rem 1rem;
    gap: .25rem;
}

.stat-mini--border {
    border-top: 1px solid var(--color-border-light);
}

.stat-mini .stat-number,
.stat-mini .stat-number.stat-date {
    font-size: 1.75rem;
    font-weight: 800;
}

.stat-mini .stat-label {
    font-size: .7rem;
}

/* Mobil: stapla vertikalt */
@media (max-width: 639px) {
    .stats-row-new     { flex-direction: column; }
    .stat-card-narrow  { flex-direction: row; }
    .stat-mini         { flex: 1; }
    .stat-mini--border { border-top: none; border-left: 1px solid var(--color-border-light); }
    .stat-breed-row    { grid-template-columns: minmax(0, 1fr) 70px 3rem; gap: .5rem; }
    .stat-breed-name   { font-size: .75rem; }
    .stat-breed-count  { font-size: .75rem; }
}

/* Statistikkort (gammal, behålls för bakåtkompatibilitet) */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--color-red);
}

.stat-number {
    display: block;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2rem;
    color: var(--color-red);
    line-height: 1.1;
    margin-bottom: .35rem;
}

.stat-number.stat-date {
    font-size: 2rem;
    font-weight: 800;
}

.stat-label {
    font-family: var(--font-heading);
    font-size: .75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
}

/* Sökruta */
.home-search { margin-bottom: 2rem; }

.search-row {
    display: flex;
    gap: .5rem;
    align-items: stretch;
}

.search-input {
    flex: 1;
    padding: .75rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    min-width: 0;
}
.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-input-icon {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-text-light);
    pointer-events: none;
    transition: color .15s;
}

.search-input--icon {
    width: 100%;
    padding-left: 2.5rem;
}

.search-input-wrap:focus-within .search-input-icon {
    color: var(--color-red);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-red);
    box-shadow: 0 0 0 3px rgba(171,25,45,.12);
}

.btn-search { padding: .75rem 1.25rem; flex-shrink: 0; }

.search-hint {
    margin-top: .6rem;
    font-size: .8rem;
    color: var(--color-text-light);
}

.btn-search-cta {
    padding: .75rem 2rem;
    font-size: 1rem;
    gap: .5rem;
}

/* ══════════════════════════════════════════════════════════════════
   SÖKRESULTAT / TABELLER
   ══════════════════════════════════════════════════════════════════ */
.page-header { margin-bottom: 2rem; }

.back-link {
    display: inline-block;
    font-family: var(--font-heading);
    font-size: .875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: .75rem;
}
.back-link:hover { color: var(--color-red); text-decoration: none; }

.page-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.75rem;
    color: var(--color-red);
    text-transform: uppercase;
    letter-spacing: .01em;
    margin-bottom: 0;
}

.page-subtitle {
    color: var(--color-text-muted);
    font-size: .9rem;
    margin-top: .25rem;
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-red);
    text-transform: uppercase;
    letter-spacing: .02em;
    margin-bottom: 1rem;
}

.search-form--page { margin-bottom: 1.75rem; }

.results-count {
    font-family: var(--font-heading);
    font-size: .875rem;
    color: var(--color-text-muted);
    margin-bottom: .75rem;
}

.results-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    background: var(--color-surface);
}

.results-table thead th {
    background: var(--color-red);
    color: var(--color-yellow);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .7rem 1rem;
    text-align: left;
    white-space: nowrap;
}

.results-table tbody tr {
    border-bottom: 1px solid var(--color-border-light);
    transition: background .1s;
}
.results-table tbody tr:last-child { border-bottom: none; }
.results-table tbody tr:hover { background: var(--color-yellow-light); }

.results-table td {
    padding: .7rem 1rem;
    vertical-align: middle;
    font-family: var(--font-body);
    font-weight: 300;
}

.mono {
    font-family: var(--font-mono);
    font-size: .85em;
    color: var(--color-text-muted);
}

.link-arrow {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .875rem;
    white-space: nowrap;
    color: var(--color-red);
}
.link-arrow:hover { color: var(--color-red-dark); text-decoration: none; }

/* ── Hundprofil ───────────────────────────────────────────────── */
.dog-profile { display: flex; flex-direction: column; gap: 2rem; }

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    color: var(--color-red);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 1rem;
    padding-bottom: .6rem;
    border-bottom: 2px solid var(--color-yellow);
    display: inline-block;
}

.meta-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .5rem 1.5rem;
}

.meta-list dt {
    font-family: var(--font-heading);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
    padding-top: .1rem;
}

.meta-list dd {
    color: var(--color-text);
    font-family: var(--font-body);
    font-weight: 300;
}

.events-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--color-border-light);
}

/* ── Hundprofil – sidlayout ────────────────────────────────── */
.page-subtitle {
    font-family: var(--font-heading);
    font-weight: 600;
    font-style: italic;
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-top: .25rem;
}

.dog-titles {
    font-family: var(--font-heading);
    font-size: .8rem;
    font-weight: 600;
    color: var(--color-text-light);
    letter-spacing: .03em;
    margin-top: 0;
    margin-bottom: .35rem;
}

.text-muted { color: var(--color-text-light); font-size: .875rem; }

.text-muted-block {
    color: var(--color-text-muted);
    font-size: .9rem;
    padding: .5rem 0;
}

/* Badge */
.badge {
    display: inline-block;
    padding: .2rem .65rem;
    border-radius: 99px;
    font-family: var(--font-heading);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .03em;
}

/* DEATH-rad i händelsetabell */
.event-row--death td {
    color: var(--color-red);
}

.badge-events {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.badge-events--btn {
    cursor: pointer;
    font-family: var(--font-heading);
    transition: background .15s, box-shadow .15s;
}
.badge-events--btn:hover {
    background: #c8e6c9;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(33,33,34,.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(2px);
}

.modal-box {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 40px rgba(33,33,34,.25);
    width: 100%;
    max-width: 680px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    border-top: 4px solid var(--color-red);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

.modal-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-red);
    text-transform: uppercase;
    letter-spacing: .02em;
    margin: 0;
}

.modal-subtitle {
    font-family: var(--font-mono);
    font-size: .8rem;
    color: var(--color-text-muted);
    margin: .15rem 0 0;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-text-muted);
    border-radius: var(--radius);
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--color-surface-alt); color: var(--color-red); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body {
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    flex: 1;
}

.modal-empty {
    color: var(--color-text-muted);
    font-size: .9rem;
    text-align: center;
    padding: 1.5rem 0;
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.modal-table thead th {
    background: var(--color-red);
    color: var(--color-yellow);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .6rem .9rem;
    text-align: left;
}

.modal-table tbody tr {
    border-bottom: 1px solid var(--color-border-light);
}
.modal-table tbody tr:last-child { border-bottom: none; }
.modal-table tbody tr:hover { background: var(--color-surface-alt); }

.modal-table td {
    padding: .65rem .9rem;
    vertical-align: top;
}

.modal-age {
    display: block;
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: .85em;
    opacity: .85;
    margin-top: .15rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border-light);
    background: var(--color-bg);
}

@media (max-width: 639px) {
    .modal-box   { max-height: 92vh; }
    .modal-header,
    .modal-body,
    .modal-footer { padding-left: 1rem; padding-right: 1rem; }
}

/* ── Klickbara rader ─────────────────────────────────────────── */
.results-table--linked .dog-row {
    cursor: pointer;
}

.results-table--linked .dog-row:hover {
    background: var(--color-yellow-light);
}

.dog-name-link {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-red);
    text-decoration: none;
}
.dog-name-link:hover {
    text-decoration: underline;
    color: var(--color-red-dark);
}

/* ── Statistik-knapp på startsidan ───────────────────────── */
/* Knapprad: Statistik + Hundregister sida vid sida */
.home-btn-row {
    display: flex;
    gap: 1rem;
    margin-top: 1.25rem;
    margin-bottom: .25rem;
}
.home-btn-row .btn-stat-link { flex: 1; }

@media (max-width: 639px) {
    .home-btn-row { flex-direction: column; }
}

.btn-stat-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--color-surface);
    border: 2px solid var(--color-border-light);
    border-left: 4px solid var(--color-red);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
    color: var(--color-text);
}
.btn-stat-link:hover {
    border-color: var(--color-red);
    background: var(--color-yellow-light);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: var(--color-text);
}

.btn-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--color-red);
    border-radius: var(--radius);
    flex-shrink: 0;
    color: var(--color-yellow);
}
.btn-stat-icon svg { width: 22px; height: 22px; }

.btn-stat-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.btn-stat-text strong {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    color: var(--color-red);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.btn-stat-text small {
    font-size: .8rem;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-weight: 300;
}

.btn-stat-arrow {
    font-size: 1.25rem;
    color: var(--color-text-light);
    flex-shrink: 0;
    transition: transform .15s, color .15s;
}
.btn-stat-link:hover .btn-stat-arrow {
    transform: translateX(4px);
    color: var(--color-red);
}

/* ──────────────────────────────────────────────────────────────────
   STATISTIKSIDA
   ══════════════════════════════════════════════════════════════════ */
.stat-page-header { margin-bottom: 1.5rem; }

.stat-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.stat-title-icon {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    margin-right: .5rem;
    color: var(--color-red);
    display: inline-block;
    position: relative;
    top: -2px;
}

/* Rasfilter */
.stat-filter-bar {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 1rem 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.filter-label {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
    padding-top: .35rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.filter-pill {
    display: inline-block;
    padding: .3rem .85rem;
    border-radius: 99px;
    font-family: var(--font-heading);
    font-size: .8rem;
    font-weight: 600;
    border: 2px solid var(--color-border);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
    background: var(--color-bg);
}
.filter-pill:hover {
    border-color: var(--color-red);
    color: var(--color-red);
    text-decoration: none;
    background: var(--color-surface);
}
.filter-pill--active {
    background: var(--color-red);
    border-color: var(--color-red);
    color: var(--color-yellow) !important;
    text-decoration: none;
}

/* KPI-kort */
.stat-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.stat-kpi-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.kpi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    flex-shrink: 0;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi-icon--red    { background: #fdecea; color: var(--color-red); }
.kpi-icon--yellow { background: #fef9ec; color: #7a5200; }
.kpi-icon--green  { background: #e8f5e9; color: #2e7d32; }

.kpi-body {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}
.kpi-value {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.375rem;
    color: var(--color-red);
    line-height: 1.1;
}
.kpi-label {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
}
.kpi-sub {
    font-size: .75rem;
    color: var(--color-text-light);
}

/* Sektioner */
.stat-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.stat-section-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    color: var(--color-red);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .4rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.stat-section-title svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--color-red);
}

.stat-section-desc {
    font-size: .85rem;
    color: var(--color-text-muted);
    margin-bottom: 1.25rem;
}

/* Dekad-staplar */
.stat-decade-grid {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.decade-bar-item {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.decade-bar-wrap {
    display: flex;
    align-items: center;
    gap: .75rem;
    height: 28px;
    background: var(--color-bg);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.decade-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-red), #d4374d);
    border-radius: 4px;
    min-width: 4px;
    transition: width .4s ease;
}

.decade-bar-value {
    position: absolute;
    right: .75rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .8rem;
    color: var(--color-text-muted);
}

.decade-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.decade-label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: .8rem;
    color: var(--color-text);
}
.decade-count {
    font-size: .75rem;
    color: var(--color-text-light);
}

/* Händelsetyp-tabell */
.stat-event-table-wrap { overflow-x: auto; }

.pct-bar-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 120px;
}
.pct-bar-fill {
    height: 8px;
    background: var(--color-red);
    border-radius: 99px;
    min-width: 2px;
    opacity: .7;
}
.pct-bar-label {
    font-size: .8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    font-family: var(--font-heading);
    font-weight: 600;
}

/* Per-år stapeldiagram */
.stat-year-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 120px;
    padding-bottom: 1.5rem;
    position: relative;
    border-bottom: 2px solid var(--color-border-light);
    overflow: hidden;
}

.year-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    position: relative;
    cursor: default;
}

.year-bar {
    width: 100%;
    background: var(--color-red);
    opacity: .75;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: opacity .15s;
}
.year-col:hover .year-bar { opacity: 1; }

.year-label {
    position: absolute;
    bottom: -1.25rem;
    font-size: .6rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-text-muted);
    white-space: nowrap;
}
.year-label--hidden { visibility: hidden; }

/* SH-test resultat */
.sh-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: .5rem;
}

.sh-result-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-top: 4px solid;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.sh-result-letter {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
}


.sh-result-body {
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.sh-result-count {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.625rem;
    color: var(--color-text);
    line-height: 1;
}

.sh-result-pct {
    font-size: .78rem;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-weight: 600;
}

.sh-result-bar-wrap {
    height: 6px;
    background: var(--color-border-light);
    border-radius: 99px;
    overflow: hidden;
}

.sh-result-bar {
    height: 100%;
    border-radius: 99px;
    min-width: 2px;
    opacity: .8;
}

.stat-chart-note {
    margin-top: 1.5rem;
    font-size: .78rem;
    color: var(--color-text-light);
    text-align: center;
}

/* ──────────────────────────────────────────────────────────────────
   HUNDREGISTERSIDAN
   ══════════════════════════════════════════════════════════════════ */
.reg-filter-form {
    background: var(--color-surface);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.reg-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.filter-group { display: flex; flex-direction: column; gap: .5rem; }
.filter-group--full { margin-bottom: 1.25rem; }
.filter-group--check { justify-content: flex-end; padding-bottom: .25rem; }

.filter-group-label {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-select {
    padding: .5rem .75rem;
    font-size: .9rem;
}

.filter-name-input {
    padding-top: .5rem;
    padding-bottom: .5rem;
    font-size: .9rem;
}

/* Slider */
.dual-slider-wrap {
    position: relative;
    height: 32px;
    display: flex;
    align-items: center;
}

.dual-slider-wrap .slider {
    position: absolute;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: transparent;
    pointer-events: none;
    outline: none;
}

.dual-slider-wrap .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-red);
    cursor: pointer;
    pointer-events: all;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.dual-slider-wrap::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 4px;
    background: var(--color-border);
    border-radius: 99px;
    pointer-events: none;
}

.slider-value-display {
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--color-red);
    font-weight: 700;
}

/* Kryssrutor */
.check-label {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: var(--color-text);
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 600;
}

.org-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: .6rem 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
    margin-bottom: .5rem;
}
.org-toggle:hover {
    border-color: var(--color-red);
    color: var(--color-red);
    background: var(--color-surface);
}
.org-toggle[aria-expanded="true"] {
    border-color: var(--color-red);
    color: var(--color-red);
    background: var(--color-surface);
}

.org-toggle-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform .2s ease;
}
.org-toggle[aria-expanded="true"] .org-toggle-icon {
    transform: rotate(180deg);
}

.org-code-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .5rem;
}

.check-label--org {
    flex-direction: column;
    align-items: flex-start;
    padding: .6rem .75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius);
    gap: .15rem;
    font-weight: 700;
    font-size: .8rem;
}

.check-label--org input { align-self: flex-start; margin-top: .1rem; }

.org-label-text {
    font-weight: 400;
    font-size: .75rem;
    color: var(--color-text-muted);
    font-family: var(--font-body);
}

/* Filteractions */
.reg-filter-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border-light);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    padding: .65rem 1.25rem;
    font-family: var(--font-heading);
    font-size: .875rem;
    font-weight: 700;
    border-radius: var(--radius);
    border: 2px solid var(--color-border);
    color: var(--color-text-muted);
    background: transparent;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.btn-outline:hover { border-color: var(--color-red); color: var(--color-red); text-decoration: none; }

.btn-export {
    display: inline-flex;
    align-items: center;
    padding: .65rem 1.25rem;
    font-family: var(--font-heading);
    font-size: .875rem;
    font-weight: 700;
    border-radius: var(--radius);
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #a5d6a7;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
}
.btn-export:hover { background: #c8e6c9; text-decoration: none; color: #1b5e20; }

/* Resultat */
.reg-result-header {
    margin-bottom: .75rem;
}

.reg-result-meta {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
}

.reg-page-info {
    font-weight: 400;
    color: var(--color-text-light);
    font-size: .85em;
}

.reg-lifespan-badge {
    font-family: var(--font-heading);
    font-size: .85rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: .25rem;
}
.reg-lifespan-badge strong { color: var(--color-red); }
.reg-lifespan-sub {
    font-size: .78rem;
    color: var(--color-text-light);
    margin-left: .2rem;
}

/* Paginering */
.reg-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.reg-page-numbers {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-wrap: wrap;
}

.reg-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 .75rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .85rem;
    border-radius: var(--radius);
    border: 2px solid var(--color-border-light);
    background: var(--color-surface);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: background .12s, border-color .12s, color .12s;
    white-space: nowrap;
}
.reg-page-btn:hover {
    border-color: var(--color-red);
    color: var(--color-red);
    text-decoration: none;
    background: var(--color-yellow-light);
}
.reg-page-btn--active {
    background: var(--color-red);
    border-color: var(--color-red);
    color: #fff;
    cursor: default;
}
.reg-page-btn--active:hover {
    background: var(--color-red);
    color: #fff;
}
.reg-page-btn--disabled {
    opacity: .35;
    cursor: default;
    pointer-events: none;
}
.reg-page-ellipsis {
    color: var(--color-text-light);
    font-family: var(--font-heading);
    padding: 0 .25rem;
}

.reg-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
    text-align: center;
}
.reg-empty-state svg { width: 48px; height: 48px; opacity: .3; }
.reg-empty-state p { font-size: .95rem; }

.results-table--reg td { vertical-align: top; }

.reg-details {
    font-size: .8rem;
    color: var(--color-text-muted);
    max-width: 220px;
}

.death-date { color: var(--color-red); font-weight: 600; }

.reg-sh-badge {
    display: inline-block;
    padding: .1rem .4rem;
    border-radius: 4px;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .75rem;
    letter-spacing: .03em;
}

.sort-link {
    color: var(--color-yellow);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}
.sort-link:hover { color: var(--color-yellow-light); text-decoration: underline; }

/* ── SH-trend per år ──────────────────────────────────────── */
.sh-trend-grid {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.sh-trend-row {
    display: grid;
    grid-template-columns: 3rem 1fr 7rem;
    align-items: center;
    gap: .75rem;
}

.sh-trend-year {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .75rem;
    color: var(--color-text-muted);
    text-align: right;
}

.sh-trend-total {
    font-family: var(--font-heading);
    font-size: .72rem;
    color: var(--color-text-light);
    text-align: right;
    line-height: 1.4;
}

.sh-trend-coverage {
    color: var(--color-text-light);
    opacity: .75;
}

.decade-coverage {
    color: var(--color-text-light);
    opacity: .8;
}

.sh-trend-bar {
    display: flex;
    height: 22px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--color-border-light);
}

.sh-trend-seg {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .65rem;
    color: rgba(255,255,255,.9);
    transition: opacity .15s;
    cursor: default;
    overflow: hidden;
    white-space: nowrap;
}
.sh-trend-seg:hover { opacity: .8; }

.sh-trend-seg--a { background: #2e7d32; }
.sh-trend-seg--b { background: var(--color-yellow); }
.sh-trend-seg--c { background: var(--color-red); }

.sh-trend-legend {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}

.sh-trend-legend-item {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .75rem;
    padding: .15rem .5rem;
    border-radius: 4px;
    color: #fff;
}
.sh-trend-legend-item--a { background: #2e7d32; }
.sh-trend-legend-item--b { background: var(--color-yellow); color: var(--color-ink); }
.sh-trend-legend-item--c { background: var(--color-red); }

.breeder-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1rem;
    color: var(--color-text);
    text-align: left;
    text-decoration: underline;
    text-decoration-color: var(--color-border);
    text-underline-offset: 3px;
    transition: color .15s;
}
.breeder-link:hover {
    color: var(--color-red);
    text-decoration-color: var(--color-red);
}

.breeder-city {
    color: var(--color-text-muted);
    font-size: .9em;
}

/* ── Rapporteringslänk på hundprofil ───────────────────────── */
.dog-report-cta {
    margin: .25rem 0 .5rem;
}

.dog-report-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .85rem;
    color: var(--color-text-muted);
    text-decoration: none;
    padding: .5rem .85rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    transition: border-color .15s, color .15s, background .15s;
}
.dog-report-link svg:first-child {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--color-red);
}
.dog-report-link:hover {
    border-color: var(--color-red);
    color: var(--color-red);
    background: var(--color-yellow-light);
    text-decoration: none;
}

.dog-report-link-ext {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    opacity: .4;
    margin-left: .1rem;
}

/* ── Stamtavla ────────────────────────────────────────────── */
.dog-pedigree {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border-light);
}

.pedigree-grid {
    display: flex;
    gap: 0;
    overflow-x: auto;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow);
}

.pedigree-col {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 160px;
}

.pedigree-col--1 { min-width: 180px; max-width: 220px; }
.pedigree-col--2 { min-width: 160px; }
.pedigree-col--3 { min-width: 160px; }
.pedigree-col--4 { min-width: 150px; }

.pedigree-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .25rem;
    padding: .65rem .9rem;
    border-bottom: 1px solid var(--color-border-light);
    border-right: 1px solid var(--color-border-light);
    min-height: 60px;
}
.pedigree-cell:last-child { border-bottom: none; }
.pedigree-col:last-child .pedigree-cell { border-right: none; }

.pedigree-cell--root {
    background: var(--color-surface-alt);
    border-right: 3px solid var(--color-red);
}

.pedigree-cell--empty {
    background: var(--color-bg);
    opacity: .5;
}

.pedigree-unknown {
    color: var(--color-text-light);
    font-size: .8rem;
}

.pedigree-reg {
    font-family: var(--font-mono);
    font-size: .72rem;
    color: var(--color-text-muted);
    font-weight: 600;
    letter-spacing: .02em;
}

.pedigree-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .78rem;
    color: var(--color-red);
    line-height: 1.3;
    text-decoration: none;
}
.pedigree-name:hover { color: var(--color-red-dark); text-decoration: underline; }

.pedigree-badge {
    font-size: .65rem;
    padding: .15rem .45rem;
    margin-top: .1rem;
    align-self: flex-start;
}

@media (max-width: 900px) {
    .pedigree-grid { font-size: .75rem; }
    .pedigree-col--1 { min-width: 130px; }
    .pedigree-col--2,
    .pedigree-col--3,
    .pedigree-col--4 { min-width: 120px; }
}

/* ── FAQ ──────────────────────────────────────────────────── */
.home-faq {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border-light);
}

.faq-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-red);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 1rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-surface);
    box-shadow: var(--shadow);
}

.faq-item {
    border-bottom: 1px solid var(--color-border-light);
}
.faq-item:last-child { border-bottom: none; }

.faq-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: .95rem;
    color: var(--color-text);
    transition: background .15s, color .15s;
}
.faq-btn:hover {
    background: var(--color-yellow-light);
    color: var(--color-red);
}
.faq-btn[aria-expanded="true"] {
    color: var(--color-red);
    background: var(--color-yellow-light);
}

.faq-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--color-text-muted);
    transition: transform .2s ease;
}
.faq-btn[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
    color: var(--color-red);
}

.faq-answer {
    padding: 0 1.25rem 1rem;
    font-size: .9rem;
    color: var(--color-text-muted);
    line-height: 1.7;
}
.faq-answer a {
    color: var(--color-red);
    font-weight: 600;
}
.faq-answer[hidden] { display: none; }

/* ── Responsive ───────────────────────────────────────────────── */

/* Desktop – utnyttja bredden bättre */
@media (min-width: 1024px) {
    .home-wrap     { max-width: 100%; }
    .stats-row     { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
    .stat-card     { padding: 1.75rem 1.5rem; }
    .stat-number   { font-size: 2.5rem; }
    .home-hero     { padding: 2rem 0 2.5rem; gap: 2rem; }
    .hero-logo-img { width: 110px; height: 110px; }
    .hero-title    { font-size: 2.75rem; }
    .results-table { font-size: .95rem; }
    .results-table thead th,
    .results-table td { padding: .85rem 1.25rem; }
}

/* Tablet */
@media (min-width: 640px) and (max-width: 1023px) {
    .stats-row { grid-template-columns: repeat(3, 1fr); }
    .search-row { gap: .75rem; }
}

/* Mobil */
@media (max-width: 639px) {
    .login-card            { padding: 2rem 1.25rem; }
    .hero-title            { font-size: 1.625rem; }
    .stat-number           { font-size: 1.625rem; }
    .stat-number.stat-date { font-size: 1.25rem; }
    .logo-name             { font-size: .8rem; }
    .logo-sub              { display: none; }
    .site-logo img         { width: 38px; height: 38px; }
    .results-table         { font-size: .8rem; }
    .results-table thead th,
    .results-table td      { padding: .5rem .65rem; }
}
