:root {
    /* Z-index policy */
    --z-base: 1;
    --z-leaflet: 400;
    --z-filter: 900;
    --z-modal-backdrop: 1050;
    --z-modal: 1055;

    /* Theme */
    --bg-color: #ffffff;
    --text-color: #000000;
    --text-muted: #6c757d;
    --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;
}



html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
}


/* ---------- TYPOGRAFI OG BASE ---------- */

body {
    background-color: var(--bg-color);
    color: var(--text-color);
}


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



#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;
}



/* ---------- TABELLER ---------- */


.category-table td.truncate-cell {
    vertical-align: top;
}

.category-table td.truncate-cell .cell-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;          /* juster per kolonne */
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}



.resizable-th:hover .resize-handle {
    background-color: rgba(0,0,0,0.05);
}


@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 --- */


/* 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;
}


 table.table td {
     vertical-align: middle;
 }

tr.bg-light-subtle textarea {
    margin-top: 4px;
}

tr.bg-light-subtle label {
    font-size: 0.85rem;
    color: #666;
}
body[data-page="/start"]:not([data-theme="dark"]) {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
}

body[data-page="/start"][data-theme="dark"] {
    background: linear-gradient(180deg, #121212 0%, #1e1e1e 100%);
}
/* ---------- TAG EDITOR ---------- */

.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    min-height: 42px;
    align-items: center;
}

/* Selve taggen (chip) */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--row-even-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-color);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.tag-chip:hover {
    background: var(--hover-bg);
}

/* X – fjern-knapp */
.tag-remove {
    font-weight: bold;
    cursor: pointer;
    opacity: 0.7;
}

.tag-remove:hover {
    opacity: 1;
    color: #b00000;
}

/* Inputfeltet inne i chips-containeren */
.tag-input {
    border: none;
    outline: none;
    background: transparent;
    min-width: 100px;
    padding: 4px;
    font-size: 0.85rem;
    color: var(--text-color);
}

/* I mørk modus */
[data-theme="dark"] .tags-wrapper {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .tag-chip {
    background: rgba(255,255,255,0.07);
    border-color: var(--border-color);
}

[data-theme="dark"] .tag-chip:hover {
    background: rgba(255,255,255,0.12);
}

[data-theme="dark"] .tag-input {
    color: var(--text-color);
}


.cfx-tree-ul { list-style: none; padding-left: 15px; }
.cfx-tree-node { cursor: pointer; padding: 3px 6px; display:inline-block; }
.cfx-tree-node:hover { background: #eef; border-radius:4px; }

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.tag-item {
    background: #e9ecef;
    color: #495057;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    border: 1px solid #ced4da;
}

.tag-item:hover {
    background: #dfe3e6;
}

.tag-remove {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: 0.85rem;
    padding: 0 2px;
    margin-left: 4px;
    cursor: pointer;
}

.tag-remove:hover {
    color: #dc3545;
}
.tag-item.dragging {
    opacity: 0.4;
}

/* Tillat markering inne i headeren når man IKKE drar */
th.resizable-th .th-content {
    user-select: text !important;
    pointer-events: auto;
}

/* For sikkerhets skyld: handle klikkområde */
th.resizable-th .resize-handle {
    cursor: col-resize;
    user-select: none !important;
    pointer-events: auto;
}



.th-content {
    user-select: text;
    pointer-events: auto;
}


.resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    z-index: 50;
    pointer-events: all;
}

.resize-handle:hover {
    background: rgba(0,0,0,0.08);
}

.sticky-col {
    z-index: 30 !important;
}
.sticky-col-2 {
    z-index: 29 !important;
}
.sticky-wrapper .category-table th.sticky-col,
.sticky-wrapper .category-table td.sticky-col {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    position: sticky;
    left: 0;
    background: var(--bg-color);
    z-index: 30;
}


/* Registrert dato – smal kolonne */
th[data-field="RegisteredDate"] {
    width: 90px !important;
    min-width: 90px;
    max-width: 90px;
    white-space: normal !important;
    line-height: 1.1;
    text-align: left;
}
td[data-field="RegisteredDate"] {
    width: 80px !important;
    max-width: 80px !important;
    min-width: 70px !important;
    white-space: normal !important; /* tillat 2 linjer */
    line-height: 1.05; /* unngå at radene blir høyere */
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    text-align: left;
}

td[data-field="RegisteredDate"] span {
    display: inline-block;
    white-space: normal !important;
    word-break: break-word;
}

.category-table td[data-field="RegisteredDate"],
.category-table td[data-field*="date"],
.category-table td[data-field*="number"],
.category-table td[data-field*="serial"],
.category-table td[data-field*="coordinate"] {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}



/* Standard celler */
.category-table {
    font-size: 0.875rem;        /* 14px – merkbart tettere */
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

/* Header: litt mindre enn celler, men tydelig */
.category-table thead th {
    font-size: 0.78rem;         /* mindre enn body */
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--thead-color);
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

/* Celler */
.category-table td {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    vertical-align: middle;
}

/* Sekundærtekst (dato/tid, småtekster) */
.category-table td small,
.category-table td .text-muted {
    font-size: 0.72rem;
    line-height: 1.1;
}

/* Tall, datoer, koordinater → jevn bredde */
.category-table td[data-field*="date"],
.category-table td[data-field*="number"],
.category-table td[data-field*="serial"],
.category-table td[data-field*="coordinate"] {
    letter-spacing: -0.01em;
}

.drag-handle {
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}
.page-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}



.filter-trigger {
    text-align: left;
}




.filter-option {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 2px 0;
    cursor: pointer;
    font-size: 0.85rem;
}


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-title {
    font-weight: 500;
    font-size: 1.25rem;
}

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

/* ---------- TABELLER ---------- */


.category-table td.truncate-cell {
    vertical-align: top;
}

.category-table td.truncate-cell .cell-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;          /* juster per kolonne */
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}



