﻿body {
}

/* Make the grid single-column and center cards (controlled via CSS, no JS changes needed) */
.skj-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    justify-items: center; /* center cards horizontally */
    gap: 12px;
    align-items: start;
    margin-top: 8px;
    box-sizing: border-box;
}
    /* main grid and cards */
    /*.skj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  align-items: start;
  margin-top: 8px;
}*/

    /* Ensure every top-level card is 80% width of the container and centered */
    .skj-grid > .skj-card {
        width: 80% !important;
        min-width: 80% !important;
        max-width: 1200px;
        box-sizing: border-box;
        margin: 0; /* justify-items handles centering */
    }
/* Small screens: make cards full width */
@media (max-width: 800px) {
    .skj-grid > .skj-card {
        width: 100% !important;
        min-width: 100% !important;
        max-width: none;
    }
}

/* ALIGN child containers to the same centered width as the parent card.
   Allow JS to set explicit width; do not cap with 80% so children can match the card. */
.skj-childrow,
.skj-child-content,
.skj-childchildrow,
.skj-gognchildrow,
.skj-tilkchildrow {
    width: auto; /* JS can set explicit width to match parent card */
    max-width: none; /* remove previous 80% cap so inserted rows can match card */
    box-sizing: border-box;
    margin-top: 8px;
    background: #fbfdff;
    border-top: 1px solid #eef6ff;
    padding: 12px;
}

/* Small-screen override: child containers become full-width and flush */
@media (max-width: 800px) {
    .skj-childrow,
    .skj-child-content,
    .skj-childchildrow,
    .skj-gognchildrow,
    .skj-tilkchildrow {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 8px;
        padding-right: 8px;
    }
}

.skj-card {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.06);
    border: 1px solid #e6edf8;
    display: flex;
    flex-direction: column;
    row-gap: 8px;
    cursor: default;
}

.skj-card-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
}

.skj-first-values {
    margin-top: 6px;
    display: flex;
    column-gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #334155;
}

.skj-card-body {
    display: grid;
    grid-template-columns: 1fr;
    row-gap: 6px;
    font-size: 13px;
    color: #0f172a;
}

/* key/value rows */
.skj-kv {
    display: flex;
    justify-content: space-between;
    align-items: center;
    column-gap: 12px;
}

    .skj-kv > div:first-child { /* key */
        color: #64748b;
        font-size: 12px;
        flex: 0 0 auto;
    }

    .skj-kv > div:last-child { /* value */
        text-align: right;
        color: #0f172a;
        font-weight: 500;
        flex: 1 1 auto;
    }

/* child content blocks */
.skj-child-content {
    padding: 12px;
    background: #fafcff;
    border: 1px solid #eef6ff;
    border-radius: 6px;
    margin-top: 8px;
    box-shadow: inset 0 1px 0 rgba(0,0,0,0.02);
}

.skj-child-block {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 6px;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 6px;
}

    .skj-child-block.column {
        flex-direction: column;
    }

/* changed: make contents of .skj-child-row float left */
.skj-child-row {
    display: block; /* stop using flex so children can float */
    padding: 6px 4px;
    border-bottom: 1px solid #f1f5f9;
    box-sizing: border-box;
    overflow: hidden; /* clearfix for floated children */
}

    /* all direct children inside .skj-child-row float left */
    .skj-child-row > * {
        float: left;
        margin-right: 12px;
        /* allow content to size naturally; narrow fields can be constrained here if needed */
    }

/* if you need a last-column to align right, add a helper class in JS or use this selector
   (uncomment if desired):
.skj-child-row > .skj-child-row-right {
  float: right;
  margin-right: 0;
}
*/

/* ensure child rows appended inside a card align / size to the card */
.skj-card > .skj-childrow {
    width: 100%;
    box-sizing: border-box;
    margin-top: 8px;
    /* keep the same visual background/border if needed */
    background: #fbfdff;
    border-top: 1px solid #eef6ff;
    padding: 12px;
}

