/* =============================================================
   Corely IAM Web — Minimal custom CSS (Bootstrap-first approach)
   ============================================================= */

/* Auth pages */
.auth-container {
    margin-top: 15vh;
}

.auth-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.auth-card .nav-tabs {
    display: flex;
    border-bottom: 2px solid #dee2e6;
}

.auth-card .nav-tabs .nav-item {
    flex: 1;
    text-align: center;
}

.auth-card .nav-tabs .nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: #6c757d;
    font-weight: 500;
}

.auth-card .nav-tabs .nav-link.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    background: transparent;
}

/* Page headers */
.management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.management-header h1 {
    margin-bottom: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.management-header .resource-label {
    font-size: 0.85rem;
    font-weight: 400;
    color: #9ca3af;
    margin-left: 0.5rem;
}

/* Compact property lists */
.props-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 1rem;
    align-items: center;
    max-width: 600px;
}

.props-grid .prop-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.props-grid .prop-value {
    margin-bottom: 0;
}

.props-grid .form-control {
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
}

/* Section headers for detail page relation tables */
.section-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.section-bar h6 {
    margin-bottom: 0;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #495057;
}

/* Detail page section cards */
.detail-section .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-color: #f8f9fa;
}

.detail-section .card-section-title {
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #495057;
    margin-bottom: 0;
}

/* Icon action buttons */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s;
    padding: 0;
    font-size: 0.9rem;
    text-decoration: none;
}

.icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

.icon-btn.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.icon-btn.text-primary:hover {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

/* Dashboard account header */
.dashboard-account-header {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    color: #fff;
    border: none;
    border-radius: 0;
    padding: 0.6rem 1rem;
}

/* Entity cards (dashboard grid) */
.entity-card {
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.entity-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.12) !important;
}

/* Onboarding card */
.onboarding-card {
    max-width: 480px;
    width: 100%;
}

/* Table improvements */
.table-actions {
    white-space: nowrap;
    width: 1%;
    text-align: right;
    vertical-align: middle;
}

.table-actions form {
    display: inline;
}

/* Sortable table headers */
th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s;
}

th.sortable:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

th.sortable.active {
    color: #0d6efd;
}

th.sortable .sort-icon {
    font-size: 0.7rem;
    opacity: 0.4;
    margin-left: 0.25rem;
}

th.sortable.active .sort-icon {
    opacity: 1;
}

.th-search {
    padding: 0.25rem 0 0;
}

.th-search .form-control {
    font-size: 0.78rem;
    padding: 0.15rem 0.4rem;
    font-weight: 400;
}

/* GUID display */
.guid-text {
    font-size: 0.72rem;
    color: #9ca3af;
    font-family: monospace;
    letter-spacing: -0.02em;
}

/* Permission badges */
.permission-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    width: 1.5rem;
    height: 1.5rem;
    line-height: 1.5rem;
    text-align: center;
    border-radius: 0.25rem;
}

.permission-badge.active {
    background-color: #198754;
    color: #fff;
}

.permission-badge.inactive {
    background-color: #e9ecef;
    color: #adb5bd;
}

/* Managed-by badges */
.sys-badge,
.user-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    vertical-align: middle;
    margin-left: 0.4rem;
}

.sys-badge {
    background: #e9ecef;
    color: #6c757d;
}

.user-badge {
    background: #d1ecf1;
    color: #0c5460;
}

/* Effective permissions panel */
.effective-permissions-panel {
    padding: 0.75rem 0;
}

/* List page table card */
.list-card {
    background-color: #fff;
    border: 1px solid #e2eaf6;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 0.75rem;
}

.section-divider {
    padding: 1.25rem;
    background-color: #fff;
    border: 1px solid #e2eaf6;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.section-divider + .section-divider {
    margin-top: 1.5rem;
}

.section-divider-label {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #343a40;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.section-divider-label::after {
    content: "";
    flex: 1;
    height: 2px;
    background: #dee2e6;
    order: 1;
}

.section-divider-label > * {
    order: 2;
}

.ep-flat-header {
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #495057;
    padding-bottom: 0.4rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.ep-grant-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
}

.ep-grant-row:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.ep-via-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ep-via-badge.direct {
    background: #d4edda;
    color: #155724;
}

.ep-via-badge.group {
    background: #e2e3f1;
    color: #383d6e;
}

.ep-via-badge.group a {
    color: inherit;
}

.ep-crudx-mini {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6c757d;
    letter-spacing: 0.15em;
    font-family: monospace;
}

/* Danger zone */
.danger-zone {
    padding: 0.75rem 0;
    margin-top: 2rem;
    border-top: 1px solid #f1aeb5;
}

/* Navbar toggler — CSP-safe icon instead of inline SVG */
.navbar-toggler .navbar-toggler-icon {
    background-image: none;
}

.navbar-toggler .navbar-toggler-icon .bi-list {
    font-size: 1.5em;
    line-height: 1;
    color: rgba(255, 255, 255, 0.75);
    vertical-align: middle;
}

/* Slim footer */
.site-footer {
    background: #212529;
    color: #9ca3af;
    padding: 0.6rem 0;
    font-size: 0.8rem;
}

.site-footer a {
    color: #9ca3af;
    text-decoration: none;
}

.site-footer a:hover {
    color: #fff;
}

/* Modals — positioned lower on screen */
.modal-dialog {
    margin-top: 15vh;
}

/* Blazor reconnect modal */
#components-reconnect-modal.components-reconnect-show {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
}

#components-reconnect-modal.components-reconnect-hide {
    display: none;
}

#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.7);
}
