/* ==========================================================
   PAGE LAYOUT
   ========================================================== */

.page-header {
    margin-bottom: 16px;
}

.page-header h1 {
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 0.9rem;
    color: #777;
}


/* ==========================================================
   CONTEXT SELECTION (SITE / FEDERATION / GROUP)
   ========================================================== */

.context-selector {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 16px;
}

.context-selector .context-radios {
    display: flex;
    align-items: center;
    gap: 12px;
}

.context-selector select {
    min-width: 220px;
}

/* ==========================================================
   Context selection bar
   ========================================================== */

.config-context-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.context-label {
    font-weight: 600;
    margin-right: 8px;
}

.context-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.context-option input[type="radio"] {
    margin: 0;
}

.context-select {
    min-width: 220px;
    height: 28px;
    padding: 4px 8px;
}

/* ==========================================================
   INHERITANCE INFORMATION BOX
   ========================================================== */

.criteria-inheritance-info {
    margin: 12px 0 16px;
    padding: 10px 14px;
    background: #f5f7fa;
    border-left: 5px solid #5b9bd5;
    font-size: 0.9rem;
    color: #444;
}


/* ==========================================================
   Scope breadcrumb
   ========================================================== */


/* Scope chain layout */
.scope-chain {
    display: inline-flex;
    align-items: center;
    gap: 6px;

}

/* Base pill */
.scope-pill {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 500;
    white-space: nowrap;
}

.scope-pill.clickable {
    cursor: pointer;
    text-decoration: underline;
}

/* Individual scopes */
.scope-group {
    background-color: #e8f0ff;
    color: #1e3a8a;
}

.scope-federation {
    background-color: #bfd4ff;
    color: #1e3a8a;
}
.scope-global {
    background-color: #4a6fd8;
    color: #ffffff;
}
.scope-badge.clickable {
    cursor: pointer;
    text-decoration: underline;
}

.scope-badge.clickable:hover {
    opacity: 0.85;
}

/* Separator */
.scope-sep {
    color: #6b7280; /* neutral grey */
    font-size: 0.75rem;
}

/* ==========================================================
   TABLE – SHARED
   ========================================================== */

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 8px 10px;
    border-bottom: 1px solid #e1e1e1;
    vertical-align: top;
}

th.center,
td.center {
    text-align: center;
}


/* ==========================================================
   SORTABLE TABLE HEADERS
   ========================================================== */

th.sortable {
    cursor: pointer;
    user-select: none;
}


th.sortable.active::after {
    content: '▲';
    margin-left: 6px;
    font-size: 10px;
}

th.sortable.active.desc::after {
    content: '▼';
}


/* ==========================================================
   CRITERION LABEL + DESCRIPTION (STACKED)
   ========================================================== */

.criterion-label {
    font-weight: 700;
}

.criterion-description {
    font-size: 0.85rem;
    color: #777;
    margin-top: 2px;
}


/* ==========================================================
   WEIGHT INPUT
   ========================================================== */

.weight-input {
    width: 70px;
    text-align: center;
}


/* ==========================================================
   BADGES – ORIGIN / STATUS
   ========================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    font-size: 0.75rem;
    border-radius: 12px;
    white-space: nowrap;
}

/* Origin badges */
.badge-site {
    background: #d9edf7;
    color: #31708f;
}

.badge-federation {
    background: #fcf8e3;
    color: #8a6d3b;
}

.badge-group {
    background: #f2dede;
    color: #a94442;
}

/* Active / inactive */
.badge-active {
    background: #e6f4ea;
    color: #2e7d32;
}

.badge-inactive {
    background: #fdecea;
    color: #c62828;
}


.page-actions {
    padding-top: 16px;
    text-align: right ;
}


/* ==========================================================
   ADD EXISTING CRITERION MODAL
   ========================================================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.open,
.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    width: 800px;
    max-width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: 6px;
    overflow: hidden;
}

.modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #ddd;
    font-weight: 700;
}

.modal-body {
    padding: 12px 16px;
    overflow-y: auto;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-actions {
    padding-top: 12px;
}


/* ==========================================================
   MODAL – SEARCH + SELECTION
   ========================================================== */

.criteria-search {
    margin-bottom: 10px;
}

.criteria-search input {
    width: 100%;
    padding: 6px 8px;
}

.selected-criteria-count {
    font-size: 0.8rem;
    color: #666;
}


/* ==========================================================
   CHECKBOX COLUMN
   ========================================================== */

td.checkbox-cell,
th.checkbox-cell {
    width: 36px;
    text-align: center;
}


