﻿/* SAFARIBOK | Fil: gridcontrol.css | Version: 1.0.0 | 2026-10-07 | Original frontend v35. */
/*
    GridControl
    version 1.08, 2026-10-05

    Syfte:
    - Gemensam styling för återanvändbar DataTables-grid.
    - Toolbar med rader/sök/export/kolumnväljare.
    - Kolumnpanel, radmarkering, drag/drop och responsiv mobilvy.

    Viktigt:
    - Alla selectors är scoped mot .gridcontrol där det går.
    - Panelen för kolumnvisning läggs i body och har gridKey i data-attribut.
    - När en cell innehåller .gc-drag-handle eller .drag-handle sätter gridcontrol.js
      automatiskt klassen .gc-col-rowtools.
*/

/* =========================================================
   Grund
========================================================= */

.gridcontrol {
    position: relative;
    width: 100%;
}

    .gridcontrol .gc-header h4 {
        margin-bottom: .35rem;
    }

    .gridcontrol .gc-header p {
        margin-bottom: .75rem;
    }

    /* =========================================================
   DataTables toolbar
   Layout:
   [Rader] [Sökfält höger/flex] [Export/kolumnknappar]
========================================================= */

    .gridcontrol .gc-toolbar,
    .gridcontrol .dt-toolbar {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 16px;
        flex-wrap: nowrap;
        width: 100%;
    }

    .gridcontrol tbody, .gridcontrol thead {
        /*font-size: 13px;*/
    }

    /* Vänster: antal rader */
    .gridcontrol .gc-length {
        flex: 0 0 auto;
        margin: 0;
    }


    /* Wrapper för antal rader */
    .gridcontrol .gc-length {
        flex: 0 0 auto;
        margin: 0;
    }

    .gridcontrol .dataTables_length {
        margin: 0;
    }

        .gridcontrol .dataTables_length label {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0;
            white-space: nowrap;
            font-weight: 400;
            font-size: 12px;
            color: #5a6068;
        }

        /* Selecten för antal rader */
        .gridcontrol .dataTables_length select.form-control,
        .gridcontrol .dataTables_length select.form-control-sm {
            width: 66px !important;
            min-width: 66px !important;
            height: 38px !important;
            padding: 6px 28px 6px 13px !important;
            font-size: 14px !important;
            line-height: 1.4 !important;
            color: #4f5963 !important;
            background-color: #fff !important;
            border: 1px solid #ddd !important;
            border-radius: 5px !important;
            box-shadow: none !important;
            appearance: none !important;
            -webkit-appearance: none !important;
            -moz-appearance: none !important;
            background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23555' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
            background-repeat: no-repeat !important;
            background-size: 10px 6px !important;
            background-position: right 11px center !important;
        }

html.dark .gridcontrol .dataTables_length select.form-control,
html.dark .gridcontrol .dataTables_length select.form-control-sm {
    background-color: #282d36 !important;
    border: 1px transparent !important;
    color: #fff !important;
}

/* Hover/focus */
.gridcontrol .dataTables_length select.form-control:hover, .gridcontrol .dataTables_length select.form-control-sm:hover {
    border-color: #cfcfcf !important;
}

.gridcontrol .dataTables_length select.form-control:focus,
.gridcontrol .dataTables_length select.form-control-sm:focus {
    border-color: #bfc5cc !important;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.04) !important;
    outline: none !important;
}

/* Mitten: sök */
.gridcontrol .gc-search {
    flex: 0 1 620px;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

    .gridcontrol .gc-search .dataTables_filter,
    .gridcontrol .dataTables_filter {
        margin: 0;
        width: 100%;
        max-width: 620px;
    }

        .gridcontrol .dataTables_filter label {
            width: 100%;
            margin: 0;
        }

        .gridcontrol .dataTables_filter input {
            width: 100%;
            max-width: none;
            height: 38px;
            margin: 0;
        }


/* bulkmeny*/
.gridcontrol .gc-bulkbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

    .gridcontrol .gc-bulkbar.d-none {
        display: none !important;
    }

/* När bulkbar visas: bulkbaren skjuts mot söken */

/* Toolbar-layout */
.gridcontrol .gc-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

/* Normalläge: söken ligger till höger */
.gridcontrol .gc-search {
    margin-left: auto;
}


.gridcontrol .gc-bulkbar:not(.d-none) + .gc-search {
    margin-left: 0;
}

.gridcontrol .gc-bulkbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gridcontrol .gc-bulk-action-group {
    display: inline-flex;
    align-items: center;
}

.gridcontrol .gc-bulk-action-button,
.gridcontrol .gc-bulk-clear {
    height: 38px;
    background: #fff !important;
    color: #4c4c4c !important;
    border: 1px solid #e5e5e5 !important;
    box-shadow: none !important;
}

.gridcontrol .gc-bulk-action-button {
    padding: 0 14px !important;
    font-size: 13px !important;
    font-weight: 400;
    border-radius: 5px 0 0 5px !important;
}

.gridcontrol .gc-bulk-clear {
    width: 38px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-left: 0 !important;
    border-radius: 0 5px 5px 0 !important;
    font-size: 14px !important;
}

/* Separator mellan åtgärd och x */
.gridcontrol .gc-bulk-clear {
    position: relative;
}

    .gridcontrol .gc-bulk-clear::before {
        content: "";
        position: absolute;
        left: 0;
        top: 25%;
        height: 50%;
        width: 1px;
        background: #e1e1e1;
    }

    .gridcontrol .gc-bulk-action-button:hover,
    .gridcontrol .gc-bulk-clear:hover {
        background: #f7f7f7 !important;
        color: #222 !important;
    }

/* Textdelar */
.gridcontrol .gc-bulk-action-button .gc-bulk-count {
    font-weight: 600;
    color: #222;
}

.gridcontrol .gc-bulk-action-button .gc-bulk-action-label {
    font-weight: 400;
    color: #666;
}

/* Höger: export/actions */
.gridcontrol .gc-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    margin: 0;
}

    .gridcontrol .gc-actions .dt-buttons,
    .gridcontrol div.dt-buttons {
        display: inline-flex;
        align-items: center;
        gap: 0;
        margin: 0;
        padding: 0;
        width: auto !important;
        float: none !important;
    }

        /* Exportknappar */
        .gridcontrol div.dt-buttons .btn,
        .gridcontrol .gc-fallback-button {
            background: #fff !important;
            border-color: #e5e5e5 !important;
            color: #4c4c4c !important;
            height: 38px;
            min-height: 38px;
            padding: 0 14px;
            margin: 0 !important;
            border-radius: 0 !important;
            font-size: 13px;
            font-weight: 400;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            box-shadow: none !important;
        }

