/*
===========================================
  KOMMUNINVENT - KONSOLIDERAD STYLESHEET
===========================================

INNEHÅLLSFÖRTECKNING:
---------------------
1. VARIABLER & ROOT
   1.1 Standard tema
   1.2 Mörkt tema
   1.3 Naturligt tema
   1.4 Kontrast tema
   1.5 Solnedgång tema
2. RESET & BASE STYLES
3. GEMENSAMMA KOMPONENTER
   3.1 Body & Container
   3.2 Header & Navigation
   3.3 Tema-väljare (Dropdown)
   3.4 Formulär (Input, Select, Textarea)
   3.5 Knappar
   3.6 Meddelanden (Error/Success)
   3.7 Loading & Spinner
   3.8 Help Text & Labels
4. SIDSPECIFIKA KOMPONENTER
   4.1 Progress Bar (Lokalinfo, Verksamhet)
   4.2 System Grid (Portal)
   4.3 Profile & Tabs (Mina Sidor)
   4.4 Login Layout
   4.5 Modal (Ärendedetaljer)
   4.6 Ärenden Tabell
5. ANIMATIONER
6. RESPONSIVA BREAKPOINTS

===========================================
*/

/* ===========================================
   1. VARIABLER & ROOT
   =========================================== */

/* --- 1.1 STANDARD TEMA (Lila-Blå) --- */
:root {
    /* Färger */
    --feid-off-white: #f7f6f7;
    --feid-white: #ffffff;
    --feid-purple: #3E3A94;
    --feid-blue: #0A98E7;
    --success-green: #4CAF50;
    --warning-orange: #ff9800;
    --error-red: #f44336;
    
    /* Gradient */
    --gradient-start: #3E3A94;
    --gradient-end: #0A98E7;
    
    /* Text färger */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.7);
    
    /* Typografi */
    --feid-primary-font: "Montserrat", Helvetica, Arial, sans-serif;
    
    /* Spacing */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 40px;
}

/* --- 1.2 MÖRKT TEMA --- */
body.theme-dark {
    --feid-purple: #5a52d4;
    --feid-blue: #1cb0ff;
    --gradient-start: #1a1a2e;
    --gradient-end: #16213e;
    --feid-off-white: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.6);
}

/* --- 1.3 NATURLIGT TEMA (Grön-Turkos) --- */
body.theme-nature {
    --feid-purple: #2e7d32;
    --feid-blue: #00897b;
    --gradient-start: #1b5e20;
    --gradient-end: #004d40;
    --success-green: #66bb6a;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.95);
    --text-muted: rgba(255, 255, 255, 0.75);
}

/* --- 1.4 KONTRAST TEMA (Hög tillgänglighet) --- */
body.theme-contrast {
    --feid-purple: #000000;
    --feid-blue: #ffeb3b;
    --gradient-start: #212121;
    --gradient-end: #424242;
    --success-green: #ffeb3b;
    --warning-orange: #ffd54f;
    --error-red: #ff1744;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-muted: #e0e0e0;
}

/* --- 1.5 SOLNEDGÅNG TEMA (Orange-Blå) --- */
body.theme-sunset {
    --feid-purple: #FF6B35;
    --feid-blue: #004E89;
    --gradient-start: #FF6B35;
    --gradient-end: #004E89;
    --success-green: #00A878;
    --warning-orange: #FFB627;
    --error-red: #D62828;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.95);
    --text-muted: rgba(255, 255, 255, 0.8);
}

/* ===========================================
   2. RESET & BASE STYLES
   =========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--feid-primary-font);
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    transition: background 0.5s ease, color 0.3s ease;
}

/* ===========================================
   3. GEMENSAMMA KOMPONENTER
   =========================================== */

/* --- 3.1 Body & Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* --- 3.2 Header & Navigation --- */
.header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.header h1 {
    color: var(--text-primary);
    font-size: 24px;
}

