/* ============================================
   assets/css/style.css - RYDDET VERSION 4.0
   ============================================ */

/* ============================================
   1. VARIABLER & RESET
   ============================================ */
:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --primary-light: #4895ef;
    --success: #06d6a0;
    --danger: #ef476f;
    --warning: #ffd166;
    --info: #118ab2;
    --dark: #1b263b;
    --light: #f8f9fa;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --gray-dark: #495057;
    --white: #ffffff;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 20px;
    --box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --box-shadow-lg: 0 4px 20px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
}

/* ============================================
   2. SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ============================================
   3. NAVBAR
   ============================================ */
.navbar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    padding: 12px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--white) !important;
    transition: var(--transition);
}
.navbar-brand:hover {
    opacity: 0.9;
}
.navbar-brand i {
    margin-right: 8px;
}

/* ============================================
   4. MOBIL MENY
   ============================================ */
.mobile-menu-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--white);
    font-size: 22px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    display: none;
}
.mobile-menu-btn:hover {
    background: rgba(255,255,255,0.3);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: none;
}
.mobile-menu-overlay.active {
    display: block !important;
}

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100%;
    background: var(--white);
    z-index: 10000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -2px 0 20px rgba(0,0,0,0.2);
    overflow-y: auto;
}
.mobile-menu-panel.active {
    right: 0 !important;
}

.menu-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 30px 20px;
    text-align: center;
}
.menu-header i {
    font-size: 50px;
    margin-bottom: 10px;
}
.menu-header .user-name {
    font-size: 16px;
    font-weight: 600;
    word-break: break-word;
}
.menu-header .user-email {
    font-size: 12px;
    opacity: 0.8;
    word-break: break-word;
}

.close-menu {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.close-menu:hover {
    background: rgba(255,255,255,0.3);
}

.menu-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}
.menu-item:hover {
    background: #f5f5f5;
}
.menu-item i {
    width: 24px;
    color: var(--primary);
}
.menu-item.logout i {
    color: var(--danger);
}
.menu-item.logout {
    color: var(--danger);
}
.menu-item.logout:hover {
    background: #fef0f0;
}

.filter-section {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}
.filter-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.filter-section select {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid #ddd;
    margin-bottom: 10px;
    font-size: 13px;
    background: var(--white);
    transition: var(--transition);
}
.filter-section select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* ============================================
   5. DESKTOP VS MOBIL
   ============================================ */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    .mobile-menu-btn {
        display: block !important;
    }
}
@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none !important;
    }
}

/* ============================================
   6. CONTAINER
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

/* ============================================
   7. STATISTIKK KORT
   ============================================ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 16px 0;
}

.stat-card {
    border-radius: var(--border-radius);
    padding: 12px 6px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    cursor: default;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}
.stat-card .stat-icon {
    font-size: 20px;
    margin-bottom: 6px;
}
.stat-card .stat-number {
    font-size: 22px;
    font-weight: 700;
}
.stat-card .stat-label {
    font-size: 10px;
    margin-top: 4px;
    opacity: 0.9;
}

.stat-card.red {
    background: linear-gradient(135deg, #ef476f, #d90429);
    color: var(--white);
}
.stat-card.yellow {
    background: linear-gradient(135deg, #ffd166, #ff9f1c);
    color: #1b263b;
}
.stat-card.blue {
    background: linear-gradient(135deg, #118ab2, #073b4c);
    color: var(--white);
}

.stat-card.gray {
    background: linear-gradient(135deg, #adb5bd, #6c757d);
    color: var(--white);
}

/* ============================================
   8. FILTER CARD
   ============================================ */
.filter-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--box-shadow);
}

