/* ---------- ROOT VARIABLER ---------- */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --card-bg: #f8f9fa;
    --navbar-bg: #ffffff;
    --link-color: #333333;
    --thead-color: #333333;
    --thead-bg: #e9ecef;
    --row-even-bg: #f8f9fa;
    --row-odd-bg: #ffffff;
    --hover-bg: #f1f1f1;
    --border-color: #dee2e6;
}

/* ---------- TYPOGRAFI OG BASE ---------- */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 60px;
    background-color: var(--bg-color);
    color: var(--text-color);
}

a {
    color: var(--link-color);
}

/* ---------- MODALER ---------- */
.modal-content {
    background-color: var(--card-bg);
    border-radius: 12px;
}

#modalDetailsTable {
    font-size: 0.85rem;
    border-color: var(--border-color);
}

#modalDetailsTable th {
    width: 30%;
    background-color: var(--thead-bg);
}

#modalDetailsTable th,
#modalDetailsTable td {
    padding: 0.4rem 0.6rem;
    vertical-align: top;
    line-height: 1.2;
}

.modal-header {
    background-color: var(--thead-bg);
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-weight: 500;
    font-size: 1.25rem;
}

.modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 1rem;
}

/* ---------- TABELLER ---------- */
.table td,
.table th {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.table-compact td,
.table-compact th {
    padding: 0.3rem;
    font-size: 0.875rem;
}

@media (max-width: 768px) {
    .table-compact td,
    .table-compact th {
        font-size: 0.85rem;
    }

    .table .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }

    #filterForm .form-select,
    #filterForm .form-control {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ---------- SORTERINGSIKONER ---------- */
.sort-link {
    font-weight: 500;
    color: var(--thead-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.2s ease;
}

.sort-link:hover {
    color: #0a58ca;
    text-decoration: underline;
}

/* ---------- TOGGLER ---------- */
.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(0, 0, 0, 0.7)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ---------- KLIKKBARE RADER ---------- */
.clickable-row {
    transition: background-color 0.2s ease;
}

.clickable-row:hover {
    background-color: var(--hover-bg);
    cursor: pointer;
}

.clicked-row {
    outline: 2px solid var(--link-color);
}

.navbar .nav-link {
    color: var(--link-color) !important;
}
.dropdown-menu a.dropdown-item {
    color: var(--text-color); /* Bruk sort (eller det du definerer i --text-color) */
}

.dropdown-menu a.dropdown-item:hover {
    background-color: var(--hover-bg);
    color: var(--text-color);
}
#mobileMenu {
    background-color: var(--navbar-bg);
    box-shadow: 0 0 6px rgba(0,0,0,0.1);
    padding: 1rem;
    z-index: 999;
}
.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}
.pagination .page-item.active .page-link {
    font-weight: bold;
    box-shadow: inset 0 -2px 0 #0d6efd;
}
input[type="checkbox"][disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}
.table-danger {
    background-color: #f8d7da !important;
}
.readonly-field.readonly-mode {
    background-color: #e9ecef;
    color: #212529;
}
details > summary {
    cursor: pointer;
}
details[open] > summary {
    font-weight: 600;
}
textarea {
    max-height: 250px;
    overflow-y: auto;
    resize: vertical;
}
textarea.form-control {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #ced4da;
    padding: 0.75rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.95rem;
}
[data-theme="dark"] details {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

[data-theme="dark"] summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
}

[data-theme="dark"] summary::-webkit-details-marker {
    filter: invert(1);
}

[data-theme="dark"] h6,
[data-theme="dark"] h5,
[data-theme="dark"] h4 {
    color: var(--text-color);
}
./* Drop-area base */
.drop-area{
    border: 1px solid #e1e5ea;         /* var 2px dashed */
    border-radius: .75rem;              /* var .5rem */
    background: #f9fafb;               /* var #fafafa */
    cursor: default;
    padding: 2rem;                      /* var 1rem */
    min-height: 220px;
    transition: border-color .2s, background .2s, box-shadow .2s;
}
.drop-area.dragover{
    background: #eef5ff;
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13,110,253,.12);   /* tydelig dropp-feedback */
}

