/* --- Modal containment and stacking for credentials/secret modals inside dialogs --- */
.modal {
    position: relative;
    z-index: 1000;
}

#secretsSecretModalBackdrop.modal-backdrop,
#secretsCredentialsModalBackdrop.modal-backdrop {
    position: absolute !important;
    z-index: 1300 !important;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    padding: 0;
    overflow: auto;
}

.secrets-modal {
    z-index: 1302 !important;
    position: relative;
    background: #fff;
    width: min(420px, 90%);
    max-width: 100%;
    max-height: 90%;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    border-radius: 8px;
    margin: auto;
    overflow: auto;
}
/*
 * Copyright © 2026
 * Alvaton Holdings
 * Anthony Liberto
 * File: common.css
 * Project: AlVaTest
 * All rights reserved
 *
 * This source code is proprietary and confidential.
 * Redistribution or modification is prohibited without prior written consent.
 *
 */

:root {
    --tcms-app-font-size: 10pt;
    --tcms-ad-footer-height: 112px;
}

html {
    font-size: var(--tcms-app-font-size, 10pt);
}

body {
    font-family: Arial, sans-serif;
    font-size: 1rem;
    margin: 0;
    padding: 0 2rem 2rem;
}

body.tcms-ad-footer-visible {
    padding-bottom: var(--tcms-ad-footer-height, 112px);
}

button,
input,
textarea,
select {
    font: inherit;
}

h1 {
    margin-bottom: 0.4rem;
}

.hint {
    color: #555;
}

.page {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

.card {
    border: 1px solid #ddd;
    padding: 1rem;
    border-radius: 4px;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.grid {
    display: grid;
    gap: 0.5rem 1rem;
}

.label {
    font-weight: 600;
}

label {
    display: block;
    margin-top: 0.5rem;
    font-weight: 600;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.5rem;
    box-sizing: border-box;
}

button {
    padding: 0.5rem 0.9rem;
    cursor: pointer;
}

/* Keep icon-only controls visually consistent across pages. */
button.icon-only-btn,
button.icon-btn {
    width: 2.15rem;
    height: 2.15rem;
    min-width: 2.15rem;
    min-height: 2.15rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 1rem;
    border-radius: 4px;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

button.icon-only-btn > i,
button.icon-btn > i {
    margin-right: 0;
    font-size: 1rem;
}

button.icon-only-btn:hover,
button.icon-btn:hover {
    background-color: #e8e8e8;
}

button.icon-only-btn:focus-visible,
button.icon-btn:focus-visible {
    outline: 2px solid #5b9dd9;
    outline-offset: 2px;
}

.secondary {
    background: #f5f5f5;
    border: 1px solid #ccc;
}

/* Standard dropdown menu primitives used across pages/fragments. */
.dropdown-menu {
    position: relative;
    display: inline-block;
}

.dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.15rem;
    background: #f0f0f0;
    border: 1px solid #bcbcbc;
    border-radius: 4px;
    color: #222;
}

.dropdown-trigger:hover {
    background: #e8e8e8;
    border-color: #b0b0b0;
}

.dropdown-trigger:focus-visible {
    outline: 2px solid #5b9dd9;
    outline-offset: 2px;
}

.dropdown-content {
    position: absolute;
    left: 0;
    top: calc(100% + 0.25rem);
    width: 180px;
    max-width: min(92vw, 280px);
    max-height: min(60vh, 20rem);
    overflow-y: auto;
    background: #efefef;
    border: 1px solid #bcbcbc;
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
    padding: 0.25rem;
    z-index: 30;
}

.dropdown-content.open-up {
    top: auto;
    bottom: calc(100% + 0.25rem);
}

.dropdown-content.align-right {
    left: auto;
    right: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    min-height: 2rem;
    border: 1px solid transparent;
    background: #efefef;
    color: #222;
    text-align: left;
    padding: 0.45rem 0.6rem;
    line-height: 1.25;
    white-space: normal;
    cursor: pointer;
}

.dropdown-item + .dropdown-item {
    margin-top: 0.2rem;
}

.dropdown-item:hover {
    background: #e2e2e2;
    border-color: #c6c6c6;
}

.dropdown-item:focus-visible {
    outline: 2px solid #5b9dd9;
    outline-offset: 1px;
}

.dropdown-item i {
    margin-right: 0;
    flex: 0 0 auto;
}

.dropdown-item > span {
    flex: 1 1 auto;
    min-width: 0;
}

.dropdown-item:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.dropdown-item:disabled:hover {
    background: transparent;
}

.result {
    display: none;
    margin-top: 1rem;
    padding: 0.75rem;
    border: 1px solid #ddd;
    white-space: pre-wrap;
    word-break: break-word;
}

.result.visible {
    display: block;
}

.error {
    color: #b00020;
}

.ok {
    color: #0b7a0b;
}

.empty {
    color: #888;
    margin-top: 1rem;
}

.muted {
    color: #666;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
}

th,
td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f5f5f5;
    white-space: nowrap;
}

th.multiline-header {
    white-space: normal;
    width: 7.5rem;
    min-width: 7.5rem;
    line-height: 1.2;
}

tbody tr:nth-child(even) {
    background-color: #e3f2fd;
}

/* ── Shared data-table styles ─────────────────────────────────────── */
.table-container {
    width: 100%;
    overflow-x: auto;
}

.tcms-data-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

.tcms-data-table th {
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: none;
}

.tcms-data-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.tcms-data-table.row-compact  td { height: 26px; padding: 0.15rem 0.4rem; }
.tcms-data-table.row-default  td { height: 38px; padding: 0.3rem  0.5rem; }
.tcms-data-table.row-comfortable td { height: 50px; padding: 0.5rem 0.5rem; }
.tcms-data-table.row-spacious td {
    height: auto;
    white-space: normal;
    word-break: break-word;
    padding: 0.6rem 0.5rem;
}

.col-resizer {
    position: absolute;
    right: 0;
    top: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    z-index: 1;
}
.col-resizer:hover,
.col-resizer.resizing { background: rgba(58, 74, 191, 0.35); }

/* ── Row resize handle ────────────────────────────────────────────── */
.tcms-data-table tbody td.row-resize-cell {
    position: relative;
    overflow: visible;
}

.row-resizer-h {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 5px;
    cursor: row-resize;
    user-select: none;
    z-index: 2;
    background: transparent;
}

.row-resizer-h:hover,
.row-resizer-h.resizing { background: rgba(58, 74, 191, 0.35); }

/* Row that the user has manually resized */
.tcms-data-table tbody tr.row-user-height td {
    height: var(--tcms-row-h) !important;
    overflow-y: auto;
    white-space: normal;
    word-break: break-word;
}

.tcms-row-height-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}
.tcms-row-height-bar label {
    font-weight: 600;
    margin: 0;
}
.tcms-row-height-bar select {
    padding: 0.2rem 0.4rem;
    font-size: 0.85rem;
}