.filter-form {
    width: 100%;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.filter-group {
    flex: 1 1 auto;
    min-width: 120px;
}

.filter-group .form-select-sm {
    font-size: 12px;
    padding: 4px 24px 4px 8px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background-color: white;
}

.filter-actions {
    display: flex;
    gap: 4px;
    flex: 0 0 auto;
}

.filter-actions .btn-sm {
    font-size: 11px;
    padding: 4px 10px;
    height: 32px;
    border-radius: 6px;
    white-space: nowrap;
}

@media (max-width: 576px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .filter-group {
        min-width: 100%;
    }
    .filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    .filter-actions .btn-sm {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   9. ACTION KNAPPER
   ============================================ */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.action-buttons .btn {
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}
.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

/* ============================================
   10. AVTALE KORT
   ============================================ */
.appointment-card {
    background: var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}
.appointment-card:hover {
    box-shadow: var(--box-shadow-lg);
}

.card-header {
    cursor: pointer;
    padding: 12px 14px;
    border: none;
    transition: var(--transition);
}
.card-header:hover {
    filter: brightness(0.95);
}
.card-header .d-flex {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

@media (min-width: 576px) {
    .card-header .d-flex {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    flex-wrap: wrap;
}

.toggle-icon {
    transition: transform 0.2s ease;
    font-size: 10px;
}
.rotate-icon {
    transform: rotate(90deg);
}

.appointment-title {
    font-size: 14px;
    font-weight: 600;
    word-break: break-word;
}

.appointment-body {
    display: none;
    padding: 14px;
    background: #fafbfc;
    border-top: 1px solid #eee;
}
.appointment-body.show {
    display: block;
    animation: slideDown 0.25s ease;
}

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

/* ============================================
   11. AVTALEKORT FARGEKLASSER
   ============================================ */
.bg-red {
    background: linear-gradient(135deg, #ef476f, #d90429) !important;
    color: #ffffff !important;
}
.bg-yellow {
    background: linear-gradient(135deg, #ffd166, #ff9f1c) !important;
    color: #1b263b !important;
}
.bg-blue {
    background: linear-gradient(135deg, #118ab2, #073b4c) !important;
    color: #ffffff !important;
}
.bg-green {
    background: linear-gradient(135deg, #06d6a0, #059669) !important;
    color: #ffffff !important;
}
/* FULLFØRTE - GRÅ */
.bg-gray {
    background: linear-gradient(135deg, #adb5bd, #6c757d) !important;
    color: #ffffff !important;
}

/* Tekstfarger for ulike bakgrunner */
.bg-red .appointment-title,
.bg-blue .appointment-title,
.bg-green .appointment-title,
.bg-gray .appointment-title {
    color: #ffffff !important;
}
.bg-yellow .appointment-title {
    color: #1b263b !important;
}

.bg-red .header-left i,
.bg-blue .header-left i,
.bg-green .header-left i,
.bg-gray .header-left i {
    color: rgba(255, 255, 255, 0.9) !important;
}
.bg-yellow .header-left i {
    color: rgba(0, 0, 0, 0.7) !important;
}

.bg-red .header-right span,
.bg-blue .header-right span,
.bg-green .header-right span,
.bg-gray .header-right span {
    color: rgba(255, 255, 255, 0.9) !important;
}
.bg-yellow .header-right span {
    color: rgba(0, 0, 0, 0.7) !important;
}

/* Hover effekter */
.bg-red:hover {
    background: linear-gradient(135deg, #d90429, #ba1826) !important;
}
.bg-yellow:hover {
    background: linear-gradient(135deg, #ff9f1c, #e88d0e) !important;
}
.bg-blue:hover {
    background: linear-gradient(135deg, #073b4c, #052e3a) !important;
}
.bg-green:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
}
.bg-gray:hover {
    background: linear-gradient(135deg, #6c757d, #495057) !important;
}

/* ============================================
   12. HEADER BADGE
   ============================================ */
.header-badge {
    background: rgba(0, 0, 0, 0.4) !important;
    color: #ffffff !important;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
}
.header-badge:hover {
    background: rgba(0, 0, 0, 0.6) !important;
    transform: scale(1.05);
}
.header-badge i {
    margin-right: 4px;
    font-size: 11px;
}

/* Yellow background */
.bg-yellow .header-badge {
    background: rgba(0, 0, 0, 0.25) !important;
    color: #1b263b !important;
    border-color: rgba(0, 0, 0, 0.1);
}
.bg-yellow .header-badge i {
    color: rgba(0, 0, 0, 0.6);
}
.bg-yellow .header-badge:hover {
    background: rgba(0, 0, 0, 0.4) !important;
}

/* Gray background */
.bg-gray .header-badge {
    background: rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.1);
}
.bg-gray .header-badge i {
    color: rgba(255, 255, 255, 0.8);
}
.bg-gray .header-badge:hover {
    background: rgba(0, 0, 0, 0.5) !important;
}


/* ============================================
   BETALINGSSTATUS - 3 TILSTANDER (KUN ETT IKON)
   ============================================ */

/* 1. BETALT - Grønn hake */
.paid-badge {
    background: rgba(40, 167, 69, 0.9) !important;
    color: #ffffff !important;
    border-color: rgba(40, 167, 69, 0.3) !important;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    animation: paidPulse 2s ease-in-out infinite;
}
.paid-badge i {
    color: #ffffff !important;
    font-size: 12px;
}

/* 2. FRIKORT - Kun 🆓 (ingen ekstra ikon) */
.frikort-badge {
    background: rgba(22, 163, 74, 0.15) !important;
    color: #16a34a !important;
    border: 1px solid rgba(22, 163, 74, 0.3) !important;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
}

/* 3. VENTER PÅ BETALING - Kun klokke (ikke ⏳) */
.pending-payment-badge {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
}
.pending-payment-badge i {
    color: #f59e0b !important;
    font-size: 12px;
}


/* Farger for ulike bakgrunner */
.bg-yellow .frikort-badge {
    background: rgba(22, 163, 74, 0.2) !important;
    color: #0d6e2d !important;
}
.bg-yellow .frikort-badge i {
    color: #0d6e2d !important;
}
.bg-yellow .paid-badge {
    background: rgba(40, 167, 69, 0.85) !important;
    color: #ffffff !important;
}
.bg-yellow .paid-badge i {
    color: #ffffff !important;
}
.bg-yellow .pending-payment-badge {
    background: rgba(245, 158, 11, 0.25) !important;
    color: #92400e !important;
}
.bg-yellow .pending-payment-badge i {
    color: #92400e !important;
}

/* Mørke bakgrunner - hvit tekst */
.bg-red .frikort-badge,
.bg-red .paid-badge,
.bg-red .pending-payment-badge,
.bg-blue .frikort-badge,
.bg-blue .paid-badge,
.bg-blue .pending-payment-badge,
.bg-green .frikort-badge,
.bg-green .paid-badge,
.bg-green .pending-payment-badge,
.bg-gray .frikort-badge,
.bg-gray .paid-badge,
.bg-gray .pending-payment-badge {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}
.bg-red .frikort-badge i,
.bg-red .paid-badge i,
.bg-red .pending-payment-badge i,
.bg-blue .frikort-badge i,
.bg-blue .paid-badge i,
.bg-blue .pending-payment-badge i,
.bg-green .frikort-badge i,
.bg-green .paid-badge i,
.bg-green .pending-payment-badge i,
.bg-gray .frikort-badge i,
.bg-gray .paid-badge i,
.bg-gray .pending-payment-badge i {
    color: #ffffff !important;
}

@keyframes paidPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* ============================================
   14. BETALINGSBOX - 3 TILSTANDER
   ============================================ */

/* 1. Betalt - grønn */
.payment-box {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 10px 0;
}

/* 2. Frikort - grønn med tykkere ramme */
.payment-box.frikort {
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 10px 0;
}
.payment-box.frikort .payment-header {
    color: #16a34a;
}
.payment-box.frikort .payment-header i {
    color: #16a34a;
}
.payment-box.frikort .payment-method {
    background: #d1fae5;
    color: #065f46;
}

/* 3. Avventer - gul */
.payment-box.pending-payment {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    padding: 12px 14px;
    margin: 10px 0;
}
.payment-box.pending-payment .payment-header {
    color: #f59e0b;
}
.payment-box.pending-payment .payment-header i {
    color: #f59e0b;
}

.payment-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    font-size: 13px;
}
.payment-header i {
    color: #16a34a;
}

.payment-method {
    background: #e5e7eb;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.payment-date {
    font-size: 12px;
    color: #6b7280;
}
.payment-receipt {
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 10px;
    border-radius: 12px;
}
.payment-notes {
    margin-top: 8px;
    padding: 8px 10px;
    background: #f9fafb;
    border-radius: 6px;
    font-size: 12px;
    color: #4b5563;
    border-left: 3px solid #16a34a;
}
.payment-actions {
    margin-top: 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.payment-actions .btn {
    font-size: 11px;
    padding: 4px 12px;
}

@media (max-width: 480px) {
    .payment-header {
        font-size: 12px;
        gap: 6px;
    }
    .payment-method {
        font-size: 10px;
        padding: 1px 8px;
    }
    .payment-date {
        font-size: 10px;
    }
    .payment-receipt {
        font-size: 10px;
    }
}

/* ============================================
   15. SMS OG NOTATER
   ============================================ */
.sms-text {
    background: #e9ecef;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12px;
    margin-bottom: 12px;
    border-left: 3px solid var(--primary);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
}

.price-box {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 10px;
}

/* ============================================
   16. KNAPPE GRUPPE
   ============================================ */
.action-btn-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

@media (min-width: 480px) {
    .action-btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .action-btn-group .btn {
        flex: 1;
        min-width: 80px;
    }
}

.action-btn-group .btn {
    font-size: 11px;
    padding: 8px 6px;
    border-radius: var(--border-radius-sm);
    white-space: nowrap;
    transition: var(--transition);
}
.action-btn-group .btn:hover {
    transform: translateY(-1px);
}

@media (max-width: 380px) {
    .action-btn-group .btn {
        font-size: 10px;
        padding: 8px 4px;
        white-space: normal;
    }
}

/* ============================================
   17. DOKUMENTER
   ============================================ */
.documents-box {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: var(--border-radius-sm);
    border: 1px solid #dee2e6;
}
.documents-box strong {
    font-size: 12px;
}

.document-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
    font-size: 11px;
}
.document-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.document-item a {
    flex: 1;
    word-break: break-word;
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}
.document-item a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.delete-doc-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 4px 8px;
    transition: var(--transition);
}
.delete-doc-btn:hover {
    color: #c82333;
    transform: scale(1.1);
}

/* ============================================
   18. STATUS SEKSJONER & GRUPPE HEADER
   ============================================ */
.status-section {
    margin: 20px 0 10px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #dee2e6;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    width: 100%;
}

.group-col {
    display: flex;
    align-items: center;
}
.group-col-icon {
    flex: 0 0 30px;
    justify-content: center;
    font-size: 18px;
}
.group-col-text {
    flex: 1 1 auto;
    font-size: 14px;
    font-weight: 700;
    min-width: 100px;
}
.group-col-count {
    flex: 0 0 60px;
    justify-content: center;
}
.group-col-count .badge {
    font-size: 14px;
    padding: 5px 14px;
    font-weight: 700;
    min-width: 40px;
}
.group-col-toggle {
    flex: 0 0 100px;
}
.group-col-toggle .btn {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.group-col-toggle .btn:hover {
    transform: scale(1.05);
}
.group-col-toggle .btn i {
    margin-right: 4px;
    font-size: 11px;
}

/* Responsiv gruppe header */
@media (max-width: 768px) {
    .group-header {
        flex-wrap: wrap;
        gap: 6px;
        padding: 6px 0;
    }
    .group-col-icon {
        flex: 0 0 24px;
        font-size: 16px;
    }
    .group-col-text {
        font-size: 13px;
        min-width: 80px;
    }
    .group-col-count {
        flex: 0 0 50px;
    }
    .group-col-count .badge {
        font-size: 12px;
        padding: 4px 10px;
        min-width: 32px;
    }
    .group-col-toggle {
        flex: 0 0 80px;
    }
    .group-col-toggle .btn {
        font-size: 11px;
        padding: 3px 8px;
    }
}

@media (max-width: 480px) {
    .group-header {
        gap: 4px;
        padding: 4px 0;
    }
    .group-col-icon {
        flex: 0 0 20px;
        font-size: 14px;
    }
    .group-col-text {
        font-size: 12px;
        min-width: 60px;
    }
    .group-col-count {
        flex: 0 0 40px;
    }
    .group-col-count .badge {
        font-size: 11px;
        padding: 3px 8px;
        min-width: 28px;
    }
    .group-col-toggle {
        flex: 0 0 70px;
    }
    .group-col-toggle .btn {
        font-size: 10px;
        padding: 2px 6px;
    }
    .group-col-toggle .btn i {
        font-size: 9px;
        margin-right: 2px;
    }
}

@media (max-width: 380px) {
    .group-col-text {
        font-size: 11px;
        min-width: 50px;
    }
    .group-col-count {
        flex: 0 0 35px;
    }
    .group-col-count .badge {
        font-size: 10px;
        padding: 2px 6px;
        min-width: 24px;
    }
    .group-col-toggle {
        flex: 0 0 60px;
    }
    .group-col-toggle .btn {
        font-size: 9px;
        padding: 2px 5px;
    }
}

/* ============================================
   19. MODAL
   ============================================ */
.modal-content {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}
.modal-header {
    padding: 14px 16px;
    border: none;
}
.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}
.modal-footer {
    padding: 14px 16px;
    border-top: 1px solid #eee;
}

/* ============================================
   20. LOGIN / REGISTER
   ============================================ */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 20px;
}

.auth-card {
    background: var(--white);
    border-radius: 30px;
    padding: 30px 24px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.5s ease;
}
.auth-header {
    text-align: center;
    margin-bottom: 24px;
}
.auth-header i {
    font-size: 50px;
    color: var(--primary);
    margin-bottom: 10px;
}
.auth-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}
.auth-card .form-control {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    transition: var(--transition);
}
.auth-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}
.auth-card .btn {
    padding: 12px;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: var(--transition);
}
.auth-card .btn:hover {
    transform: translateY(-1px);
}

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

/* ============================================
   21. ALERT
   ============================================ */
.alert {
    border-radius: var(--border-radius);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    animation: fadeInUp 0.3s ease;
}

/* ============================================
   22. PWA INSTALL BANNER
   ============================================ */
.pwa-install-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    padding: 12px 20px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    z-index: 99999;
    align-items: center;
    justify-content: space-between;
    animation: slideUp 0.5s ease;
    flex-wrap: wrap;
    gap: 10px;
}
.pwa-install-banner.show {
    display: flex;
}
.pwa-install-banner .btn-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    opacity: 0.7;
    padding: 5px 10px;
}
.pwa-install-banner .btn-close:hover {
    opacity: 1;
}
.pwa-install-banner .btn-install {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}
.pwa-install-banner .btn-install:hover {
    background: #218838;
    transform: scale(1.05);
}

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

#installAppMenuBtn {
    background: linear-gradient(135deg, #28a745, #20c997) !important;
    color: white !important;
    border-radius: 12px !important;
    margin: 10px 15px !important;
    padding: 14px 20px !important;
    font-weight: 600 !important;
    text-align: center;
    transition: all 0.3s ease;
}
#installAppMenuBtn i {
    color: white !important;
}
#installAppMenuBtn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

#installAppDesktopBtn {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    color: white;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-size: 14px;
}
#installAppDesktopBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* ============================================
   23. TYPE MANAGER
   ============================================ */
.type-icon {
    font-size: 24px;
    width: 40px;
    display: inline-block;
    text-align: center;
}
.color-preview {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid #ddd;
}
.type-card {
    transition: var(--transition);
}
.type-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}
.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 5px;
    background: white;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}
.icon-item:hover {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.icon-item.selected {
    border-color: var(--success);
    background: #d4edda;
}
.icon-item i {
    font-size: 28px;
    margin-bottom: 4px;
}
.icon-item .icon-name {
    font-size: 9px;
    color: var(--gray);
    word-break: break-all;
    text-align: center;
}
.icon-filter {
    margin-bottom: 10px;
}
.icon-filter input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}
.selected-icon-display {
    font-size: 32px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: center;
}
.icon-grid::-webkit-scrollbar {
    width: 6px;
}
.icon-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
.icon-grid::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* ============================================
   24. RESPONSIV - TOUCH TARGETS
   ============================================ */
@media (max-width: 768px) {
    button,
    .btn,
    .menu-item,
    .delete-doc-btn,
    .toggle-header {
        cursor: pointer;
        min-height: 44px;
    }
    .btn-sm {
        min-height: auto;
    }
    select,
    input,
    textarea {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    .stats-row {
        gap: 6px;
    }
    .stat-card {
        padding: 10px 4px;
    }
    .stat-card .stat-number {
        font-size: 18px;
    }
    .stat-card .stat-icon {
        font-size: 16px;
    }
    .stat-card .stat-label {
        font-size: 9px;
    }
    .card-header {
        padding: 10px 12px;
    }
    .appointment-title {
        font-size: 13px;
    }
    .header-right span {
        font-size: 10px;
    }
    .header-badge {
        font-size: 9px;
        padding: 3px 8px;
    }
    .header-badge i {
        font-size: 8px;
    }
    .sms-text {
        font-size: 11px;
    }
    .documents-box {
        padding: 8px;
    }
    .document-item {
        font-size: 10px;
    }
    .action-btn-group .btn {
        font-size: 9px;
        padding: 6px 3px;
    }
    .mobile-menu-panel {
        width: 280px;
        right: -280px;
    }
    .paid-badge {
        font-size: 9px;
        padding: 2px 8px;
    }
    .paid-badge i {
        font-size: 9px;
    }
}

@media (max-width: 400px) {
    .header-right {
        gap: 4px !important;
    }
    .header-badge {
        font-size: 8px;
        padding: 2px 6px;
    }
    .paid-badge {
        font-size: 8px;
        padding: 2px 6px;
    }
    .paid-badge i {
        font-size: 8px;
    }
}

/* ============================================
   25. MISC
   ============================================ */
.bg-dark {
    background-color: #212529 !important;
}
.bg-opacity-50 {
    --bs-bg-opacity: 0.5;
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ============================================
   FILTER - MED SØKEFELT
   ============================================ */
.filter-search {
    flex: 2 1 auto;
    min-width: 150px;
}

.filter-search .form-control-sm {
    font-size: 12px;
    padding: 4px 10px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background-color: white;
    transition: var(--transition);
}

.filter-search .form-control-sm:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* Aktive filtre */
.filter-active {
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.filter-active .badge {
    font-size: 11px;
    padding: 4px 10px;
    margin-right: 4px;
}

.filter-active a {
    text-decoration: none;
}

.filter-active a:hover {
    text-decoration: underline;
}

/* Responsiv */
@media (max-width: 768px) {
    .filter-search {
        min-width: 100%;
    }
}

/* ============================================
   STATISTIKK KORT - KLIKKBARE
   ============================================ */

.stat-card {
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.stat-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.stat-card:active {
    transform: scale(0.95);
}

/* Visuell feedback når gruppen er skjult */
.stat-card.dimmed {
    opacity: 0.5;
    transform: scale(0.95);
    filter: grayscale(0.6);
}

.stat-card.dimmed:hover {
    transform: translateY(-2px) scale(0.97);
}
/* ============================================
   STATISTIKK KORT - DIMPED (SKJULT)
   ============================================ */

.stat-card {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.stat-card:active {
    transform: scale(0.95);
}

/* Dimmet tilstand - brukes når gruppen er skjult */
.stat-card.dimmed {
    opacity: 0.4 !important;
    transform: scale(0.95) !important;
    filter: grayscale(0.6) !important;
}

.stat-card.dimmed:hover {
    opacity: 0.6 !important;
    transform: scale(0.97) !important;
}

/* Overgang når dimmet fjernes */
.stat-card:not(.dimmed) {
    opacity: 1 !important;
    transform: scale(1) !important;
    filter: none !important;
}

