/* Reset og grunnleggende styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Container layout */
.container {
    display: flex;
    min-height: 100vh;
}

/* Venstremeny */
.sidebar {
    width: 250px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
    padding: 8px 0;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.logo {
    padding: 2rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 1rem;
}

.logo h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #ecf0f1;
}

.menu {
    list-style: none;
    padding: 0 0.75rem;
}

.menu li {
    margin-bottom: 0.25rem;
}

.menu a {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #bdc3c7;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.menu-icon {
    font-size: 1.1rem !important;
    margin-right: 0.5rem !important;
    display: inline-block !important;
    width: 20px !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding: 0 !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.menu-text {
    display: inline-block !important;
    vertical-align: middle !important;
    padding: 0 !important;
    margin: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force menu icons to be visible */
.menu a .menu-icon {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-size: 1.1rem !important;
    margin-right: 0.5rem !important;
    width: 20px !important;
    text-align: center !important;
    vertical-align: middle !important;
}

.menu a .menu-text {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    vertical-align: middle !important;
}

.menu a:hover {
    background-color: rgba(255,255,255,0.1);
    color: #ecf0f1;
    transform: translateX(4px);
}

.menu a.active {
    background-color: #3498db;
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.logout-item {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e74c3c !important;
    font-weight: 500;
}

.logout-link:hover {
    background-color: rgba(231, 76, 60, 0.1) !important;
    color: #c0392b !important;
}

.logout-icon {
    font-size: 1rem;
}

/* Hovedinnhold */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
    max-width: calc(100vw - 250px);
    transition: margin-left 0.3s ease, max-width 0.3s ease;
}

.main-content.sidebar-collapsed {
    margin-left: 60px;
    max-width: calc(100vw - 60px);
}

.page-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e9ecef;
}

.page-header h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.page-header p {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 400;
}

.user-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.user-email {
    color: #7f8c8d;
    font-size: 0.8rem;
}

/* Innholdskort */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.info-card h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.info-card p {
    color: #7f8c8d;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.card-link {
    display: inline-flex;
    align-items: center;
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.card-link:hover {
    color: #2980b9;
    transform: translateX(4px);
}

.card-link::after {
    content: '→';
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.card-link:hover::after {
    transform: translateX(4px);
}

/* Undersider styling */
.page-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    margin-top: 2rem;
}

.page-content h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.page-content h3 {
    color: #34495e;
    margin: 2rem 0 1rem 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.page-content p {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.page-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.page-content li {
    margin-bottom: 0.5rem;
    color: #555;
}

/* Responsivt design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
        transform: none !important;
    }
    
    .sidebar.collapsed {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 1rem;
    }
    
    .main-content.sidebar-collapsed {
        margin-left: 0;
        max-width: 100%;
    }
    
    .sidebar-toggle {
        left: 50px !important; /* Always on right side of collapsed sidebar on mobile */
        width: 15px;
        height: 35px;
    }
    
    .sidebar.collapsed {
        width: 50px;
    }
    
    .main-content.sidebar-collapsed {
        margin-left: 50px;
        max-width: calc(100vw - 50px);
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .info-card {
        padding: 1.5rem;
    }
    
    .page-content {
        padding: 1.5rem;
    }
}

/* Tabell styling */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.table-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.actions-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 750px;
    table-layout: auto;
}

.actions-table th {
    background: #3498db;
    color: white;
    padding: 0.3rem 0.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.actions-table td {
    padding: 0.2rem 0.4rem;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
    line-height: 1.2;
}

.actions-table tr:hover {
    background-color: #e3f2fd;
    transition: none;
}

.actions-table tr {
    height: auto;
}

/* Striped table rows */
.actions-table tbody tr:nth-child(even) {
    background-color: #e9ecef;
}

.actions-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

/* Textarea background matches cell background */
.actions-table tbody tr:nth-child(even) .sakbeskrivelse-cell textarea {
    background-color: transparent !important;
}

.actions-table tbody tr:nth-child(odd) .sakbeskrivelse-cell textarea {
    background-color: transparent !important;
}

.actions-table input {
    width: 100%;
    padding: 0.2rem 0.3rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.8rem;
    line-height: 1.2;
    transition: none;
}

.actions-table input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.frist-input {
    width: 100%;
    padding: 0.2rem 0.3rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.8rem;
    line-height: 1.2;
    transition: none;
    text-align: center;
}

/* Date picker styling */
.frist-input[data-date-picker="true"] {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px 16px;
    padding-right: 30px;
}

.frist-input[data-date-picker="true"]:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23007bff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
}

.frist-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.frist-input:invalid {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

/* Red text for overdue dates */
.frist-input.overdue {
    color: #e74c3c !important;
    font-weight: bold;
}

.frist-input.overdue:focus {
    color: #e74c3c !important;
    border-color: #e74c3c;
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.2);
}

.actions-table input[type="text"] {
    min-width: 1px;
    max-width: 100%;
    padding: 0.1rem 0.3rem;
    font-size: 0.8rem;
}

/* Spesifikke bredder for input-felt i forskjellige kolonner */
.actions-table td:nth-child(1) input[type="text"] {
    min-width: 1px;
    max-width: 60px;
}

.actions-table td:nth-child(3) input[type="text"] {
    min-width: 1px;
    max-width: 92px;
}

.actions-table td:nth-child(4) input[type="text"] {
    min-width: 1px;
    max-width: 100px;
}

.actions-table td:nth-child(5) input[type="text"] {
    min-width: 1px;
    max-width: 125px;
}

/* Spesifikke kolonnebredder for optimal plassering */
.actions-table th:nth-child(1),
.actions-table td:nth-child(1) {
    width: 60px; /* Punkt - fiksert bredde */
    min-width: 60px;
    max-width: 60px;
}

.actions-table th:nth-child(2),
.actions-table td:nth-child(2) {
    width: 50%; /* Sakbeskrivelse - fleksibel bredde */
    min-width: 100px;
}

.actions-table th:nth-child(3),
.actions-table td:nth-child(3) {
    width: 92px; /* Ansvarlig - fiksert bredde */
    min-width: 92px;
    max-width: 92px;
    padding: 0.1rem 0.3rem;
}

.actions-table th:nth-child(4),
.actions-table td:nth-child(4) {
    width: 100px; /* Status - fiksert bredde */
    min-width: 100px;
    max-width: 100px;
    vertical-align: top;
    padding: 0.1rem 0.3rem;
}

.status-cell, .ansvarlig-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 28px;
}

.status-select, .ansvarlig-select {
    width: 100%;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: white;
    font-weight: bold;
    padding: 0.1rem 0.3rem;
    font-size: 0.8rem;
    line-height: 1.2;
    transition: none;
}

.actions-table th:nth-child(5),
.actions-table td:nth-child(5) {
    width: 125px; /* Frist - fiksert bredde */
    min-width: 125px;
    max-width: 125px;
}

.actions-table th:nth-child(6),
.actions-table td:nth-child(6) {
    width: 50%; /* Kommentarer - fleksibel bredde */
    min-width: 100px;
}

/* Kommentarer-celle med tannhjul */
.comments-cell {
    position: relative;
    padding: 0.5rem;
}

.comments-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 80px;
    height: auto;
    max-height: none;
}

