/* site-specific overrides */

/* ── Tables ── */
.table {
    overflow: hidden;
    border-radius: 0.375rem;
}

.table thead th,
.table thead td {
    background-color: #212529 !important;
    color: #fff !important;
    border-color: #373b3e !important;
}

.table thead tr:first-child th:first-child {
    border-top-left-radius: 0.375rem;
}

.table thead tr:first-child th:last-child {
    border-top-right-radius: 0.375rem;
}

.table thead a {
    color: #fff !important;
}

th a.sort-asc::after  { content: " ▲"; font-size: .7em; }
th a.sort-desc::after { content: " ▼"; font-size: .7em; }

/* ── Nav ── */
.navbar-nav .nav-link {
    font-weight: bold;
}

.navbar-nav .nav-link.active {
    color: #a31851 !important;
    background-color: #ebebeb;
    border-radius: 0.25rem;
}

.navbar .dropdown-item.active {
    color: #a31851;
    font-weight: bold;
    background-color: transparent;
}

/* ── Pagination active page ── */
.page-item.active .page-link {
    background-color: #a31851;
    border-color: #a31851;
}

/* ── Tooltips ── */
.tooltip-inner {
    text-align: left;
}

.tooltip-control .tooltip-inner {
    max-width: 420px;
}

/* ── Form controls ── */
.form-control,
.form-select {
    border-color: #adb5bd;
}

.form-control:focus,
.form-select:focus {
    border-color: #6c757d;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

.form-check-input {
    border-color: #adb5bd;
}

/* ── Button: Export ────────────────────────────────── */
.btn-export {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.375rem;
    border: 1px solid #a8d5a2;
    background-color: #f0f9f0;
    color: #2d6a2d;
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color .15s ease-in-out, border-color .15s ease-in-out, color .15s ease-in-out;
}
.btn-export:hover {
    background-color: #d4edda;
    border-color: #7fbf7a;
    color: #1a4d1a;
}
.btn-export:active {
    background-color: #c3e6cb;
    border-color: #6aaa64;
    color: #1a4d1a;
}

/* ── Button: Nav (prev / next document) ─────────────── */
.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    flex-shrink: 0;
    border-radius: 50%;
    background: transparent;
    border: 1px solid #ced4da;
    color: #6c757d;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s, border-color .15s, color .15s;
}
.btn-nav:hover:not(:disabled) {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #343a40;
}
.btn-nav:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}
.btn-nav:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
}

/* ── Login page ─────────────────────────────────────────────────── */
.login-page-bg {
    background: linear-gradient(150deg, #011e35 0%, #023459 55%, #a31851 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    padding: 2.75rem 2.5rem;
    width: 100%;
    max-width: 420px;
    animation: loginFadeUp 0.45s ease both;
}

@keyframes loginFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #023459, #a31851);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: white;
    font-size: 36px;
}

.login-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.2rem;
    letter-spacing: -0.3px;
}

.login-title .login-accent { color: #a31851; }
.login-title .login-main   { color: #023459; }

.login-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
}

.login-field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
    letter-spacing: 0.3px;
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 1.1rem;
}

.login-input-icon {
    position: absolute;
    left: 12px;
    color: #9ca3af;
    font-size: 18px;
    pointer-events: none;
    z-index: 1;
}

.login-input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    color: #1a2a3a;
    background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
    box-sizing: border-box;
}

.login-input:focus {
    border-color: #023459;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(2, 52, 89, 0.1);
}

.login-input:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.login-error {
    background: #fff0f4;
    border: 1px solid #f9c8d6;
    border-radius: 8px;
    color: #a31851;
    font-size: 0.85rem;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    text-align: center;
}

.login-error.validation-summary-valid { display: none; }

.login-error ul { margin: 0; padding: 0; list-style: none; }

.login-validation {
    display: block;
    color: #a31851;
    font-size: 0.8rem;
    margin-top: -0.75rem;
    margin-bottom: 0.6rem;
}

.login-forgot {
    text-align: right;
    margin-top: -0.35rem;
    margin-bottom: 1.25rem;
}

.login-forgot a {
    font-size: 0.82rem;
    color: #023459;
    text-decoration: none;
}

.login-forgot a:hover { text-decoration: underline; color: #a31851; }

.login-btn {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, #023459, #034a7a);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    margin-top: 0.5rem;
}

.login-btn:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.login-btn:active:not(:disabled) { transform: translateY(0); }
.login-btn:disabled { background: #9ca3af; cursor: not-allowed; }

.login-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    padding: 1rem;
}

/* ── Hierarchy scroll ────────────────────────────────────────────── */
.hierarchy-scroll {
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 32px;
}