html.dark .gridcontrol div.dt-buttons .btn, html.dark .gridcontrol .gc-fallback-button {
    background-color: #282d36 !important;
    border-color: transparent !important;
    color: #fff !important
}

.gridcontrol div.dt-buttons .btn:first-child {
    border-top-left-radius: 4px !important;
    border-bottom-left-radius: 4px !important;
}

.gridcontrol div.dt-buttons .btn:last-child {
    border-top-right-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
}

.gridcontrol div.dt-buttons .btn + .btn {
    margin-left: -1px !important;
    position: relative;
}

    .gridcontrol div.dt-buttons .btn + .btn::before {
        content: "";
        position: absolute;
        left: 0;
        top: 25%;
        height: 50%;
        width: 1px;
        background-color: rgba(255,255,255,0.45);
    }

.gridcontrol div.dt-buttons .btn:hover,
.gridcontrol div.dt-buttons .btn:focus,
.gridcontrol .gc-fallback-button:hover,
.gridcontrol .gc-fallback-button:focus {
    background: #f2f2f2 !important;
    color: #000 !important;
}

/* Ikoner/text i exportknappar */
.gridcontrol div.dt-buttons .btn i,
.gridcontrol .gc-fallback-button i {
    color: #4c4c4c !important;
    font-weight: 300;
}

html.dark .gridcontrol div.dt-buttons .btn i,
html.dark .gridcontrol .gc-fallback-button i {
    color: #fff !important;
}

.gridcontrol .dt-button-text-label {
    margin-left: 4px;
}

/* Paging kan döljas om det inte behövs */
.gridcontrol .gc-paging-hidden {
    display: none !important;
}

.pagination {
    font-size: 13px;
}

/* =========================================================
   Mobil / smal vy
========================================================= */

@media (max-width: 767.98px) {
    .gridcontrol .gc-toolbar,
    .gridcontrol .dt-toolbar {
        gap: 8px;
        flex-wrap: wrap;
    }

    .gridcontrol .gc-length {
        flex: 0 0 auto;
    }

    .gridcontrol .gc-search {
        flex: 1 1 160px;
        justify-content: flex-end;
    }

        .gridcontrol .gc-search .dataTables_filter,
        .gridcontrol .dataTables_filter {
            max-width: none;
        }

    .gridcontrol .gc-actions {
        flex: 0 0 auto;
    }

    .gridcontrol .dt-button-text-label {
        display: none;
    }

    .gridcontrol div.dt-buttons .btn,
    .gridcontrol .gc-fallback-button {
        padding: 0 11px;
    }
}

@media (max-width: 420px) {
    .gridcontrol .dataTables_length select,
    .gridcontrol .dataTables_length .select2-container {
        width: 65px !important;
        min-width: 65px;
    }

    .gridcontrol .dataTables_length label {
        gap: 6px;
    }

    .gridcontrol div.dt-buttons .btn,
    .gridcontrol .gc-fallback-button {
        padding: 0 9px;
    }
}

/* =========================================================
   Tabell
========================================================= */

/*.gridcontrol,
.gridcontrol table,
.gridcontrol .dataTables_wrapper,
.gridcontrol .form-control,
.gridcontrol .btn,
.gridcontrol select,
.gridcontrol input {
    font-size: inherit;
}*/
.gridcontrol table.dataTable thead th,
.gridcontrol table.dataTable tbody td {
    font-size: inherit;
}


.gridcontrol table.dataTable th,
.gridcontrol table.dataTable td {
    box-sizing: border-box;
}

.gridcontrol table.dataTable th {
    padding-right: 24px !important;
}

.gridcontrol thead tr,
.gridcontrol tfoot tr {
    background: #ffebeb;
}

