/* TABS */
.custom-tabs .nav-link {
    font-weight: 500;
    color: #000;
    border: none;
    border-bottom: 2px solid transparent;
    background-color: transparent;
    border-radius: 8px 8px 0 0;
    padding: 0.5rem 1.5rem;
}

.custom-tabs .nav-link.active {
    border-bottom: 2px solid var(--brand-primary);
    background-color: white;
    color: #000;
}

.custom-tabs .nav-link:hover {
    border-color: rgba(0, 0, 0, 0.1);
    color: #000;
    text-decoration: none;
    background-color: #ededed;
}

.custom-tabs .nav-link.active:hover {
    color: #000;
    text-decoration: none;
    background-color: white;
}

.custom-tabs .disabled {
    color: #6c757d;
}

/* KPI CARDS */
.kpi-card {
    cursor: pointer;
    background-color: white;
    padding: 1em;
    border-radius: 0.5em;
    border: 1px solid var(--ui-border);
    color: #fff;
    text-align: right;
}

.kpi-card:hover {
    background-color: var(--ui-light);
    opacity: 0.9;
    transform: translateY(-2px);
}

.kpi-card h5 {
    margin-bottom: 0;
    margin-right: 10px;
    font-size: 4em;
    color: var(--text-medium);
}

.kpi-card p {
    margin-bottom: 0;
    margin-right: 10px;
    color: var(--text-medium);
}

/* TUTORIAL CARDS */
.tutorial-card {
    background-color: white;
    padding: 2em;
    border-radius: 0.5em;
    border: 1px solid var(--ui-border);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.watermark-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 150px;
    height: 150px;
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
    color: var(--brand-primary);
}

.tutorial-card h2,
.tutorial-card p,
.tutorial-card a {
    position: relative;
    z-index: 2;
}

/* PAGINATION */
.pagination .page-link {
    color: var(--brand-primary);
    background-color: #fff;
    border: 1px solid #dee2e6;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.pagination .page-link:hover,
.pagination .page-link:focus {
    background-color: var(--ui-light);
    text-decoration: none;
}

.pagination .page-item.active .page-link {
    color: #fff;
    background-color: var(--table-header-bg);
    border-color: var(--table-header-bg);
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

/* STATUS PILLS */
.status-pill {
    display: inline-block;
    min-width: 32px;
    height: 16px;
    padding: 0 8px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 16px;
    border-radius: 2px;
    color: #fff;
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
}

.badge.status-pill,
.badge.status-pill.rounded-pill {
    border-radius: 2px !important;
    height: 16px;
    font-size: 0.75rem;
    padding: 0 8px;
    line-height: 16px;
}

.badge.status-pill.text-bg-success {
    background-color: var(--status-success-bg) !important;
    color: var(--status-success-text) !important;
}

.badge.status-pill.text-bg-danger {
    background-color: var(--status-failed-bg) !important;
    color: var(--status-failed-text) !important;
}

.badge.status-pill.text-bg-secondary {
    background-color: var(--status-unknown-bg) !important;
    color: var(--status-unknown-text) !important;
}

.badge.status-pill.text-bg-warning {
    background-color: var(--status-warning-bg) !important;
    color: var(--ui-white) !important;
}

/* MODALS */
.add-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(30, 41, 59, 0.35);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(.4, 0, .2, 1);
}

.add-modal-overlay[x-show="open"],
.add-modal-overlay[style*="display: flex"] {
    opacity: 1;
    pointer-events: auto;
}

.add-modal-window {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    max-width: 600px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem 2rem 1.5rem 2rem;
    position: relative;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition: opacity 0.3s cubic-bezier(.4, 0, .2, 1), transform 0.3s cubic-bezier(.4, 0, .2, 1);
}

.add-modal-wide {
    max-width: 1100px;
    width: 98vw;
}

.add-modal-overlay[x-show="open"] .add-modal-window,
.add-modal-overlay[style*="display: flex"] .add-modal-window {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: fadeInModal 0.3s;
}

.add-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-dark);
    cursor: pointer;
    z-index: 1070;
    width: 2rem;
    height: 2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.add-modal-close:hover {
    color: var(--brand-primary);
    background: var(--ui-light);
    border-radius: 50%;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.use_existing_modal[hidden] {
    display: none;
}

.use_existing_modal__dialog {
    background: var(--ui-white);
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    width: min(640px, 92vw);
    max-height: 86vh;
    overflow: auto;
}

.use_existing_modal__header {
    margin-top: 10px;
    margin-left: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.use_existing_modal__header [data-ue-close] {
    margin-top: 5px;
    margin-right: 5px;
    margin-left: auto;
    order: 2;
    line-height: 1;
    font-size: 20px;
    float: none;
}

.use_existing_modal__header .card-title {
    margin: 0;
    order: 1;
}

.use_existing_modal__footer {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ui-border);
}

.use_existing_modal__footer {
    border-top: 1px solid var(--ui-border);
    border-bottom: 0;
}

.use_existing_modal__body {
    padding: 16px;
}

/* NOTIFICATION DOTS */
.actions-notification,
.profile-dot,
.maintenance-dot,
.dropdown-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--status-warning-bg);
    border-radius: 50%;
    display: inline-block;
    z-index: 2;
}

.actions-notification {
    top: 8px;
    right: 0;
    margin-left: 4px;
}

.profile-dot,
.maintenance-dot {
    top: 8px;
    right: -0.35rem;
}

.dropdown-dot {
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
}

/* LOADERS */
.load-more-spinner {
    display: none;
    width: 1rem;
    height: 1rem;
    margin-left: .5rem;
    border: 2px solid rgba(0, 0, 0, .12);
    border-top-color: rgba(0, 0, 0, .6);
    border-radius: 50%;
}

.load-more-spinner.htmx-request {
    display: inline-block;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
