/* style.css - MODERN CLEAN SAAS 2026 */
:root {
    --bg-body: #f3f4f6;       /* Ljusgrå bakgrund */
    --bg-sidebar: #1f2937;    /* Mörkgrå professionell sidebar */
    --bg-card: #ffffff;
    --primary: #2563eb;       /* Modern klarblå */
    --primary-hover: #1d4ed8;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- SIDEBAR (PC & MOBIL) --- */
.sidebar {
    width: 250px;
    background-color: var(--bg-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    z-index: 1000;
}

.brand {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu { display: flex; flex-direction: column; gap: 5px; flex-grow: 1; }
.menu-item {
    padding: 12px 15px;
    text-decoration: none;
    color: #d1d5db;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}
.menu-item:hover, .menu-item.active {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
}
.menu-footer {
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    color: #9ca3af;
}
.lang-btn {
    color: #9ca3af; text-decoration: none; font-weight: bold; margin-right: 10px; font-size: 0.8rem;
}
.lang-btn.active { color: #fff; text-decoration: underline; }

/* --- MAIN CONTENT --- */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 30px;
    width: 100%;
}

/* --- CARDS (Modern Look) --- */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
}

h3 { margin-top: 0; margin-bottom: 20px; font-weight: 700; color: var(--text-main); font-size: 1.2rem; }

/* --- FORMS & INPUTS --- */
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.85rem; color: #374151; }
input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    transition: all 0.2s;
    font-family: inherit;
    color: var(--text-main);
}
input:focus, select:focus, textarea:focus { 
    border-color: var(--primary); 
    outline: none; 
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); 
}

/* --- BUTTONS --- */
.btn-primary, .btn-success, .btn-danger {
    display: inline-flex; justify-content: center; align-items: center;
    padding: 12px 24px; border-radius: 8px; font-weight: 600;
    cursor: pointer; border: none; text-decoration: none;
    transition: background 0.2s; font-size: 0.95rem;
    color: #ffffff !important;
}
.btn-primary { background-color: var(--primary); }
.btn-primary:hover { background-color: var(--primary-hover); }

.btn-success { background-color: var(--success); }
.btn-danger { background-color: var(--danger); padding: 8px 16px; font-size: 0.85rem; }
.btn-small { padding: 8px 16px; font-size: 0.85rem; }

/* --- TABLES & RESPONSIVE SCROLL --- */
.table-responsive {
    overflow-x: auto; /* Gör tabellen scrollbar på mobil */
    -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 600px; /* Tvinga bredd för scroll */ }
th { 
    text-align: left; padding: 15px; background: #f9fafb; 
    font-weight: 600; font-size: 0.85rem; color: #6b7280; 
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border); 
}
td { padding: 15px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 0.95rem; }

/* Input i tabeller */
table input { margin-bottom: 0; padding: 8px; min-width: 80px; font-size: 0.9rem; }

/* --- STATS GRID --- */
.stats-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
    gap: 20px; 
    margin-bottom: 30px; 
}
.stat-card {
    background: #fff; padding: 25px; border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.stat-lbl { color: var(--text-muted); font-size: 0.9rem; font-weight: 500; margin-bottom: 5px; }
.stat-num { font-size: 1.8rem; font-weight: 700; color: var(--text-main); }

/* --- BADGES --- */
.badge { padding: 6px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge.paid { background: #dcfce7; color: #166534; }
.badge.unpaid { background: #fee2e2; color: #991b1b; }

/* --- LOGIN PAGE --- */
.login-body {
    background-color: #f3f4f6; height: 100vh;
    display: flex; align-items: center; justify-content: center; margin: 0;
}
.login-box {
    background: #ffffff; padding: 40px; width: 100%; max-width: 400px;
    border-radius: 16px; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    text-align: center; border: 1px solid #e5e7eb;
}
.lang-switch { display: flex; justify-content: center; gap: 15px; margin-bottom: 25px; }
.lang-switch .lang-btn { margin: 0; text-transform: uppercase; font-size: 0.8rem; color: #9ca3af; }
.lang-switch .lang-btn.active { color: var(--primary); border-bottom: 2px solid var(--primary); text-decoration: none; }

/* --- MOBILE & RESPONSIVE --- */
.mobile-menu-toggle {
    display: none; /* Dold på PC */
    position: fixed; top: 15px; left: 15px; z-index: 1100;
    background: var(--bg-sidebar); color: #fff; border: none;
    padding: 10px 15px; border-radius: 8px; cursor: pointer; font-size: 1.2rem;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed; 
        top: 0; 
        left: 0; 
        height: 100%;
        transform: translateX(-100%); /* Göm menyn som standard */
        width: 80%; 
        max-width: 300px;
        box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }
    
    .sidebar.open { 
        transform: translateX(0); /* Visa menyn när den är öppen */ 
    }
    
    .mobile-menu-toggle { 
        display: block; /* Visa menyknappen på mobil */
    }
    
    .main-content { 
        padding: 60px 15px 20px 15px; /* Ge plats för knappen i toppen */ 
    }
    
    .grid-2 { 
        grid-template-columns: 1fr; /* Stapla kolumner på höjden */
    }
    
    .btn-small { 
        padding: 10px; /* Gör knappar lite större för touch */
    }
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.btn-remove { background: #fee2e2; color: #ef4444; border: 1px solid #fca5a5; border-radius: 6px; padding: 8px 12px; cursor: pointer; font-weight: bold; }
.btn-remove:hover { background: #fecaca; }
.profile-switch { display: flex; gap: 20px; margin-bottom: 20px; align-items: center; }
.profile-switch label { margin: 0; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.profile-switch input { width: auto; margin: 0; transform: scale(1.2); }

@media print { .sidebar, .mobile-menu-toggle { display: none; } }
/* --- MODERN SCROLLBAR --- */
/* Fungerar i Chrome, Edge och Safari */
::-webkit-scrollbar {
    width: 8px; /* Smalare */
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent; 
}

::-webkit-scrollbar-thumb {
    background: #d1d5db; /* Ljusgrå */
    border-radius: 4px; /* Rundad */
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af; /* Mörkare när man pekar på den */
}