.resizable-th:hover .resize-handle {
    background-color: rgba(0,0,0,0.05);
}


@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;
}


table.table td {
    vertical-align: middle;
}

tr.bg-light-subtle textarea {
    margin-top: 4px;
}

tr.bg-light-subtle label {
    font-size: 0.85rem;
    color: #666;
}
body[data-page="/start"]:not([data-theme="dark"]) {
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
}

body[data-page="/start"][data-theme="dark"] {
    background: linear-gradient(180deg, #121212 0%, #1e1e1e 100%);
}
/* ---------- TAG EDITOR ---------- */

.tags-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    min-height: 42px;
    align-items: center;
}

/* Selve taggen (chip) */
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--row-even-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-color);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.tag-chip:hover {
    background: var(--hover-bg);
}

/* X – fjern-knapp */
.tag-remove {
    font-weight: bold;
    cursor: pointer;
    opacity: 0.7;
}

.tag-remove:hover {
    opacity: 1;
    color: #b00000;
}

/* Inputfeltet inne i chips-containeren */
.tag-input {
    border: none;
    outline: none;
    background: transparent;
    min-width: 100px;
    padding: 4px;
    font-size: 0.85rem;
    color: var(--text-color);
}

/* I mørk modus */
[data-theme="dark"] .tags-wrapper {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .tag-chip {
    background: rgba(255,255,255,0.07);
    border-color: var(--border-color);
}

[data-theme="dark"] .tag-chip:hover {
    background: rgba(255,255,255,0.12);
}

[data-theme="dark"] .tag-input {
    color: var(--text-color);
}


.cfx-tree-ul { list-style: none; padding-left: 15px; }
.cfx-tree-node { cursor: pointer; padding: 3px 6px; display:inline-block; }
.cfx-tree-node:hover { background: #eef; border-radius:4px; }

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.tag-item {
    background: #e9ecef;
    color: #495057;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    border: 1px solid #ced4da;
}

.tag-item:hover {
    background: #dfe3e6;
}

.tag-remove {
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: 0.85rem;
    padding: 0 2px;
    margin-left: 4px;
    cursor: pointer;
}

.tag-remove:hover {
    color: #dc3545;
}
.tag-item.dragging {
    opacity: 0.4;
}
/* ---------- FIX: Disable text selection during column resize ---------- */
th.resizable-th,
th.resizable-th * {
    user-select: none !important;
}

/* Tillat markering inne i headeren når man IKKE drar */
th.resizable-th .th-content {
    user-select: text !important;
    pointer-events: auto;
}

/* For sikkerhets skyld: handle klikkområde */
th.resizable-th .resize-handle {
    cursor: col-resize;
    user-select: none !important;
    pointer-events: auto;
}




/* ---------- RESIZABLE HEADERS ---------- */
.resizable-th {
    position: relative;
    overflow: visible !important;
}

.th-content {
    user-select: text;
    pointer-events: auto;
}


.resize-handle {
    position: absolute;
    top: 0;
    right: -3px;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    z-index: 50;
    pointer-events: all;
}

.resize-handle:hover {
    background: rgba(0,0,0,0.08);
}
.sticky-wrapper {
    position: relative;
    overflow-x: auto;
}



.sticky-col {
    z-index: 30 !important;
}
.sticky-col-2 {
    z-index: 29 !important;
}


/* Registrert dato – smal kolonne */
th[data-field="RegisteredDate"] {
    width: 90px !important;
    min-width: 90px;
    max-width: 90px;
    white-space: normal !important;
    line-height: 1.1;
    text-align: left;
}
td[data-field="RegisteredDate"] {
    width: 80px !important;
    max-width: 80px !important;
    min-width: 70px !important;
    white-space: normal !important; /* tillat 2 linjer */
    line-height: 1.05; /* unngå at radene blir høyere */
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    text-align: left;
}

td[data-field="RegisteredDate"] span {
    display: inline-block;
    white-space: normal !important;
    word-break: break-word;
}

.category-table td[data-field="RegisteredDate"],
.category-table td[data-field*="date"],
.category-table td[data-field*="number"],
.category-table td[data-field*="serial"],
.category-table td[data-field*="coordinate"] {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}



/* Standard celler */
.category-table {
    font-size: 0.875rem;        /* 14px – merkbart tettere */
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

/* Header: litt mindre enn celler, men tydelig */
.category-table thead th {
    font-size: 0.78rem;         /* mindre enn body */
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--thead-color);
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

/* Celler */
.category-table td {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    vertical-align: middle;
}

/* Sekundærtekst (dato/tid, småtekster) */
.category-table td small,
.category-table td .text-muted {
    font-size: 0.72rem;
    line-height: 1.1;
}

/* Tall, datoer, koordinater → jevn bredde */
.category-table td[data-field*="date"],
.category-table td[data-field*="number"],
.category-table td[data-field*="serial"],
.category-table td[data-field*="coordinate"] {
    letter-spacing: -0.01em;
}


.drag-handle {
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}
.page-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}




.filter-trigger {
    text-align: left;
}


.filter-option {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 2px 0;
    cursor: pointer;
    font-size: 0.85rem;
}
.filter-option:hover {
    background-color: var(--hover-bg);
    border-radius: 4px;
}





body.modal-open .filter-dropdown,
body.modal-open .filter-panel,
body.modal-open .filter-bar {
    display: none !important;
}
.leaflet-container {
    z-index: var(--z-leaflet);
}

.leaflet-control {
    z-index: calc(var(--z-leaflet) + 10);
}
.filter-dropdown {
    position: relative;
    z-index: auto; /* viktig */
}


.filter-dropdown.open {
    z-index: calc(var(--z-filter) + 1);
}


.filter-panel {
    display: none;
    position: absolute;
    z-index: 2000; /* høyere enn inputs, buttons, rows */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem;
    max-height: 240px;
    overflow-y: auto;
    width: 100%;
    top: 100%;
    left: 0;
}


.filter-dropdown.open .filter-panel {
    display: block;
}


#filterSection {
    position: relative;
    z-index: var(--z-filter);
}
#filterSection .row {
    position: relative;
    z-index: auto;
}