html.dark .gridcontrol thead tr,
html.dark .gridcontrol tfoot tr {
    background: #1e2023;
}

.gridcontrol tr:hover {
    cursor: pointer;
}

.gridcontrol .gc-th-info {
    margin-left: 4px;
    opacity: .65;
}

.gridcontrol .gc-row-processing {
    opacity: .45;
}

/* =========================================================
   Radmarkering
========================================================= */

.gridcontrol tr.selected,
.gridcontrol tr.selected > td {
    background-color: rgb(61 155 55 / 16%) !important;
}

html.dark .gridcontrol tr.selected,
html.dark .gridcontrol tr.selected > td {
    background-color: rgb(67 143 90 / 16%) !important;
}

/*
    Vanlig första kolumn med bara select-icon.
    Gäller endast när första cellen INTE är rowtools.
*/
.gridcontrol.gc-select-icons table.dataTable tbody tr td:first-child:not(.gc-col-rowtools) {
    position: relative;
    padding-left: 34px !important;
}

    .gridcontrol.gc-select-icons table.dataTable tbody tr td:first-child:not(.gc-col-rowtools)::before {
        content: "\f111";
        font-family: "Font Awesome 6 Pro", "Font Awesome 6 Free";
        font-weight: 300;
        position: absolute;
        left: 11px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 11px;
        line-height: 1;
        color: #777;
        pointer-events: none;
    }

.gridcontrol.gc-select-icons table.dataTable tbody tr.selected td:first-child:not(.gc-col-rowtools)::before {
    content: "\f058";
    font-weight: 900;
    color: #28a745;
}

/* =========================================================
   Drag/drop
========================================================= */

.gridcontrol .drag-handle,
.gridcontrol .gc-drag-handle {
    cursor: move;
    opacity: .7;
}

.gridcontrol .gc-sort-placeholder {
    height: 42px;
    background: rgba(0,0,0,.05);
    border: 1px dashed rgba(0,0,0,.25);
}

html.dark .gridcontrol .gc-sort-placeholder {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.25);
}


.gridcontrol.gc-dragdrop-enabled tbody tr {
    cursor: default;
}

.gridcontrol.gc-dragdrop-enabled .gc-drag-handle {
    cursor: grab;
}

    .gridcontrol.gc-dragdrop-enabled .gc-drag-handle:active {
        cursor: grabbing;
    }


/* Originalraden medan den flyttas */
.gridcontrol.gc-dragdrop-enabled tr.gc-row-being-dragged > td {
    opacity: 0.45;
}

.gridcontrol.gc-dragdrop-enabled tr.gc-sort-placeholder {
    visibility: visible !important;
    height: 6px !important;
    position: relative;
}

    .gridcontrol.gc-dragdrop-enabled tr.gc-sort-placeholder > td {
        background: transparent !important;
        padding: 0 !important;
        height: 6px !important;
        line-height: 6px !important;
        border: 0 !important;
        position: relative;
    }

    /* själva släpplinjen */
    .gridcontrol.gc-dragdrop-enabled tr.gc-sort-placeholder > td::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 1px; /* justera här */
        height: 2px;
        background: #222;
    }

/* =========================================================
   Rowtools: kombinerad första/systemkolumn
   Layout: [drag] [select-icon]

   Syfte:
   - Drag-ikonen ligger till vänster.
   - Select/checkbox-ikonen ligger till höger.
   - Ikonerna påverkar inte radens höjd.
   - Cellens höjd följer övriga DataTables-celler.
========================================================= */

.gridcontrol table.dataTable th.gc-col-rowtools,
.gridcontrol table.dataTable td.gc-col-rowtools {
    width: 1% !important;
    min-width: 58px !important;
    max-width: 70px !important;
    white-space: nowrap;
    text-align: center;
    vertical-align: middle !important;
    line-height: inherit !important;
}

/* Headern ska vara kompakt men inte påverka övriga rubriker */
.gridcontrol table.dataTable th.gc-col-rowtools {
    padding-left: 8px !important;
    padding-right: 8px !important;
}

/* Cell med både drag och select-icon */
.gridcontrol.gc-select-icons table.dataTable tbody tr td.gc-col-rowtools {
    position: relative;
    padding-left: 8px !important;
    padding-right: 28px !important;
    vertical-align: middle !important;
}

/*
    Drag-ikonen ska inte påverka höjden.
    inline-flex ger stabil centrering utan att lägga till extra pixelhöjd.
*/
.gridcontrol .gc-col-rowtools .gc-drag-handle,
.gridcontrol .gc-col-rowtools .drag-handle {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 14px;
    line-height: 14px;
    vertical-align: middle;
    cursor: move;
    opacity: .65;
}

/* Select/checkbox-ikon till höger i samma cell */
.gridcontrol.gc-select-icons table.dataTable tbody tr td.gc-col-rowtools::before {
    content: "\f111";
    font-family: "Font Awesome 6 Pro";
    font-weight: 300;
    position: absolute;
    right: 10px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    line-height: 1;
    color: #777;
    pointer-events: none;
}

/* Markerad rad */
.gridcontrol.gc-select-icons table.dataTable tbody tr.selected td.gc-col-rowtools::before {
    content: "\f058";
    font-weight: 900;
    color: #28a745;
}

