/* ==============
   Base layout
   ============== */

:root {
    --bg-page: #f5f5f7;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f0f0f3;

    --border-subtle: #e0e0e5;
    --border-strong: #c2c2cc;

    --text-main: #222222;
    --text-muted: #666666;
    --text-inverse: #ffffff;

    --accent: #2563eb;          /* primary blue */
    --accent-soft: #dbeafe;
    --accent-strong: #1d4ed8;

    --danger: #dc2626;
    --danger-soft: #fee2e2;

    --warning: #f97316;
    --warning-soft: #ffedd5;

    --success: #16a34a;
    --success-soft: #dcfce7;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-soft: 0 2px 4px rgba(15, 23, 42, 0.06);
    --shadow-strong: 0 6px 16px rgba(15, 23, 42, 0.12);

    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "Roboto", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-main);
    background: radial-gradient(circle at 0 0, #e0f2fe 0, #f5f5f7 55%) fixed;
}

/* Container around page content */
.page-content {
    max-width: 1100px;
    margin: 80px auto 40px auto;
    padding: 0 16px;
}

/* Headings */

h1, h2, h3, h4 {
    margin: 0 0 0.5em 0;
    font-weight: 600;
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.4rem;
}

h3 {
    font-size: 1.15rem;
}

/* Text helpers */

.muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
    background: #f3f4f6;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
}

/* ==============
   Topbar / navigation
   ============== */

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.96);
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
    z-index: 1000;
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-title {
    color: var(--text-inverse);
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.03em;
    font-size: 1.05rem;
}

.brand-title:hover {
    text-decoration: underline;
}

/* Navigation */

.nav-right {
    display: flex;
    align-items: center;
}

/* Desktop nav */

.main-nav {
    display: flex;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    color: rgba(248, 250, 252, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.nav-link:hover {
    background: rgba(148, 163, 184, 0.25);
    color: #ffffff;
    transform: translateY(-1px);
}

.nav-link.active {
    background: #e5e7eb;
    color: #111827;
}

/* Dropdown */

.nav-item-dropdown > .nav-link {
    padding-right: 20px;
}

.nav-caret {
    margin-left: 4px;
    font-size: 0.7rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: #0f172a;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 6px 0;
    list-style: none;
    margin: 0;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.4);
    display: none;
    z-index: 1001;
}

.nav-item-dropdown:hover > .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 6px 12px;
    color: rgba(226, 232, 240, 0.9);
    font-size: 0.9rem;
    text-decoration: none;
}

.dropdown-menu a:hover {
    background: rgba(148, 163, 184, 0.25);
    color: rgba(226, 232, 240, 0.9);

}

/* Mobile nav toggle */

/* Mobile nav toggle */

.nav-toggle {
    display: none;
}

/* Button: burger + label text */
.nav-toggle-btn {
    display: none; /* shown only on mobile */
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    cursor: pointer;
    color: #e5e7eb;
    font-size: 0.85rem;
}

.nav-toggle-btn span {
    display: block;
}


/* last span is the "Meny" text */
.nav-toggle-label-text {
    background: none;
    width: auto;
    height: auto;
}

/* Desktop vs mobile nav behaviour */

/* Desktop (>= 769px) */
@media (min-width: 769px) {
    .main-nav {
        display: flex;
    }

    .nav-toggle-btn {
        display: none;
    }
}

/* ==============
   Buttons / actions
   ============== */

.btn,
button,
input[type="submit"] {
    font-family: inherit;
    font-size: 0.95rem;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 6px 14px;
    cursor: pointer;
    background: var(--accent);
    color: var(--text-inverse);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    line-height: 1.3;
    transition: background-color 0.12s ease, box-shadow 0.12s ease, transform 0.05s ease;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    background: var(--accent-strong);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.btn:disabled,
button:disabled,
input[type="submit"]:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent-soft);
}

.btn-secondary:hover {
    background: var(--accent-soft);
}

/* Page-level actions bar */

.page-actions {
    margin: 0 0 1rem 0;
    display: flex;
    justify-content: flex-end;
}

/* ==============
   Forms
   ============== */

form {
    margin: 1rem 0;
}

.form-row {
    margin-bottom: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-row label {
    font-weight: 500;
    font-size: 0.93rem;
}

.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="date"],
.form-row input[type="email"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
    font-family: inherit;
    font-size: 0.95rem;
    padding: 7px 9px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: #ffffff;
    outline: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft);
    background: #ffffff;
}

.form-row small {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.form-actions {
    margin-top: 1rem;
    display: flex;
    gap: 8px;
    align-items: center;
}

.form-actions a {
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text-muted);
}

.form-actions a:hover {
    text-decoration: underline;
}