/* heiti link */
.skj-child-heiti,
.skj-heiti-link {
    color: #0d6efd;
    font-weight: 600;
    text-decoration: none;
}

    .skj-child-heiti:hover,
    .skj-heiti-link:hover {
        text-decoration: underline;
    }

/* search/title */
.skj-search {
    margin: 12px 0;
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e7eef8;
    border-radius: 6px;
    background: #fbfdff;
    font-size: 14px;
    outline: none;
}

    .skj-search:focus {
        box-shadow: 0 0 0 3px rgba(13,110,253,0.08);
    }

.skj-title {
    font-weight: 700;
    margin-bottom: 10px;
    color: #0f172a;
    font-size: 18px;
}

/* helpers */
.skj-full-data {
    margin-top: 8px;
}

.skj-gogn-block {
    padding: 8px;
    border: 1px solid #eef4ff;
    border-radius: 6px;
    background: #fff;
}

/* Two-column grid for gogn details (level 4) */
.skj-gogn-datarow {
    width: 100% !important;
    box-sizing: border-box;
    padding: 12px;
    background: #fbfdff;
    border-top: 1px solid #eef6ff;
}

/* columns container */
.skj-gogn-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

/* individual column */
.skj-gogn-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* item: title (bold) above value (plain) */
.skj-gogn-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 4px;
}

.skj-gogn-item-title {
    font-weight: 700;
    color: #475569;
    font-size: 13px;
}

.skj-gogn-item-value {
    color: #0f172a;
    font-size: 14px;
    font-weight: 400;
    white-space: pre-wrap;
}

/* full width fields span both columns */
.skj-gogn-full {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding: 8px 4px;
    border-top: 1px dashed #e6eef8;
}

/* meta line small font across full width */
.skj-gogn-meta {
    grid-column: 1 / -1;
    margin-top: 10px;
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* responsive: stack columns on small screens */
@media (max-width: 800px) {
    .skj-gogn-columns {
        grid-template-columns: 1fr;
    }

    .skj-gogn-full, .skj-gogn-meta {
        grid-column: 1 / -1;
    }
}

/* Ensure child rows inserted as siblings to cards match the card width (fallback) */
.skj-grid > .skj-childrow,
.skj-grid > .skj-child-content,
.skj-grid > .skj-childchildrow,
.skj-grid > .skj-gognchildrow,
.skj-grid > .skj-tilkchildrow {
    width: 80% !important;
    box-sizing: border-box;
    margin-top: 8px;
    margin-left: 0; /* JS insertAfter may override marginLeft with pixel alignment */
    background: #fbfdff;
    border-top: 1px solid #eef6ff;
    padding: 12px;
}

/* Small screens: make these full-width */
@media (max-width: 800px) {
    .skj-grid > .skj-childrow,
    .skj-grid > .skj-child-content,
    .skj-grid > .skj-childchildrow,
    .skj-grid > .skj-gognchildrow,
    .skj-grid > .skj-tilkchildrow {
        width: 100% !important;
        margin-left: 0 !important;
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* ensure card is positioned so absolute-positioned button places correctly */
.skj-card {
    position: relative;
}

/* Top-right register/edit buttons for cards */
.skj-card {
    position: relative;
}

/* common top button style */
.skj-register-top-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    margin-left: 6px;
    padding: 4px 8px;
    font-size: 0.9rem;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.06);
    background: #ffffff;
    color: #0b6b3a;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* individual variants */
.skj-register-btn {
    right: 8px;
    background: #ffffff;
}

.skj-register-update-btn {
    right: 170px;
    background: #ffffff;
    color: #0b6b3a;
    border-color: rgba(0,0,0,0.06);
}

.skj-register-top-edit-btn {
    right: 170px;
    background: #0b6b3a;
    color: #fff;
    border-color: #0b6b3a;
}

/* small responsive tweak so buttons don't overflow on narrow cards */
@media (max-width: 520px) {
    .skj-register-top-btn {
        display: none;
    }

        .skj-register-top-btn.mobile-show {
            display: inline-block;
            position: static;
            margin: 6px 4px;
        }
}

/* Position the Myndrit top button to the left of the "Breyta skráningu sveitafélags" button.
   Keep this narrow, targeted and resilient to the existing .skj-register-top-btn rules. */
.skj-register-myndrit-btn {
    position: absolute;
    top: 8px;
    /* place it left of the update button which is at right:170px;
     choose a value slightly larger so it appears to the left of it */
    /*right: 400px !important;*/
    margin-left: 6px;
    padding: 4px 8px;
    font-size: 0.9rem;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.06);
    background: #ffffff;
    color: #0b6b3a;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    z-index: 20; /* ensure visible above other card content */
}

/* Slight adjustment for medium/narrow widths so buttons don't overlap */
@media (max-width: 920px) {
    .skj-register-myndrit-btn {
        right: 200px !important;
    }
}

@media (max-width: 680px) {
    /* hide absolute top buttons on very small screens (keeps existing behavior) */
    .skj-register-myndrit-btn {
        display: none !important;
    }
}


/* Modal-only compact / "grand" styles
   Scoped under .skj-modal so grid view buttons and card controls are unaffected.
*/

:root {
    --modal-accent: #0b6bff;
    --modal-contrast: #062a4b;
    --modal-bg: #ffffff;
    --modal-border: #e6eef8;
    --modal-radius: 12px;
    --modal-control-height: 34px;
    --modal-control-padding: 6px 10px;
    --modal-font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* overlay (keeps existing layout but with smoother backdrop) */
.skj-modal-overlay {
    backdrop-filter: blur(4px) saturate(1.03);
    background: rgba(6, 10, 24, 0.48);
}

/* shell */
.skj-modal {
    font-family: var(--modal-font);
    color: var(--modal-contrast);
    max-width: 880px;
    width: min(94%, 880px);
    border-radius: calc(var(--modal-radius) + 2px);
    box-shadow: 0 18px 48px rgba(2, 6, 23, 0.28), inset 0 1px 0 rgba(255,255,255,0.6);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,252,255,0.98));
    padding: 8px;
}

