
:root {
    --bg: #fbfbfc;
    --panel: #ffffff;
    --muted: #000000;
    --text: #0c0f1a;
    --primary: #e31b23;
    --accent: #6e59ff;
    --line: #eceef3;
    --chip: #f2f5ff;
    --shadow: 0 6px 18px rgba(10,16,34,.05);
    --radius: 14px;
    --facet-bg: #f4f5f8;
    --facet-bar: #cfd3dd;
    --danger: #e31b23;
    --topbar-h: 56px;
    --modal-bg: #fff;
    --modal-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    --modal-backdrop: rgba(0, 0, 0, 0.5);
}
.skip-link {
    position: absolute;
    top: -40px;
    left: 10px;
    background: #000;
    color: #fff;
    padding: 8px 12px;
    z-index: 10000;
    border-radius: 6px;
    text-decoration: none;
}

    .skip-link:focus {
        top: 10px;
    }

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    height: 100vh;
    overflow: hidden;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    color: var(--text);
    background: var(--panel);
}

    body.modal-open {
        overflow: hidden;
    }


.app {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    min-height: 100dvh;
}

.topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 16px;
    background: #E90802;
    color: #fff;
    padding: 0 18px;
    flex: 0 0 var(--topbar-h);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

    .brand svg {
        width: 24px;
        height: 24px;
    }

.grow {
    flex: 1;
}

.search-wrap {
    position: relative;
    flex: 1;
    max-width: 620px;
}

    .search-wrap input {
        width: 100%;
        height: 36px;
        border-radius: 10px;
        border: 1px solid #9ca3af;
        padding: 0 44px 0 40px;
    }
:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

    .search-wrap svg {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        opacity: .5;
    }

.toolbar {
    display: flex;
    gap: 10px;
}

.btn {
    border: 1px solid rgba(255,255,255,.25);
    background: #E90802;
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: saturate(140%) blur(4px);
}


.layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    height: calc(100vh - var(--topbar-h));
    min-height: 0;
}

.sidebar {
    border-right: 1px solid var(--line);
    background: #fafbff;
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-h));
    position: sticky;
    top: var(--topbar-h);
    align-self: start;
    min-height: 0;
}

.sidebar-inner {
    padding: 10px 16px 90px;
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
}

.welcome {
    margin: 6px 0 18px;
    font-weight: 600;
}

.facet {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    margin-bottom: 14px;
    overflow: hidden;
}

    .facet summary {
        list-style: none;
        cursor: pointer;
        padding: 0;
        background: var(--facet-bg);
        display: flex;
        align-items: center;
        gap: 10px;
        border-bottom: 1px solid var(--line);
        min-height: 42px;
    }

        .facet summary::-webkit-details-marker {
            display: none;
        }

    .facet .row {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        width: 100%;
        position: relative;
    }

        .facet .row::before {
            content: "";
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 6px;
            background: var(--facet-bar);
            border-right: 1px solid var(--line);
        }

.chev {
    margin-left: auto;
    opacity: .6;
    transition: transform .2s ease;
}

.facet[open] .chev {
    transform: rotate(180deg);
}

.facet-body {
    padding: 12px 14px;
    display: grid;
    gap: 10px;
}

.check {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    font-size: 14px;
    padding: 6px 0;
}

    .check input {
        width: 16px;
        height: 16px;
    }

.sidebar-footer {
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, #fff 60%, rgba(255,255,255,0));
    padding: 14px 16px;
    border-top: 1px solid var(--line);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
    width: 100%;
    height: 44px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
}

.search-tags-btn {
    width: 90%;
    margin: 10px auto 20px;
    display: block;
}

.main {
    padding: 20px;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 24px;
    overflow: hidden;
    min-height: 0;
}

    .main > *:not(.sidebar-toggle-btn) {
        width: min(1500px, 100%);
        margin-inline: auto;
        padding-top: 6px;
    }

.sidebar-toggle-btn {
    display: none;
}

.main-container {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    flex: 1 1 auto;
    width: 100%;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.statusbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.pill {
    background: rgba(110,89,255,.1);
    border: 1px dashed rgba(110,89,255,.25);
    color: #4238b8;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.meta {
    margin-left: auto;
    color: var(--muted);
    font-size: 14px;
}

.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--line);
    padding: 12px;
    margin-bottom: 3px;
}

.field {
    position: relative;
    flex: 1;
    min-width: 0;  
    width: 100%;
    border: 1px solid darkgrey;
}

    .field input,
    .field select {
        width: 100%;
        height: 42px;
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 0 12px 0 40px;
        background: #fff;
        outline: none;
        font-size: 0.95em;
    }

    .field svg {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        opacity: .5;
    }