/* =========================================================
   Kolumnpanel: visa/dölj fält
========================================================= */

.gc-colpanel {
    position: absolute;
    z-index: 2000;
    width: 280px;
    background: #fff;
    color: #30343b;
    border: 1px solid #d8dce1;
    border-radius: 7px;
    display: none;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 10px 28px rgba(0,0,0,.14);
}

.gc-colregion {
    padding: 8px 10px;
    font-weight: 600;
    background: #f3f4f6;
    border-bottom: 1px solid #dfe2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.gc-colregion .btn {
    margin-left: 4px;
    background: #fff;
    border-color: #d5d9de;
    font-weight: 500;
}

html.dark .gc-colregion {
    color: #f1f3f5;
    background: #282d36;
    border-bottom-color: #3b424d;
}

html.dark .gc-colregion .btn {
    color: #e9ecef;
    background: #343a45;
    border-color: #4a5260;
}

html.dark .gc-colregion .btn:hover,
html.dark .gc-colregion .btn:focus {
    color: #fff;
    background: #3d4552;
    border-color: #596372;
}

html.dark .gc-colpanel {
    color: #e9ecef;
    background: #20242b;
    border-color: #3b424d;
    box-shadow: 0 10px 28px rgba(0,0,0,.4);
}

.gc-colrow {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 34px;
    padding: 5px 11px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.25;
}

.gc-colrow:hover {
    background: #f6f7f8;
}

html.dark .gc-colrow:hover {
    background: #2b3039;
}

.gc-colrow.is-hidden {
    color: #747b84;
    opacity: 1;
    text-decoration: none;
}

.gc-colrow.is-locked {
    color: #8a9098;
    opacity: 1;
    cursor: default;
}

.gc-colcheck,
.gc-colcheck-placeholder {
    width: 16px;
    height: 16px;
    margin: 0;
    justify-self: start;
}

.gc-colcheck {
    cursor: pointer;
    accent-color: #ffbcbc;
    pointer-events: none;
}

.gc-colcheck-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

html.dark .gc-colrow.is-hidden {
    color: #969daa;
}

html.dark .gc-colcheck {
    accent-color: #5b6675;
}

/* =========================================================
   Externa actions under grid
========================================================= */

.gridcontrol .gc-external-actions .btn + .btn {
    margin-left: 5px;
}

/* =========================================================
   Status/badge-hjälpklasser - kan användas i cell-HTML
========================================================= */

.gridcontrol .badge {
    font-weight: 400;
    border-radius: 15px;
    padding: .45em .6em;
}

.gridcontrol .badge-prio1 {
    color: white;
    background: #f1b3b3;
}

.gridcontrol .badge-prio2 {
    color: white;
    background: #a96b6b;
}

.gridcontrol .badge-prio3 {
    color: white;
    background: #854040;
}

.gridcontrol .badge-grey1 {
    color: white;
    background: #aad1c2;
}

.gridcontrol .badge-grey2 {
    color: white;
    background: #8ea59c;
}

.gridcontrol .badge-grey3 {
    color: white;
    background: #667d74;
}

.gridcontrol .badge-grey4 {
    color: white;
    background: #47695c;
}

.gridcontrol .badge-grey5 {
    color: white;
    background: #4d4c4c;
}

.gridcontrol .badge-status1 {
    background-color: #f1b3b3;
    color: #000;
}

.gridcontrol .badge-status2 {
    background-color: #cc6969;
    color: #fff;
}

.gridcontrol .badge-status3 {
    background-color: #d7a630;
    color: #fff;
}

.gridcontrol .badge-status4 {
    background-color: #4d6b24;
    color: #fff;
}

.gridcontrol .badge-status5 {
    background-color: #a96b6b;
    color: #fff;
}

.gridcontrol .badge-status6 {
    background-color: #854040;
    color: #fff;
}

/* =========================================================
   Patch 2026-07-09
   Bulk actions: hover/active, gruppavstånd och dark mode
   - Behåller befintliga regler men skriver över oönskade states.
========================================================= */

/* Lite tajtare mellan bulk action-gruppen och exportknapparna */
.gridcontrol .gc-bulkbar.gc-bulkbar-inline {
    margin-right: -4px;
}

/* Bulk action-knappar ska visuellt höra ihop med exportknapparna */
.gridcontrol .gc-bulk-action-group .gc-bulk-action-button,
.gridcontrol .gc-bulk-action-group .gc-bulk-clear {
    height: 38px !important;
    min-height: 38px !important;
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
    color: #4c4c4c !important;
    border: 1px solid #e5e5e5 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    outline: none !important;
}

/* Håll ihop tvådelad knapp utan att tappa kantlinjer */
.gridcontrol .gc-bulk-action-group .gc-bulk-action-button {
    border-right: 0 !important;
    border-radius: 5px 0 0 5px !important;
    position: relative;
    z-index: 1;
}

