/*
 * BarabNeo shell-specific custom CSS.
 *
 * Loaded AFTER barabneo-theme.css. Holds layout primitives that have no Radzen
 * equivalent (Activity Bar, dense status bar, scope-strip chip groups). Goal
 * per PRD-20: keep this file under ~120 lines total — Radzen primitives do
 * everything else.
 */

/* ── Header ────────────────────────────────────────────────────────────── */
/* Three-zone grid: brand (220px) | scope strip (1fr) | utilities (auto).
   44px tall. White surface with ink text — matches the design bundle
   (Design/UI-UX/claude-design-bundle/project/styles.css .header rule), NOT
   Radzen Fluent's default orange-painted RadzenHeader. The .rz-header override
   below kills the Radzen primary background so the surface shows through. */
.rz-header:has(.bn-header) {
    background: var(--rz-base-background-color, #ffffff);
    border-bottom: 1px solid var(--rz-base-200);
    box-shadow: none;
    padding: 0;
}

.bn-header {
    display: grid;
    grid-template-columns: 220px 1fr auto;
    align-items: center;
    gap: 12px;
    height: var(--bn-header-h);
    padding: 0 12px;
    width: 100%;
    color: var(--rz-text-color);
}

.bn-header__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
/* Diamond brand mark — solid orange with white inset, mirroring
   .brand-mark::before / ::after from the bundle. */
.bn-header__brand-mark {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
}
.bn-header__brand-mark::before,
.bn-header__brand-mark::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: rotate(45deg);
    background: var(--bn-orange);
}
.bn-header__brand-mark::after {
    inset: 4px;
    background: #ffffff;
}
.bn-header__wordmark {
    font-size: 16px;
    font-weight: 700;
    color: var(--rz-text-color);
    letter-spacing: 0;
}
.bn-header__sub {
    font-size: var(--bn-fs-small);
    color: var(--rz-text-tertiary-color);
    padding-left: 8px;
    margin-left: 4px;
    border-left: 1px solid var(--rz-base-200);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bn-header__scope {
    display: flex;
    align-items: center;
    min-width: 0;
}

.bn-header__utils {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--rz-text-color);
}
.bn-header__user {
    font-size: var(--bn-fs-small);
    color: var(--rz-text-secondary-color);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Search trigger — soft surface pill matching the bundle's .search-trigger. */
.bn-header__search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    min-width: 220px;
    padding: 0 8px;
    border: 1px solid var(--rz-base-200);
    background: var(--rz-base-50);
    border-radius: 4px;
    color: var(--rz-text-tertiary-color);
    font-size: var(--bn-fs-small);
    cursor: pointer;
}
.bn-header__search:hover { border-color: var(--rz-base-300); }
.bn-header__search[disabled] { cursor: not-allowed; opacity: 0.65; }
.bn-header__search kbd {
    background: var(--rz-base-100);
    color: var(--rz-text-secondary-color);
    border-radius: 3px;
    padding: 0 4px;
    font-size: 10px;
    margin-left: auto;
}

.bn-header__bell {
    background: transparent;
    border: 0;
    color: var(--rz-text-secondary-color);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}
.bn-header__bell:hover { background: var(--rz-base-100); }
.bn-header__bell[disabled] { cursor: not-allowed; opacity: 0.65; }

/* ── Scope strip ───────────────────────────────────────────────────────── */
/* On the white header surface — chips ride on surface-2 with subtle border;
   module chips get the terracotta accent. */
.bn-scope {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    min-width: 0;
}
.bn-scope__hint {
    color: var(--rz-text-tertiary-color);
    font-size: var(--bn-fs-small);
    font-style: italic;
}
.bn-scope__chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 4px 0 8px;
    background: var(--rz-base-50);
    color: var(--rz-text-color);
    border: 1px solid var(--rz-base-200);
    border-radius: 11px;
    font-size: var(--bn-fs-small);
    white-space: nowrap;
}
.bn-scope__chip[data-kind="module"] {
    background: var(--bn-terracotta);
    border-color: var(--bn-terracotta);
    color: #ffffff;
}
.bn-scope__remove {
    background: transparent;
    border: 0;
    color: inherit;
    font-size: 14px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    border-radius: 50%;
}
.bn-scope__remove:hover { background: rgba(0, 0, 0, 0.08); }

.bn-scope__add {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 22px;
    padding: 0 8px;
    background: transparent;
    color: var(--rz-text-tertiary-color);
    border: 1px dashed var(--rz-base-300);
    border-radius: 11px;
    font-size: var(--bn-fs-small);
    cursor: pointer;
}
.bn-scope__add:hover { color: var(--rz-text-color); border-color: var(--bn-orange); }
.bn-scope__add[disabled] { cursor: not-allowed; opacity: 0.6; }

