.glpisaml .form-field.row {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    width: auto !important;
    margin: 0 0.5rem 0.35rem 0.5rem !important;
    padding: 0.25rem 0.5rem 0.65rem 0.5rem !important;
    background-color: rgba(0,0,0,0.02);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.glpisaml .col-form-label,
.glpisaml label {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    text-align: left !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    word-break: break-word;
    margin-bottom: 0 !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.05em !important;
}

.glpisaml .mb-3,
.glpisaml .card-body .mb-3 {
    margin-bottom: 0.35rem !important;
}

.glpisaml .card-body {
    padding: 0.4rem !important;
}
.glpisaml .card {
    margin-bottom: 0.35rem !important;
}
.glpisaml label .label-text-part {
    display: inline-flex !important;
    align-items: center !important;
}
.glpisaml label .label-icons-part {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}
.glpisaml .form-field.row > div:not(.col-form-label):not([class*="-hover-box"]) {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: none !important;
    display: flex;
    align-items: center;
    justify-content: flex-start !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.glpisaml .form-field.row input[type="number"] {
    max-width: 120px;
    text-align: center;
}
.glpisaml .form-field.row input[type="text"],
.glpisaml .form-field.row select {
    width: 100% !important;
    max-width: 500px !important;
}
.glpisaml .form-field.row textarea {
    width: 100% !important;
    max-width: 600px !important;
}
.glpisaml .nav-tabs .nav-link.active {
    border-bottom-color: #fff !important;
    margin-bottom: -1px !important;
}
.glpisaml .card {
    border: 1px solid rgba(0,0,0,.125) !important;
    border-radius: 0.25rem !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075) !important;
}
.glpisaml .card-header {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid rgba(0,0,0,.125) !important;
}
/* Error, Warning and Info row indicators */
.glpisaml .form-field-error-row {
    background-color: rgba(220, 53, 69, 0.05) !important;
    border: 1px solid rgba(220, 53, 69, 0.2) !important;
    border-radius: 6px !important;
    padding: 0.5rem 0.75rem 0.8rem 0.75rem !important;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.glpisaml .form-field-warning-row {
    background-color: rgba(255, 193, 7, 0.08) !important;
    border: 1px dashed rgba(255, 193, 7, 0.4) !important;
    border-radius: 6px !important;
    padding: 0.5rem 0.75rem 0.8rem 0.75rem !important;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.glpisaml .form-field-info-row {
    background-color: rgba(23, 162, 184, 0.08) !important;
    border: 1px dashed rgba(23, 162, 184, 0.4) !important;
    border-radius: 6px !important;
    padding: 0.5rem 0.75rem 0.8rem 0.75rem !important;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

/* Raise hovered row to bring its absolute-positioned bubble to the front */
.glpisaml .form-field.row:hover {
    z-index: 1100 !important;
}

/* Ensure the icons container is relative */
.glpisaml .label-icons-part {
    position: relative;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Base styling for all hover chat bubbles, bound relative to form-field.row */
.glpisaml .form-field.row > .form-text-error-hover-box,
.glpisaml .form-field.row > .form-text-warning-hover-box,
.glpisaml .form-field.row > .form-text-info-hover-box,
.glpisaml .form-field.row > .form-text-help-hover-box {
    position: absolute;
    z-index: 1200;
    bottom: calc(100% + 10px); /* 10px spacing above the field */
    right: 8px !important;
    left: auto !important;
    width: 60% !important;     /* exactly 60% width of the row element */
    min-width: 320px;
    padding: 0.6rem 1rem !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12) !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    text-align: left !important;
    text-transform: none !important; /* prevent uppercase from label */
    font-weight: normal !important;
    letter-spacing: normal !important;
    white-space: normal !important;
    
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    transform: translateY(5px);
}

/* Ensure inner content of help bubble is left-aligned */
.glpisaml .form-field.row > .form-text-help-hover-box * {
    text-align: left !important;
    white-space: normal !important;
}

/* Chat bubble pointers pointing down to warning/info icon */
.glpisaml .form-field.row > .form-text-error-hover-box::before,
.glpisaml .form-field.row > .form-text-warning-hover-box::before,
.glpisaml .form-field.row > .form-text-info-hover-box::before {
    content: '';
    position: absolute;
    bottom: -5px; /* extends slightly below the bottom edge */
    right: 37px !important;
    left: auto !important;
    transform: rotate(45deg) !important;
    width: 10px;
    height: 10px;
    z-index: -1;
}

/* Chat bubble pointer pointing down to help icon */
.glpisaml .form-field.row > .form-text-help-hover-box::before {
    content: '';
    position: absolute;
    bottom: -5px; /* extends slightly below the bottom edge */
    right: 13px !important;
    left: auto !important;
    transform: rotate(45deg) !important;
    width: 10px;
    height: 10px;
    z-index: -1;
}

/* Info bubble (blue theme) */
.glpisaml .form-field.row > .form-text-info-hover-box {
    background-color: hsl(188, 70%, 96%) !important;
    border: 1px solid hsl(188, 70%, 80%) !important;
    color: hsl(188, 76%, 22%) !important;
}
.glpisaml .form-field.row > .form-text-info-hover-box::before {
    background-color: hsl(188, 70%, 96%);
    border-right: 1px solid hsl(188, 70%, 80%);
    border-bottom: 1px solid hsl(188, 70%, 80%);
}

/* Warning bubble (yellow/orange theme) */
.glpisaml .form-field.row > .form-text-warning-hover-box {
    background-color: hsl(38, 90%, 96%) !important;
    border: 1px solid hsl(38, 90%, 80%) !important;
    color: hsl(38, 90%, 25%) !important;
}
.glpisaml .form-field.row > .form-text-warning-hover-box::before {
    background-color: hsl(38, 90%, 96%);
    border-right: 1px solid hsl(38, 90%, 80%);
    border-bottom: 1px solid hsl(38, 90%, 80%);
}

/* Error bubble (red theme) */
.glpisaml .form-field.row > .form-text-error-hover-box {
    background-color: hsl(354, 70%, 96%) !important;
    border: 1px solid hsl(354, 70%, 85%) !important;
    color: hsl(354, 76%, 30%) !important;
}
.glpisaml .form-field.row > .form-text-error-hover-box::before {
    background-color: hsl(354, 70%, 96%);
    border-right: 1px solid hsl(354, 70%, 85%);
    border-bottom: 1px solid hsl(354, 70%, 85%);
}

/* Help bubble (gray theme) */
.glpisaml .form-field.row > .form-text-help-hover-box {
    background-color: hsl(0, 0%, 90%) !important;
    border: 1px solid hsl(0, 0%, 75%) !important;
    color: hsl(0, 0%, 20%) !important;
}
.glpisaml .form-field.row > .form-text-help-hover-box::before {
    background-color: hsl(0, 0%, 90%);
    border-right: 1px solid hsl(0, 0%, 75%);
    border-bottom: 1px solid hsl(0, 0%, 75%);
}

/* Trigger visibility on row hover */
.glpisaml .form-field.row:hover > .form-text-error-hover-box,
.glpisaml .form-field.row:hover > .form-text-warning-hover-box,
.glpisaml .form-field.row:hover > .form-text-info-hover-box {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Visibility when help icon is hovered (hides other bubbles, shows help bubble) */
.glpisaml .form-field.row.help-hovered > .form-text-help-hover-box {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}
.glpisaml .form-field.row.help-hovered > .form-text-error-hover-box,
.glpisaml .form-field.row.help-hovered > .form-text-warning-hover-box,
.glpisaml .form-field.row.help-hovered > .form-text-info-hover-box {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(5px) !important;
}

/* Override default Bootstrap toggle switch negative margins to align them nicely */
.glpisaml .form-check.form-switch,
.glpisaml .form-switch {
    padding-left: 2.5rem !important;
    margin-left: 0 !important;
}
.glpisaml .form-switch .form-check-input {
    margin-left: -2.5rem !important;
}


#xml_highlighted_code { color: #24292e; }
.xml-tag { color: #d73a49; font-weight: bold; }
.xml-attr { color: #6f42c1; }
.xml-val { color: #032f62; }
.xml-comment { color: #6a737d; font-style: italic; }
#samlsso-mapping-tools-collapse .select2-container .select2-selection.select2-selection--single .select2-selection__rendered::before {
    display: inline !important;
}

/* Styling for custom logging tab */
.logging-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25em 0.6em;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
    border: 1px solid transparent;
}
.logging-badge-success {
    background-color: hsl(142, 70%, 95%);
    color: hsl(142, 76%, 28%);
    border-color: hsl(142, 70%, 90%);
}
.logging-badge-danger {
    background-color: hsl(354, 70%, 96%);
    color: hsl(354, 76%, 35%);
    border-color: hsl(354, 70%, 90%);
}
/* Phase Badges HSL curated palette */
.logging-badge-phase-1 { /* Initial */
    background-color: hsl(210, 80%, 96%);
    color: hsl(210, 80%, 35%);
    border-color: hsl(210, 80%, 90%);
}
.logging-badge-phase-2 { /* SAML ACS Expected */
    background-color: hsl(35, 90%, 96%);
    color: hsl(35, 90%, 35%);
    border-color: hsl(35, 90%, 90%);
}
.logging-badge-phase-3 { /* SAML Authed */
    background-color: hsl(190, 80%, 95%);
    color: hsl(190, 80%, 30%);
    border-color: hsl(190, 80%, 90%);
}
.logging-badge-phase-4 { /* GLPI Authed */
    background-color: hsl(150, 60%, 95%);
    color: hsl(150, 60%, 30%);
    border-color: hsl(150, 60%, 90%);
}
.logging-badge-phase-5 { /* Reserved */
    background-color: hsl(260, 30%, 95%);
    color: hsl(260, 30%, 45%);
    border-color: hsl(260, 30%, 90%);
}
.logging-badge-phase-6 { /* Forced Logoff */
    background-color: hsl(10, 85%, 96%);
    color: hsl(10, 85%, 40%);
    border-color: hsl(10, 85%, 90%);
}
.logging-badge-phase-7 { /* Timed Out */
    background-color: hsl(0, 0%, 90%);
    color: hsl(0, 0%, 35%);
    border-color: hsl(0, 0%, 80%);
}
.logging-badge-phase-8 { /* Logged Out */
    background-color: hsl(280, 50%, 95%);
    color: hsl(280, 50%, 40%);
    border-color: hsl(280, 50%, 90%);
}
.logging-badge-phase-9 { /* Error / Assertion Error */
    background-color: hsl(354, 70%, 96%);
    color: hsl(354, 76%, 35%);
    border-color: hsl(354, 70%, 90%);
}

.logging-table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tb-secondary, #626976);
}

.logging-table td {
    padding: 0.65rem 0.5rem;
}

/* Popover improvements */
.popover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    border-color: var(--tb-border-color, #dee2e6) !important;
    border-radius: 0.5rem !important;
    max-width: 480px !important;
    z-index: 2000 !important;
}
.popover-header {
    font-weight: 600;
    background-color: var(--tb-light, #f8f9fa);
    border-bottom-color: var(--tb-border-color, #dee2e6);
}

/* Harmonized Popover Theme Accents */
.popover.samlsso-popover-info {
    border-left: 4px solid #9eeaf9 !important;
}
.popover.samlsso-popover-warning {
    border-left: 4px solid #ffe69c !important;
}
.popover.samlsso-popover-error {
    border-left: 4px solid #f5c2c7 !important;
}
.popover.samlsso-popover-success {
    border-left: 4px solid #a3cfbb !important;
}
.popover.samlsso-popover-trace {
    border-left: 4px solid #ffd8b3 !important;
}
.popover.samlsso-popover-trace .popover-body {
    font-family: var(--tb-font-monospace, monospace);
    font-size: 0.8rem;
}

/* Simplified forms: Categories without cards/boxes */
.glpisaml .samlsso-category-header {
    margin: 1.5rem 0.5rem 0.75rem 0.5rem !important;
    padding: 0 0.5rem 0.5rem 0.5rem !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: var(--tb-secondary, #5c626a) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}
.glpisaml .samlsso-category-header:first-of-type {
    margin-top: 0.5rem !important;
}
.glpisaml .samlsso-category-header i {
    font-size: 0.95rem !important;
}
.glpisaml .samlsso-category-body {
    padding: 0 !important;
    margin-bottom: 1.5rem !important;
}

/* Custom authn checkbox pill styling */
.samlsso-authn-checkboxes-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    max-width: 650px;
}
.samlsso-authn-checkbox {
    background-color: var(--tb-light, #f8f9fa);
    border: 1px solid var(--tb-border-color, #dee2e6);
    border-radius: 6px;
    padding: 6px 12px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    flex-direction: row !important;
}
.samlsso-authn-checkbox:hover {
    background-color: var(--tb-border-color, #e9ecef);
    border-color: #adb5bd;
}
.samlsso-authn-checkbox input[type="checkbox"] {
    margin: 0 !important;
    cursor: pointer;
    width: 1.1em;
    height: 1.1em;
}
.samlsso-authn-checkbox label {
    margin: 0 !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    text-transform: none !important;
    cursor: pointer;
    color: var(--tb-dark, #212529) !important;
    letter-spacing: normal !important;
    display: inline-flex !important;
}
.samlsso-authn-checkbox.checked {
    background-color: rgba(13, 110, 253, 0.08) !important;
    border-color: #0d6efd !important;
}
.samlsso-authn-checkbox.checked label {
    color: #0d6efd !important;
}