.header p {
    font-size: 16px;
    opacity: 0.9;
    margin: 0;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-buttons {
    display: flex;
    gap: 15px;
}

/* Dashboard-specifik header */
.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right {
    display: flex;
    gap: 15px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.user-welcome {
    color: var(--text-primary);
}

.user-welcome h2 {
    font-size: 20px;
    margin-bottom: 5px;
}

.user-welcome p {
    font-size: 14px;
    opacity: 0.9;
}

.btn-back {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--feid-primary-font);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-logout {
    background: rgba(244, 67, 54, 0.8);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--feid-primary-font);
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-logout:hover {
    background: rgba(244, 67, 54, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.btn-profile {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--feid-primary-font);
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-profile:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* --- 3.3 Tema-väljare (Dropdown) --- */
.theme-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.theme-selector label {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.theme-selector select {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--feid-primary-font);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-selector select:hover {
    background: rgba(255, 255, 255, 0.2);
}

.theme-selector select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.25);
}

.theme-selector select option {
    background: #3E3A94;
    color: white;
    padding: 8px;
}

/* Fix för Safari/iOS dropdown */
.theme-selector select {
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    appearance: menulist;
    min-width: 150px;
}

/* --- 3.3 Formulär (Input, Select, Textarea) --- */
.form-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    color: var(--feid-white);
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: var(--feid-white);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.required {
    color: var(--error-red);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    color: var(--feid-white);
    font-size: 14px;
    font-family: var(--feid-primary-font);
    transition: all 0.3s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.form-input.error {
    border-color: var(--error-red);
    animation: shake 0.5s;
}

.form-select {
    cursor: pointer;
}

.form-select option {
    background: #3E3A94;
    color: white;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Radio buttons */
.radio-group {
    display: flex;
    gap: 20px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--feid-blue);
}

.radio-option label {
    color: var(--feid-white);
    font-size: 14px;
    cursor: pointer;
}

/* --- 3.4 Knappar --- */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn,
.btn-submit,
.btn-cancel,
.btn-primary,
.btn-secondary {
    padding: 16px;
    border: none;
    border-radius: 15px;
    color: var(--feid-white);
    font-size: 16px;
    font-weight: 700;
    font-family: var(--feid-primary-font);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.btn-submit,
.btn-primary {
    flex: 1;
    background: var(--success-green);
}

.btn-submit:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-cancel,
.btn-secondary {
    flex: 1;
    background: rgba(244, 67, 54, 0.8);
}

.btn-cancel:hover,
.btn-secondary:hover {
    background: rgba(244, 67, 54, 1);
    transform: translateY(-2px);
}

.btn-submit:disabled,
.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.btn-submit.loading .button-text,
.btn-primary.loading .button-text {
    opacity: 0;
}

.button-text {
    display: inline-block;
}

/* --- 3.5 Meddelanden (Error/Success) --- */
.error-message,
.success-message {
    display: none;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

.error-message {
    background: rgba(244, 67, 54, 0.9);
    color: white;
}

.success-message {
    background: rgba(76, 175, 80, 0.9);
    color: white;
}

.error-message.show,
.success-message.show {
    display: block;
}

/* --- 3.6 Loading & Spinner --- */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spinner {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

.btn-submit.loading .spinner,
.btn-primary.loading .spinner {
    display: block;
}

.loading .spinner {
    display: block;
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    margin: 0 auto 20px;
    width: 40px;
    height: 40px;
    border-color: #f3f3f3;
    border-top-color: #3E3A94;
}

/* --- 3.7 Help Text & Labels --- */
.help-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
}

/* ===========================================
   4. SIDSPECIFIKA KOMPONENTER
   =========================================== */

/* --- 4.1 Progress Bar (Lokalinfo, Verksamhet) --- */
.progress-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 20px;
}

.progress-line {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 0;
}

.progress-line-fill {
    height: 100%;
    background: var(--success-green);
    transition: width 0.3s ease;
}

.step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.step.active .step-circle {
    background: var(--feid-blue);
    border-color: var(--feid-blue);
    box-shadow: 0 0 20px rgba(10, 152, 231, 0.5);
}

.step.completed .step-circle {
    background: var(--success-green);
    border-color: var(--success-green);
}

.step-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-align: center;
    font-weight: 600;
}

.step.active .step-label {
    color: white;
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.step-title {
    color: var(--feid-white);
    font-size: 22px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-prev,
.btn-next {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 15px;
    color: var(--feid-white);
    font-size: 16px;
    font-weight: 700;
    font-family: var(--feid-primary-font);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.btn-prev {
    background: rgba(255, 255, 255, 0.2);
}

.btn-prev:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-next {
    background: var(--feid-blue);
}

.btn-next:hover:not(:disabled) {
    background: #0880c7;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(10, 152, 231, 0.4);
}

.btn-next:disabled {
    background: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.btn-next.loading .button-text {
    opacity: 0;
}

.btn-next.loading .spinner {
    display: block;
}

/* Dashboard Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 35px 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.card:hover::before {
    opacity: 1;
}

.card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.card-icon {
    font-size: 48px;
    margin-bottom: 20px;
    display: block;
}

.card-title {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}

.card-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--error-red);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* --- 4.2 System Grid (Portal) --- */
.logo-container {
    text-align: center;
    margin-bottom: 60px;
}

.logo-placeholder {
    width: 200px;
    height: 100px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--feid-white);
    letter-spacing: 3px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-text {
    text-align: center;
    margin-bottom: 50px;
}

.welcome-text h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.welcome-text p {
    font-size: 18px;
    opacity: 0.9;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.systems-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.system-card {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 40px 30px;
    text-align: center;
    text-decoration: none;
    color: var(--feid-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.system-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.system-card:hover::before {
    opacity: 1;
}

.system-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.18);
}

.system-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.system-card.disabled::after {
    content: 'KOMMER SNART';
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 193, 7, 0.9);
    color: #333;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.system-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

.system-card:nth-child(1) .system-icon { color: #4CAF50; }
.system-card:nth-child(2) .system-icon { color: #FF9800; }
.system-card:nth-child(3) .system-icon { color: #E91E63; }
.system-card:nth-child(4) .system-icon { color: #9C27B0; }

.system-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.system-description {
    font-size: 14px;
    opacity: 0.85;
    line-height: 1.5;
}

.footer-info {
    text-align: center;
    margin-top: 60px;
    opacity: 0.7;
    font-size: 14px;
}

/* --- 4.3 Profile & Tabs (Mina Sidor) --- */
.hero {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    font-weight: bold;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.hero-info {
    flex: 1;
    color: white;
}

.hero-info h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.hero-info .role {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.hero-info .contact {
    display: flex;
    gap: 25px;
    font-size: 14px;
    opacity: 0.85;
}

.hero-info .contact span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab {
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px 10px 0 0;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.15);
}

.tab.active {
    background: rgba(255, 255, 255, 0.95);
    color: #3E3A94;
    border-bottom: none;
}

.content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 20px 20px 20px;
    padding: 30px;
    min-height: 500px;
}

.content table thead {
    background: white;
}

.content table th {
    background: white;
    color: #333 !important;
}

.content table td {
    color: #333;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.profile-section {
    margin-bottom: 30px;
}

.profile-section h3 {
    color: #3E3A94;
    font-size: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.profile-card {
    background: #f8f9fa;
    border-left: 4px solid #3E3A94;
    padding: 15px;
    border-radius: 8px;
}

.profile-card .label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.profile-card .value {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge {
    background: #3E3A94;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.badge-niva1 { background: #e3f2fd; color: #1976d2; }
.badge-niva2 { background: #f3e5f5; color: #7b1fa2; }
.badge-niva3 { background: #e8f5e9; color: #388e3c; }
.badge-niva4 { background: #fff3e0; color: #f57c00; }
.badge-niva5 { background: #fce4ec; color: #c2185b; }

.badge.active {
    background: #28a745;
    color: white;
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
}

.stat-card .number {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card .label {
    font-size: 14px;
    opacity: 0.9;
}

.logout-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(220, 53, 69, 0.9);
    z-index: 1000;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #c82333;
}

/* --- 4.4 Login Layout --- */
.login-container {
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
}

.login-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 50px 40px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-title {
    text-align: center;
    color: var(--feid-white);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.login-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    margin-bottom: 35px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    z-index: 1;
}

.login-box .form-input {
    padding-left: 45px;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: rgba(255, 255, 255, 1);
}

.remember-me {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
}

.remember-me label {
    color: var(--feid-white);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.login-button {
    width: 100%;
    padding: 16px;
    background: var(--success-green);
    border: none;
    border-radius: 15px;
    color: var(--feid-white);
    font-size: 16px;
    font-weight: 700;
    font-family: var(--feid-primary-font);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    position: relative;
    overflow: hidden;
}

.login-button:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    background: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    transform: none;
}

.login-button.loading .button-text {
    opacity: 0;
}

.button-loader {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.login-button.loading .button-loader {
    display: block;
}

.links-container {
    text-align: center;
    margin-top: 25px;
}

.link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    display: inline-block;
    margin: 0 10px;
}

.link:hover {
    color: var(--feid-white);
    text-decoration: underline;
}

.footer {
    text-align: center;
    margin-top: 30px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

/* Info Box (Anmäl Medarbetare) */
.info-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-box h3 {
    color: var(--feid-white);
    font-size: 16px;
    margin-bottom: 10px;
}

.info-box p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.6;
}

/* --- 4.5 Modal (Ärendedetaljer) --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    background: linear-gradient(135deg, #3E3A94 0%, #0A98E7 100%);
    color: white;
    padding: 25px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 28px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
}

.arende-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.arende-details h3 {
    color: #3E3A94;
    margin-bottom: 15px;
}

.arende-details p {
    margin: 10px 0;
    color: #555;
}

.anteckningar-list {
    margin-bottom: 25px;
}

.anteckning-item {
    background: #f8f9fa;
    border-left: 4px solid #3E3A94;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
}

.anteckning-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
}

.anteckning-text {
    color: #333;
    line-height: 1.6;
    white-space: pre-wrap;
}

.add-anteckning-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.add-anteckning-form h4 {
    color: #3E3A94;
    margin-bottom: 15px;
}

.add-anteckning-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
}

.add-anteckning-form textarea:focus {
    outline: none;
    border-color: #3E3A94;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* --- 4.6 Ärenden Tabell --- */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.filter-bar input {
    flex: 1;
    min-width: 250px;
}

.arenden-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.arenden-table thead {
    background: white;
    color: #333;
}

.arenden-table thead th {
    color: #333 !important;
    background: white !important;
    font-weight: 600;
}

.arenden-table th,
.arenden-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

.arenden-table tbody tr:hover {
    background: #f8f9fa;
}

.clickable-row {
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-row:hover {
    background: #e3f2fd !important;
    transform: translateX(5px);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-ny { background: #28a745; color: white; }
.status-pagaende { background: #ffc107; color: black; }
.status-avslutad { background: #6c757d; color: white; }

.prio-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
}

.prio-hog { background: #dc3545; color: white; }
.prio-medel { background: #ffc107; color: black; }
.prio-lag { background: #28a745; color: white; }

.empty-state {
    text-align: center;
    padding: 60px;
    color: #999;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.section-title {
    color: #3E3A94;
    font-size: 18px;
    margin: 20px 0 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e0e0e0;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
}

/* Toolbar */
.toolbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-box {
    flex: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-group select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

thead {
    background: white;
}

th {
    background: white;
    font-weight: 600;
    color: #333;
    padding: 12px;
}

tbody th {
    background: #f8f9fa;
    color: #333;
}

td {
    color: #333;
}

tr:hover {
    background: #f8f9fa;
}

.actions {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===========================================
   5. ANIMATIONER
   =========================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Spin animation för loading spinner (standalone) */
.loading .spinner {
    animation: spin-standalone 0.8s linear infinite;
}

@keyframes spin-standalone {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===========================================
   6. RESPONSIVA BREAKPOINTS
   =========================================== */

/* TABLETS & MINDRE (max 768px) */
@media (max-width: 768px) {
    /* Formulär */
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-box {
        padding: 25px;
    }

    /* System grid */
    .systems-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 20px;
    }

    .system-card {
        padding: 30px 20px;
    }

    .system-icon {
        font-size: 48px;
    }

    .system-name {
        font-size: 18px;
    }

    /* Welcome text */
    .welcome-text h1 {
        font-size: 32px;
    }

    /* Progress steps */
    .progress-steps {
        flex-wrap: wrap;
    }

    .step-label {
        font-size: 10px;
    }

    /* Buttons */
    .button-group {
        flex-direction: column;
    }

    /* Profile grid */
    .profile-grid {
        grid-template-columns: 1fr;
    }

    /* Stats grid */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Filter bar */
    .filter-bar {
        flex-direction: column;
    }

    .filter-bar input {
        min-width: 100%;
    }

    /* Tabell - gör scrollbar */
    .arenden-table {
        display: block;
        overflow-x: auto;
    }
}

/* MOBILTELEFONER (max 500px) */
@media (max-width: 500px) {
    /* Login */
    .login-box {
        padding: 40px 25px;
    }

    .login-title {
        font-size: 24px;
    }

    .form-input {
        padding: 13px 13px 13px 40px;
    }

    /* Hero */
    .hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-info .contact {
        flex-direction: column;
        gap: 10px;
    }

    /* Tabs */
    .tabs {
        flex-wrap: wrap;
    }

    .tab {
        padding: 10px 15px;
        font-size: 14px;
    }
}