.comments-list {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.comment-preview {
    margin-bottom: 0.25rem;
    padding: 0.25rem;
    background: #f8f9fa;
    border-radius: 3px;
    border-left: 3px solid #007bff;
    max-width: 100%;
    overflow: hidden;
    transition: none;
}

.comment-author {
    font-weight: 600;
    color: #495057;
    margin-right: 0.5rem;
}

.comment-meta {
    font-weight: 600;
    color: #495057;
    font-size: 0.7rem;
    margin-bottom: 0.25rem;
}

.comment-text {
    color: #000000;
    font-size: 0.85rem;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* Styling for @-mentions in comments */
.comment-text .mention {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 500;
}

.comments-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* New comment input section */
.comment-input-section {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.comment-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    resize: none;
    min-height: 40px;
    max-height: 600px; /* 30 rader * 20px per rad */
    overflow-y: auto;
    line-height: 1.4;
    height: 40px;
}

.save-comment-btn {
    background: none;
    color: #28a745;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 1.2rem;
    min-width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.save-comment-btn:hover {
    color: #218838;
}

.add-comment-btn {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-comment-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

/* Comment actions styling */
.comment-actions {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.edit-comment-btn,
.delete-comment-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 12px;
    opacity: 0.7;
    transition: all 0.2s;
}

.edit-comment-btn:hover {
    background: #e3f2fd;
    opacity: 1;
}

.delete-comment-btn:hover {
    background: #ffebee;
    opacity: 1;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

/* Comment header styling for modal */
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-item {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.comment-item:last-child {
    border-bottom: none;
}

/* Hide admin-only elements for non-admins */
body:not(.admin-user) .main-settings-btn,
body:not(.admin-user) .add-button,
body:not(.admin-user) .gear-btn,
body:not(.admin-user) .comment-actions,
body:not(.admin-user) .delete-btn,
body:not(.admin-user) .admin-only {
    display: none !important;
}

.comments-cell .gear-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sakbeskrivelse-celle - FORENKLET */
.sakbeskrivelse-cell {
    width: 100%;
    height: 100%;
}

.sakbeskrivelse-overskrift {
    font-weight: bold;
    color: #2c3e50;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #e9ecef;
}

.sakbeskrivelse-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.sakbeskrivelse-header .gear-btn {
    background: none;
    color: #6c757d;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 0.9rem;
    margin-left: 0.5rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.sakbeskrivelse-header .gear-btn:hover {
    opacity: 1;
    color: #495057;
}

.sakbeskrivelse-cell textarea {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0.15rem 0.3rem;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-family: inherit;
    line-height: 1.2;
    resize: none;
    overflow: visible;
    word-wrap: break-word;
    white-space: normal;
    box-sizing: border-box;
}

.sakbeskrivelse-cell input:focus,
.sakbeskrivelse-cell textarea:focus {
    outline: none;
    background: #f8f9fa;
    border-radius: 3px;
    padding: 0.25rem 0.5rem;
}

/* Modal textarea styling */
.add-sak-form textarea,
.edit-sak-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 200px;
    height: 200px;
    font-family: inherit;
    line-height: 1.4;
}

.add-sak-form textarea:focus,
.edit-sak-form textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Tabell cellehøyde for textarea */
.actions-table td {
    vertical-align: top;
    padding: 0.15rem 0.3rem;
}

.actions-table .sakbeskrivelse-cell {
    min-height: auto;
    vertical-align: top;
}

/* Søkbar dropdown */
.searchable-dropdown {
    position: relative;
    width: 100%;
    z-index: 1;
}

/* Ensure dropdown can extend outside table cells */
.actions-table td {
    overflow: visible !important;
}

.actions-table th {
    overflow: visible !important;
}

/* Ensure table container doesn't clip dropdowns */
.tema-segment {
    overflow: visible !important;
}

.actions-table {
    overflow: visible !important;
}

.ansvarlig-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #faf9f8;
    transition: none;
    min-width: 140px;
}

.ansvarlig-input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 10000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.option {
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: none;
    font-size: 0.8rem;
    color: #2c3e50;
}

.option:hover {
    background-color: #f8f9fa;
}

.option:last-child {
    border-bottom: none;
}

.option.highlighted {
    background-color: #e3f2fd;
    color: #1976d2;
}

/* Scrollbar for dropdown */
.dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Validering */
.validation-error {
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Tannhjulsknapp */
.settings-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background-color: rgba(52, 152, 219, 0.1);
    transform: rotate(90deg);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.modal.show {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 0;
    border-radius: 8px;
    width: auto;
    max-width: 500px;
    min-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

/* Main settings modal specific styling */
#mainSettingsModal .modal-content {
    max-width: 450px;
    min-width: 400px;
}


/* Ensure all content fits within modal */
.modal-content * {
    box-sizing: border-box;
    max-width: 100%;
}

/* Prevent text overflow */
.modal-content input,
.modal-content textarea,
.modal-content select {
    max-width: 100%;
    word-wrap: break-word;
}

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

.modal-header {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #ecf0f1;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    min-height: 0;
}

.actor-list h3,
.add-actor h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.actor-items {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.actor-table-header {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.actor-item {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.actor-item:hover {
    background-color: #f8f9fa;
}

.actor-item:last-child {
    border-bottom: none;
}

.actor-name-col {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.actor-desc-col {
    color: #555;
    font-size: 0.9rem;
    font-style: italic;
}

.actor-name-input, .actor-desc-input {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.actor-name-input:focus, .actor-desc-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.actor-name-input {
    font-weight: 600;
    color: #2c3e50;
}

.actor-desc-input {
    color: #555;
    font-style: italic;
}

.actor-actions-col {
    text-align: right;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.remove-actor-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.remove-actor-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.edit-actor-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.edit-actor-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.add-actor-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

#newActorInput,
#newActorDesc {
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#newActorInput:focus,
#newActorDesc:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.add-actor-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.add-actor-btn:hover {
    background: linear-gradient(135deg, #229954, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.modal-footer {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    text-align: right;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.cancel-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

.save-btn {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: 0.5rem;
}

.save-btn:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

/* Hovedoverskrift med tannhjul */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* Search and Filter Section */
.search-filter-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: #6c757d;
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
}

.clear-search-btn:hover {
    background: #495057;
}


.filter-boxes {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.checkbox-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    cursor: pointer;
}

.filter-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.hide-completed-group {
    margin-left: auto;
}

.filter-select {
    padding: 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    min-width: 150px;
    transition: border-color 0.2s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #007bff;
}

.clear-filters-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
    height: fit-content;
}

.clear-filters-btn:hover {
    background: #c82333;
}

/* Sidebar toggle button - flap design */
.sidebar-toggle {
    position: fixed;
    top: 1rem;
    left: 250px; /* Positioned at the edge of the sidebar */
    background: #007bff;
    border: none;
    color: white;
    width: 20px;
    height: 40px;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
    box-shadow: 2px 0 8px rgba(0,0,0,0.2);
}

.sidebar.collapsed + .main-content .sidebar-toggle {
    left: 60px; /* Always on the right side of the collapsed sidebar */
    border-radius: 0 8px 8px 0;
}

/* Collapsed sidebar - thin strip with icons */
.sidebar.collapsed {
    width: 60px;
    transform: none;
}

.sidebar.collapsed .logo {
    display: none;
}

.sidebar.collapsed .menu {
    padding: 0.5rem 0;
}

.sidebar.collapsed .menu li {
    text-align: center;
    margin-bottom: 0.75rem;
}

.sidebar.collapsed .menu a {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    text-decoration: none;
    color: rgba(255,255,255,0.8);
    transition: color 0.2s ease;
}

/* Menu icon and text styling for collapsed sidebar */

.sidebar.collapsed .menu-text {
    display: none !important; /* Hide text when collapsed */
}

.sidebar.collapsed .menu a:hover,
.sidebar.collapsed .menu a.active {
    color: white;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
}

.sidebar.collapsed .menu-icon {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

/* Logout item styling */
.logout-item {
    margin-top: auto;
    border-top: 1px solid #e9ecef;
    padding-top: 0.5rem;
}

.logout-item a {
    color: #dc3545 !important;
    font-weight: 500;
}

.logout-item a:hover {
    background-color: #f8d7da !important;
    color: #721c24 !important;
}

.sidebar.collapsed .logout-item {
    border-top: 1px solid #e9ecef;
    padding-top: 0.5rem;
    margin-top: auto;
}

.sidebar-toggle:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.arrow-icon {
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.sidebar-toggle.active .arrow-icon {
    transform: rotate(180deg);
}


/* Kolonnebredde editor */
.column-width-editor {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 10000;
    min-width: 300px;
    display: none;
}

.column-width-editor p {
    margin: 0 0 15px 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.column-width-editor h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.column-width-editor .column-setting {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.column-width-editor .column-setting label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.column-width-editor .slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.column-width-editor .width-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.column-width-editor .width-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #28a745;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.column-width-editor .width-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #28a745;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.column-width-editor .width-value {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: #28a745;
    font-size: 0.9rem;
}

.column-width-editor .editor-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.column-width-editor .editor-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.column-width-editor .apply-btn {
    background: #28a745;
    color: white;
}

.column-width-editor .apply-btn:hover {
    background: #218838;
    transform: translateY(-1px);
}

.column-width-editor .reset-btn {
    background: #6c757d;
    color: white;
}

.column-width-editor .reset-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.column-width-editor .cancel-btn {
    background: #dc3545;
    color: white;
}

.column-width-editor .cancel-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Individual column lock controls */
.column-lock-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-left: 10px;
}

.column-lock-toggle input[type="checkbox"] {
    display: none;
}

.column-lock-toggle .lock-icon {
    font-size: 16px;
    transition: color 0.3s ease;
    padding: 4px;
    border-radius: 3px;
    display: inline-block;
    min-width: 20px;
    text-align: center;
}

.column-lock-toggle input[type="checkbox"]:checked + .lock-icon {
    color: #dc3545;
    background: #f8d7da;
}

.column-lock-toggle input[type="checkbox"]:not(:checked) + .lock-icon {
    color: #6c757d;
    background: transparent;
}

.column-lock-toggle:hover .lock-icon {
    background: #e9ecef;
}

/* Ensure lock icons are always visible */
.column-lock-toggle .lock-icon:before {
    content: "🔒";
    display: inline-block;
}

/* Input fields for column widths */
.column-width-inputs {
    margin: 20px 0;
}

.column-width-info {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.column-width-info p {
    margin-bottom: 10px;
    color: #333;
}

.column-width-info ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.column-width-info li {
    margin-bottom: 5px;
    color: #555;
}

/* Excel-lignende kolonnegrenser */
.actions-table th {
    position: relative;
}

.column-resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 1000;
}

.column-resize-handle:hover {
    background: #007bff;
    opacity: 0.7;
}

.column-resize-handle.active {
    background: #007bff;
    opacity: 1;
}

/* Vis kolonnegrenser kun i edit-modus */
.actions-table:not(.edit-mode) .column-resize-handle {
    display: none;
}

.actions-table.edit-mode .column-resize-handle {
    display: block;
}

/* Hover-effekt på kolonner i edit-modus */
.actions-table.edit-mode th:hover {
    background: #e3f2fd !important;
}

.actions-table.edit-mode td:hover {
    background: #e3f2fd !important;
}

/* Ensure table layout allows resizing */
.actions-table {
    table-layout: auto;
    width: 100%;
}

/* Force column widths to be respected */
.actions-table th,
.actions-table td {
    overflow: visible;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-text h1 {
    margin: 0;
}

.header-text p {
    margin: 0.5rem 0 0 0;
}

.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.main-settings-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.main-settings-btn:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.admin-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
    text-decoration: none;
    margin-left: 10px;
}

.admin-btn:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    color: white;
    text-decoration: none;
}

/* Large modal for varsel-administrasjon */
.large-modal {
    max-width: 95vw;
    max-height: 95vh;
    width: 1200px;
    height: 800px;
}

.large-modal .notifications-body {
    max-height: calc(95vh - 120px);
    overflow-y: auto;
}

/* Admin container styling */
.admin-container {
    padding: 20px;
}

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

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #007bff;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.filter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-group label {
    font-weight: 500;
    margin-bottom: 5px;
    color: #495057;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
}

.clear-filters-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    height: fit-content;
}

.clear-filters-btn:hover {
    background: #5a6268;
}

.notifications-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.notifications-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.notifications-table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

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

.notification-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.notification-type.info {
    background: #d1ecf1;
    color: #0c5460;
}

.notification-type.warning {
    background: #fff3cd;
    color: #856404;
}

.notification-type.error {
    background: #f8d7da;
    color: #721c24;
}

.notification-type.success {
    background: #d4edda;
    color: #155724;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

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


/* Innstillingsalternativer */
.settings-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-option-btn {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    width: 100%;
}

.settings-option-btn:hover {
    border-color: #3498db;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.option-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.option-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.option-desc {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

/* Fagområde-administrasjon */
.theme-list {
    margin-bottom: 1rem;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

.theme-table-header {
    display: grid;
    grid-template-columns: 40px 40px 1fr 80px;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.theme-number-col {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-number-display {
    font-weight: 600;
    color: #495057;
    font-size: 0.8rem;
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    border: 1px solid #e9ecef;
    min-width: 24px;
    text-align: center;
}

.theme-name-col {
    padding-left: 0.5rem;
}

.theme-move-col {
    text-align: center;
}

.theme-actions-col {
    text-align: center;
}

.drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    padding: 0.2rem;
    border-radius: 3px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    width: 30px;
    height: 30px;
}

.drag-handle:hover {
    background: #e9ecef;
    border-color: #3498db;
    transform: scale(1.05);
}

.drag-handle:active {
    cursor: grabbing;
    background: #3498db;
    color: white;
    transform: scale(0.95);
}

.grip-lines {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 0.8;
    letter-spacing: -1px;
}

.drag-handle:hover .grip-lines {
    color: #3498db;
}

.drag-handle:active .grip-lines {
    color: white;
}

.theme-item {
    display: grid;
    grid-template-columns: 40px 40px 1fr 80px;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #e9ecef;
    background: white;
    align-items: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.theme-item.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.theme-item.drag-over {
    border-top: 2px solid #3498db;
    background: #f8f9fa;
}

.theme-item:last-child {
    border-bottom: none;
}

.theme-number-input {
    width: 100%;
    padding: 0.2rem 0.3rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.75rem;
    text-align: center;
    background: #f8f9fa;
    color: #6c757d;
}

.theme-name-input {
    width: 100%;
    padding: 0.2rem 0.3rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.75rem;
}

.remove-theme-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 0.2rem 0.4rem;
    border-radius: 2px;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-theme-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.add-theme {
    border-top: 1px solid #e9ecef;
    padding-top: 0.75rem;
}

.add-theme h3 {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 0.9rem;
}

.add-theme-form {
    display: grid;
    grid-template-columns: 1fr 2fr auto;
    gap: 0.5rem;
    align-items: end;
}

.add-theme-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-theme-btn:hover {
    background: linear-gradient(135deg, #229954, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.add-theme-form input {
    padding: 0.2rem 0.3rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.75rem;
}

.add-theme-form label {
    font-size: 0.75rem;
    color: #495057;
    margin-bottom: 0.25rem;
}

/* Tema-segmenter */
.tema-segments {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tema-segment {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 3px solid;
    position: relative;
    transition: none;
}

/* Dynamic border colors based on background color */
.tema-segment[style*="background-color: #FFE5E5"] {
    border-color: #d4a5a5 !important; /* Mørkere rosa */
}

.tema-segment[style*="background-color: #E5F3FF"] {
    border-color: #a5c4d4 !important; /* Mørkere blå */
}

.tema-segment[style*="background-color: #E5FFE5"] {
    border-color: #a5d4a5 !important; /* Mørkere grønn */
}

.tema-segment[style*="background-color: #FFF5E5"] {
    border-color: #d4c4a5 !important; /* Mørkere oransje */
}

.tema-segment[style*="background-color: #F0E5FF"] {
    border-color: #c4a5d4 !important; /* Mørkere lilla */
}

.tema-segment[style*="background-color: #E5FFFF"] {
    border-color: #a5d4d4 !important; /* Mørkere cyan */
}

.tema-segment[style*="background-color: #FFE5F0"] {
    border-color: #d4a5c4 !important; /* Mørkere rosa-lilla */
}

.tema-segment[style*="background-color: #F5FFE5"] {
    border-color: #c4d4a5 !important; /* Mørkere gul-grønn */
}

.tema-segment[style*="background-color: #E5E5FF"] {
    border-color: #a5a5d4 !important; /* Mørkere lavendel */
}

.tema-segment[style*="background-color: #FFE5FF"] {
    border-color: #d4a5d4 !important; /* Mørkere rosa-lavendel */
}

.tema-header {
    background: #667eea;
    color: #2c3e50;
    padding: 0.4rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

/* Tema-spesifikke pastellfarger */
.tema-01 .tema-header { background: #a8d8ea; } /* Fremdriftsplanlegging - Pastellblå */
.tema-02 .tema-header { background: #a8e6cf; } /* Overordnet - Pastellgrønn */
.tema-03 .tema-header { background: #dda0dd; } /* BIM/3D - Pastelllilla */
.tema-04 .tema-header { background: #ffb3ba; } /* Offentlige myndigheter - Pastellrød */
.tema-05 .tema-header { background: #ffdfba; } /* Helse, miljø og sikkerhet - Pastelloransje */
.tema-06 .tema-header { background: #bae1ff; } /* Arkitektur - Pastellturkis */
.tema-07 .tema-header { background: #baffc9; } /* Landskapsarkitektur - Pastellmint */
.tema-08 .tema-header { background: #e6ccff; } /* Bærekonstruksjoner - Pastelllavendel */
.tema-09 .tema-header { background: #ffcccb; } /* Grunnundersøkelser - Pastellkorall */
.tema-10 .tema-header { background: #ffb3b3; } /* Brannsikring - Pastellrosa */
.tema-11 .tema-header { background: #b3e5fc; } /* Ventilasjonsanlegg - Pastellhimmelblå */
.tema-12 .tema-header { background: #ffe0b3; } /* Varme-, sanitær- og brannslukkingsanlegg - Pastellaprikos */
.tema-13 .tema-header { background: #c7ceea; } /* Elektro, automasjon og kommunikasjon - Pastellindigo */
.tema-14 .tema-header { background: #e0e0e0; } /* Utvendig vann og avløp - Pastellgrå */
.tema-15 .tema-header { background: #d3d3d3; } /* Bygningsfysikk - Pastelllysgrå */
.tema-16 .tema-header { background: #ffb6c1; } /* Innredning - Pastellrosa */
.tema-17 .tema-header { background: #d1c4e9; } /* Person- og varetransport - Pastelllilla */
.tema-18 .tema-header { background: #c8e6c9; } /* Bærekraft - Pastellmintgrønn */
.tema-19 .tema-header { background: #fff3e0; } /* Byggherrebeslutninger - Pastellkrem */

.tema-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    flex-grow: 1;
    padding: 0.3rem 0;
}

.tema-footer {
    padding: 0.3rem;
    border-radius: 0 0 8px 8px;
}

.tema-segment .actions-table {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    background: white;
}

.tema-segment .actions-table thead {
    background: white;
}

.tema-segment .actions-table th {
    background: white;
    border-bottom: 2px solid rgba(44, 62, 80, 0.2);
    font-weight: 600;
    color: #2c3e50;
    padding: 0.2rem 0.3rem;
    font-size: 0.8rem;
}

.tema-segment .actions-table tbody {
    background: white;
}

.tema-segment .actions-table td {
    background: white;
    border-bottom: 1px solid rgba(44, 62, 80, 0.1);
    padding: 0.15rem 0.3rem;
    vertical-align: top;
    transition: none;
}

/* Annenhver sak har grå bakgrunn */
.tema-segment .actions-table tbody tr:nth-child(even) td {
    background-color: #e9ecef;
}

.tema-segment .actions-table tbody tr:nth-child(odd) td {
    background-color: white;
}

/* Knapper */
.add-button, .save-button, .export-button {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.add-button {
    background: #27ae60;
    color: white;
    margin-top: 0.5rem;
}

.add-button:hover {
    background: #229954;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.save-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    margin-right: 1rem;
}

.save-button:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.export-button {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: white;
}

.export-button:hover {
    background: linear-gradient(135deg, #d35400, #ba4a00);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

.delete-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* Responsivt design for tabell */
@media (max-width: 768px) {
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .table-container {
        font-size: 0.8rem;
    }
    
    .actions-table th,
    .actions-table td {
        padding: 0.5rem 0.25rem;
    }
    
    .actions-table input {
        padding: 0.25rem;
        font-size: 0.8rem;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .save-button {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
}

/* Innloggingsside styling */
.login-info {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 1rem;
}

.login-info p {
    color: #bdc3c7;
    margin: 0;
    font-size: 0.9rem;
}

.login-subtitle {
    color: #95a5a6 !important;
    font-size: 0.8rem !important;
    margin-top: 0.25rem !important;
}

.login-form-container {
    max-width: 500px;
    margin: 0 auto;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.9rem;
}

.input-group input {
    padding: 0.875rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.input-group input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-group input::placeholder {
    color: #a19f9d;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: -0.5rem 0;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3498db;
}

.remember-me label {
    color: #555;
    font-size: 0.9rem;
    cursor: pointer;
}

.login-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
}

.login-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.login-options {
    text-align: center;
    margin-top: 1rem;
}

.forgot-password {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: #2980b9;
    text-decoration: underline;
}

.demo-credentials {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.demo-credentials h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.demo-credentials p {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.demo-info {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    font-size: 0.9rem;
    color: #2c3e50;
    line-height: 1.6;
}

.error-message {
    background: #fde7e9;
    color: #d13438;
    border: 1px solid #f1aeb5;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.9rem;
    margin-top: 1rem;
    animation: slideIn 0.3s ease;
}

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

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Tannhjul-knapp for redigering av rader */
.gear-btn {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gear-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

/* Modal for redigering av rader */
.edit-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.edit-form .form-group {
    display: flex;
    flex-direction: column;
}

.edit-form label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
    font-size: 0.9rem;
}

.edit-form input {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.edit-form input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.edit-form input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* Responsiv design for edit-form */
@media (max-width: 768px) {
    .edit-form {
        grid-template-columns: 1fr;
    }
}

/* Kommentar-modal styling */
.comments-display {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    background: #f8f9fa;
}

.comment-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #007bff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.comment-time {
    font-size: 0.8rem;
    color: #6c757d;
}

.comment-text {
    color: #000000;
    font-size: 0.85rem;
    line-height: 1.4;
}

.no-comments {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

.add-comment-section {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

.add-comment-section h3 {
    margin-bottom: 0.5rem;
    color: #495057;
    font-size: 1rem;
}

.add-comment-section textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 1rem;
    font-family: inherit;
}

.add-comment-section textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.comment-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Status modal styling */
.status-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    background: #f8f9fa;
}

.status-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    min-width: 0; /* Prevent grid overflow */
}

/* Status settings modal specific styling */
#statusSettingsModal .modal-content {
    max-width: 600px;
    width: auto;
    min-width: 500px;
}

#statusSettingsModal .status-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    min-height: 0;
}

.add-status-form {
    padding: 10px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.add-status-form h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.add-status-item {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr auto;
    gap: 10px;
    padding: 10px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    align-items: center;
}

.action-column {
    display: flex;
    align-items: center;
    justify-content: center;
}

#statusSettingsModal .status-item {
    grid-template-columns: 1.5fr 1fr 1fr auto;
    gap: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

.status-column,
.fyllfarge-column,
.tekstfarge-column {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.status-column label,
.fyllfarge-column label,
.tekstfarge-column label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.status-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.status-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.color-picker-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.color-picker-button {
    position: relative;
    display: inline-block;
}

.selected-color {
    padding: 6px 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.selected-color:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.color-dropdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    padding: 20px;
    max-width: 400px;
    width: max-content;
    min-width: 300px;
}

.color-option {
    width: 25px;
    height: 25px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.color-option:hover {
    transform: scale(1.1);
    border-color: #007bff;
}

.color-option.selected {
    border-color: #007bff;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.color-option.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.text-color-picker {
    margin-top: 10px;
}

.text-color-picker label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
}

.text-color-button {
    position: relative;
    display: inline-block;
}

.selected-text-color {
    padding: 5px 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    min-width: 70px;
    text-align: center;
    transition: all 0.2s ease;
}

.selected-text-color:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.text-color-dropdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    padding: 20px;
    max-width: 400px;
    width: max-content;
    min-width: 300px;
}

.text-color-option {
    width: 25px;
    height: 25px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.text-color-option:hover {
    transform: scale(1.1);
    border-color: #007bff;
}

.text-color-option.selected {
    border-color: #007bff;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.text-color-option.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* Color picker overlay */
.color-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

/* Column settings styling */
.column-settings {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.column-setting {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.column-setting label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.width-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.width-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.width-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.width-value {
    min-width: 50px;
    text-align: right;
    font-weight: 600;
    color: #007bff;
    font-size: 0.9rem;
}

.remove-status-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-status-btn:hover {
    background: #c82333;
}

.add-status-form {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

.add-status-form .form-group {
    display: flex;
    align-items: end;
    gap: 0.5rem;
}

.add-status-form input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.add-status-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.add-status-btn:hover {
    background: #218838;
}

/* Status select styling */
.status-select, .ansvarlig-select {
    width: 100%;
    height: 28px;
    padding: 0.1rem 0.3rem;
    border: 1px solid #ced4da;
    font-size: 0.8rem;
    border-radius: 4px;
    font-weight: bold;
    background: white;
    cursor: pointer;
    transition: none;
    line-height: 1.2;
}

.status-select:focus, .ansvarlig-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Status colors are now handled dynamically from database */

/* Notifikasjonssystem */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.info {
    background: #17a2b8;
}

/* Edit indicator for comments - v=35 */
.edit-indicator {
    font-size: 0.8em;
    color: #6c757d;
    margin-left: 4px;
    vertical-align: middle;
    opacity: 0.7;
}

.edit-indicator:hover {
    opacity: 1;
}

.edit-indicator.clickable {
    cursor: pointer;
    color: #007bff;
    opacity: 0.8;
}

.edit-indicator.clickable:hover {
    opacity: 1;
    color: #0056b3;
}

/* Three dots button and local actions modal - v=35 */
.comment-preview,
.comment-item {
    position: relative;
    overflow: visible;
}

.comments-list,
.comments-display {
    overflow: visible;
}

.three-dots-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    color: #6c757d;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: none;
    opacity: 0.7;
}

.three-dots-btn:hover {
    background: #f8f9fa;
    color: #495057;
    opacity: 1;
}

.comment-actions-modal {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    background: white !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    z-index: 10000 !important;
    min-width: 120px !important;
    padding: 4px 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.action-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: none;
    font-size: 0.9em;
}

.action-btn:hover {
    background: #f8f9fa;
}

.action-icon {
    margin-right: 8px;
    font-size: 0.9em;
}

.action-text {
    font-weight: 500;
}

.edit-action:hover {
    color: #007bff;
}

.delete-action:hover {
    color: #dc3545;
}

/* Comment history modal - v=35 */
.history-container {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    background: #f8f9fa;
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-type {
    font-weight: 600;
    color: #495057;
    font-size: 0.9em;
}

.history-date {
    font-size: 0.8em;
    color: #6c757d;
}

.history-author {
    font-size: 0.85em;
    color: #6c757d;
    margin-bottom: 8px;
}

.history-content {
    background: white;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Modal system for confirmations and alerts - v=34 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-dialog {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 20px 24px;
    color: #495057;
    line-height: 1.5;
}

.modal-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    color: #495057;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.modal-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.modal-btn.primary {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.modal-btn.primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.modal-btn.danger {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

.modal-btn.danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

.modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
    text-align: center;
}

.modal-icon.warning {
    color: #ffc107;
}

.modal-icon.danger {
    color: #dc3545;
}

.modal-icon.info {
    color: #17a2b8;
}

/* Styringsverktøy - Phase selection styling */
.phases-container {
    margin-bottom: 2rem;
}

.phases-header {
    text-align: center;
    margin-bottom: 2rem;
}

.phases-header h2 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.phases-header p {
    color: #7f8c8d;
    font-size: 1rem;
}

.phases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.phase-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.phase-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.phase-item.active {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border-color: #007bff;
    color: white;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.phase-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    pointer-events: none;
}

.phase-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.phase-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: inherit;
}

.phase-description {
    font-size: 1rem;
    color: #6c757d;
    line-height: 1.4;
}

.phase-item.active .phase-description {
    color: rgba(255, 255, 255, 0.9);
}

/* Phase content styling */
.phase-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.phase-content.active {
    display: block;
}

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

.content-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.content-header h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin: 0;
}

.checklist-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.checklist-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.checklist-section h4 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.checklist-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.checklist-icon {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
}

.checklist-name {
    font-size: 0.95rem;
    color: #495057;
    font-weight: 500;
}

/* Checkbox Styling */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.form-help {
    display: block;
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    margin-left: 1.5rem;
}

/* Delete Modal Styling */
.delete-warning {
    text-align: center;
    padding: 1rem;
}

.warning-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.delete-warning h3 {
    color: #dc3545;
    margin-bottom: 1rem;
}

.delete-warning p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.project-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: left;
}

.project-info span {
    font-weight: 600;
    color: #495057;
}

/* Responsive design */
@media (max-width: 768px) {
    .phases-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .phase-item {
        padding: 1.5rem;
    }
    
    .checklist-sections {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .checklist-section {
        padding: 1rem;
    }
}

/* Varslingsboks - iPhone-stil */
.notification-bell {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #dc3545; /* Rød bakgrunn for uleste varsler */
    color: white;
    border: none;
    border-radius: 50%;
    width: 37.5px !important;
    height: 37.5px !important;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 3px 9px rgba(220, 53, 69, 0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    min-width: 37.5px !important;
    min-height: 37.5px !important;
    max-width: 37.5px !important;
    max-height: 37.5px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    aspect-ratio: 1 / 1 !important;
}

.notification-bell:hover {
    background: #c82333;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

/* Når ingen uleste varsler - grå bakgrunn */
.notification-bell.no-notifications {
    background: #6c757d !important;
    box-shadow: 0 3px 9px rgba(108, 117, 125, 0.3);
    width: 37.5px !important;
    height: 37.5px !important;
}

.notification-bell.no-notifications:hover {
    background: #5a6268 !important;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
    width: 37.5px !important;
    height: 37.5px !important;
}

/* Antall varsler som fyller hele rundingen */
.notification-count {
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

/* Fjern den gamle badge-stilen */
.notification-badge {
    display: none;
}

/* Varslingsmodal */
.notifications-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.notifications-modal.show {
    opacity: 1;
    visibility: visible;
}

.notifications-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.notifications-modal.show .notifications-content {
    transform: scale(1);
}

.notifications-header {
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.notifications-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.notifications-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notifications-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.notification-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.notification-item:last-child {
    margin-bottom: 0;
}

.notification-item.unread {
    border-left: 4px solid #dc3545;
    background: #fff5f5;
}

.notification-item.read {
    border-left: 4px solid #28a745;
    background: #f8f9fa;
    opacity: 0.7;
}

.notification-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.notification-message {
    color: #495057;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.notification-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6c757d;
}

.notification-time {
    font-style: italic;
}

.notification-type {
    background: #007bff;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.notification-type.urgent {
    background: #dc3545;
}

.notification-type.warning {
    background: #ffc107;
    color: #212529;
}

.notification-type.info {
    background: #17a2b8;
}

.no-notifications {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.no-notifications .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-notifications h3 {
    margin: 0 0 0.5rem 0;
    color: #495057;
}

.no-notifications p {
    margin: 0;
    font-size: 0.9rem;
}

.notifications-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mark-all-read-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.mark-all-read-btn:hover {
    background: #218838;
}

.clear-all-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.clear-all-btn:hover {
    background: #c82333;
}

/* Demo credentials styling */
.demo-info {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.demo-user {
    flex: 1;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.demo-user:first-child {
    border-left-color: #28a745;
}

.demo-user:last-child {
    border-left-color: #dc3545;
}

/* Add sak modal styling */
.add-sak-form,
.edit-sak-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.add-sak-form .form-group,
.edit-sak-form .form-group {
    display: flex;
    flex-direction: column;
}

.form-group-full {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.add-sak-form label,
.edit-sak-form label,
.form-group-full label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
    font-size: 0.9rem;
}

.add-sak-form input,
.edit-sak-form input {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.add-sak-form input:focus,
.edit-sak-form input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.add-sak-form input[readonly],
.edit-sak-form input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* Readonly fields in main table */
.actions-table input[readonly],
.actions-table textarea[readonly] {
    background-color: transparent;
    color: #000000;
    cursor: not-allowed;
    border: none;
}

/* Responsiv design for add-sak-form */
@media (max-width: 768px) {
    .add-sak-form,
    .edit-sak-form {
        grid-template-columns: 1fr;
    }
}