.form-inline {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Fieldset for grouped things (like match sales) */

.form-fieldset {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.8rem;
    margin: 1rem 0;
    background: var(--bg-surface-alt);
}

.form-fieldset legend {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 0.4rem;
}

/* ==============
   Tables
   ============== */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.table th,
.table td {
    padding: 6px 10px;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    text-align: left;
    font-weight: 600;
    background: #f9fafb;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #4b5563;
}

.table-striped tr:nth-child(even) td {
    background: #f9fafb;
}

.table-compact th,
.table-compact td {
    padding: 4px 8px;
}

/* Tables that can become cards on mobile */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.table--cards {
    width: 100%;
}

/* ==============
   Cards / dashboard
   ============== */

.cards-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

@media (min-width: 900px) {
    .cards-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.card {
    background: rgba(255, 255, 255, 0.96);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: var(--shadow-strong);
    overflow: hidden;
}

.card-header {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    background: linear-gradient(135deg, #eff6ff, #f9fafb);
}

.card-header h2 {
    font-size: 1.05rem;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.card-body {
    padding: 12px 14px 14px 14px;
}

.card-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 16px;
}

@media (max-width: 800px) {
    .card-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}

.card-column h3 {
    margin-top: 0;
    margin-bottom: 0.4rem;
}

/* ==============
   Alerts & badges
   ============== */

.alert {
    border-radius: var(--radius-md);
    padding: 8px 10px;
    margin: 0.7rem 0;
    font-size: 0.9rem;
}

.alert ul {
    margin: 0.4rem 0 0.2rem 1.2rem;
    padding: 0;
}

.alert-error {
    background: var(--danger-soft);
    border: 1px solid var(--danger);
    color: #7f1d1d;
}

.alert-warning {
    background: var(--warning-soft);
    border: 1px solid var(--warning);
    color: #7c2d12;
}

.alert-success {
    background: var(--success-soft);
    border: 1px solid var(--success);
    color: #14532d;
}

.alert-info {
    background: #e0f2fe;
    border: 1px solid #0ea5e9;
    color: #0c4a6e;
	padding: 10px;
	display: block;
}

/* Badges */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.badge-primary {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-strong);
}

.badge-muted {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #4b5563;
}

/* ==============
   Misc
   ============== */

a {
    color: var(--accent-strong);
}

a:hover {
    color: #1e3a8a;
}

/* =====================================
   MOBILE OVERRIDES
   ===================================== */
@media (max-width: 768px) {

    /* Typography / base layout */
    body {
        font-size: 17px;  /* slightly bigger base text on phones */
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.7rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .page-content {
        max-width: 100%;
        margin: 70px auto 20px auto;
        padding: 0 10px;
    }

    /* Forms & buttons a bit bigger */
    .form-row input[type="text"],
    .form-row input[type="password"],
    .form-row input[type="date"],
    .form-row input[type="email"],
	.form-row input[type="number"],
    .form-row select,
    .form-row textarea {
        font-size: 1rem;
        padding: 8px 10px;
    }

    .btn,
    button,
    input[type="submit"] {
        padding: 8px 14px;
        font-size: 1rem;
    }

    /* NAV: mobile behaviour */

    .topbar-inner {
        padding: 8px 10px;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .nav-right {
        width: 100%;
        display: block;
    }

    .main-nav {
        display: none;       /* hidden by default on mobile, opened by checkbox */
        width: 100%;
        margin-top: 6px;
    }

    /* SHOW the burger on mobile */
    .nav-toggle-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 4px 8px;
        border-radius: 999px;
        border: 1px solid rgba(148, 163, 184, 0.6);
        cursor: pointer;
        color: #e5e7eb;
        font-size: 0.85rem;
    }

    /* Burger group */
    .nav-toggle-btn .burger {
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    /* Burger lines */
    .nav-toggle-btn .burger span {
        width: 18px;
        height: 2px;
        background: #e5e7eb;
        border-radius: 999px;
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 6px 0 4px 0;
    }

    .nav-link {
        border-radius: 8px;
        width: 100%;
    }

    /* When the burger checkbox is checked, show the menu */
    .nav-toggle:checked ~ .nav-right .main-nav {
        display: block;
    }

    /* Dropdowns behave as inline submenus rather than hover flyouts */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0 0 0 14px;
        margin-top: 2px;
    }

    .dropdown-menu a {
        padding: 4px 0;
    }
    /* TABLES: turn into cards on mobile */

    .table--cards {
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .table--cards thead {
        display: none;
    }

    .table--cards tbody {
        display: block;
    }

    .table--cards tr {
        display: block;
        margin-bottom: 12px;
        background: #ffffff;
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
        border: 1px solid #e5e7eb;
        overflow: hidden;
    }

    .table--cards td {
        display: block;
        border-bottom: 1px solid #e5e7eb;
        padding: 6px 10px;
        font-size: 0.9rem;
    }

    .table--cards td:last-child {
        border-bottom: none;
    }

    .table--cards td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #6b7280;
        margin-bottom: 2px;
        font-weight: 600;
    }
	 .lang-select-form {
        margin-left: 0;
        margin-top: 6px;
    }
	 .lang-select-form {
        width: 100%;
        margin-top: 6px;
        margin-left: 0;
    }

    .lang-select {
        width: 100%;
        box-sizing: border-box;
        border-radius: 8px;
        background: #111827;
    }
}

/* Language select in topbar */
.lang-select-form {
    margin-left: 8px;
}

.lang-select {
    background: transparent;
    color: #e5e7eb;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    padding: 4px 10px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
}

/* Remove ugly default background on some browsers */
.lang-select option {
    color: #ffffff;
}

/* Language selector – desktop defaults */
.lang-select-form {
    margin-left: 8px;
}

.lang-select {
    font-family: inherit;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: #0f172a;
    color: #e5e7eb;
    min-width: 110px;  /* don't be tiny on desktop */
}

/* Fix the legend sitting on the border edge */
.form-fieldset legend {
    display: table;
    padding: .25em .6em;
    margin-bottom: .5em;
	background: var(--bg-surface-alt);
    border-radius: 4px;

}.card legend {
    display: table;          /* stops 'border notch' behaviour */
    padding: .25em .6em;
    margin: 0 0 .5em 0;      /* space under it instead of cutting border */
    font-weight: 600;
 background: #ffffff;     /* optional */
    border-radius: 4px;      /* optional */
}

/* Gives space so content doesn't collide with title */
fieldset.card {
    padding: 1em;
}

