/* ArmNAB BodyLabs - a Bootstrap 5.3 theme for the R.TR.TS.02.001 register. */

:root {
    --ab-sidebar-width: 16.5rem;
    --ab-topbar-height: 3.5rem;

    --ab-navy: #14243d;
    --ab-navy-soft: #1d3355;
    --ab-accent: #2f6fed;
    --ab-surface: #f5f7fb;
    --ab-border: #e2e7f0;
    --ab-muted: #64748b;

    --bs-body-bg: var(--ab-surface);
    --bs-body-color: #1f2937;
    --bs-border-color: var(--ab-border);
    --bs-primary: var(--ab-accent);
    --bs-primary-rgb: 47, 111, 237;
    --bs-link-color: var(--ab-accent);
    --bs-link-hover-color: #1d51bd;
    --bs-body-font-size: 0.9375rem;
    --bs-border-radius: 0.5rem;
}

html, body {
    height: 100%;
}

body {
    background: var(--ab-surface);
    font-family: "Segoe UI", "Noto Sans Armenian", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

.btn-primary {
    --bs-btn-bg: var(--ab-accent);
    --bs-btn-border-color: var(--ab-accent);
    --bs-btn-hover-bg: #2560d8;
    --bs-btn-hover-border-color: #2560d8;
    --bs-btn-active-bg: #1d51bd;
    --bs-btn-active-border-color: #1d51bd;
}

/* ── Shell ──────────────────────────────────────────────────────────────── */

.ab-shell {
    display: flex;
    min-height: 100vh;
}

.ab-sidebar {
    width: var(--ab-sidebar-width);
    flex: 0 0 var(--ab-sidebar-width);
    background: var(--ab-navy);
    color: #cbd5e1;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.ab-sidebar-scrim {
    display: none;
}

/* The read-only view for a visitor who is not signed in: no sidebar, brand in the top bar. */
.ab-shell-bare .ab-content {
    max-width: 82rem;
    width: 100%;
    margin: 0 auto;
}

.ab-topbar-brand {
    flex: none;
    max-width: 20rem;
    padding-right: 0.9rem;
    border-right: 1px solid var(--ab-border);
    color: var(--ab-navy);
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ab-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ab-topbar {
    height: var(--ab-topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--ab-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.ab-topbar-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ab-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ab-user-name {
    color: var(--ab-muted);
    font-size: 0.875rem;
    white-space: nowrap;
}

.ab-burger {
    display: none;
}

.ab-content {
    padding: 1.5rem;
    flex: 1 1 auto;
    min-width: 0;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */

.ab-brand {
    /* The sidebar is a column flex container, so without this the header is compressed - and its text
       clipped by the rule under it - as soon as the navigation is taller than the window. */
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: var(--ab-topbar-height);
    justify-content: center;
    padding: 0.95rem 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ab-brand-name {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-wrap: balance;
}

/* Set like the group headings below it, so the sidebar reads as one column of labels. */
.ab-brand-sub {
    color: #8ea3c0;
    font-size: 0.65rem;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.ab-nav {
    /* Same reason as the header above: keep its own height and let the sidebar scroll. */
    flex: none;
    padding: 0.75rem 0 2rem;
}

.ab-nav-group {
    padding: 1rem 1.15rem 0.35rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #7c8fab;
}

.ab-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 1.15rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
}

.ab-nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.ab-nav-link.active {
    background: var(--ab-navy-soft);
    border-left-color: var(--ab-accent);
    color: #fff;
    font-weight: 600;
}

.ab-nav-sub {
    padding-left: 2rem;
}

/* ── Cards and sections ─────────────────────────────────────────────────── */

.ab-card {
    background: #fff;
    border: 1px solid var(--ab-border);
    border-radius: 0.65rem;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.ab-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--ab-border);
    background: #fbfcfe;
}

.ab-card-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: #0f172a;
}

.ab-card-header .ab-card-actions {
    margin-left: auto;
    display: flex;
    gap: 0.35rem;
}

.ab-card-body {
    padding: 1rem;
}

.ab-card-accent {
    border-top: 3px solid var(--ab-accent);
}

.ab-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.ab-page-header .ab-page-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

/* ── Definition rows ────────────────────────────────────────────────────── */

.ab-field {
    display: flex;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px dashed #eef1f6;
}

.ab-field:last-child {
    border-bottom: 0;
}

.ab-field dt {
    flex: 0 0 18rem;
    color: var(--ab-muted);
    font-weight: 500;
}

.ab-field dd {
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

/* ── Tables ─────────────────────────────────────────────────────────────── */

.ab-table {
    --bs-table-bg: #fff;
    margin-bottom: 0;
}

.ab-table > thead th {
    background: #f1f4f9;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 1px solid var(--ab-border);
}

.ab-table td, .ab-table th {
    vertical-align: middle;
}

.ab-scroll-x {
    overflow-x: auto;
}

.ab-actions {
    display: inline-flex;
    gap: 0.15rem;
    white-space: nowrap;
}

.ab-actions .btn {
    --bs-btn-padding-y: 0.15rem;
    --bs-btn-padding-x: 0.4rem;
    --bs-btn-font-size: 0.8rem;
}

/* ── Accreditation areas ────────────────────────────────────────────────── */

.ab-area {
    border: 1px solid var(--ab-border);
    border-radius: 0.6rem;
    background: #fff;
    margin-bottom: 0.85rem;
    overflow: hidden;
}

.ab-area-header {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    background: #eef4ff;
    border-bottom: 1px solid var(--ab-border);
}

.ab-area-rowno {
    flex: none;
    min-width: 2.5rem;
    font-weight: 700;
    color: var(--ab-navy);
}

.ab-area-title {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    color: #0f172a;
}

.ab-area-body {
    padding: 0.85rem;
}

/* Կանոնակարգման օբյեկտներ. Values sit at the top of the cell so a long name does not push the
   codes and the status down with it. */
.ab-objects > tbody > tr > td {
    vertical-align: top;
}

/* The characteristics of one object, as a full width row tucked under it. */
.ab-objects > tbody > tr.ab-characteristics-row > td {
    background: #f8fafc;
    border-top: 0;
    padding: 0 0.9rem 0.9rem 2.6rem;
}

.ab-objects > tbody > tr.ab-characteristics-row .ab-subhead {
    margin-top: 0.35rem;
}

.ab-subhead {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0f766e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 0.4rem;
}

.ab-subhead.ab-subhead-blue {
    color: #1d4ed8;
}

.ab-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.ab-status-date {
    font-size: 0.78rem;
    color: var(--ab-muted);
}

.ab-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.ab-chip {
    display: inline-block;
    background: #eef2f7;
    border: 1px solid #dde3ec;
    border-radius: 0.35rem;
    padding: 0.05rem 0.4rem;
    font-size: 0.8rem;
}

.ab-lines {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ab-lines li {
    padding: 0.05rem 0;
}

/* ── Pick lists inside dialogs ──────────────────────────────────────────── */

.ab-picklist {
    max-height: 15rem;
    overflow-y: auto;
    border: 1px solid var(--ab-border);
    border-radius: 0.4rem;
    padding: 0.5rem 0.65rem;
    background: #fff;
}

.ab-picklist .form-check {
    margin-bottom: 0.15rem;
}

.ab-picklist-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.25rem;
    display: block;
}

/* ── History ────────────────────────────────────────────────────────────── */

.ab-history-entry {
    border: 1px solid var(--ab-border);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.ab-history-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--ab-border);
    font-size: 0.85rem;
}

.ab-history-changed {
    background: #fffbeb;
}

/* ── Login ──────────────────────────────────────────────────────────────── */

.ab-login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background: linear-gradient(160deg, var(--ab-navy) 0%, #24406b 100%);
}

.ab-login-title {
    margin-bottom: 0.45rem;
    color: var(--ab-navy);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    text-wrap: balance;
}

.ab-login-card {
    width: 100%;
    max-width: 26rem;
    background: #fff;
    border-radius: 0.9rem;
    padding: 2rem;
    box-shadow: 0 1.5rem 3rem rgba(9, 20, 40, 0.35);
}

/* ── Modals without Bootstrap's script ──────────────────────────────────── */

.modal.show.d-block {
    overflow-y: auto;
    background: transparent;
}

.modal-backdrop.show {
    opacity: 0.5;
}

.ab-icon {
    vertical-align: -0.125em;
    flex: none;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff3cd;
    border-top: 1px solid #ffe69c;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1080;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ── Small screens ──────────────────────────────────────────────────────── */

@media (max-width: 991.98px) {
    .ab-burger {
        display: inline-flex;
    }

    .ab-sidebar {
        position: fixed;
        z-index: 1045;
        transform: translateX(-100%);
        transition: transform 0.2s ease-in-out;
    }

    .ab-sidebar-open .ab-sidebar {
        transform: translateX(0);
    }

    .ab-sidebar-open .ab-sidebar-scrim {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 1040;
    }

    .ab-content {
        padding: 1rem;
    }

    .ab-field {
        flex-direction: column;
        gap: 0.1rem;
    }

    .ab-field dt {
        flex: none;
    }

    .ab-user-name {
        display: none;
    }

    .ab-topbar-brand {
        max-width: 10rem;
    }
}

/* ── ԵԱՏՄ ռեեստր ────────────────────────────────────────────────────────── */

.ab-eaeu > tbody > tr > td {
    vertical-align: top;
}

.ab-eaeu-id {
    margin-top: 0.15rem;
    font-size: 0.75rem;
    color: var(--ab-muted);
    word-break: break-all;
}

/* The reason a document was rejected - long Russian prose, so it gets the width of the row. */
.ab-eaeu > tbody > tr.ab-eaeu-detail-row > td {
    padding-top: 0;
    border-top: 0;
    color: #7f1d1d;
    font-size: 0.85rem;
}

.ab-xml {
    max-height: 60vh;
    overflow: auto;
    padding: 0.9rem;
    background: #f8fafc;
    border: 1px solid var(--ab-border);
    border-radius: 0.5rem;
    font-size: 0.78rem;
    white-space: pre-wrap;
    word-break: break-word;
}