.gridcontrol .gc-bulk-action-group .gc-bulk-clear {
    border-left: 0 !important;
    border-radius: 0 5px 5px 0 !important;
    position: relative;
    z-index: 1;
}

    /* Hover/focus ska vara samma lugna känsla som exportknapparna */
    .gridcontrol .gc-bulk-action-group .gc-bulk-action-button:hover,
    .gridcontrol .gc-bulk-action-group .gc-bulk-clear:hover,
    .gridcontrol .gc-bulk-action-group .gc-bulk-action-button:focus,
    .gridcontrol .gc-bulk-action-group .gc-bulk-clear:focus {
        background: #efefef !important;
        color: #222 !important;
        border-color: #d8d8d8 !important;
        box-shadow: none !important;
        outline: none !important;
    }

    /* När dropdownen är öppen: behåll ljus knapp, inte svart/active Bootstrap-state */
    .gridcontrol .gc-bulk-action-group .gc-bulk-action-button:active,
    .gridcontrol .gc-bulk-action-group .gc-bulk-clear:active,
    .gridcontrol .gc-bulk-action-group .gc-bulk-action-button.active,
    .gridcontrol .gc-bulk-action-group .gc-bulk-clear.active,
    .gridcontrol .gc-bulk-action-group .gc-bulk-action-button:not(:disabled):not(.disabled):active,
    .gridcontrol .gc-bulk-action-group .gc-bulk-clear:not(:disabled):not(.disabled):active,
    .gridcontrol .gc-bulk-action-group.show .gc-bulk-action-button,
    .gridcontrol .gc-bulk-action-group.show .gc-bulk-clear,
    .gridcontrol .gc-bulk-action-group.show > .gc-bulk-action-button.dropdown-toggle,
    .gridcontrol .gc-bulk-action-group .show > .gc-bulk-action-button.dropdown-toggle,
    .gridcontrol .gc-bulk-action-group .dropdown.show .gc-bulk-action-button,
    .gridcontrol .gc-bulk-action-group .dropdown.show > .gc-bulk-action-button.dropdown-toggle {
        background: #efefef !important;
        background-color: #efefef !important;
        background-image: none !important;
        color: #222 !important;
        border-color: #d8d8d8 !important;
        box-shadow: none !important;
        outline: none !important;
    }

    /* Separator mellan åtgärd och X ska alltid synas */
    .gridcontrol .gc-bulk-action-group .gc-bulk-clear::before {
        content: "";
        position: absolute;
        left: 0;
        top: 25%;
        height: 50%;
        width: 1px;
        background: #e1e1e1;
    }

/* Text och ikon i bulkknappen */
.gridcontrol .gc-bulk-action-button .gc-bulk-count {
    color: #222 !important;
    font-weight: 600;
}

.gridcontrol .gc-bulk-action-button .gc-bulk-action-label {
    color: #666 !important;
    font-weight: 400;
}

.gridcontrol .gc-bulk-clear i,
.gridcontrol .gc-bulk-clear svg {
    color: #4c4c4c !important;
}

/* Dropdownmenyn för bulk actions */
.gridcontrol .gc-bulkbar .dropdown-menu {
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 8px 20px rgba(0,0,0,.10);
    padding: 0;
    overflow: hidden;
}

.gridcontrol .gc-bulkbar .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 9px 14px;
    color: #4c4c4c;
    border-bottom: 1px solid #eeeeee;
}

    .gridcontrol .gc-bulkbar .dropdown-item:last-child {
        border-bottom: 0;
    }

    .gridcontrol .gc-bulkbar .dropdown-item:hover,
    .gridcontrol .gc-bulkbar .dropdown-item:focus {
        background: #f7f7f7;
        color: #222;
    }

    .gridcontrol .gc-bulkbar .dropdown-item.text-danger {
        color: #a94442 !important;
    }

        .gridcontrol .gc-bulkbar .dropdown-item.text-danger:hover,
        .gridcontrol .gc-bulkbar .dropdown-item.text-danger:focus {
            background: #fff4f4;
            color: #8f2f2d !important;
        }

/* Dark mode: bulkknappar */
html.dark .gridcontrol .gc-bulk-action-group .gc-bulk-action-button,
html.dark .gridcontrol .gc-bulk-action-group .gc-bulk-clear {
    background: #282d36 !important;
    background-color: #282d36 !important;
    background-image: none !important;
    color: #fff !important;
    border-color: #3a414d !important;
    box-shadow: none !important;
}

    html.dark .gridcontrol .gc-bulk-action-group .gc-bulk-action-button:hover,
    html.dark .gridcontrol .gc-bulk-action-group .gc-bulk-clear:hover,
    html.dark .gridcontrol .gc-bulk-action-group .gc-bulk-action-button:focus,
    html.dark .gridcontrol .gc-bulk-action-group .gc-bulk-clear:focus,
    html.dark .gridcontrol .gc-bulk-action-group .gc-bulk-action-button:active,
    html.dark .gridcontrol .gc-bulk-action-group .gc-bulk-clear:active,
    html.dark .gridcontrol .gc-bulk-action-group .gc-bulk-action-button.active,
    html.dark .gridcontrol .gc-bulk-action-group .gc-bulk-clear.active,
    html.dark .gridcontrol .gc-bulk-action-group .gc-bulk-action-button:not(:disabled):not(.disabled):active,
    html.dark .gridcontrol .gc-bulk-action-group .gc-bulk-clear:not(:disabled):not(.disabled):active,
    html.dark .gridcontrol .gc-bulk-action-group.show .gc-bulk-action-button,
    html.dark .gridcontrol .gc-bulk-action-group.show .gc-bulk-clear,
    html.dark .gridcontrol .gc-bulk-action-group.show > .gc-bulk-action-button.dropdown-toggle,
    html.dark .gridcontrol .gc-bulk-action-group .show > .gc-bulk-action-button.dropdown-toggle,
    html.dark .gridcontrol .gc-bulk-action-group .dropdown.show .gc-bulk-action-button,
    html.dark .gridcontrol .gc-bulk-action-group .dropdown.show > .gc-bulk-action-button.dropdown-toggle {
        background: #343b46 !important;
        background-color: #343b46 !important;
        background-image: none !important;
        color: #fff !important;
        border-color: #4a5362 !important;
        box-shadow: none !important;
    }

    html.dark .gridcontrol .gc-bulk-action-group .gc-bulk-clear::before {
        background: rgba(255,255,255,.18);
    }