/* PRD-21b — Construction grouping. Chips of one Construction sit inside a
   subtle bordered frame with a "Stavba: …" label so admins can read scope
   structure at a glance. */
.bn-scope__group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px 2px 6px;
    border: 1px dashed var(--rz-border-color);
    border-radius: 12px;
    background: rgba(var(--bn-orange-rgb, 255, 134, 0), 0.04);
}
.bn-scope__group-label {
    font-size: 0.75rem;
    color: var(--rz-text-tertiary-color);
    margin-right: 4px;
    white-space: nowrap;
}

/* PRD-21b — Picker dialog content. Compact stacked rows with checkbox + label. */
.bn-picker { display: flex; flex-direction: column; gap: 0.5rem; min-width: 480px; }
.bn-picker__list { max-height: 50vh; overflow-y: auto; padding: 4px; }
.bn-picker__row {
    display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px;
    cursor: pointer;
}
.bn-picker__row:hover { background: var(--rz-base-100); }
.bn-picker__name { flex: 1; }
.bn-picker__code { color: var(--rz-text-tertiary-color); font-family: var(--bn-mono, monospace); font-size: 0.85em; }
.bn-picker__group { color: var(--rz-text-secondary-color); font-size: 0.85em; }
.bn-picker__empty { padding: 1rem; color: var(--rz-text-tertiary-color); text-align: center; }
.bn-picker__footer { display: flex; justify-content: flex-end; gap: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--rz-border-color); }

/* ── Activity Bar ──────────────────────────────────────────────────────── */
/* Vertical 44px icon strip on the left edge. Active state = 3px orange
   left border + ink-strong icon color; hover = soft orange tint. */
.bn-activity {
    grid-area: bn-activity;
    width: var(--bn-activity-w);
    background: var(--rz-base-50);
    border-right: 1px solid var(--rz-base-200);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 4px 0;
    overflow: hidden;
}

.bn-activity__cell {
    height: var(--bn-activity-w);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rz-text-secondary-color);
    border-left: var(--accent-strip-w, 3px) solid transparent;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 80ms ease, color 80ms ease;
}
.bn-activity__cell:hover {
    background: var(--bn-orange-soft);
    color: var(--rz-text-color);
}
.bn-activity__cell.active {
    border-left-color: var(--bn-orange);
    color: #050505;
    background: transparent;
}
.bn-activity__cell .rzi {
    font-size: 22px;
}

.bn-activity__sep {
    height: 1px;
    background: var(--rz-base-200);
    margin: 6px 8px;
}

.bn-activity__spacer {
    flex: 1 1 auto;
}

/* ── Mode-aware sidebar ────────────────────────────────────────────────── */
.bn-sidebar-mode {
    padding: 8px 0;
}
.bn-sidebar-section {
    padding: 4px 12px 12px;
}
.bn-sidebar-section__title {
    font-size: var(--bn-fs-small);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rz-text-tertiary-color);
    margin: 0 0 6px;
}
.bn-sidebar-section__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bn-sidebar-mode__hint {
    font-size: var(--bn-fs-small);
    color: var(--rz-text-secondary-color);
    margin: 0;
    line-height: 1.4;
}
.bn-sidebar-mode__btn {
    width: 100%;
    justify-content: flex-start;
}

/* ── Entity tree (PRD-12) ──────────────────────────────────────────────── */
.bn-entity-tree {
    margin: 0 -8px;
    font-size: var(--bn-fs-small);
}
.bn-entity-tree .rz-tree-node-content {
    padding: 2px 4px;
    line-height: 1.2;
}
.bn-entity-tree__label {
    margin-left: 4px;
    color: var(--rz-text-color);
}
.bn-entity-tree__code {
    margin-left: 6px;
    color: var(--rz-text-tertiary-color);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
}

/* ── Entity detail (PRD-12) ────────────────────────────────────────────── */
.bn-entity-detail {
    padding: 16px 24px;
}
.bn-entity-detail__breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: var(--bn-fs-small);
    color: var(--rz-text-tertiary-color);
}
.bn-entity-detail__crumb {
    color: inherit;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 3px;
}
.bn-entity-detail__crumb:hover {
    background: var(--rz-base-100);
    color: var(--rz-text-color);
}
.bn-entity-detail__crumb-sep {
    color: var(--rz-base-300);
}

.bn-entity-detail__header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}
.bn-entity-detail__code {
    color: var(--rz-text-tertiary-color);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--bn-fs-small);
}

