:root, html[data-bs-theme="dark"]:root {
    --bs-primary: #9A63EC;
    --bs-link-color: var(--bs-primary);
    --bs-link-color-rgb: 154, 99, 236;
    --bs-link-hover-color-rgb: 154, 99, 236;
    --brand-black: #333333;
    --brand-mid: #C4ACE0;
    --brand-light: #FCEAFF;
    --brand-success: #64BAAA;
}
.dropdown-menu, html[data-bs-theme="dark"] .dropdown-menu {
    --bs-dropdown-link-active-bg: var(--bs-primary);
}
.layout-horizontal .main-navbar {
    background-color: var(--bs-primary);
}
html[data-bs-theme="dark"] .btn-primary, .btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-border-color: var(--bs-primary);
    --bs-btn-active-bg: var(--bs-primary);
    --bs-btn-active-border-color: var(--bs-primary);
    --bs-btn-disabled-bg: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
}
.btn.btn-light-primary {
    background-color: var(--brand-light);
    color: var(--bs-primary);
}
html[data-bs-theme="dark"] .btn.btn-light-primary {
    background-color: var(--brand-light);
}
html[data-bs-theme="dark"] .btn-outline-primary, .btn-outline-primary {
    --bs-btn-color: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-hover-border-color: var(--bs-primary);
    --bs-btn-active-bg: var(--bs-primary);
    --bs-btn-active-border-color: var(--bs-primary);
    --bs-btn-disabled-color: var(--bs-primary);
    --bs-btn-disabled-color: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
}

.header-top-left {
    display: flex;
    align-items: baseline;
}
#main .header-top .logo img {
    height: 32px;
}
.form-group.d-inline {
    margin-bottom: 0;
}

fieldset .form-check-input + label {
    font-weight: normal;
    min-height: 1.5rem;
    margin: .125rem;
}

.search-form .form-body>.row {
    display: flex;
    &>.col-12 {
        width: auto;
        flex-grow: 1;
    }
}

[data-bs-theme="light"] {
    header #logo-dark {
        display: none;
    }
    header #logo-light {
        display: inline-block;
    }
}
[data-bs-theme="dark"] {
    header #logo-light {
        display: none;
    }
    header #logo-dark {
        display: inline-block;
    }
}
.btn-keycloak {
    display: flex;
    align-items: center;
}
a.btn-keycloak {
    display: inline-flex;
}
.page-heading h3 {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}
.hide-form-errors .alert.form-errors {
    display: none;
}
.organization-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}

.organization-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    i::before {
        display: block;
        margin-top: -4px;
        margin-left: -5px;
    }
}

.stats-icon.purple {
    background-color: var(--bs-primary);
}

.stats-icon.blue {
    background-color: var(--bs-info);
}

.stats-icon.green {
    background-color: var(--brand-success);
}

.timeline {
    position: relative;
    padding-left: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e5e7eb;
}

.timeline-item {
    position: relative;
    margin-bottom: 1rem;
}

.timeline-marker {
    position: absolute;
    left: -16px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #d1d5db;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #f3f4f6;
}

.timeline-content {
    margin-left: 10px;
}
.quick-actions i.bi {
    margin-top: -16px;
    padding-right: 28px;
}

/* Card layout utilities - reusable for any card grid */
.card-grid {
    display: flex;
    flex-wrap: wrap;
}

.card-grid > * {
    display: flex;
    align-items: stretch;
}

.card-grid .card {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.card-grid .card-content {
    flex-grow: 1;
}

.card-grid .card-body {
    flex-grow: 1;
}

/* Card header with logo styling */
.card-header-with-logo {
    display: flex;
    align-items: center;
}

.card-header-with-logo img {
    max-width: 48px;
    max-height: 48px;
    margin-right: 1rem;
}

.card-header-with-logo .card-header-content {
    display: flex;
    flex-direction: column;
}

.card-header-with-logo .card-header-content h4 {
    margin-bottom: 0;
}

.card-header-with-logo .card-header-content .text-muted {
    font-size: 0.875rem;
}

/* Backwards compatibility - keep existing service-cards-container class */
.service-cards-container > * {
    display: flex;
    align-items: stretch;
}
.service-cards-container .card {
    width: 100%;
}
.service-cards-container .card-content {
    flex-grow: 1;
}

/* Expert CRD Form mandatory field styling */
.expert-crd-form .form-group.mandatory .form-label {
    font-weight: bold;
    position: relative;
}

.expert-crd-form .form-group.mandatory .form-label::after {
    content: " *";
    color: #dc3545;
    font-weight: bold;
}

.expert-crd-form .form-group.mandatory {
    border-left: 3px solid #dc3545;
    padding-left: 10px;
    background-color: rgba(220, 53, 69, 0.05);
    border-radius: 3px;
}

.expert-crd-form .nav-tabs .nav-link .mandatory-indicator {
    color: #dc3545;
    font-weight: bold;
    font-size: 1.1em;
    margin-left: 4px;
}

html[data-bs-theme="dark"] .expert-crd-form .form-group.mandatory {
    background-color: rgba(220, 53, 69, 0.1);
    border-left-color: #ff6b6b;
}

html[data-bs-theme="dark"] .expert-crd-form .form-group.mandatory .form-label::after {
    color: #ff6b6b;
}

html[data-bs-theme="dark"] .expert-crd-form .nav-tabs .nav-link .mandatory-indicator {
    color: #ff6b6b;
}

.crd-form .nav-tabs .nav-link.has-mandatory {
    position: relative;
}

.service-deactivated .card {
    opacity: 50%;
    cursor: not-allowed;
    img {
        opacity: 75%
    }
    h4, small, p {
        color: var(--bs-secondary-color) !important;
    }
    a.btn-outline-secondary {
        color: var(--bs-btn-disabled-color) !important;
        background-color: var(--bs-btn-disabled-bg) !important;
        border-color: var(--bs-btn-disabled-border-color) !important;
        opacity: var(--bs-btn-disabled-opacity);
    }
    a.btn-secondary {
        color: white !important;
    }
    a.btn {
        pointer-events: none;
    }
}
.ml-auto {
    margin-left: auto !important
}

.beta-banner {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--brand-mid) 100%);
    color: white;
    padding: 0.75rem 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.beta-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.beta-banner-badge {
    background-color: white;
    color: var(--bs-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: bold;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}
.beta-banner-text {
    font-size: 0.95rem;
}
.beta-banner-button {
    background-color: white;
    color: var(--bs-primary);
    border: none;
    font-weight: 600;
    padding: 0.375rem 1rem;
    transition: all 0.2s ease;
}
.beta-banner-button:hover {
    background-color: var(--brand-light);
    color: var(--bs-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

html[data-bs-theme="dark"] .beta-banner {
    background: linear-gradient(135deg, var(--bs-primary) 0%, #7a4fc4 100%);
}
html[data-bs-theme="dark"] .beta-banner-badge {
    background-color: rgba(255, 255, 255, 0.95);
}
html[data-bs-theme="dark"] .beta-banner-button {
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--bs-primary);
}
html[data-bs-theme="dark"] .beta-banner-button:hover {
    background-color: white;
    color: var(--bs-primary);
}

/* Fixed table layout for credentials */
.table-fixed {
    table-layout: fixed;
    word-wrap: break-word;
}