.drop-area .drop-inner{
    padding: 0;                         /* rydd vekk ekstra padding */
    min-height: 0;                      /* ikke tving høyde */
    display: flex;
    flex-direction: column;
    align-items: center;                /* sentrer innhold */
    max-width: 720px;      
    margin: 0 auto;      
    gap: .75rem;
}

/* Kun knappen/lenken er klikkbar */
.drop-area .dz-browse{
    text-decoration: underline;
    cursor: pointer;
}
.dz-hero-icon svg{ opacity:.9; }

.dz-hero-title{ margin-bottom:.25rem; }
.dz-hero-sub{ color:#8a8f98; line-height:1.6; }
.dz-browse{ font-weight:600; }  /* ser mer ut som lenke-knapp */


/* Hero (ikon + tittel + undertekst) */
.dz-hero-icon{ font-size: 2.25rem; line-height: 1; margin-bottom: .25rem; }
.dz-hero-title{ font-weight: 700; font-size: 1.25rem; }
.dz-hero-sub{ color: #6c757d; }

/* Preview-liste (file chip) */
.dz-preview-list{
    display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin-top: .5rem;
}
.dz-file-chip{
    display: inline-flex; align-items: center; gap: .5rem;
    border: 1px solid #dee2e6; background: #fff; border-radius: 999px;
    padding: .375rem .75rem; font-size: .925rem;
}
.dz-file-chip .dz-chip-name{ font-weight: 600; }
.dz-file-chip .dz-chip-size{ color:#6c757d; }
.dz-file-chip .dz-chip-remove{
    border: 0; background: transparent; padding: .125rem .25rem; line-height: 1; border-radius: .375rem;
}
.dz-file-chip .dz-chip-remove:hover{ background: rgba(0,0,0,.06); }

/* Synlighetsboks (card-ish) */
.visibility-box{
    background: #f2f4f6;
    border: 1px solid #e1e5ea;
    border-radius: .5rem;
    padding: 1rem;
}

.visibility-box{
    background: rgba(0,0,0,.03);
    border-radius: .75rem;
    border: 1px solid #e1e5ea;
}
[data-theme="dark"] .visibility-box{
    background: rgba(255,255,255,.04);
    border-color: var(--border-color);
}
.drop-area .actions{ width:100%; display:flex; justify-content:flex-start; margin-top:1rem; }
.dz-browse:focus{ outline:2px solid #0d6efd; outline-offset:2px; border-radius:4px; }
.drop-area.dragover{
    background: rgba(13,110,253,.10);
    border-color:#0d6efd;
    box-shadow: 0 0 0 3px rgba(13,110,253,.18);
}
/* --- Forbedret utseende for opplastingsboks --- */

/* Gjør drop-area tydeligere og mer balansert */
.drop-area {
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    background: var(--card-bg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    transition: border-color .2s, background .2s, box-shadow .2s;
}

/* Effekt når man drar filer inn */
.drop-area.dragover {
    background: rgba(13,110,253,.08);
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13,110,253,.15);
}

/* Hero-ikon + tittel */
.dz-hero-icon {
    font-size: 2.5rem;
    margin-bottom: .25rem;
    color: #0d6efd;
}
.dz-hero-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: .25rem;
}
.dz-hero-sub {
    color: #6c757d;
    font-size: 0.95rem;
}

/* Lenken til filvelgeren */
.dz-browse {
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}
.dz-browse:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Forhåndsvisning (chip-stil) */
.dz-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
    margin-top: .75rem;
}
.dz-file-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 999px;
    padding: .35rem .75rem;
    font-size: .9rem;
}
.dz-file-chip .dz-chip-name { font-weight: 600; }
.dz-file-chip .dz-chip-size { color: #6c757d; }

/* Synlighetsboks */
.visibility-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: .75rem;
    padding: 1rem;
    margin-top: 1.25rem;
    text-align: left;
}

/* Knappeområde */
.drop-area .actions {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}
/* Unngå at lange filnavn sprenger layout */
.list-group-item .text-truncate { display: block; }

/* Jevn høyde på småknapper */
.list-group-item .btn-sm { min-height: 32px; }


.list-group-item .badge {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}