html.dark .gridcontrol .gc-bulk-action-button .gc-bulk-count,
html.dark .gridcontrol .gc-bulk-action-button .gc-bulk-action-label,
html.dark .gridcontrol .gc-bulk-clear i,
html.dark .gridcontrol .gc-bulk-clear svg {
    color: #fff !important;
}

/* Dark mode: dropdownmeny */
html.dark .gridcontrol .gc-bulkbar .dropdown-menu {
    background: #1c1f26;
    border-color: #3a414d;
    box-shadow: 0 8px 20px rgba(0,0,0,.35);
}

html.dark .gridcontrol .gc-bulkbar .dropdown-item {
    color: #f2f2f2;
    border-bottom-color: #303640;
}

    html.dark .gridcontrol .gc-bulkbar .dropdown-item:hover,
    html.dark .gridcontrol .gc-bulkbar .dropdown-item:focus {
        background: #2b313a;
        color: #fff;
    }

    html.dark .gridcontrol .gc-bulkbar .dropdown-item.text-danger {
        color: #ff9b9b !important;
    }

        html.dark .gridcontrol .gc-bulkbar .dropdown-item.text-danger:hover,
        html.dark .gridcontrol .gc-bulkbar .dropdown-item.text-danger:focus {
            background: #3a2427;
            color: #ffb8b8 !important;
        }

/* Dark mode: exportknappar ska inte bli ljusa på hover */
html.dark .gridcontrol div.dt-buttons .btn:hover,
html.dark .gridcontrol div.dt-buttons .btn:focus,
html.dark .gridcontrol .gc-fallback-button:hover,
html.dark .gridcontrol .gc-fallback-button:focus {
    background: #343b46 !important;
    color: #fff !important;
    border-color: #4a5362 !important;
}

    html.dark .gridcontrol div.dt-buttons .btn:hover i,
    html.dark .gridcontrol div.dt-buttons .btn:focus i,
    html.dark .gridcontrol .gc-fallback-button:hover i,
    html.dark .gridcontrol .gc-fallback-button:focus i {
        color: #fff !important;
    }

/* =========================================================
   Workhour 1.04 - modern komponentdesign
   Gemensam styling för alla GridControl-instanser.
   Ingen sidunik override krävs.
========================================================= */
.gridcontrol {
    --gc-bg: #ffffff;
    --gc-bg-soft: #f8fafc;
    --gc-bg-hover: #f5f7fa;
    --gc-border: #e7ebf0;
    --gc-border-strong: #dce2e8;
    --gc-text: #172033;
    --gc-muted: #6f7b8d;
    --gc-heading: #52627a;
    --gc-control-bg: #ffffff;
    --gc-shadow: 0 1px 2px rgba(16,24,40,.03);
    color: var(--gc-text);
}

html.dark .gridcontrol {
    --gc-bg: #172231;
    --gc-bg-soft: #1c2939;
    --gc-bg-hover: #202f41;
    --gc-border: rgba(255,255,255,.075);
    --gc-border-strong: rgba(255,255,255,.11);
    --gc-text: #e9eef5;
    --gc-muted: #9aa8ba;
    --gc-heading: #a8b7ca;
    --gc-control-bg: #202d3d;
    --gc-shadow: none;
}

/* Luftigare, sammanhållen toolbar */
.gridcontrol .gc-toolbar,
.gridcontrol .dt-toolbar {
    gap: 10px;
    margin-bottom: 14px;
}

.gridcontrol .dataTables_length label {
    color: var(--gc-muted) !important;
}

.gridcontrol .dataTables_length select.form-control,
.gridcontrol .dataTables_length select.form-control-sm,
.gridcontrol .dataTables_filter input {
    height: 40px !important;
    color: var(--gc-text) !important;
    background-color: var(--gc-control-bg) !important;
    border: 1px solid var(--gc-border-strong) !important;
    border-radius: 9px !important;
    box-shadow: var(--gc-shadow) !important;
}

.gridcontrol .dataTables_filter input {
    padding: 0 14px !important;
}

.gridcontrol .dataTables_filter input::placeholder {
    color: var(--gc-muted);
    opacity: .85;
}

