.hidden {
    display: none !important;
}
/* Se till att layouten är gömd tills vi loggat in */
.layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    align-items: stretch; /* Återställer så innehållet fyller skärmen korrekt */
}

.layout.hidden {
    display: none !important;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1e293b;
    color: #f8fafc;
    min-height: 100vh;
    display: flex;
    justify-content: center; /* Centrerar horisontellt */
    align-items: center;     /* Centrerar vertikalt */
}

.footer-link {
    color: #94a3b8; /* En diskret gråblå färg */
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-link:hover {
    color: #f8fafc; /* Lyser upp lite när man hovrar */
    text-decoration: underline;
}

.sidebar {
    width: 250px;
    background-color: #0f172a; /* Mörkblå menyrad */
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #334155;
    box-sizing: border-box;
}

.sidebar h2 {
    color: #38bdf8;
    font-size: 1.2rem;
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: 2px;
}

.sidebar a {
    color: #cbd5e1;
    text-decoration: none;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar a:hover {
    background-color: #1e293b;
    color: #38bdf8;
}

.logout-link {
    margin-top: auto; /* Trycker ner elementet till botten */
    margin-bottom: 20px; /* Ger marginalen på "någon cm" från botten */
    color: #ff9999; /* Valfritt: gör den röd så man ser den */
}

.content {
    flex: 1;
    padding: 30px;
    background-color: #1e293b;
}

/* Knappar */
button, .button {
    background-color: #0ea5e9; /* Ljusblå knappar */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

button:hover {
    background-color: #0284c7;
}

button.danger { background-color: #ef4444; }
button.danger:hover { background-color: #dc2626; }
button.secondary { background-color: #64748b; }
button.secondary:hover { background-color: #475569; }

/* Kort (Cards) */
.card {
    background-color: #334155;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

.card-constrained {
    max-width: 800px;
}

/* --- NYA STATISTIKKORTEN --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #334155;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border-top: 4px solid #0ea5e9;
}

.stat-card i {
    font-size: 2rem;
    color: #38bdf8;
    margin-bottom: 10px;
}

.stat-card h3 {
    margin: 10px 0 5px 0;
    font-size: 1.8rem;
    color: #f8fafc;
}

.stat-card p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Input fält & Tabell */
.input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    background-color: #0f172a;
    border: 1px solid #475569;
    color: white;
    border-radius: 6px;
    box-sizing: border-box;
}

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #475569;
}

/* Ny design för Mötestabellen */
.doc-badge {
    background-color: #38bdf8;
    color: #0f172a;
    font-weight: bold;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

/* Osynliga knappar med färgade ikoner för hover-effekt */
.icon-action {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 6px 10px;
    border-radius: 6px;
    transition: 0.2s;
}

.icon-action.folder { color: #38bdf8; }
.icon-action.folder:hover { background-color: rgba(56, 189, 248, 0.15); }

.icon-action.trash { color: #ef4444; }
.icon-action.trash:hover { background-color: rgba(239, 68, 68, 0.15); }

/* Flik-navigering (Tabs) */
.tabs { display: flex; border-bottom: 1px solid #475569; margin-bottom: 20px; gap: 20px; overflow-x: auto; }
.tab-btn { background: none; border: none; color: #94a3b8; font-size: 1rem; padding: 10px 15px; cursor: pointer; border-bottom: 3px solid transparent; transition: 0.3s; white-space: nowrap; }
.tab-btn:hover { color: #f8fafc; }
.tab-btn.active { color: #38bdf8; border-bottom-color: #38bdf8; font-weight: bold; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Status Etiketter */
.status-badge { padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; text-align: center; display: inline-block; min-width: 60px; }
.status-aktuell { background-color: rgba(34, 197, 94, 0.2); color: #4ade80; } /* Grön */
.status-ny { background-color: rgba(56, 189, 248, 0.2); color: #7dd3fc; } /* Blå */
.status-utkast { background-color: rgba(148, 163, 184, 0.2); color: #cbd5e1; } /* Grå */

/* Dropdown Meny (3 prickar) */
.dropdown { position: relative; display: inline-block; }
.dropdown-content { display: none; position: absolute; right: 0; background-color: #1e293b; min-width: 180px; box-shadow: 0 8px 16px rgba(0,0,0,0.5); border: 1px solid #475569; border-radius: 6px; z-index: 10; }
.dropdown-content button { width: 100%; text-align: left; background: none; color: #f8fafc; padding: 10px 15px; border-radius: 0; font-size: 0.9rem; }
.dropdown-content button:hover { background-color: #334155; color: #38bdf8; }
.show { display: block; }

/* --- TOP BAR (Sök & Profil) --- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #1e293b;
    padding-bottom: 20px;
    border-bottom: 1px solid #334155;
    margin-bottom: 30px;
}

/* Sökrutan */
.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}
.search-container i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}
.search-container input {
    width: 100%;
    padding: 10px 10px 10px 40px;
    background-color: #0f172a;
    border: 1px solid #475569;
    color: white;
    border-radius: 20px; /* Runda kanter på sökrutan */
    outline: none;
    transition: 0.3s;
}
.search-container input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* Profil-delen */
.profile-dropdown {
    position: relative;
    display: inline-block;
}
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 30px;
    transition: 0.2s;
}
.profile-trigger:hover {
    background-color: #334155;
}
.profile-trigger img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.profile-trigger span {
    font-weight: bold;
    color: #f8fafc;
}
.profile-menu-content {
    top: 50px; /* Skjuter ner menyn lite under profilen */
    right: 0;
    min-width: 150px;
}

#login-section {
    width: 100%;
    max-width: 400px; /* Gör rutan lagom bred */
    background-color: #334155;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 10px 15px rgba(0,0,0,0.5);
    text-align: center;
}