/* header / body / footer - compact spacing, refined typography */
.skj-modal-header {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(11,107,255,0.06);
    background: linear-gradient(180deg, rgba(245,247,255,0.6), transparent);
}

    .skj-modal-header h2, .skj-modal-header h3 {
        margin: 0;
        font-size: 1rem;
        font-weight: 600;
        color: var(--modal-contrast);
        letter-spacing: 0.2px;
    }

/* body uses slightly smaller type and tighter spacing */
.skj-modal-body {
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.35;
    color: #0f172a;
}

/* layout for modal forms: tighter grid */
.skj-modal .skj-modal-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* labels slightly more subtle / compact */
.skj-modal .skj-field-wrap label {
    font-size: 0.78rem;
    color: #475569;
    text-transform: none;
    margin-bottom: 4px;
}

/* Compact, elegant inputs only inside modals */
.skj-modal .skj-field-input,
.skj-modal select,
.skj-modal textarea, {
    height: var(--modal-control-height);
    padding: var(--modal-control-padding);
    border-radius: 10px;
    border: 1px solid var(--modal-border);
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
    font-size: 0.9rem;
    color: #062a4b;
    transition: box-shadow .12s ease, transform .06s ease, border-color .12s ease;
    outline: none;
    box-sizing: border-box;
}

/* textareas taller but still styled */
.skj-modal textarea {
    min-height: 64px;
    padding: 8px 10px;
    height: auto;
}

    /* subtle focus style */
    .skj-modal .skj-field-input:focus,
    .skj-modal select:focus,
    .skj-modal textarea:focus {
        border-color: rgba(11,107,255,0.9);
        box-shadow: 0 8px 26px rgba(11,107,255,0.08);
        transform: translateY(-1px);
    }