.filter-dropdown.open {
    z-index: calc(var(--z-filter) + 1);
}

/*Mobil */
@media (max-width: 768px) {

    .filter-panel {
        position: static !important;
        width: 100%;
        max-height: none;
        margin-top: 0.25rem;
        box-shadow: none;
    }

    .filter-dropdown {
        z-index: auto;
    }
}
.type-help {
    margin-top: .25rem;
    font-size: 0.875rem;
    color: #6c757d;
}
.form-label {
    margin-bottom: .25rem;
}


.kanban-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: grab;

    display: flex;
    flex-direction: column;
    gap: 4px;

    transition: box-shadow .15s ease;

    max-width: 100%;
    overflow: hidden;
}


.kanban-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.kanban-card:active {
    cursor: grabbing;
}


.kanban-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.25;

    display: -webkit-box;
    -webkit-line-clamp: 3;         /* maks 3 linjer */
    -webkit-box-orient: vertical;

    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    overflow-wrap: anywhere;
}


.kanban-card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.2;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;

    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.kanban-card-meta {
    display: flex;
    gap: 6px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.kanban-chip {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--row-even-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    line-height: 1.2;
}

.kanban-chip-status {
    font-weight: 500;
    cursor: pointer;
}

.kanban-chip-date {
    opacity: 0.85;
}
.kanban-column {
    background: var(--row-even-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px 8px 10px;
    min-height: 100%;

    width: 300px;          /* ← VIKTIG */
    max-width: 300px;
    flex: 0 0 300px;       /* lås flex-bredden */
}

.kanban-column-header {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;

    padding: 6px 8px;
    margin-bottom: 6px;

    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);

    display: flex;
    justify-content: space-between;
    align-items: center;
}
.kanban-column.drag-over {
    background: rgba(13,110,253,0.08);
    border-color: #0d6efd;
}
@media (max-width: 768px) {
    .kanban-chip-status {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
}
/* ---------- KANBAN: KOLLAPS / UTVID ---------- */

.kanban-column.collapsed .kanban-column-body {
    display: none;
}

/* Visuell indikator (chevron) */
.kanban-column-chevron {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform .15s ease;
    opacity: 0.7;
}

.kanban-column.collapsed .kanban-column-chevron {
    transform: rotate(-90deg);
}

/* Header er klikkbar, men uten å forstyrre drag & drop */
.kanban-column-header {
    cursor: pointer;
    user-select: none;
}
.kanban-column.collapsed .kanban-column-body {
    display: none !important;
}


.kanban-column.collapsed .kanban-column-chevron {
    transform: rotate(-90deg);
}