/* Generic Info panel <dl> grid: label column auto, value column 1fr. */
.bn-panel-info {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 16px;
    row-gap: 4px;
    margin: 0;
    max-width: 800px;
}
.bn-panel-info dt {
    color: var(--rz-text-tertiary-color);
    font-size: var(--bn-fs-small);
}
.bn-panel-info dd {
    margin: 0;
    color: var(--rz-text-color);
    font-size: var(--bn-fs-body);
}
.bn-panel-info__epsg {
    margin-left: 8px;
    padding: 0 4px;
    background: var(--rz-base-100);
    color: var(--rz-text-tertiary-color);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 10px;
    border-radius: 3px;
}

/* ── Audit panel (PRD-12) ──────────────────────────────────────────────── */
.bn-audit {
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 900px;
}
.bn-audit__row {
    display: grid;
    grid-template-columns: 130px 18px max-content 1fr;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--rz-base-100);
    font-size: var(--bn-fs-body);
}
.bn-audit__row:last-child { border-bottom: 0; }
.bn-audit__time {
    color: var(--rz-text-tertiary-color);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--bn-fs-small);
}
.bn-audit__actor {
    color: var(--rz-text-secondary-color);
    font-size: var(--bn-fs-small);
    white-space: nowrap;
}
.bn-audit__what {
    color: var(--rz-text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Quickopen dialog (PRD-12) ─────────────────────────────────────────── */
.bn-quickopen {
    display: flex;
    flex-direction: column;
    max-height: 60vh;
    min-height: 320px;
}
.bn-quickopen__inputbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--rz-base-200);
}
.bn-quickopen__inputbox .rzi { font-size: 18px; color: var(--rz-text-tertiary-color); }
.bn-quickopen__input {
    flex: 1 1 auto;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 15px;
    color: var(--rz-text-color);
}
.bn-quickopen__clear {
    background: transparent;
    border: 0;
    color: var(--rz-text-tertiary-color);
    font-size: 18px;
    cursor: pointer;
    padding: 0 6px;
    border-radius: 50%;
}
.bn-quickopen__clear:hover { background: var(--rz-base-100); }

.bn-quickopen__status {
    padding: 16px;
    color: var(--rz-text-tertiary-color);
    font-size: var(--bn-fs-small);
}

.bn-quickopen__list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    overflow-y: auto;
}
.bn-quickopen__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    cursor: pointer;
    font-size: var(--bn-fs-body);
}
.bn-quickopen__item:hover { background: var(--rz-base-50); }
.bn-quickopen__item.active { background: var(--bn-orange-soft); }
.bn-quickopen__item .rzi { font-size: 16px; }
.bn-quickopen__item-name { flex: 0 1 auto; color: var(--rz-text-color); }
.bn-quickopen__item-code {
    color: var(--rz-text-tertiary-color);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: var(--bn-fs-small);
}
.bn-quickopen__item-type {
    margin-left: auto;
    color: var(--rz-text-tertiary-color);
    font-size: var(--bn-fs-small);
}

/* ── Status bar ────────────────────────────────────────────────────────── */
/* Single dense row, 22px tall, 11px type, 12px horizontal padding. */
.bn-statusbar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--bn-status-h);
    padding: 0 12px;
    font-size: var(--bn-fs-small);
    color: var(--rz-text-secondary-color);
    background: var(--rz-base-100);
    border-top: 1px solid var(--rz-base-200);
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
}

.bn-statusbar > span,
.bn-statusbar > a {
    flex: 0 0 auto;
}

.bn-statusbar__spacer {
    flex: 1 1 auto;
}

/* Env badge — color-coded by data-env (dev = green, staging = amber, prod = red).
   Unknown envs use the secondary text color so the surface still works in tests. */
.bn-statusbar__env {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #ffffff;
    background: var(--rz-text-tertiary-color);
}
.bn-statusbar__env[data-env="dev"]     { background: var(--bn-ok); }
.bn-statusbar__env[data-env="staging"] { background: var(--bn-orange); }
.bn-statusbar__env[data-env="prod"]    { background: var(--bn-err); }

/* Alarm link — orange link tone; click navigates to /status. */
.bn-statusbar__warn {
    color: var(--bn-warn);
    text-decoration: none;
}
.bn-statusbar__warn:hover {
    text-decoration: underline;
}

/* User / scope / count / sync / build all share the muted secondary tone. */
.bn-statusbar__db,
.bn-statusbar__user,
.bn-statusbar__scope,
.bn-statusbar__count,
.bn-statusbar__sync,
.bn-statusbar__build {
    color: var(--rz-text-secondary-color);
}

/* Override the RadzenFooter default vertical padding so the 22px height is honored. */
.rz-footer:has(.bn-statusbar) {
    padding: 0;
    min-height: var(--bn-status-h);
}