/* Buttons limited to modals (do NOT style global buttons) */
.skj-modal button {
    font-size: 0.86rem;
    padding: 6px 10px;
    height: 34px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(2,6,23,0.06);
    cursor: pointer;
    border: 1px solid rgba(11,107,255,0.10);
    background: linear-gradient(180deg,#fff,#f7fbff);
    color: var(--modal-accent);
    transition: all .12s ease;
}

/* primary action inside modals */
.skj-modal .skj-modal-create,
.skj-modal .skj-modal-save {
    background: linear-gradient(180deg, var(--modal-accent), #0a5fd8);
    color: #fff;
    border: none;
    box-shadow: 0 10px 26px rgba(11,107,255,0.14);
}

/* secondary actions inside modals */
.skj-modal .skj-modal-close,
.skj-modal .skj-modal-cancel {
    background: linear-gradient(180deg,#fff,#f4f7fb);
    color: #334155;
    border: 1px solid rgba(15,23,42,0.05);
}

/* make the small inline add/remove buttons compact and elegant inside modals */
.skj-modal .skj-add-starf-btn,
.skj-modal .skj-add-tengsl-btn {
    padding: 6px 10px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.84rem;
    background: linear-gradient(180deg,#fff,#f3f8ff);
    color: #0b6b3a;
    border: 1px solid rgba(11,107,255,0.06);
}

/* compact remove buttons used inside modal lists */
.skj-modal .skj-tengsl-remove-btn,
.skj-modal .skj-starf-remove {
    padding: 5px 8px;
    height: 30px;
    font-size: 0.82rem;
    border-radius: 6px;
    background: #fff;
    color: #b02b2b;
    border: 1px solid rgba(176,43,43,0.08);
}

/* list rows inside modals (starfseiningar / tengsl) */
.skj-modal .skj-starf-list,
.skj-modal .skj-tengsl-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.skj-modal .skj-starf-row,
.skj-modal .skj-tengsl-row {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(230,238,248,0.9);
    background: linear-gradient(180deg,#fff,#fcfeff);
    font-size: 0.9rem;
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
}

/* make modal forms collapse to single column on very small screens */
@media (max-width: 640px) {
    .skj-modal .skj-modal-form {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .skj-modal {
        width: 96%;
        padding: 8px;
    }

        .skj-modal .skj-modal-header {
            padding: 10px;
        }

        .skj-modal .skj-modal-body {
            padding: 8px;
        }

        .skj-modal .skj-modal-footer {
            padding: 8px;
        }
}

/* Smaller checkboxes for `.skj-field-input` (and tolerate typo `.skj-field-inpun`) */
input[type="checkbox"].skj-field-input,
input[type="checkbox"].skj-field-inpun,
.skj-modal input[type="checkbox"].skj-field-input,
.skj-modal input[type="checkbox"].skj-field-inpun {
    width: 16px;
    height: 16px;
    padding: 0;
    box-sizing: border-box;
    margin: 0 8px 0 0;
    vertical-align: middle;
    accent-color: var(--modal-accent, #0b6bff);
    cursor: pointer;
}

/* Fallback for user agents that ignore explicit sizing on native checkboxes */
input[type="checkbox"].skj-field-input,
input[type="checkbox"].skj-field-inpun {
    transform-origin: center;
    transform: scale(0.92);
}

/* Slightly smaller on very narrow screens */
@media (max-width: 520px) {
    input[type="checkbox"].skj-field-input,
    input[type="checkbox"].skj-field-inpun,
    .skj-modal input[type="checkbox"].skj-field-input,
    .skj-modal input[type="checkbox"].skj-field-inpun {
        width: 14px;
        height: 14px;
        transform: scale(0.9);
        margin-right: 6px;
    }
}

/* Preserve newlines when rendering values so '\n' becomes visible line breaks */
.skj-gogn-item-value,
.skj-tilk-text,
.skj-kv > div:last-child {
    white-space: pre-wrap;
}

/* Make per-child Myndrit button visible and inline with the "Skrá skjalamyndara" button.
   Minimal, targeted rules to avoid disturbing other layouts. */
.skj-child-block .skj-register-myndrit-btn,
.skj-child-block .skj-register-skj-btn {
    display: inline-block; /* ensure buttons sit on the same line */
    width: auto !important; /* prevent any CSS forcing full-width */
    margin: 0 0 0 8px; /* small gap between buttons */
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #e6eef8;
    border-radius: 4px;
    color: #0f172a;
    cursor: pointer;
    vertical-align: middle;
    box-sizing: border-box;
}

/* If buttons were previously hidden by color/opacity rules, force visibility */
.skj-child-block .skj-register-myndrit-btn {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Optional: keep the block positioned so absolute placement (if used elsewhere) works */
.skj-child-block {
    position: relative;
}

/* Align per-child Myndrit + Skjálamyndara buttons so they appear at the right of the child block.
   The child heading (link) will take the remaining width so buttons sit inline at the right. */
.skj-child-block {
    display: flex; /* ensure flex layout */
    align-items: center;
    gap: 8px;
    position: relative;
}

    .skj-child-block > .skj-child-head,
    .skj-child-block > a,
    .skj-child-block > .skj-child-heiti {
        flex: 1 1 auto; /* let the title/heading take remaining space */
        min-width: 0; /* allow truncation instead of overflow */
    }

    /* Button appearance and stacking */
    .skj-child-block .skj-register-myndrit-btn,
    .skj-child-block .skj-register-skj-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 6px 10px;
        background: #fff;
        border: 1px solid #e6eef8;
        border-radius: 4px;
        color: #0f172a;
        cursor: pointer;
        white-space: nowrap;
        box-sizing: border-box;
        z-index: 3; /* ensure visible above neighboring elements */
    }

    /* Push the main action (Skrá skjalamyndara) to the far right; Myndrit sits immediately left */
    .skj-child-block .skj-register-skj-btn {
        margin-left: auto;
    }

    .skj-child-block .skj-register-myndrit-btn {
        margin-left: 8px;
    }
/* Stack all top buttons on every card in a vertical column at the right edge.
   JS will compute exact top offsets and set inline `top` and card padding so
   the card height is 10px larger than the stack height.
*/
.skj-card {
    position: relative; /* anchor for absolutely positioned buttons (already present) */
    /* allow JS to set padding-top dynamically; keep existing paddings as baseline */
}

    /* Target common top-button classes and the actions dropdown wrapper */
    .skj-card > .skj-register-top-btn,
    .skj-card > .skj-actions-dropdown,
    .skj-card > .skj-register-myndrit-btn,
    .skj-card > .skj-register-update-btn,
    .skj-card > .skj-register-gogn-btn,
    .skj-card > .skj-register-skj-btn,
    .skj-card > .skj-register-btn,
    .skj-card > .skj-actions-toggle {
        position: absolute !important;
        right: 8px !important;
        /* top is assigned by JS so we don't set it here */
        display: inline-flex !important;
        align-items: center;
        gap: 6px;
        z-index: 9999 !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        white-space: nowrap;
    }

    /* Ensure dropdown menu is positioned relative to its wrapper and not clipped */
    .skj-card .skj-actions-dropdown .skj-actions-menu {
        right: 0 !important;
        top: calc(100% + 6px) !important;
        z-index: 10000 !important;
        display: none; /* menu toggles with .open on wrapper */
    }

/* Ensure card header / links sit at top-left and do not overlap the stacked buttons */
/* Reserve space on the right for stacked buttons/menus (adjust 240px if your menus are wider) */
.skj-card {
    /* default top padding to keep header visible when JS hasn't adjusted padding yet */
    padding-top: 48px;
    position: relative;
}

/* Place header top-left and constrain its right edge so it doesn't flow under buttons */
.skj-card-header {
    position: absolute;
    top: 8px;
    left: 12px;
    right: calc(8px + 240px); /* 8px (right margin) + room for stacked buttons/menu width */
    z-index: 6;
    display: block;
    pointer-events: auto;
}

    /* Make title/link a block so it aligns to the left inside header */
    .skj-card-header > div,
    .skj-card-header a.skj-heiti-link {
        display: block;
        line-height: 1.15;
        color: inherit;
    }

/* Child blocks: ensure their local link/header sits top-left of the block */
.skj-child-block {
    position: relative; /* anchor for its absolute header */
    padding-top: 40px; /* reserve space for the absolute link area */
}

    .skj-child-block > .skj-child-head,
    .skj-child-block a.skj-child-heiti {
        position: absolute;
        top: 8px;
        left: 12px;
        right: calc(8px + 160px); /* leave smaller room for local child buttons */
        z-index: 5;
        display: block;
    }

/* Responsive: when absolute top buttons are hidden or narrow screens, allow header to span full width */
@media (max-width: 920px) {
    .skj-card-header,
    .skj-child-block > .skj-child-head,
    .skj-child-block a.skj-child-heiti {
        right: 12px;
    }

    /* reduce reserved top padding on small screens */
    .skj-card {
        padding-top: 36px;
    }

    .skj-child-block {
        padding-top: 34px;
    }
}

/* when a modal is open, block pointer events for page content but allow the modal itself */
body.skj-modal-open * {
    pointer-events: none !important;
}

/* ensure modal and its descendants remain interactive */
body.skj-modal-open .skj-modal,
body.skj-modal-open .skj-modal *,
body.skj-modal-open .modal,
body.skj-modal-open .modal *,
body.skj-modal-open .modal-backdrop {
    pointer-events: auto !important;
}

/* dim underlying content slightly (optional) */
body.skj-modal-open > :not(.skj-modal-overlay) {
    filter: brightness(0.95);
}

/* Prevent background scrolling while modal open; allow modal to scroll */
body.skj-modal-open {
    overflow: hidden;
}

/* Ensure modal bodies scroll if taller than viewport */
.skj-modal, .modal {
    max-height: 90vh;
    overflow: auto;
}

/* position the actions group in the top-right of its .skj-card container */
.skj-actions-group {
    /* most inline styles set by JS; keep a fallback */
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    z-index: 1200;
    display: block;
}

/* Legend styling to look like a small action toggle in the corner */
/*.skj-actions-legend {
  cursor: pointer;
  padding: 4px 8px;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.9);
  border-radius: 4px;
  border: 1px solid rgba(15,23,42,0.06);
  color: #0f172a;
}*/

/* Ensure the actions legend sits above button stack and is clickable */
.skj-actions-legend {
    position: relative;
    top: 8px;
    right: 80px;
    z-index: 11000; /* above stacked buttons */
    pointer-events: auto;
    background: rgba(255,255,255,0.95);
}

/* Slight spacing so legend doesn't visually overlap first button when JS hasn't run yet */
.skj-card > .skj-actions-group .skj-actions-legend {
    margin-bottom: 6px;
}

/* TEMP: hide search bar during debugging */
.skj-search-wrap,
.skj-search {
    display: none !important;
    visibility: hidden !important;
}

/* Fix stacking so card buttons stay under the fixed navbar.
   Keeps navbar (#site) above everything while allowing card dropdowns
   to appear above card buttons but still below the navbar.
   Append this block to the end of view.css. */

.navbar,
header,
.site-navbar,
.main-menu {
  /* Site navbar is already fixed in site.css; ensure it stays on top */
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6000 !important; /* higher than card buttons */
  background: inherit; /* don't change visual style */
}

/* Ensure card action buttons are placed below the navbar */
.skj-card > .skj-register-top-btn,
.skj-card > .skj-actions-dropdown,
.skj-card > .skj-register-myndrit-btn,
.skj-card > .skj-register-update-btn,
.skj-card > .skj-register-gogn-btn,
.skj-card > .skj-register-skj-btn,
.skj-card > .skj-register-btn,
.skj-card > .skj-actions-toggle,
.skj-card > .skj-register-top-edit-btn,
.skj-actions-group,
.skj-child-block .skj-register-myndrit-btn,
.skj-child-block .skj-register-skj-btn {
  z-index: 4000 !important; /* below navbar (6000) */
}

/* Dropdown menus for actions should float above card buttons but still below navbar */
.skj-card .skj-actions-dropdown .skj-actions-menu,
.skj-actions-group .skj-actions-menu {
  z-index: 5500 !important; /* between buttons (4000) and navbar (6000) */
}

/* Keep modal overlays above everything (no change) */
.skj-modal-overlay {
  z-index: 10000 !important;
}

/* Safety: reset any overly-aggressive inline z-index from JS where possible
   (JS may set inline styles; these CSS rules use !important to clamp them). */