﻿:root {
    --primary: #2C3E50;
    --secondary: #18BC9C;
    --danger: #E74C3C;
    --bg: #F8F9FA;
    --text: #333;
}

* {
    box-sizing: border-box
}

body.bg {
    background: var(--bg);
    color: var(--text);
    margin: 0;
    font-family: system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb
}

.brand {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.2rem
}

.navlink {
    margin-right: 1rem;
    text-decoration: none;
    color: var(--primary)
}

.inline {
    display: inline
}

.btn {
    padding: .5rem .9rem;
    border-radius: .5rem;
    border: 1px solid #e5e7eb;
    cursor: pointer
}

.btn-primary {
    background: var(--secondary);
    border-color: var(--secondary)
}

.btn-secondary {
    background: #fff;
    color: var(--primary)
}

.card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    padding: 1rem;
    margin-bottom: 1rem
}

.grid {
    display: grid;
    gap: 1rem
}

.grid-3 {
    grid-template-columns: repeat(3,1fr)
}

.input, .textarea, .select {
    width: 100%;
    padding: .6rem;
    border: 1px solid #d1d5db;
    border-radius: .5rem
}

.label {
    font-size: .9rem;
    color: #555;
    margin-bottom: .25rem;
    display: block
}

.help {
    font-size: .8rem;
    color: #6b7280
}

.badge {
    display: inline-block;
    padding: .15rem .5rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: .75rem
}

    .badge.green {
        background: #ECFDF5;
        color: #065F46;
        border-color: #A7F3D0
    }

    .badge.yellow {
        background: #FFFBEB;
        color: #92400E;
        border-color: #FCD34D
    }

    .badge.gray {
        background: #F3F4F6;
        color: #374151;
        border-color: #E5E7EB
    }

.table {
    width: 100%;
    border-collapse: collapse
}

    .table th, .table td {
        padding: .6rem;
        border-bottom: 1px solid #e5e7eb;
        text-align: left
    }

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0
}

.brand img {
    display: block;
    height: 40px;
    width: auto;
}

.notif-icon {
    font-size: 1.5rem; /* lite större */
    color: #20c997; /* samma gröna som Bootstrap btn-success / GoPlan-knappen */
    cursor: pointer;
}

/* --- Fix: gör att 'Öppna'-knappen bara tar sin egen yta --- */
.card {
    position: relative;
}

    .card a.btn {
        position: relative !important; /* inte absolute */
        display: inline-block !important; /* inte block/100% */
        width: auto !important;
        height: auto !important;
        z-index: 1;
        pointer-events: auto;
    }

        /* Om någon global regel lägger ett overlay via pseudo-element */
        .card a.btn::before,
        .card a.btn::after {
            content: none !important;
        }

    /* Säkerställ att inga andra <a> i kortet blir utsträckta */
    .card > a {
        display: inline;
        position: static;
    }

/* Bas-typografi med clamp: skalar mellan mobil & desktop */
:root {
    --step-0: clamp(14px, 1.6vw, 16px);
    --step-1: clamp(18px, 2vw, 20px);
}

body {
    font-size: var(--step-0);
}

h1, .h1 {
    font-size: var(--step-1);
}

/* Mindre paddings på mobil */
@media (max-width: 576px) {
    .card-body {
        padding: 1rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Fix för kort med lika höjd + knapp i botten */
.card {
    display: flex;
    flex-direction: column;
}

.card-footer {
    margin-top: auto;
}

/* Horisontell scrollindikation för tabeller (valfritt) */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive {
    max-height: 70vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.table thead th {
    position: sticky;
    top: 0;
}
/* Trimma celler på mycket små skärmar */
@media (max-width: 576px) {
    .table td, .table th {
        white-space: nowrap;
    }

        .table td.text-break {
            white-space: normal;
        }
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border-radius: 50px; /* rundad */
    padding: .35rem .9rem;
    font-weight: 500;
    transition: all .2s ease;
    text-decoration: none;
}

    .back-link:hover {
        background-color: #f3f4f6; /* ljus grå */
        box-shadow: 0 1px 3px rgba(0,0,0,.1);
        text-decoration: none;
    }

    .back-link i {
        font-size: 1rem;
    }