.btn-primary {
    background: #E90802;
    color: #fff;
    border: none;
    padding: 0 16px;
    height: 42px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

/* =========================================================
   Cards (list scrolls)
========================================================= */
.cards {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 14px;
    width: 100%;
    max-width: 1500px;
    margin-inline: auto;
     flex: 1 1 auto;  
    align-content: start;  
    overflow-y: auto;  
    min-height: 0;  
}

.card {
    width: 100%;
    /*border: 1px solid var(--line);*/
    border: 1px solid black;
    height: 200px; background: #fff;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 2.5fr 1fr;
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}

.card-main {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.icon-bookmark {
    color: var(--muted);
    flex-shrink: 0;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.category-chip {
    margin-left: auto;
    background: #eef2ff;
    color: #4c5fb1;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.card-description {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.card-footer {
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--muted);
}

.footer-item strong {
    color: var(--text);
    font-weight: 600;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #22c55e;
}

.card-meta {
    background: var(--bg);
    border-left: 1px solid var(--line);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    font-size: 14px;
}

.meta-type {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.meta-item {
    color: var(--muted);
}

    .meta-item strong {
        display: block;
        color: var(--text);
        margin-bottom: 2px;
    }

.card-title-link {
    text-decoration: none;
    color: inherit;
}

    .card-title-link:hover h3 {
        text-decoration: underline;
        color: var(--primary);
    }

    .card-title-link h3 {
        transition: color .2s ease;
    }

/* Hover effect */
.card:hover {
    box-shadow: 0 10px 30px rgba(10,16,34,.1);
    transform: translateY(-5px);
    border-color: grey;
}

/* Bookmark / icons */
.card-icons {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
}

    .card-icons svg {
        color: var(--muted);
        cursor: pointer;
        transition: color .2s ease-in-out;
    }

        .card-icons svg:hover {
            color: var(--primary);
        }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--chip);
    color: #4238b8;
    font-weight: 600;
    font-size: 12px;
}


.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.modal-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    pointer-events: none;
}

.modal-content-small {
    background-color: var(--modal-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 400px;
    width: 90%;
    padding: 20px;
    padding-top: 30px;
    max-height: 80vh; 
    display: flex; 
    flex-direction: column; 
    pointer-events: auto;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--line);
}

.modal-body-tags {
    padding: 12px 14px;
    flex: 1 1 auto;  
    overflow-y: auto; 
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;

}

 
@media (max-width: 980px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 300px;
        height: 100vh;
        z-index: 1001;
        box-shadow: 0 0 20px rgba(0,0,0,0.25);
        transform: translateX(-100%);
        transition: transform .3s ease-in-out;
        border-right: none;
        background: var(--panel);
        display: flex;
        flex-direction: column;
    }

        .sidebar.is-visible {
            transform: translateX(0);
        }

    .sidebar-toggle-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: 1002;
        background-color: var(--accent);
        color: white;
        border: none;
        border-radius: 50px;
        padding: 12px 16px;
        font-weight: 700;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        cursor: pointer;
    }

    .card {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1280px) {
   
}

 
.visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
}
/* Position the bookmark button at the top-left of the card header */
.bookmark-btn {
    background: transparent;
    border: none;
    padding: 0;
    margin-right: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease-in-out;
}

    /* Subtle hover scale effect */
    .bookmark-btn:hover {
        transform: scale(1.1);
    }

/* Default bookmark icon (not bookmarked) */
.icon-bookmark {
    stroke: #888; /* gray outline */
    fill: none; /* empty */
    transition: stroke 0.2s ease, fill 0.2s ease;
}

    /* Active (bookmarked) state */
    .icon-bookmark.bookmarked {
        stroke: red;
        fill: red;
    }
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.perpage-selector {
    font-size: 14px;
}

    .perpage-selector label {
        margin-right: 6px;
    }

.pagination-buttons {
    display: flex;
    gap: 6px;
}

.page-btn {
    padding: 6px 12px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

    .page-btn:hover:not(:disabled) {
        background-color: #0078d7;
        color: white;
    }

    .page-btn:disabled {
        background-color: #eee;
        cursor: default;
    }

    .page-btn.active {
        background-color: #0078d7;
        color: white;
        font-weight: bold;
    }


.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .brand .logo {
        height: 28px; /* adjust to fit nicely */
        width: auto;
    }



.subfacet {
    border-bottom: 1px solid var(--line);
    padding: 4px 0;
}

    .subfacet summary {
        display: flex;
        align-items: center;
        cursor: pointer;
        list-style: none;
    }

        .subfacet summary::-webkit-details-marker {
            display: none;
        }

.chev-small {
    margin-left: auto;
    opacity: .6;
    transition: transform .2s ease;
}

.subfacet[open] .chev-small {
    transform: rotate(180deg);
}

.subfacet-body {
    padding-left: 26px;
    display: grid;
    gap: 8px;
    margin-top: 6px;
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}