/* ---- Base / Public ---- */
body {
    font-family: 'Segoe UI', sans-serif;
    margin: 40px auto;
    max-width: 1200px;
    padding: 0 20px;
    background-color: #f9f9f9;
}

header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 30px;
}
.header-rad1 {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.header-sponsorer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.header-sponsorer .sponsor-etikett {
    text-align: right;
}
.header-sponsorer .sponsor-logoer {
    justify-content: flex-end;
}
@media (max-width: 640px) {
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .header-sponsorer {
        align-items: flex-start;
        border-top: 1px solid #e8e8e8;
        padding: 10px 0 4px;
    }
    .header-sponsorer .sponsor-etikett { text-align: left; }
    .header-sponsorer .sponsor-logoer  { justify-content: flex-start; }
}
header img {
    height: 60px;
    margin-right: 20px;
}
h1 {
    margin: 0;
    font-size: 28px;
}

nav {
    margin-bottom: 20px;
}
nav a {
    margin-right: 16px;
}

table {
    border-collapse: collapse;
    width: 100%;
    background-color: white;
}
th, td {
    padding: 6px 8px;
    border: 1px solid #ccc;
    text-align: center;
}
th {
    background-color: #e9f1fb;
}
tr:nth-child(even) {
    background-color: #f3f3f3;
}
tr.plassering-1 { background-color: #dff0d8; font-weight: bold; }
tr.plassering-2 { background-color: #fcf8e3; }
tr.plassering-3 { background-color: #e6dada; }

strong { font-weight: bold; }
a { text-decoration: none; color: #0066cc; }
a:hover { text-decoration: underline; }

/* ---- Details/summary arrow ---- */
details .details-arrow { display:inline-block; transition:transform 0.15s; }
details:not([open]) .details-arrow { transform:rotate(-90deg); }

/* ---- Breadcrumb nav ---- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    font-size: 13px;
}
.breadcrumb a {
    background: #ecf0f1;
    color: #2c3e50;
    padding: 4px 10px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s;
}
.breadcrumb a:hover { background: #d5dbdb; text-decoration: none; }
.breadcrumb a.active {
    background: #2c3e50;
    color: white;
    cursor: default;
}
.breadcrumb-sep { color: #bdc3c7; font-size: 11px; }

/* ---- Alert boxes ---- */
.success { color: #2d6a4f; background: #d8f3dc; padding: 8px 12px; border-radius: 4px; margin: 10px 0; display:block; }
.error   { color: #9b2335; background: #f8d7da; padding: 8px 12px; border-radius: 4px; margin: 10px 0; display:block; }
.info    { color: #084298; background: #cfe2ff; padding: 8px 12px; border-radius: 4px; margin: 10px 0; display:block; }

/* ---- Form elements (shared) ---- */
form input[type="text"],
form input[type="number"],
form input[type="password"],
form input[type="email"],
form select,
form textarea {
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: inherit;
    font-size: 14px;
}
form button, form input[type="submit"] {
    padding: 6px 14px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}
form button:hover { background: #1a252f; }
form button.danger { background: #c0392b; }
form button.danger:hover { background: #96281b; }
form button.secondary { background: #7f8c8d; }
form button.secondary:hover { background: #626f70; }

a.button-link {
    display: inline-block;
    padding: 6px 14px;
    background: #2c3e50;
    color: white;
    border-radius: 3px;
    font-size: 13px;
    text-decoration: none;
}
a.button-link:hover { background: #1a252f; text-decoration: none; }

/* ---- Admin layout ---- */
body.admin-body {
    margin: 0;
    padding: 0;
    max-width: none;
    display: flex;
    min-height: 100vh;
    background: #ecf0f1;
}

.admin-sidenav {
    width: 220px;
    flex-shrink: 0;
    background: #2c3e50;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidenav-header {
    padding: 20px 16px 16px;
    border-bottom: 1px solid #3d5166;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.admin-logo-text {
    color: #ecf0f1;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}
.admin-badge {
    display: inline-block;
    background: #e67e22;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    width: fit-content;
}

.admin-sidenav ul {
    list-style: none;
    margin: 8px 0;
    padding: 0;
    flex: 1;
}
.admin-sidenav ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: #bdc3c7;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.admin-sidenav ul li a:hover,
.admin-sidenav ul li a.aktiv {
    background: #3d5166;
    color: #ecf0f1;
    text-decoration: none;
}
.admin-sidenav ul li a.aktiv {
    border-left: 3px solid #e67e22;
    padding-left: 13px;
}
.nav-ikon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.admin-sidenav-footer {
    padding: 12px 16px;
    border-top: 1px solid #3d5166;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.admin-sidenav-footer a {
    color: #95a5a6;
    font-size: 13px;
    text-decoration: none;
}
.admin-sidenav-footer a:hover { color: #ecf0f1; }
.admin-sidenav-footer a.logg-ut { color: #e74c3c; }
.admin-sidenav-footer a.logg-ut:hover { color: #ff6b6b; }

.admin-main {
    flex: 1;
    padding: 32px 40px;
    max-width: 1100px;
    background: #f5f6fa;
    min-height: 100vh;
}
.admin-main h1 {
    margin-top: 0;
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 8px;
}
.admin-main h2 {
    font-size: 18px;
    color: #34495e;
    margin-top: 28px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #dde3ea;
}

/* ---- Admin dashboard cards ---- */
.admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 24px;
}
.admin-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: #2c3e50;
    border: 1px solid #dde3ea;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.admin-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    border-color: #b0c4de;
    text-decoration: none;
    color: #2c3e50;
}
.admin-card .card-ikon {
    font-size: 28px;
}
.admin-card .card-tittel {
    font-weight: 600;
    font-size: 15px;
}
.admin-card .card-beskrivelse {
    font-size: 12px;
    color: #7f8c8d;
    line-height: 1.4;
}
.admin-card.primary { border-left: 4px solid #2980b9; }
.admin-card.success { border-left: 4px solid #27ae60; background: white; color: #2c3e50; }
.admin-card.warning { border-left: 4px solid #e67e22; }

/* ---- Admin table improvements ---- */
.admin-main table {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dde3ea;
}
.admin-main th {
    background: #34495e;
    color: white;
    border-color: #3d5166;
    font-weight: 500;
    font-size: 13px;
}
.admin-main td {
    font-size: 13px;
    border-color: #e8ecf0;
}

/* ---- Admin form layout ---- */
.admin-form-box {
    background: white;
    border-radius: 8px;
    padding: 20px 24px;
    border: 1px solid #dde3ea;
    margin-bottom: 24px;
}
.admin-form-box h2 {
    margin-top: 0;
    border: none;
    padding: 0;
    margin-bottom: 16px;
}
.form-rad {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
}
.form-rad label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: #555;
}
.form-rad input[type="text"],
.form-rad input[type="number"],
.form-rad select,
.form-rad textarea {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

/* ---- Hamburger menu ---- */
.hamburger-menu { display: none; position: relative; }

.hamburger-btn {
    list-style: none;
    font-size: 24px;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 6px;
    color: #2c3e50;
    flex-shrink: 0;
}
.hamburger-btn::-webkit-details-marker { display: none; }
.hamburger-btn::marker { display: none; }

.hamburger-nav {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #dde3ea;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 240px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 8px 0;
    z-index: 100;
}
.hamburger-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.hamburger-nav ul li a {
    display: block;
    padding: 9px 20px;
    font-size: 14px;
    color: #2c3e50;
    text-decoration: none;
}
.hamburger-nav ul li a:hover {
    background: #f0f4f8;
    text-decoration: none;
}
.hamburger-nav ul li {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.hamburger-nav ul li a:first-child {
    flex: 1;
}
.ham-liveweb {
    font-size: 11px;
    color: #e67e22;
    text-decoration: none;
    padding: 9px 20px 9px 8px;
    white-space: nowrap;
}
.ham-liveweb:hover { text-decoration: underline; color: #e67e22; }

.ham-section {
    margin: 8px 0 2px;
    padding: 4px 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #95a5a6;
}
.ham-section:first-child { margin-top: 0; }

/* ---- Responsive table wrapper ---- */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- Mobile breakpoint ---- */
@media (max-width: 640px) {
    body {
        margin: 12px auto;
        padding: 0 12px;
    }
    header img { height: 40px; }
    h1 { font-size: 20px; }

    /* Vis hamburger, skjul sidebar på mobil */
    .hamburger-menu { display: block; }
    .index-sidebar { display: none; }

    header {
        justify-content: space-between;
        align-items: center;
    }

    /* index.php: sidebar øverst, innhold under */
    .index-layout {
        flex-direction: column;
    }
    .index-layout > div:first-child {
        min-width: unset !important;
        max-width: unset !important;
        width: 100%;
    }

    /* klasse.php: skjul per-bane-kolonner */
    .bane-kolonne { display: none; }

    /* index.php: innhold fyller full bredde når sidebar er skjult */
    .index-main { width: 100%; min-width: 0; }
}

/* ---- Sponsor-striper ---- */
.sponsor-strip {
    text-align: center;
    padding: 16px 0 12px;
    border-top: 1px solid #e8e8e8;
    margin-top: 40px;
}
.sponsor-etikett {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #aaa;
    margin-bottom: 10px;
}
.sponsor-logoer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 28px;
}
.header-sponsorer .sponsor-logoer img    { max-width: 200px; max-height: 80px; }
.sponsor-strip .sponsor-logoer img       { max-width: 150px; max-height: 60px; }
.sponsor-logoer img {
    object-fit: contain;
    opacity: 0.9;
    transition: opacity 0.2s;
}
.sponsor-logoer a:hover img,
.sponsor-logoer img:hover { opacity: 1; }

@media (max-width: 640px) {
    .header-sponsorer .sponsor-logoer img    { max-width: 140px; max-height: 56px; }
    .sponsor-strip .sponsor-logoer img       { max-width: 110px; max-height: 44px; }
    .sponsor-logoer { gap: 16px; }
}

/* ---- Bildegalleri (skytter.php) ---- */
.bilde-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.bilde-kort {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dde3ea;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.bilde-kort img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    transition: opacity .15s;
}
.bilde-kort a:hover img { opacity: .9; }
.bilde-kort figcaption {
    font-size: 11px;
    color: #7f8c8d;
    padding: 6px 10px;
    line-height: 1.4;
}