.toolbar,
.session-menu {
    margin: 1rem -2rem;
    width: calc(100% + 4rem);
    box-sizing: border-box;
    padding: 0.5rem 3.5rem;
    display: flex;
    gap: 0.6rem;
    background: linear-gradient(90deg, #000000 0%, #e53935 50%, #1e88e5 100%);
    color: #fff;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(30, 136, 229, 0.08);
    align-items: center;
}

.filters {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-weight: 600;
    font-size: 0.85em;
    margin-top: 0;
}

.filter-group select,
.filter-group input {
    padding: 0.4rem 0.5rem;
    font-size: 0.9em;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 1rem;
    overflow: auto;
    z-index: 1200;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    background: #fff;
    width: min(560px, 92vw);
    max-width: calc(100vw - 2rem);
    min-width: min(320px, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    padding: 1rem 1rem 0;
    border-radius: 6px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
    overflow: auto;
    resize: both;
    margin: 0 auto;
    box-sizing: border-box;
}

.modal-drag-handle {
    cursor: move;
    user-select: none;
    touch-action: none;
}

.modal.modal-dragging {
    transition: none;
}

@media (max-width: 768px) {
    .modal {
        resize: none;
    }
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
}

.modal .modal-actions,
.modal .section-toolbar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e2e2e2;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
    margin-top: 0.75rem;
    z-index: 1;
}

.modal .section-toolbar {
    margin: 0;
    padding: 0;
    border-top: 0;
    box-shadow: none;
    background: #fff;
}

.secure {
    content : "*"
}

.status-PASSED {
    color: #0b7a0b;
    font-weight: 600;
}

.status-FAILED,
.status-ERROR {
    color: #b00020;
    font-weight: 600;
}

.status-RUNNING {
    color: #1a56db;
    font-weight: 600;
}

.status-QUEUED,
.status-CANCELLED {
    color: #888;
}

/* Ensure secrets-modal overlays are above dialogs */
.secrets-modal {
    z-index: 1300;
    position: relative;
}

/* Ensure credentials/secret modal is above parent dialog */
#secretsSecretModalBackdrop.modal-backdrop,
#secretsCredentialsModalBackdrop.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1301;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    padding: 0;
    overflow: auto;
}

/* Optionally, make sure modal is centered and covers viewport */
#secretsSecretModalBackdrop.modal-backdrop,
#secretsCredentialsModalBackdrop.modal-backdrop {
    align-items: center !important;
    justify-content: center !important;
}

/* --- Modal containment update for dialog popups --- */
/* Make modal-backdrop fill parent (dialog), not viewport */
#secretsSecretModalBackdrop.modal-backdrop,
#secretsCredentialsModalBackdrop.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1300;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    padding: 0;
    overflow: auto;
}

/* The modal itself should not exceed the parent dialog size */
.secrets-modal {
    z-index: 1302;
    position: relative;
    width: min(420px, 90%);
    max-width: 100%;
    max-height: 90%;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    border-radius: 8px;
    background: #fff;
    margin: auto;
    overflow: auto;
}

.responsive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}