html.dark .gridcontrol .dataTables_length select.form-control,
html.dark .gridcontrol .dataTables_length select.form-control-sm {
    background-color: var(--gc-control-bg) !important;
    border-color: var(--gc-border-strong) !important;
    color: var(--gc-text) !important;
}

/* Export och kolumnknappar: samma kontrollspråk som resten av Workhour */
.gridcontrol div.dt-buttons .btn,
.gridcontrol .gc-fallback-button {
    height: 40px;
    min-height: 40px;
    padding: 0 13px;
    color: var(--gc-text) !important;
    background: var(--gc-control-bg) !important;
    border-color: var(--gc-border-strong) !important;
    font-weight: 400;
}

.gridcontrol div.dt-buttons .btn:first-child {
    border-top-left-radius: 9px !important;
    border-bottom-left-radius: 9px !important;
}

.gridcontrol div.dt-buttons .btn:last-child {
    border-top-right-radius: 9px !important;
    border-bottom-right-radius: 9px !important;
}

.gridcontrol div.dt-buttons .btn i,
.gridcontrol .gc-fallback-button i,
html.dark .gridcontrol div.dt-buttons .btn i,
html.dark .gridcontrol .gc-fallback-button i {
    color: var(--gc-muted) !important;
}

.gridcontrol div.dt-buttons .btn:hover,
.gridcontrol div.dt-buttons .btn:focus,
.gridcontrol .gc-fallback-button:hover,
.gridcontrol .gc-fallback-button:focus,
html.dark .gridcontrol div.dt-buttons .btn:hover,
html.dark .gridcontrol div.dt-buttons .btn:focus,
html.dark .gridcontrol .gc-fallback-button:hover,
html.dark .gridcontrol .gc-fallback-button:focus {
    background: var(--gc-bg-hover) !important;
    color: var(--gc-text) !important;
    border-color: var(--gc-border-strong) !important;
}

/* Själva tabellen: ta bort Bootstrap-gridkänslan med hårda rutnät */
.gridcontrol .dataTables_scroll,
.gridcontrol .dataTables_scrollHead,
.gridcontrol .dataTables_scrollBody {
    border: 0 !important;
}

.gridcontrol table.dataTable {
    width: 100% !important;
    margin: 0 !important;
    color: var(--gc-text) !important;
    background: transparent !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid var(--gc-border) !important;
    border-radius: 10px;
    overflow: hidden;
}

.gridcontrol table.dataTable thead tr,
.gridcontrol table.dataTable tfoot tr,
html.dark .gridcontrol table.dataTable thead tr,
html.dark .gridcontrol table.dataTable tfoot tr {
    background: var(--gc-bg-soft) !important;
}

.gridcontrol table.dataTable thead th {
    padding: 12px 14px !important;
    color: var(--gc-heading) !important;
    background: #ebedef !important;
    border-top: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--gc-border-strong) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: .01em;
    vertical-align: middle;
    white-space: nowrap;
}

/* Mörkt tema behåller GridControls mörka rubrikbakgrund. */
html.dark .gridcontrol table.dataTable thead th {
    background: var(--gc-bg-soft) !important;
}

.gridcontrol table.dataTable tbody td {
    padding: 6px 14px !important;
    color: var(--gc-text) !important;
    background: transparent !important;
    border-top: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--gc-border) !important;
    vertical-align: middle !important;
    line-height: 1.35;
}

.gridcontrol table.dataTable tbody tr:last-child td {
    border-bottom: 0 !important;
}

.gridcontrol table.dataTable.table-striped tbody tr:nth-of-type(odd),
.gridcontrol table.dataTable.table-striped tbody tr:nth-of-type(even) {
    background: transparent !important;
}

.gridcontrol table.dataTable tbody tr:hover > td {
    background: var(--gc-bg-hover) !important;
}

/* DataTables sortindikatorer ska vara diskreta */
.gridcontrol table.dataTable thead .sorting:before,
.gridcontrol table.dataTable thead .sorting:after,
.gridcontrol table.dataTable thead .sorting_asc:before,
.gridcontrol table.dataTable thead .sorting_asc:after,
.gridcontrol table.dataTable thead .sorting_desc:before,
.gridcontrol table.dataTable thead .sorting_desc:after {
    opacity: .22 !important;
}

.gridcontrol table.dataTable thead .sorting_asc:before,
.gridcontrol table.dataTable thead .sorting_desc:after {
    opacity: .7 !important;
}

/* Info/paging */
.gridcontrol .dataTables_info {
    padding-top: 14px !important;
    color: var(--gc-muted) !important;
    font-size: 12px;
}

.gridcontrol .dataTables_paginate {
    padding-top: 10px !important;
}

.gridcontrol .pagination .page-link {
    color: var(--gc-muted);
    background: var(--gc-control-bg);
    border-color: var(--gc-border);
    box-shadow: none !important;
}

.gridcontrol .pagination .page-item.active .page-link {
    color: var(--gc-text);
    background: var(--gc-bg-hover);
    border-color: var(--gc-border-strong);
}

/* Standardbadges får samma lugna Workhour-form */
.gridcontrol .badge {
    padding: .48em .72em;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.15;
    font-weight: 500;
}

/* Mobil: sökfältet får egen rad när utrymmet blir trångt. */
@media (max-width: 767.98px) {
    .gridcontrol .gc-toolbar,
    .gridcontrol .dt-toolbar {
        align-items: stretch;
    }

    .gridcontrol .gc-search {
        order: 3;
        flex: 1 0 100%;
        width: 100%;
        margin-left: 0;
    }

    .gridcontrol .gc-search .dataTables_filter,
    .gridcontrol .dataTables_filter {
        max-width: none;
    }

    .gridcontrol table.dataTable thead th,
    .gridcontrol table.dataTable tbody td {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* =========================================================
   Workhour 1.05 - layoutjustering
   - GridControl fyller tillgänglig yta utan egen kortbakgrund.
   - DataTables dolda mäthuvud i scrollBody får inte synas.
   - Sökfältet ligger direkt före exportknapparna.
========================================================= */

.gridcontrol,
.gridcontrol .dataTables_wrapper {
    width: 100% !important;
    max-width: none !important;
    min-height: 100%;
    background: transparent !important;
}

/* Sökfältet ska ligga till höger, direkt före export/actions. */
.gridcontrol .gc-search {
    flex: 0 1 360px !important;
    width: min(360px, 100%);
    margin-left: auto !important;
    justify-content: flex-end;
}

.gridcontrol .gc-search .dataTables_filter,
.gridcontrol .dataTables_filter {
    width: 100%;
    max-width: 360px !important;
}

.gridcontrol .gc-actions {
    margin-left: 0 !important;
}

/*
   När horizontal scroll används skapar DataTables ett extra thead i
   scrollBody enbart för kolumnmätning. Vår normala header-padding får
   inte göra den raden synlig.
*/
.gridcontrol .dataTables_scrollBody table.dataTable thead tr,
.gridcontrol .dataTables_scrollBody table.dataTable thead th {
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    background: transparent !important;
}

.gridcontrol .dataTables_scrollBody table.dataTable thead th::before,
.gridcontrol .dataTables_scrollBody table.dataTable thead th::after {
    display: none !important;
}

/* Själva gridden använder hela bredden utan ytterligare kortkant. */
.gridcontrol table.dataTable {
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
}

@media (max-width: 767.98px) {
    .gridcontrol .gc-search {
        flex: 1 0 100% !important;
        width: 100%;
        margin-left: 0 !important;
    }

    .gridcontrol .gc-search .dataTables_filter,
    .gridcontrol .dataTables_filter {
        max-width: none !important;
    }
}

/* =========================================================
   Workhour 1.06 - finjustering av grid
   - Sökfält och exportknappar hålls ihop till höger.
   - Gridytan får en gemensam 10px ram.
   - Ingen extra linje under kolumnrubrikerna.
   - Aktiv sortering får tydlig vit indikator i dark mode.
   - Datumceller radbryts inte.
========================================================= */

/* Högergruppen: sök direkt intill exportknapparna. */
.gridcontrol .gc-search {
    flex: 0 0 260px !important;
    width: 260px !important;
    margin-left: auto !important;
    margin-right: 0 !important;
}

.gridcontrol .gc-search .dataTables_filter,
.gridcontrol .dataTables_filter,
.gridcontrol .dataTables_filter label,
.gridcontrol .dataTables_filter input {
    width: 100% !important;
    max-width: none !important;
}

.gridcontrol .gc-actions {
    flex: 0 0 auto !important;
    margin-left: 0 !important;
}

/* En enda ram runt själva gridytan, inte toolbar eller bottentext. */
.gridcontrol .dataTables_scroll {
    border: 1px solid var(--gc-border) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

.gridcontrol .dataTables_scrollHead,
.gridcontrol .dataTables_scrollBody {
    border: 0 !important;
}

.gridcontrol table.dataTable {
    border: 0 !important;
    border-radius: 0 !important;
}

/* Ingen ljus skiljelinje direkt under rubrikraden. */
.gridcontrol table.dataTable thead th {
    border-bottom: 0 !important;
}

/* Aktiv sortering ska synas tydligt. */
html.dark .gridcontrol table.dataTable thead .sorting_asc:before,
html.dark .gridcontrol table.dataTable thead .sorting_desc:after {
    color: #fff !important;
    opacity: 1 !important;
}

/* Datum och andra uttryckligen nowrap-markerade celler hålls på en rad. */
.gridcontrol table.dataTable td.admin-nowrap,
.gridcontrol table.dataTable th.admin-nowrap,
.gridcontrol .admin-nowrap {
    white-space: nowrap !important;
}

/* Klickbara datarader. */
.gridcontrol table.dataTable tbody tr[data-share-id] {
    cursor: pointer;
}

@media (max-width: 767.98px) {
    .gridcontrol .gc-search {
        flex: 1 0 100% !important;
        width: 100% !important;
        margin-left: 0 !important;
    }
}


/* Workhour 1.08 – kompakt standardrad, samma ungefärliga höjd som rubriken.
   Rader med flera textrader får växa; knappar/bilder tvingas aldrig att klippas. */
.gridcontrol table.dataTable tbody td {
    min-height: 40px;
    height: 40px;
    box-sizing: border-box;
}
