/* ========================================
   AntDesign Override CSS
   This file MUST load after ant-design-blazor.css
   Using custom .pisarcheon-menu class for maximum specificity
   ======================================== */

/* ========================================
   Global Text + Icon Color Defaults — TASK_04 systemic fix.
   AntDesign's bundled CSS sets `body { color: rgba(0, 0, 0, 0.85) }` which
   leaks light-theme text into any element rendered outside an AntDesign
   component class chain. We override here (loads AFTER ant-design-blazor.css)
   so every text element on a dark surface inherits white/secondary by default.
   Component-specific rules later in this file remain authoritative.
   ======================================== */
body {
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    line-height: var(--font-line-body);
}

/* No italics (F-264 D7 b). Neither brand face ships an italic, and a synthesized slant gives Cyrillic its Russian
   forms. AntD's reset (an italic `dfn`) loads before this sheet, so equal specificity wins on order;
   emphasis uses weight (<strong>). font-synthesis-style: none keeps any stray italic upright. */
em, i, cite, address, dfn, var {
    font-style: normal;
}

html {
    font-synthesis-style: none;
}

/* B-051 AD1: AntD's link colours (#1890ff / #40a9ff / #096dd9, plain and inside Typography) load after app.css, so
   the brand link colours live here. Equal specificity, later sheet wins — no !important.
   I-041 (L3): link text is --pri-ink — the fill token --pri fails 4.5:1 on --bg-2 in light. */
a,
a.ant-typography,
.ant-typography a {
    color: var(--pri-ink);
}

/* Loading last, the bare a:hover / a:active (0,1,1) also beat AntD's later equal-specificity anchor colours that have no
   :hover / :active counterpart of their own — a[disabled] and .ant-radio-button-wrapper a (.ant-tabs-tab-disabled a is
   pointer-events: none) — so those are excluded inside :where() (zero specificity: the rule stays (0,1,1) and still
   beats AntD's own a:hover).
   B-054 run 14, measured: do NOT add `[class]` to this guard. AntD's own `a:hover { color: #40a9ff }` is also (0,1,1)
   and beats any single-class anchor colour (0,1,0), so excluding classed anchors does not hand them their own colour —
   it hands them AntD blue (a.status-indicator and the pagination jump link on /design-system went from the brand light
   colour to rgb(64, 169, 255)). A class that needs its own hover colour sets it with a `.cls:hover` rule ((0,2,0) beats
   both); CssFoundation_ClassedAnchor_ShouldNotFallBackToAntdBlueOnHover pins that. */
a:hover:where(:not([disabled], .ant-radio-button-wrapper a)),
a:active:where(:not([disabled], .ant-radio-button-wrapper a)),
a.ant-typography:hover,
.ant-typography a:hover,
a.ant-typography:focus-visible,
.ant-typography a:focus-visible,
a.ant-typography:active,
.ant-typography a:active {
    color: var(--color-primary-light);
}

/* I-049 AD7: AntD's `a:focus { outline: 0 }` (0,1,1) loads after app.css and beats its bare :focus-visible outline
   (0,1,0), so a link's focus outline lives here, (0,1,1) in the later sheet. A menu's anchor is excluded: its item
   draws the inset outline (the menu clips what leaves the anchor — the Menu block below). */
a:focus-visible:where(:not(.ant-menu a)) {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* I-041: --color-primary-light is an alias of --pri-ink, the rest colour, so the rule above no longer changes a
   link's colour, and the palette has no other primary step that reads as text in both themes (--pri-h is --pri-ink
   in dark and under 4.5:1 in light). A text link underlines on hover instead. Only links that read as text: a classed
   anchor is a component with its own hover rule, navigation anchors (a nav landmark, a menu, a dropdown menu, a
   breadcrumb) change colour or background, the auth logo is an image and .auth-footer-links draws its own animated
   underline (app.css). */
a:hover:where(:not([class], [disabled], nav a, .ant-menu a, .ant-dropdown-menu a, .ant-breadcrumb a, .ant-radio-button-wrapper a, .auth-logo a, .auth-footer-links a)),
a.ant-typography:hover,
.ant-typography a:hover {
    text-decoration: underline;
}

/* AntDesign also colors h1–h5 with `rgba(0, 0, 0, 0.85)` via element selectors,
   which beats the inherited body color above — so any heading whose component
   forgot an explicit color renders near-black on our dark surfaces (e.g. the act
   editor's section titles). Default every heading to the primary text color. No
   !important, so components that set their own heading color (higher specificity)
   and gradient page titles (-webkit-text-fill-color) still win. */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

/* AntDesign's reset colors `caption { color: rgba(0, 0, 0, 0.45) }` — a visible
   <table><caption> would render near-black on dark surfaces (I-016). */
caption {
    color: var(--text-secondary);
}

.anticon,
.material-icons {
    color: currentColor;
}

/* ========================================
   Sidebar Navigation - Override AntDesign Blue
   Using custom class + AntDesign selectors for MAXIMUM specificity
   ======================================== */

/* HIGHEST SPECIFICITY: Custom class + doubled AntDesign class + element */
ul.pisarcheon-menu.ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) li.ant-menu-item-selected,
ul.pisarcheon-menu.ant-menu.ant-menu-dark .ant-menu-item-selected,
.pisarcheon-menu.ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) .ant-menu-item-selected,
.pisarcheon-menu.ant-menu.ant-menu-dark .ant-menu-item-selected {
    background-color: var(--sd-act-bg) !important;
    color: var(--sd-act-ink) !important;
}

/* Override selected item text color */
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected,
ul.pisarcheon-menu.ant-menu-dark li.ant-menu-item-selected {
    color: var(--sd-act-ink) !important;
    border-right: 0;
    font-weight: 600;
}

/* Override link colors inside selected item */
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected > a,
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected > span > a,
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected > a:hover,
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected > span > a:hover,
ul.pisarcheon-menu.ant-menu-dark li.ant-menu-item-selected a {
    color: var(--sd-act-ink) !important;
}

/* Override icon colors inside selected item */
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected .ant-menu-item-icon,
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected .anticon,
ul.pisarcheon-menu.ant-menu-dark li.ant-menu-item-selected .anticon {
    color: var(--sd-act-ink) !important;
}

/* Override icon + span colors. I-039: a descendant `span` selector in this block excludes the nav badge (.nb) —
   it is not label text and keeps its own colours (app.css shell block). */
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected .ant-menu-item-icon + span,
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected .anticon + span,
ul.pisarcheon-menu.ant-menu-dark li.ant-menu-item-selected span:not(.nb) {
    color: var(--sd-act-ink) !important;
}

/* Override menu title content */
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected .ant-menu-title-content,
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected .ant-menu-title-content a,
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected .ant-menu-title-content span:not(.nb) {
    color: var(--sd-act-ink) !important;
}

/* Override SVG fill */
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected svg,
ul.pisarcheon-menu.ant-menu-dark li.ant-menu-item-selected svg {
    fill: var(--sd-act-ink) !important;
}

/* Quad class specificity for extra safety */
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item.ant-menu-item-selected,
ul.pisarcheon-menu.ant-menu.ant-menu-root.ant-menu-dark li.ant-menu-item.ant-menu-item-selected {
    background-color: var(--sd-act-bg) !important;
    color: var(--sd-act-ink) !important;
}

ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item.ant-menu-item-selected .anticon,
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item.ant-menu-item-selected a,
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item.ant-menu-item-selected span:not(.nb) {
    color: var(--sd-act-ink) !important;
}

/* ========================================
   Menu Item Styling - Border Radius, Height, Indicator
   ======================================== */

/* Menu container - constrain overflow */
.pisarcheon-menu.ant-menu,
ul.pisarcheon-menu.ant-menu {
    overflow: hidden !important;
    padding: 0 8px !important;
}

/* All menu items - rounded corners and proper sizing */
.pisarcheon-menu.ant-menu-dark .ant-menu-item,
ul.pisarcheon-menu.ant-menu.ant-menu-dark .ant-menu-item,
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item {
    border-radius: 8px !important;
    /* I-039: PROGRAM § 4 — 40 px items */
    height: 40px !important;
    line-height: 40px !important;
    margin: 1px 0 !important;
    width: calc(100% - 16px) !important;
    margin-left: 8px !important;
    margin-right: 8px !important;
    transition: all 150ms ease !important;
}

/* Selected item - orange indicator bar on left */
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected::before,
ul.pisarcheon-menu.ant-menu.ant-menu-dark .ant-menu-item-selected::before,
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item-selected::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 3px !important;
    height: 20px !important;
    background: var(--pri) !important;
    border-radius: 0 2px 2px 0 !important;
}

/* Hide the default right border indicator */
.pisarcheon-menu.ant-menu-dark .ant-menu-item-selected::after,
ul.pisarcheon-menu.ant-menu.ant-menu-dark .ant-menu-item-selected::after {
    display: none !important;
    border-right: none !important;
}

/* ========================================
   Sidebar & Menu - Full Glassy Dark Theme
   ======================================== */

/* Sidebar container - matches main app dark theme with subtle orange tint */
.main-sider.ant-layout-sider,
.main-sider.ant-layout-sider-dark,
aside.main-sider.ant-layout-sider,
aside.main-sider.ant-layout-sider-dark,
.ant-layout-sider.main-sider,
.ant-layout-sider-dark.main-sider {
    background: var(--sd-bg) !important; /* flat, as the prototype's .sider */
    border-right: 1px solid var(--sd-bd) !important;
}

/* Sider children container — flex column that owns the scroll-pin trio:
   children flex-column + min-height:0 + overflow:hidden lets the inner <nav>
   shrink correctly; the organ row above it and the foot below it stay pinned. */
.main-sider .ant-layout-sider-children,
aside.main-sider .ant-layout-sider-children {
    background: transparent !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

/* Sidebar scroll formula (F-174 — lifted from mlekerp). The <nav> child owns
   the actual scroll; the organ row and the foot stay pinned outside the scroll region. */
.main-sider .ant-layout-sider-children > nav,
aside.main-sider .ant-layout-sider-children > nav {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--sd-n-bg) transparent;
}

.main-sider .ant-layout-sider-children > nav::-webkit-scrollbar {
    width: 6px;
}

.main-sider .ant-layout-sider-children > nav::-webkit-scrollbar-track {
    background: transparent;
}

.main-sider .ant-layout-sider-children > nav::-webkit-scrollbar-thumb {
    background: var(--sd-n-bg);
    border-radius: 3px;
    transition: background var(--transition-base);
}

.main-sider .ant-layout-sider-children > nav::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--pri-rgb), .4);
}

/* Override AntDesign's default dark sider background - MAXIMUM SPECIFICITY */
.ant-layout-sider.ant-layout-sider-dark.main-sider,
aside.ant-layout-sider.ant-layout-sider-dark.main-sider,
aside.main-sider.ant-layout-sider.ant-layout-sider-dark,
aside.main-sider.ant-layout-sider.ant-layout-sider-dark.ant-layout-sider-has-trigger,
.ant-layout-has-sider aside.main-sider,
section.ant-layout aside.main-sider {
    background: var(--sd-bg) !important; /* flat, as the prototype's .sider */
    border-right: 1px solid var(--sd-bd) !important;
}

/* Menu container - transparent to show sider background */
.pisarcheon-menu.ant-menu-dark,
.pisarcheon-menu.ant-menu.ant-menu-dark,
.pisarcheon-menu.ant-menu-dark.ant-menu-inline,
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline {
    background: transparent !important;
    flex: 1;
}

/* ========================================
   NON-SELECTED Menu Items - Override AntDesign Blue
   Using high specificity with pisarcheon-menu class
   ======================================== */

/* Non-selected items - base styling (exclude selected) */
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item:not(.ant-menu-item-selected),
ul.pisarcheon-menu.ant-menu-dark li.ant-menu-item:not(.ant-menu-item-selected),
.pisarcheon-menu.ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected) {
    color: var(--sd-text) !important;
    background: transparent !important;
    margin: 1px 8px !important;
    border-radius: 8px !important;
    transition: all 150ms ease !important;
}

/* Non-selected items - icons */
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item:not(.ant-menu-item-selected) .anticon,
ul.pisarcheon-menu.ant-menu-dark li.ant-menu-item:not(.ant-menu-item-selected) .anticon,
.pisarcheon-menu.ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected) .anticon {
    color: var(--sd-muted) !important;
}

/* Non-selected items - links and text */
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item:not(.ant-menu-item-selected) a,
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item:not(.ant-menu-item-selected) span:not(.nb),
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item:not(.ant-menu-item-selected) .ant-menu-title-content,
ul.pisarcheon-menu.ant-menu-dark li.ant-menu-item:not(.ant-menu-item-selected) a,
ul.pisarcheon-menu.ant-menu-dark li.ant-menu-item:not(.ant-menu-item-selected) span:not(.nb),
.pisarcheon-menu.ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected) a,
.pisarcheon-menu.ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected) span:not(.nb),
.pisarcheon-menu.ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected) .ant-menu-title-content {
    color: var(--sd-text) !important;
}

/* Non-selected items - HOVER state (glassy). I-039: AntD's own active class (.ant-menu-item-active) takes the
   same look, so /design-system#app-shell-template can show the state in static markup. */
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item:not(.ant-menu-item-selected):hover,
ul.pisarcheon-menu.ant-menu-dark li.ant-menu-item:not(.ant-menu-item-selected):hover,
.pisarcheon-menu.ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected):hover,
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item-active:not(.ant-menu-item-selected) {
    background: var(--sd-hover) !important;
    color: var(--sd-strong) !important;
}

ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item:not(.ant-menu-item-selected):hover .anticon,
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item:not(.ant-menu-item-selected):hover a,
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item:not(.ant-menu-item-selected):hover span:not(.nb),
ul.pisarcheon-menu.ant-menu-dark li.ant-menu-item:not(.ant-menu-item-selected):hover .anticon,
ul.pisarcheon-menu.ant-menu-dark li.ant-menu-item:not(.ant-menu-item-selected):hover a,
ul.pisarcheon-menu.ant-menu-dark li.ant-menu-item:not(.ant-menu-item-selected):hover span:not(.nb),
.pisarcheon-menu.ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected):hover .anticon,
.pisarcheon-menu.ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected):hover a,
.pisarcheon-menu.ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected):hover span:not(.nb),
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item-active:not(.ant-menu-item-selected) .anticon,
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item-active:not(.ant-menu-item-selected) a,
ul.pisarcheon-menu.ant-menu.ant-menu-dark.ant-menu-inline li.ant-menu-item-active:not(.ant-menu-item-selected) span:not(.nb) {
    color: var(--sd-strong) !important;
}

/* I-039 TASK_07 (shell sweep): keyboard focus on a nav link. AntD resets the anchor's outline and nothing replaced
   it, so Tab moved through the sider without a visible position. The ring is drawn on the item — the anchor is
   narrower than the row and the menu clips what leaves it — inset like the prototype's `.sd-it:focus-visible`. */
ul.pisarcheon-menu.ant-menu.ant-menu-dark li.ant-menu-item:has(a:focus-visible) {
    outline: 2px solid var(--focus);
    outline-offset: -2px;
}

/* I-049 AD7: the same inset outline on every other menu's item (prototype .menu__it:focus-visible, line 236), and no
   AntD ring beside it — AntD's dark menu draws `0 0 0 2px #096dd9` on a focused item. */
.ant-menu .ant-menu-item:is(:focus-visible, :has(a:focus-visible)) {
    outline: 2px solid var(--focus);
    outline-offset: -2px;
}

.ant-menu-dark .ant-menu-item:focus-visible,
.ant-menu-dark .ant-menu-submenu-title:focus-visible {
    box-shadow: none;
}

/* The sider box (I-039): fixed and full height, with the content column offset by a margin, so main#main-content
   stays the only scroll container (PLAN D8). 256 / 68px are the Sider's Width / CollapsedWidth, which AntD writes
   as an inline style; there is no trigger bar (NoTrigger — the header button is the only toggle). The child
   combinator keeps these rules off the /design-system demo siders. B-009: they live here because ::deep on
   .ant-layout-* is banned in scoped CSS. */
.layout-container > .main-sider.ant-layout-sider {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100vh;
    /* AntD keeps .ant-layout-sider-has-trigger (48px of bottom padding for its trigger bar) on a Collapsible
       sider even with NoTrigger; the foot sits on the bottom edge */
    padding-bottom: 0;
    /* Over the scrim (.shell-scrim, app.css) while the sider is an overlay */
    z-index: 200;
    /* Only the collapse (the width AntD writes inline) and the overlay's slide move. Not AntD's `all`: it would
       animate the height on a window resize too — and visibility, which must switch at once when the overlay
       opens (the focus trap moves focus into the sider right away, and a hidden element takes no focus). */
    transition: flex-basis .2s, width .2s, min-width .2s, max-width .2s, transform .2s ease;
}

.layout-container > .main-sider ~ .content-layout {
    margin-left: 256px;
    transition: margin-left .2s;
}

.layout-container > .main-sider.ant-layout-sider-collapsed ~ .content-layout {
    margin-left: 68px;
}

/* Below 1000px the sider is an overlay over the content (off-canvas rule: shell block of app.css) */
@media (max-width: 999.98px) {
    .layout-container > .main-sider ~ .content-layout,
    .layout-container > .main-sider.ant-layout-sider-collapsed ~ .content-layout {
        margin-left: 0;
    }

    /* Closing: the sider turns hidden only once its slide-out has ended */
    .layout-container > .main-sider.ant-layout-sider:not(.is-open) {
        transition: transform .2s ease, visibility 0s linear .2s;
    }
}

@media (prefers-reduced-motion: reduce) {
    .layout-container > .main-sider.ant-layout-sider,
    .layout-container > .main-sider.ant-layout-sider:not(.is-open),
    .layout-container > .main-sider ~ .content-layout {
        transition: none;
    }
}

/* Remove the default blue right border */
.main-sider .ant-menu-item-selected::after,
.ant-menu-dark .ant-menu-item-selected::after,
.ant-menu.ant-menu-dark .ant-menu-item-selected::after {
    border-right-color: transparent !important;
    display: none !important;
}

/* Hover state */
.main-sider .ant-menu-dark .ant-menu-item:hover,
.ant-menu-dark .ant-menu-item:hover:not(.ant-menu-item-selected) {
    color: var(--sd-strong) !important;
}

.main-sider .ant-menu-dark .ant-menu-item:hover .anticon,
.ant-menu-dark .ant-menu-item:hover:not(.ant-menu-item-selected) .anticon {
    color: var(--sd-strong) !important;
}

/* Non-selected items - default styling */
.main-sider .ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected) .ant-menu-title-content,
.main-sider .ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected) .ant-menu-title-content a,
.main-sider .ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected) a,
.ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected) .ant-menu-title-content,
.ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected) .ant-menu-title-content a,
.ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected) a {
    color: var(--sd-text) !important;
}

.main-sider .ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected) .anticon,
.ant-menu-dark .ant-menu-item:not(.ant-menu-item-selected) .anticon {
    color: var(--sd-muted) !important;
}

/* ========================================
   App shell v2 (I-039) — the rules whose subject is an AntD element.
   The shell's own classes (.sd-top, .hdr, .nb, …) are in the shell block of app.css; showcase:
   /design-system#app-shell-template.
   ======================================== */

/* Sider group title (MenuItemGroup). Its text is F-264's .group-label, so the box takes the label's size:
   with AntD's 14px / 1.5715 the 11px label would sit in a 22px line. */
.pisarcheon-menu .ant-menu-item-group-title {
    padding: 16px 10px 6px;
    font-size: var(--font-size-label);
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
}

/* Sider item link: icon, label and badge on one row — the label takes the free space and truncates, so a badge
   (.nb, app.css) keeps the right edge. Collapsed, the app.css "Sidebar Menu Collapsed State" rules centre the icon. */
.pisarcheon-menu .ant-menu-item .ant-menu-title-content > a {
    display: flex;
    align-items: center;
}

.pisarcheon-menu .ant-menu-item .ant-menu-title-content > a > span:not(.anticon):not(.nb) {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Collapsed sider: no group titles, a rule between groups */
.main-sider.ant-layout-sider-collapsed .pisarcheon-menu .ant-menu-item-group-title {
    display: none;
}

.main-sider.ant-layout-sider-collapsed .pisarcheon-menu .ant-menu-item-group + .ant-menu-item-group {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--sd-bd);
}

/* Header script switch: the compact segmented. The label keeps AntD's 28px line, so at <=480px the item still
   takes the I-012 44px lift (never size .ant-segmented-item itself here). */
.hdr .script-toggle.ant-segmented {
    border: 1px solid var(--border);
}

.hdr .script-toggle .ant-segmented-item-label {
    min-height: 28px;
    padding: 0 9px;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 28px;
}

.hdr .script-toggle .ant-segmented-item-selected .ant-segmented-item-label {
    font-weight: 600;
}

/* User chip: the menu chevron is quieter than the name */
.uchip > .anticon {
    color: var(--muted);
    font-size: 14px;
}

/* User menu: .user-menu is the panel, so the AntD menu inside it carries no second one. !important answers the
   global dropdown-menu recipe below. I-062 TASK_12: AntD's own `.ant-dropdown { padding: 0 }` loads after app.css and
   wiped the panel's 6px inset (prototype .pop.menu), and the overlay is a flex row, so the menu's wrapper shrank to its
   content — the header rule and the separator stopped short of the panel's edge. */
.ant-dropdown.user-menu {
    padding: 6px;
}

.ant-dropdown.user-menu > div {
    flex: 1 1 auto;
    min-width: 0;
}

.user-menu .ant-dropdown-menu {
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ========================================
   Dropdown Overrides (Select panel + items)
   ======================================== */

/* Dropdown panel — matches .ant-dropdown-menu recipe (showcase "Dropdown Menu"
   section) so Select panels and menu panels share the same chrome. I-062 TASK_12: the prototype draws its selects as
   native lists (option on --float, --text) and every floating list it designs as .pop.menu — 6px inset, rows radius 7
   with 10px sides, the keyboard / hover row on neutral --panel-3 and the chosen one on --row-sel (.pick__r.is-sel);
   no row is tinted orange. Rows keep AntD's 32px height (the option list is sized by it). */
.ant-select-dropdown {
    background: var(--color-bg-elevated) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow) !important;
    padding: 6px !important;
}

/* Dropdown items */
.ant-select-item {
    padding: 5px 10px;
    color: var(--text) !important;
    border-radius: 7px !important;
    transition: background-color var(--transition-fast) !important;
}

.ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
    background: var(--row-sel) !important;
    color: var(--text) !important;
    font-weight: 500;
}

.ant-select-item-option-active:not(.ant-select-item-option-disabled) {
    background: var(--panel-3) !important;
    color: var(--text) !important;
}

.ant-select-item-option-selected:not(.ant-select-item-option-disabled) .ant-select-item-option-state {
    color: var(--text-2) !important;
}

/* A disabled option reads disabled: the row colour above would otherwise paint it like an enabled one */
.ant-select-item-option-disabled {
    color: var(--text-disabled) !important;
}

/* Clear button */
.ant-select-clear {
    background: transparent !important;
    color: var(--text-muted) !important;
}

.ant-select-clear:hover {
    color: var(--text-secondary) !important;
}

/* Hide clear when empty */
.ant-select:not(:has(.ant-select-selection-item)) .ant-select-clear {
    display: none !important;
}

/* ========================================
   Calendar (full-page <Calendar>) - Dark Theme
   ======================================== */

/* Default AntD Calendar bg is solid white. Inherit the parent glass-card surface. */
.ant-picker-calendar,
.ant-picker-calendar-full,
.ant-picker-calendar .ant-picker-panel {
    background: transparent !important;
    color: var(--text-primary) !important;
}

.ant-picker-calendar-header {
    border-bottom: 1px solid var(--glass-border) !important;
}

/* Year/Month switch — AntD renders this as an internal RadioGroup. We can't swap
   the component without overriding the whole HeaderRender, so we restyle the
   wrapper + buttons to be visually identical to .ant-segmented (matching every
   other variant switcher in the project). */
.ant-picker-calendar-mode-switch {
    background: var(--seg-bg) !important;
    border-radius: var(--radius-md) !important;
    padding: 2px !important;
    display: inline-flex !important;
}

.ant-picker-calendar-mode-switch .ant-radio-button-wrapper {
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-sm) !important;
    transition: all var(--transition-base) !important;
    box-shadow: none !important;
}

.ant-picker-calendar-mode-switch .ant-radio-button-wrapper::before {
    display: none !important;
}

.ant-picker-calendar-mode-switch .ant-radio-button-wrapper:hover {
    color: var(--text-primary) !important;
}

.ant-picker-calendar-mode-switch .ant-radio-button-wrapper-checked {
    background: var(--color-primary) !important;
    color: var(--on-pri) !important;
    box-shadow: 0 2px 8px rgba(var(--pri-rgb), .3) !important;
}

.ant-picker-calendar-mode-switch .ant-radio-button-wrapper-checked:hover {
    color: var(--on-pri) !important;
}

/* Year/Month select dropdowns in the header */
.ant-picker-calendar-header .ant-select-selector {
    background: var(--glass-bg-light) !important;
    border-color: var(--glass-border) !important;
    color: var(--text-primary) !important;
}

/* Day-of-week column headers */
.ant-picker-calendar thead th,
.ant-picker-calendar .ant-picker-content thead th {
    color: var(--text-secondary) !important;
    border-bottom: 1px solid var(--glass-border) !important;
}

/* Cell separators */
.ant-picker-calendar-full .ant-picker-cell {
    border-bottom: 1px solid var(--glass-border) !important;
}

.ant-picker-calendar-date,
.ant-picker-calendar-date-today {
    border-top-color: var(--glass-border) !important;
    background: transparent !important;
}

.ant-picker-calendar-date:hover {
    background: var(--row-h) !important;
}

.ant-picker-calendar-date-value {
    color: var(--text-primary) !important;
}

/* B-009: the full calendar's selected day is a calm tint, not a solid block. !important
   beats the transparent .ant-picker-calendar-date rule above. (I-056 TASK_05: /admin/praznici left AntD's Calendar for
   MonthCalendar, so the holiday grid's exclusion is gone; the dev playground keeps this block.) */
.ant-picker-calendar-full .ant-picker-cell-selected .ant-picker-calendar-date {
    background: rgba(var(--color-primary-rgb), 0.12) !important;
}

.ant-picker-calendar-full .ant-picker-cell-selected .ant-picker-calendar-date-value {
    color: var(--color-primary) !important;
}

/* Out-of-month cells — muted */
.ant-picker-cell:not(.ant-picker-cell-in-view) .ant-picker-calendar-date-value {
    color: var(--text-muted) !important;
}

/* ========================================
   DatePicker Dropdown (Calendar Panel) - Dark Theme
   ======================================== */

.ant-picker-dropdown {
    background: transparent !important;
}

.ant-picker-panel-container {
    background: var(--color-bg-elevated) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
}

.ant-picker-panel {
    background: transparent !important;
    border: none !important;
}

.ant-picker-header {
    color: var(--text) !important;
    border-bottom: 1px solid var(--border) !important;
}

/* I-062 TASK_12: the prototype draws its date fields as native inputs, so the open panel takes its floating-panel and
   calendar looks — the month / year label is the .pop__hd title (700 14.5px Manrope); today is the .cal__d.is-today
   neutral ring (the today rule below), orange staying the chosen day's alone. */
.ant-picker-dropdown .ant-picker-header-view {
    font-family: var(--head);
    font-size: 14.5px;
    font-weight: 700;
}

.ant-picker-header button {
    color: var(--muted) !important;
}

.ant-picker-header button:hover {
    color: var(--color-primary) !important;
}

.ant-picker-content th {
    color: var(--muted) !important;
}

/* Out-of-month days on --muted (the prototype's .cal__d.is-out — F-266 TASK_03: I-041's --text-disabled read 2.46:1 on the
   light panel, below the 4.5:1 a selectable day needs), in-month on --text — the month boundary stays visible */
.ant-picker-cell {
    color: var(--muted) !important;
}

.ant-picker-cell-in-view {
    color: var(--text) !important;
}

/* A day DisabledDate rules out reads disabled in either month: after the in-view rule (equal weight) so it wins,
   and AntD's own band (rgba(0, 0, 0, .04), invisible on the dark panel) is repainted on a token. */
.ant-picker-cell-disabled {
    color: var(--text-disabled) !important;
}

.ant-picker-cell-disabled::before {
    background: var(--neu-bg) !important;
}

.ant-picker-cell:hover:not(.ant-picker-cell-selected):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end) .ant-picker-cell-inner {
    background: var(--neu-bg) !important;
}

/* Today is the prototype's neutral ring (.cal__d.is-today, --text-2 — I-062 TASK_12), never orange */
.ant-picker-cell-today .ant-picker-cell-inner::before {
    border-color: var(--text-2) !important;
}

/* B-009: solid primary only in the DatePicker dropdown and the mini calendar — the
   full-page <Calendar> gets a calm tint instead (Calendar block above). */
.ant-picker-dropdown .ant-picker-cell-selected .ant-picker-cell-inner,
.ant-picker-calendar-mini .ant-picker-cell-selected .ant-picker-cell-inner {
    background: var(--color-primary) !important;
    color: var(--on-pri) !important;
}

/* ----- RangePicker cell states — brand tint instead of AntD default blue ----- */

/* Confirmed range endpoints (start / end / single-confirmed) */
.ant-picker-cell-range-start .ant-picker-cell-inner,
.ant-picker-cell-range-end .ant-picker-cell-inner,
.ant-picker-cell-range-start-single .ant-picker-cell-inner,
.ant-picker-cell-range-end-single .ant-picker-cell-inner {
    background: var(--color-primary) !important;
    color: var(--on-pri) !important;
}

/* Connected fill spanning between confirmed start and end cells */
.ant-picker-cell-in-range::before,
.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single)::before,
.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single)::before {
    background: rgba(var(--color-primary-rgb), 0.15) !important;
}

/* Hover preview fill (after start is picked, before end is committed) */
.ant-picker-cell-range-hover::before,
.ant-picker-cell-range-hover-start::before,
.ant-picker-cell-range-hover-end::before {
    background: rgba(var(--color-primary-rgb), 0.08) !important;
}

/* Dashed edge markers on the hover-preview endpoints */
.ant-picker-cell-range-hover::after,
.ant-picker-cell-range-hover-start::after,
.ant-picker-cell-range-hover-end::after,
.ant-picker-cell-range-hover-edge-start::after,
.ant-picker-cell-range-hover-edge-end::after {
    border-color: var(--color-primary) !important;
}

/* Hovering a confirmed endpoint while picking the second — keep brand tint */
.ant-picker-cell-range-start.ant-picker-cell-range-hover-end::before,
.ant-picker-cell-range-end.ant-picker-cell-range-hover-start::before {
    background: rgba(var(--color-primary-rgb), 0.15) !important;
}

.ant-picker-footer {
    border-top: 1px solid var(--border) !important;
}

.ant-picker-today-btn {
    color: var(--color-primary) !important;
}

.ant-picker-today-btn:hover {
    color: var(--color-primary-light) !important;
}

/* ========================================
   Message/Notification Overrides
   ======================================== */

/* I-062 TASK_13: a toast is the prototype's AntD Message (.pz-toasts / .pz-toast, prototype.html 2942–2971) — one
   centred column whose first toast sits 76px under the viewport top (clear of the 56px header), 8px between toasts.
   AntD Blazor writes the container's top inline (24px), hence the !important; the notice's 4px top padding completes
   the 76px. A toast: --toast-bg with a 1px --toast-bd border, radius 10, 9px 14px, 14px / 1.5 --toast-fg, the 16px icon
   8px before the text in the type's colour (--ok / --err / --info; the prototype has no warning toast, --warn by the
   same rule), --toast-shadow, no blur. */
.ant-message {
    top: 72px !important;
}

.ant-message-notice {
    padding: 4px 16px;
}

.ant-message-notice-content {
    padding: 9px 14px !important;
    background: var(--toast-bg) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid var(--toast-bd) !important;
    border-radius: 10px !important;
    box-shadow: var(--toast-shadow) !important;
    color: var(--toast-fg);
    font-size: 14px;
    line-height: 1.5;
}

.ant-message-success .anticon {
    color: var(--ok) !important;
}

.ant-message-error .anticon {
    color: var(--err) !important;
}

.ant-message-warning .anticon {
    color: var(--warn) !important;
}

.ant-message-info .anticon,
.ant-message-loading .anticon {
    color: var(--info) !important;
}

.ant-message-notice-content .ant-message-custom-content span:last-child {
    color: var(--toast-fg) !important;
}

/* ========================================
   Notification Overrides - Dark Theme
   ======================================== */

.ant-notification-notice {
    background: var(--color-bg-elevated) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow) !important;
    padding: 16px 20px !important;
}

.ant-notification-notice-message {
    color: var(--text-primary) !important;
    font-weight: 600;
}

.ant-notification-notice-description {
    color: var(--text-secondary) !important;
}

.ant-notification-notice-icon-success {
    color: var(--color-success) !important;
}

.ant-notification-notice-icon-error {
    color: var(--color-error) !important;
}

.ant-notification-notice-icon-warning {
    color: var(--color-warning, #faad14) !important;
}

.ant-notification-notice-icon-info {
    color: var(--color-primary) !important;
}

.ant-notification-notice-close {
    color: var(--muted) !important;
}

.ant-notification-notice-close:hover {
    color: var(--text-primary) !important;
}

/* ========================================
   Table Overrides - Dark Theme
   ======================================== */

.ant-table {
    background: transparent !important;
    color: var(--text-2) !important;
}

.ant-table-container,
.ant-table-content,
.ant-table table {
    background: transparent !important;
}

/* Systemic horizontal-overflow guard for glass-card tables.
   Wide list tables (Predmeti, Movements, Adresar, Postupci, Submissions,
   Tipovi dokumenata, Inbox "za arhiviranje") have fixed column widths whose
   sum exceeds the card on narrow windows. AntDesign leaves .ant-table-content
   at overflow: visible unless Scroll.X is set per-table, so columns bleed off
   the card edge instead of scrolling. .ant-table-content wraps only the grid
   (thead + tbody) — pagination is a sibling — so scrolling it keeps the header
   and rows aligned and leaves pagination fixed. auto = no scrollbar when the
   table already fits. */
.ant-table-content {
    overflow-x: auto;
}

.ant-table-thead > tr > th {
    background: var(--th-bg) !important;
    border-bottom: 1px solid var(--border) !important;
    color: var(--text-2) !important;
    /* header type (F-264 D3) lives once, in the Table Overrides block below */
}

.ant-table-tbody > tr > td {
    background: transparent !important;
    border-bottom: 1px solid var(--line) !important;
    color: var(--text-2) !important;
}

.ant-table-tbody > tr {
    background: transparent !important;
}

.ant-table-tbody > tr.ant-table-row:is(:hover, .ds-force-hover) > td,
.ant-table-tbody > tr:is(:hover, .ds-force-hover) > td {
    background: var(--row-h) !important;
}

/* ========================================
   Card Overrides - Dark Theme
   ======================================== */

.ant-card {
    background: var(--panel-2) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
}

.ant-card-body {
    background: transparent !important;
}

.ant-card-head {
    background: transparent !important;
    border-bottom: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
}

.ant-card-head-title {
    color: var(--text-primary) !important;
}

/* ========================================
   Empty State Overrides
   ======================================== */

.ant-empty-description {
    color: var(--muted) !important;
}

.ant-empty-image svg {
    fill: var(--text-disabled) !important;
}

/* ========================================
   Spin/Loading Overrides
   ======================================== */

.ant-spin-text {
    color: var(--text-2) !important;
}

.ant-spin-dot-item {
    background-color: var(--color-primary) !important;
}

/* ========================================
   Alert Overrides - Glassy Dark Theme
   ======================================== */

/* I-049 TASK_26 (PLAN LP13): the box is the prototype's .alert, verbatim — padding: 12px 16px; border-radius: 10px;
   1px border; no backdrop (was the glass recipe: radius 16, padding 16 / 20, blur 16).
   I-062 TASK_13: the whole .alert (prototype.html 194–204, 823–826), not only the box — on the page body's 15px / 1.5
   (AntD's box is 14px / 1.5715); the 18px icon 2px down and 12px before the text (AntD: 14px or 24px, 8px or 15px
   apart, centred when there is no description); the message is the .alert__t title, 600 in --text whatever the type;
   the description the .alert__d, 14px --text-2; actions (.alert__act) right-aligned, centred, 8px apart. The type paints
   only the box (--{tone}-bg / -bd) and the icon (--{tone}-ink). Was the record header's and the holidays banner's
   contextual recipe (app.css). */
.ant-alert {
    gap: 12px;
    align-items: flex-start;
    background: var(--neu-bg) !important;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid var(--neu-bd) !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
}

.ant-alert > .ant-alert-icon {
    flex: none;
    margin: 2px 0 0;
    font-size: 18px;
}

.ant-alert-message {
    color: var(--text) !important;
    font-weight: 600;
}

.ant-alert-with-description .ant-alert-message {
    margin-bottom: 0;
    font-size: inherit;
}

.ant-alert-description {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-2) !important;
}

.ant-alert-action {
    display: flex;
    flex: none;
    align-self: center;
    gap: 8px;
    margin-left: 0;
}

.ant-alert-close-icon {
    margin-left: 0;
}

/* F-263 finding L7 (I-041): info is blue (--info-*), never the brand tint */
.ant-alert-info {
    background: var(--info-bg) !important;
    border-color: var(--info-bd) !important;
}

.ant-alert-info .ant-alert-icon {
    color: var(--info-ink) !important;
}

.ant-alert-success {
    background: var(--ok-bg) !important;
    border-color: var(--ok-bd) !important;
}

.ant-alert-success .ant-alert-icon {
    color: var(--ok-ink) !important;
}

.ant-alert-warning {
    background: var(--warn-bg) !important;
    border-color: var(--warn-bd) !important;
}

.ant-alert-warning .ant-alert-icon {
    color: var(--warn-ink) !important;
}

.ant-alert-error {
    background: var(--err-bg) !important;
    border-color: var(--err-bd) !important;
}

.ant-alert-error .ant-alert-icon {
    color: var(--err-ink) !important;
}

/* Attention alert (I-041 D6): an AntD Alert Type=Info with Class="ant-alert-attn" — "waits for this user", never
   a decoration. Two classes outrank .ant-alert-info whatever the order; attention is never a button colour. */
.ant-alert.ant-alert-attn {
    background: var(--attn-bg) !important;
    border-color: var(--attn) !important;
}

.ant-alert.ant-alert-attn .ant-alert-icon {
    color: var(--attn-ink) !important;
}

/* ========================================
   Tag Overrides - Glassy Dark Theme
   ======================================== */

.ant-tag {
    background: var(--neu-bg) !important;
    border: 1px solid var(--neu-bd) !important;
    border-radius: 6px !important;
    color: var(--text-2) !important;
}

/* Semantic tag colours (B-001). They must follow the base .ant-tag rule above: every tag rule is
   single-class with !important, so the later rule wins. Every tag colour rule, semantic and named,
   lives in this Tag Overrides section — app.css has none. */
.ant-tag-success {
    background: var(--ok-bg) !important;
    border-color: var(--ok-bd) !important;
    color: var(--color-success-light) !important;
}

.ant-tag-error {
    background: var(--err-bg) !important;
    border-color: var(--err-bd) !important;
    color: var(--color-error-light) !important;
}

.ant-tag-warning {
    background: var(--warn-bg) !important;
    border-color: var(--warn-bd) !important;
    color: var(--color-warning-light) !important;
}

.ant-tag-processing {
    background: var(--info-bg) !important;
    border-color: var(--info-bd) !important;
    color: var(--color-info-light) !important;
}

.ant-tag-default {
    background: var(--neu-bg) !important;
    border-color: var(--glass-border) !important;
    color: var(--text-secondary) !important;
}

.ant-tag-green {
    background: var(--ok-bg) !important;
    border-color: var(--ok-bd) !important;
    color: var(--color-success-light) !important;
}

.ant-tag-blue {
    background: var(--info-bg) !important;
    border-color: var(--info-bd) !important;
    color: var(--color-info-light) !important;
}

.ant-tag-orange {
    background: var(--warn-bg) !important;
    border-color: var(--warn-bd) !important;
    color: var(--color-warning-light) !important;
}

.ant-tag-red {
    background: var(--err-bg) !important;
    border-color: var(--err-bd) !important;
    color: var(--color-error-light) !important;
}

/* F-263: AntD named hues have no v2 token. The tint/border alphas read on both themes; the ink mixes the
   hue 50/50 (lime 45/55) with --text, so it is light on dark and dark on light (>= 4.5:1 in both). */
.ant-tag-cyan {
    background: rgba(19, 194, 194, 0.15) !important;
    border-color: rgba(19, 194, 194, 0.25) !important;
    color: color-mix(in srgb, #13c2c2 50%, var(--text)) !important;
}

.ant-tag-purple {
    background: color-mix(in srgb, var(--color-accent-purple) 15%, transparent) !important;
    border-color: color-mix(in srgb, var(--color-accent-purple) 25%, transparent) !important;
    color: var(--color-accent-purple-light) !important;
}

.ant-tag-magenta,
.ant-tag-pink {
    background: rgba(235, 47, 150, 0.15) !important;
    border-color: rgba(235, 47, 150, 0.25) !important;
    color: color-mix(in srgb, #eb2f96 50%, var(--text)) !important;
}

.ant-tag-gold {
    background: var(--warn-bg) !important;
    border-color: var(--warn-bd) !important;
    color: var(--color-warning-light) !important;
}

.ant-tag-lime {
    background: rgba(160, 217, 17, 0.15) !important;
    border-color: rgba(160, 217, 17, 0.25) !important;
    color: color-mix(in srgb, #a0d911 45%, var(--text)) !important;
}

.ant-tag-volcano {
    background: rgba(250, 84, 28, 0.15) !important;
    border-color: rgba(250, 84, 28, 0.25) !important;
    color: color-mix(in srgb, #fa541c 50%, var(--text)) !important;
}

.ant-tag-geekblue {
    background: rgba(47, 84, 235, 0.15) !important;
    border-color: rgba(47, 84, 235, 0.25) !important;
    color: color-mix(in srgb, #2f54eb 50%, var(--text)) !important;
}

/* Tone tags (I-041 D7/D8) — <ToneTag> / <StatusTag>: an AntD Tag with tone-tag tone-tag--<tone>. Two classes, so
   a tone outranks the base, semantic and named rules above whatever the order. Text is always an -ink token
   (>= 4.5:1 on its own tint in both themes). Attention only for "new / waits for this user". */
.tone-tag-host {
    display: contents;
}

.ant-tag.tone-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    margin: 0;
    padding: 0 8px;
    border-radius: 6px !important;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.ant-tag.tone-tag--neutral {
    background: var(--neu-bg) !important;
    border-color: var(--neu-bd) !important;
    color: var(--text-2) !important;
}

.ant-tag.tone-tag--info {
    background: var(--info-bg) !important;
    border-color: var(--info-bd) !important;
    color: var(--info-ink) !important;
}

.ant-tag.tone-tag--ok {
    background: var(--ok-bg) !important;
    border-color: var(--ok-bd) !important;
    color: var(--ok-ink) !important;
}

.ant-tag.tone-tag--warn {
    background: var(--warn-bg) !important;
    border-color: var(--warn-bd) !important;
    color: var(--warn-ink) !important;
}

.ant-tag.tone-tag--err {
    background: var(--err-bg) !important;
    border-color: var(--err-bd) !important;
    color: var(--err-ink) !important;
}

.ant-tag.tone-tag--muted {
    background: transparent !important;
    border-color: var(--neu-bd) !important;
    color: var(--muted) !important;
}

.ant-tag.tone-tag--attention {
    background: var(--attn-bg) !important;
    border-color: var(--attn) !important;
    color: var(--attn-ink) !important;
}

/* ========================================
   Steps Overrides - Dark Theme with Orange Active
   ======================================== */

/* Steps container */
.ant-steps {
    color: var(--text-2) !important;
}

/* Step titles */
.ant-steps-item-title {
    color: var(--text-2) !important;
}

.ant-steps-item-description {
    color: var(--muted) !important;
}

/* Waiting steps - dark glass circles */
.ant-steps-item-wait .ant-steps-item-icon {
    background: var(--panel-2) !important;
    border-color: var(--border-2) !important;
}

.ant-steps-item-wait .ant-steps-item-icon .ant-steps-icon {
    color: var(--muted) !important;
}

.ant-steps-item-wait .ant-steps-item-title {
    color: var(--muted) !important;
}

/* Active/Process step - the flat brand colour: --on-pri on --pri is the pairing the theme guarantees, the gradient's lighter
   end measured 3.97:1 in light (I-049 TASK_08, the procedure import modal's step rail). */
.ant-steps-item-process .ant-steps-item-icon {
    background: var(--pri) !important;
    border-color: var(--color-primary) !important;
}

.ant-steps-item-process .ant-steps-item-icon .ant-steps-icon {
    color: var(--on-pri) !important;
}

.ant-steps-item-process .ant-steps-item-title {
    color: var(--text-primary) !important;
}

.ant-steps-item-process .ant-steps-item-description {
    color: var(--text-2) !important;
}

/* Finished steps - orange with checkmark */
.ant-steps-item-finish .ant-steps-item-icon {
    background: var(--pri-bg) !important;
    border-color: var(--color-primary) !important;
}

.ant-steps-item-finish .ant-steps-item-icon .ant-steps-icon {
    color: var(--color-primary) !important;
}

.ant-steps-item-finish .ant-steps-item-title {
    color: var(--text) !important;
}

/* Tail/connector lines between steps */
.ant-steps-item-tail::after {
    background: var(--border-2) !important;
}

.ant-steps-item-finish .ant-steps-item-tail::after {
    background: var(--color-primary) !important;
}

/* Title connector line (the visible one between steps) */
.ant-steps-item-finish .ant-steps-item-title::after {
    background-color: var(--color-primary) !important;
}

/* ========================================
   Primary Button Overrides - Orange Theme
   ======================================== */

/* Primary button - solid --pri fill, --on-pri ink (F-263 D12) */
.ant-btn-primary,
button.ant-btn-primary,
.ant-btn.ant-btn-primary {
    background: var(--pri) !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(var(--pri-rgb), .35) !important;
    color: var(--on-pri) !important;
    transition: all 150ms ease !important;
}

/* B-009: a disabled primary never lights up on hover/focus - the disabled rule below owns it.
   B-028 (1349): the guard also excludes [disabled] (the disabled rule matches it: <a disabled>, fieldset).
   :where() keeps the guard at zero specificity so contextual (danger) hovers still win. */
.ant-btn-primary:is(:hover, .ds-force-hover):where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)),
.ant-btn-primary:is(:focus-visible, .ds-force-focus):where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)),
button.ant-btn-primary:is(:hover, .ds-force-hover):where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)),
button.ant-btn-primary:is(:focus-visible, .ds-force-focus):where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)),
.ant-btn.ant-btn-primary:is(:hover, .ds-force-hover):where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)),
.ant-btn.ant-btn-primary:is(:focus-visible, .ds-force-focus):where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)) {
    background: var(--pri-h) !important;
    border: none !important;
    box-shadow: 0 6px 20px rgba(var(--pri-rgb), .45) !important;
    color: var(--on-pri) !important;
    transform: translateY(-1px);
}

.ant-btn-primary:active:where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)),
button.ant-btn-primary:active:where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)),
.ant-btn.ant-btn-primary:active:where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)) {
    background: var(--pri-press) !important;
    box-shadow: 0 2px 8px rgba(var(--pri-rgb), .35) !important;
    transform: translateY(0);
}

/* B-051 AD4 (b), I-049 AD7: keyboard focus keeps the hover glow above and adds no ring here — the focus ring is the
   outline of app.css's `.ant-btn-primary:is(:focus-visible, .ds-force-focus)` rule (2px --focus, offset 2px), which
   these box-shadow copies do not touch. */

/* Disabled primary button */
/* B-028 (1349): :disabled listed too, so the disabled look and the hover guard agree */
.ant-btn-primary[disabled],
.ant-btn-primary:disabled,
.ant-btn-primary.ant-btn-disabled,
button.ant-btn-primary[disabled],
button.ant-btn-primary:disabled,
button.ant-btn-primary.ant-btn-disabled {
    background: var(--neu-bg) !important;
    box-shadow: none !important;
    color: var(--text-disabled) !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Loading state: § Button Loading (after the danger buttons, I-062 TASK_13). */

/* Dropdown trigger button styling */
.ant-btn-primary .anticon,
button.ant-btn-primary .anticon {
    color: var(--on-pri) !important;
}

/* ========================================
   Dropdown Menu Overrides - Dark Theme
   ======================================== */

/* I-062 TASK_12 — the prototype's .pop.menu: a 6px inset; rows .menu__it — --text 14px/1.5, 8px 10px, radius 7, the
   16px icon --text-2; hover and the keyboard row on neutral --panel-3 (no orange: the menu is a list of actions, not a
   selection), the inset keyboard ring; .menu__sep 1px --line 6px 4px. A chosen row (a Selectable menu) is --row-sel. The
   menu is 248px wide at least and floats 8px off its trigger (.pop: top calc(100% + 8px); AntD places it 4px off). */
.ant-dropdown-menu {
    min-width: 248px;
    background: var(--color-bg-elevated) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow) !important;
    padding: 6px !important;
}

.ant-dropdown:is(.ant-dropdown-placement-bottomLeft, .ant-dropdown-placement-bottom, .ant-dropdown-placement-bottomRight) {
    margin-top: 4px;
}

.ant-dropdown:is(.ant-dropdown-placement-topLeft, .ant-dropdown-placement-top, .ant-dropdown-placement-topRight) {
    margin-top: -4px;
}

.ant-dropdown-menu-item {
    color: var(--text) !important;
    border-radius: 7px !important;
    padding: 8px 10px !important;
    line-height: 1.5 !important;
    transition: background-color 150ms ease !important;
}

.ant-dropdown-menu-item:is(:hover, .ds-force-hover),
.ant-dropdown-menu-item-active {
    background: var(--panel-3) !important;
    color: var(--text) !important;
}

.ant-dropdown-menu-item-selected {
    background: var(--row-sel) !important;
    color: var(--text) !important;
}

.ant-dropdown-menu-item-selected:is(:hover, .ds-force-hover) {
    background: var(--panel-3) !important;
}

.ant-dropdown-menu-item:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: -2px;
}

.ant-dropdown-menu-item .anticon {
    color: var(--text-2) !important;
    font-size: 16px;
}

/* An icon and its label sit 10px apart (.menu__it gap), not one space */
.ant-dropdown-menu-item .ant-menu-title-content {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* A disabled row reads disabled and takes no hover (the row colour above would paint it like an enabled one) */
.ant-dropdown-menu-item.ant-dropdown-menu-item-disabled,
.ant-dropdown-menu-item.ant-dropdown-menu-item-disabled .anticon {
    color: var(--text-disabled) !important;
}

.ant-dropdown-menu-item.ant-dropdown-menu-item-disabled:is(:hover, .ds-force-hover) {
    background: transparent !important;
}

.ant-dropdown-menu-item-divider {
    margin: 6px 4px !important;
    background: var(--line) !important;
}

/* Danger item (I-041): AntD's MenuItem has no Danger parameter, so a destructive row carries the class itself —
   <MenuItem Class="ant-dropdown-menu-item-danger"> — and reads on --err-ink, hovered or keyboard-active alike */
.ant-dropdown-menu-item.ant-dropdown-menu-item-danger,
.ant-dropdown-menu-item.ant-dropdown-menu-item-danger .anticon {
    color: var(--err-ink) !important;
}

.ant-dropdown-menu-item.ant-dropdown-menu-item-danger:is(:hover, .ds-force-hover),
.ant-dropdown-menu-item.ant-dropdown-menu-item-danger.ant-dropdown-menu-item-active {
    background: var(--err-bg) !important;
}

.ant-dropdown-menu-item.ant-dropdown-menu-item-danger:is(:hover, .ds-force-hover) .anticon,
.ant-dropdown-menu-item.ant-dropdown-menu-item-danger.ant-dropdown-menu-item-active .anticon {
    color: var(--err-ink) !important;
}

/* ========================================
   ImageCard Overrides - Dark Theme
   ======================================== */

/* Image filename - white text */
.image-card .filename {
    color: var(--text-primary) !important;
}

/* More platforms badge (+2) - dark theme */
.image-card .more-platforms {
    color: var(--text) !important;
    background-color: var(--neu-bg) !important;
}

/* Download button - dark glass with orange hover */
.image-card .download-btn,
.image-card .download-btn.ant-btn {
    background: var(--float) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border) !important;
    box-shadow: 0 2px 8px var(--shadow-color) !important;
    color: var(--text) !important;
}

.image-card .download-btn:hover,
.image-card .download-btn.ant-btn:hover {
    background: rgba(var(--pri-rgb), .2) !important;
    border-color: rgba(var(--pri-rgb), .4) !important;
    color: var(--color-primary) !important;
}

.image-card .download-btn .anticon,
.image-card .download-btn.ant-btn .anticon {
    color: inherit !important;
}

/* Image thumbnail background - dark */
.image-card .image-thumbnail {
    background-color: var(--panel-2) !important;
}

/* Image placeholder icon - muted */
.image-card .image-placeholder {
    color: var(--muted) !important;
}

/* Compliance icon background - dark */
.image-card .compliance-icon {
    background: var(--color-bg-dark-secondary) !important;
}

/* ========================================
   Subscription Tag Overrides
   ======================================== */

/* Base subscription-tag — pill shape, neutral muted glass. Tier variants override
   background + border + color; expiring-* variants add animation on top. */
.subscription-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    border: 1px solid transparent;
    background: var(--glass-bg-subtle);
    color: var(--text-secondary);
}

.subscription-tag.tier-free {
    background: var(--glass-bg-subtle);
    color: var(--text-muted);
    border-color: var(--glass-border);
}

.subscription-tag.tier-starter {
    background: var(--color-tier-starter-bg);
    color: var(--color-tier-starter);
    border-color: color-mix(in srgb, var(--color-tier-starter) 30%, transparent);
}

.subscription-tag.tier-pro {
    background: var(--color-tier-pro-bg);
    color: var(--color-tier-pro);
    border-color: color-mix(in srgb, var(--color-tier-pro) 30%, transparent);
}

.subscription-tag.tier-enterprise {
    background: rgba(var(--pri-rgb), .12);
    color: var(--color-primary-light);
    border-color: rgba(var(--pri-rgb), .3);
}

/* tier-max — gradient gold + glow (digidok-grade flagship polish). Hex values
   here are intentional — gold doesn't map to any brand-orange or semantic token.
   F-263: the gold is the same in both themes, so its ink is a fixed dark too (a themed
   token would turn light on gold in the light theme). */
.subscription-tag.tier-max,
.ant-tag.subscription-tag.tier-max {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 50%, #b8860b 100%) !important;
    color: #1a1f2e !important;
    border-color: rgba(255, 215, 0, 0.5) !important;
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
    font-weight: 700;
}

/* Expiring status indicators — apply on top of any tier variant. */
.subscription-tag.expiring-warning {
    border-color: var(--color-warning) !important;
    color: var(--color-warning-light) !important;
}

@keyframes expiring-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--err) 50%, transparent); }
    50%      { box-shadow: 0 0 0 6px transparent; }
}

.subscription-tag.expiring-critical {
    border-color: var(--color-error) !important;
    color: var(--color-error-light) !important;
    animation: expiring-pulse 1.5s ease-in-out infinite;
}

/* ========================================
   Dashboard Plan Value Styling
   ======================================== */

/* Free plan - default muted styling */
.stat-value.plan-free {
    color: var(--text-muted) !important;
}

/* Pro plan - blue */
.stat-value.plan-pro {
    color: var(--color-tier-starter) !important;
}

/* Plus plan - purple */
.stat-value.plan-plus {
    color: var(--color-tier-pro) !important;
}

/* Max plan - orange gradient with glow effect */
.stat-value.plan-max {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(var(--pri-rgb), .4);
}

/* ========================================
   Upgrade Page Button Overrides
   ======================================== */

/* Plan card body - flex layout to push button to bottom */
.plan-card .ant-card-body,
.plan-card.ant-card .ant-card-body {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
}

/* All plan card buttons - pill shape, pushed to bottom */
.plan-card .ant-btn,
.plan-card.ant-card .ant-btn {
    height: 48px !important;
    font-weight: 600 !important;
    border-radius: 24px !important;
    font-size: 0.9375rem !important;
    transition: all 200ms ease !important;
    margin-top: auto !important;
}

/* Default button (Free plan) */
.plan-card .ant-btn-default,
.plan-card.ant-card .ant-btn-default {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-2) !important;
}

.plan-card .ant-btn-default:hover:not(:disabled),
.plan-card.ant-card .ant-btn-default:hover:not(:disabled) {
    background: var(--neu-bg) !important;
    border-color: var(--border-2) !important;
    color: var(--text-primary) !important;
}

/* Disabled "Current Plan" button - green indicator style */
.plan-card .ant-btn-default[disabled],
.plan-card .ant-btn-default.ant-btn-disabled,
.plan-card.ant-card .ant-btn-default[disabled],
.plan-card.ant-card .ant-btn-default.ant-btn-disabled {
    background: var(--ok-bg) !important;
    border: 1px solid var(--ok-bd) !important;
    color: var(--color-success) !important;
    opacity: 1 !important;
    cursor: default !important;
}

/* Primary button (Subscribe) — fill, border and rest glow come from the single .ant-btn.ant-btn-primary rule (F-263 D12) */
.plan-card .ant-btn-primary:hover:not(:disabled),
.plan-card.ant-card .ant-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(var(--pri-rgb), .45) !important;
}

/* ========================================
   Billing Toggle - Save Badge
   ======================================== */

/* Save percentage badge - make it stand out */
.billing-toggle .ant-tag {
    background: var(--pri) !important;
    border: none !important;
    color: var(--on-pri) !important;
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(var(--pri-rgb), .4) !important;
    animation: pulse-glow 2s ease-in-out infinite !important;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(var(--pri-rgb), .4);
    }
    50% {
        box-shadow: 0 2px 16px rgba(var(--pri-rgb), .6), 0 0 20px rgba(var(--pri-rgb), .3);
    }
}

/* ========================================
   Checkbox Overrides - Orange Theme
   ======================================== */

/* Checkbox inner box - dark glass background */
.ant-checkbox .ant-checkbox-inner,
.ant-checkbox-wrapper .ant-checkbox .ant-checkbox-inner {
    background: var(--ctl-bg) !important;
    border-color: var(--ctl-bd) !important;
    border-radius: 4px !important;
}

/* Checkbox hover state */
.ant-checkbox:is(:hover, .ds-force-hover) .ant-checkbox-inner,
.ant-checkbox-wrapper:is(:hover, .ds-force-hover) .ant-checkbox .ant-checkbox-inner {
    border-color: var(--color-primary) !important;
}

/* Checkbox checked state - orange */
.ant-checkbox-checked .ant-checkbox-inner,
.ant-checkbox-wrapper .ant-checkbox-checked .ant-checkbox-inner {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

/* Checkbox checked hover - lighter orange */
.ant-checkbox-checked:is(:hover, .ds-force-hover) .ant-checkbox-inner,
.ant-checkbox-wrapper:is(:hover, .ds-force-hover) .ant-checkbox-checked .ant-checkbox-inner {
    background: var(--color-primary-light) !important;
    border-color: var(--color-primary-light) !important;
}

/* Checkbox indeterminate state - orange */
.ant-checkbox-indeterminate .ant-checkbox-inner::after,
.ant-checkbox-wrapper .ant-checkbox-indeterminate .ant-checkbox-inner::after {
    background-color: var(--color-primary) !important;
}

/* Checkbox focus (I-049 AD7): keyboard only, the focus outline around the box. The input is AntD's invisible overlay
   (opacity 0), so the outline goes on its sibling box; a mouse click leaves the rest look. */
.ant-checkbox-input:focus-visible + .ant-checkbox-inner,
.ant-checkbox-wrapper .ant-checkbox-input:focus-visible + .ant-checkbox-inner,
.ant-checkbox-wrapper.ds-force-focus .ant-checkbox .ant-checkbox-inner {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* Disabled checkbox label — AntDesign colors it rgba(0, 0, 0, 0.25), which is
   near-invisible on dark surfaces (e.g. the auto-assigned Руководилац ОЈ role in
   the user drawer). --text-muted matches the disabled radio-button treatment. */
.ant-checkbox-disabled + span {
    color: var(--text-muted) !important;
}

/* Checkbox label text color */
.ant-checkbox-wrapper {
    color: var(--text) !important;
}

/* Checkbox wrapper hover */
.ant-checkbox-wrapper:is(:hover, .ds-force-hover) {
    color: var(--text-primary) !important;
}

/* ========================================
   Radio Button Overrides - Orange Theme
   ======================================== */

/* Radio inner circle - dark glass background */
.ant-radio .ant-radio-inner,
.ant-radio-wrapper .ant-radio .ant-radio-inner {
    background: var(--ctl-bg) !important;
    border-color: var(--ctl-bd) !important;
}

/* Radio hover state */
.ant-radio:is(:hover, .ds-force-hover) .ant-radio-inner,
.ant-radio-wrapper:is(:hover, .ds-force-hover) .ant-radio .ant-radio-inner {
    border-color: var(--color-primary) !important;
}

/* Radio checked state - orange */
.ant-radio-checked .ant-radio-inner,
.ant-radio-wrapper .ant-radio-checked .ant-radio-inner {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

/* Radio checked inner dot */
.ant-radio-checked .ant-radio-inner::after,
.ant-radio-wrapper .ant-radio-checked .ant-radio-inner::after {
    background-color: var(--on-pri) !important;
}

/* Radio checked hover - lighter orange */
.ant-radio-checked:is(:hover, .ds-force-hover) .ant-radio-inner,
.ant-radio-wrapper:is(:hover, .ds-force-hover) .ant-radio-checked .ant-radio-inner {
    background: var(--color-primary-light) !important;
    border-color: var(--color-primary-light) !important;
}

/* Radio focus (I-049 AD7): as the checkbox — keyboard only, the focus outline around the circle. AntD's own
   `.ant-radio-input:focus + .ant-radio-inner` ring (a mouse click draws it too) is cancelled. */
.ant-radio-input:focus + .ant-radio-inner {
    box-shadow: none;
}

.ant-radio-input:focus-visible + .ant-radio-inner,
.ant-radio-wrapper .ant-radio-input:focus-visible + .ant-radio-inner,
.ant-radio-wrapper.ds-force-focus .ant-radio .ant-radio-inner {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* Radio label text color */
.ant-radio-wrapper {
    color: var(--text) !important;
}

/* Radio wrapper hover */
.ant-radio-wrapper:is(:hover, .ds-force-hover) {
    color: var(--text-primary) !important;
}

/* ========================================
   Adjustment Grid Item - Dark Theme
   ======================================== */

.adjustment-grid-item {
    background: var(--panel-2) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.adjustment-grid-item:hover {
    border-color: var(--color-primary) !important;
    box-shadow: 0 2px 8px rgba(var(--pri-rgb), .15) !important;
}

.adjustment-grid-item.selected {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--pri-rgb), .2) !important;
}

.adjustment-grid-item .item-preview {
    background: var(--panel-3) !important;
}

.adjustment-grid-item .adjustment-badge {
    background: var(--color-primary) !important;
}

.adjustment-grid-item .item-footer {
    border-top: 1px solid var(--border) !important;
}

.adjustment-grid-item .item-name {
    color: var(--text-primary) !important;
}

.adjustment-grid-item .item-size {
    color: var(--muted) !important;
}

/* ===============================================
   Slider Overrides - Orange Theme
   =============================================== */

.ant-slider-rail {
    background: var(--border) !important;
}

.ant-slider-track {
    background: var(--color-primary) !important;
}

.ant-slider-handle {
    background: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
}

.ant-slider-handle:hover,
.ant-slider-handle:focus,
.ant-slider-handle-dragging {
    box-shadow: 0 0 0 4px rgba(var(--pri-rgb), .2) !important;
    border-color: var(--color-primary) !important;
}

.ant-slider:hover .ant-slider-track {
    background: var(--color-primary-light) !important;
}

.ant-slider:hover .ant-slider-handle:not(.ant-tooltip-open) {
    border-color: var(--color-primary-light) !important;
}

/* ===============================================
   Modal/Drawer Overrides - Dark Theme
   =============================================== */

/* I-062 TASK_12 — every Modal is the prototype's dialog (.dmask / .dlg): the mask a plain --scrim (no blur), the panel
   radius 14; .dlg__hd 18px 16px 4px 20px with no rule, its 700 18px/1.35 Manrope title (3px down) and a 34px ghost
   close button (--text-2, radius 8) — so the header is 56px tall; .dlg__bd 10px 20px 6px; .dlg__ft 14px 20px 18px with no
   rule. The close is AntD's absolute button, so the header keeps 56px on the right for it. */
.ant-modal-mask {
    background: var(--scrim) !important;
}

.ant-modal-content {
    background: var(--color-bg-elevated) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    box-shadow: var(--shadow) !important;
    padding: 0 !important;
    /* NOT overflow:hidden — AntDesign renders Select/DatePicker overlays as children
       of .ant-modal-content (not portaled to body), so clipping here cuts off any
       dropdown that extends past the modal (e.g. a DatePicker as the last field).
       Rounded corners still hold via border-radius + this element's own background;
       all child sections (header/body/footer) are transparent, so none bleed. */
    overflow: visible;
}

.ant-modal-header {
    min-height: 56px;
    background: transparent !important;
    border-bottom: 0 !important;
    padding: 21px 56px 4px 20px !important;
}

.ant-modal-title {
    color: var(--text-primary) !important;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    line-height: 1.35;
}

.ant-modal-close {
    top: 18px !important;
    right: 16px !important;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: var(--text-2) !important;
}

.ant-modal-close-x {
    width: 34px;
    height: 34px;
    font-size: 18px;
    line-height: 34px;
}

.ant-modal-close:hover {
    color: var(--text-primary) !important;
    background: var(--panel-3) !important;
}

/* AntD's `.ant-modal-close { outline: 0 }` loads after app.css's :focus-visible rule */
.ant-modal-close:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.ant-modal-body {
    padding: 10px 20px 6px !important;
    color: var(--text-2) !important;
}

.ant-modal-body p {
    color: var(--text-2);
    margin: 0 0 16px 0;
    line-height: 1.6;
}

/* B-009: AntD's dark heading colour is near-invisible on the dark modal. No !important and
   :where() keeps it at (0,0,1), so a heading class (.section-title-sm, …) still decides its own colour.
   B-028 (1342): the drawer body has the same problem, so it shares the rule. */
:where(.ant-modal-body, .ant-drawer-body) :is(h1, h2, h3, h4, h5, h6) {
    color: var(--text-primary);
}

/* ModalService.ConfirmAsync — AntD's light-theme text colours are black on the dark surface. I-062 TASK_12: the confirm
   has no header, so its body keeps the dialog's outer padding (.dlg__hd top, .dlg__ft bottom); the title is the dialog
   title, the text the decision body (.dm-body 14.5px/1.5 --text-2), the buttons 20px under it (.dlg__bd 6 + .dlg__ft
   14) and the icon an -ink token (.dlg__ic.tx-warn) instead of AntD's fixed gold, blue, green and red. */
.ant-modal-confirm .ant-modal-body {
    padding: 20px 20px 18px !important;
}

.ant-modal-confirm-body .ant-modal-confirm-title {
    color: var(--text-primary) !important;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.ant-modal-confirm-body .ant-modal-confirm-content {
    color: var(--text-secondary) !important;
    font-size: 14.5px;
    line-height: 1.5;
}

.ant-modal-confirm .ant-modal-confirm-btns {
    margin-top: 20px;
}

.ant-modal-confirm:is(.ant-modal-confirm-confirm, .ant-modal-confirm-warning) .ant-modal-confirm-body > .anticon {
    color: var(--warn-ink);
}

.ant-modal-confirm-error .ant-modal-confirm-body > .anticon {
    color: var(--err-ink);
}

.ant-modal-confirm-success .ant-modal-confirm-body > .anticon {
    color: var(--ok-ink);
}

.ant-modal-confirm-info .ant-modal-confirm-body > .anticon {
    color: var(--info-ink);
}

.ant-modal-footer {
    background: transparent !important;
    border-top: 0 !important;
    padding: 14px 20px 18px !important;
}

.ant-modal-footer .ant-btn {
    border-radius: 8px !important;
    font-weight: 500;
}

/* I-062 TASK_12: the footer's default button is the prototype's .dlg__ft .btn — --text on --ctl-bg / --ctl-bd (F-263's
   --text-2 was the token port of the old 70% white, not a design choice); hover, keyboard focus and the disabled guard
   are the global .ant-btn-default rules', as a page's (a copy here lit a disabled „Откажи“ up while submitting). */
.ant-modal-footer .ant-btn-default {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    color: var(--text) !important;
}

/* The footer primary is the plain .ant-btn.ant-btn-primary (solid --pri, --pri-h on hover — F-263 D12); a footer
   copy at (0,2,0) painted --gradient-primary at rest over it. */

.ant-modal-footer .ant-btn-dangerous {
    background: var(--err-bg) !important;
    border: 1px solid var(--err-bd) !important;
    color: var(--color-error-light) !important;
}

.ant-modal-footer .ant-btn-dangerous:hover {
    background: var(--err-bd) !important;
    border-color: color-mix(in srgb, var(--err) 40%, transparent) !important;
}

/* I-062 TASK_12 — the prototype has no content drawer; its Drawer is the sider overlay (a --shadow over a plain --scrim,
   its head on a --line rule), so a drawer takes that and the dialog's parts: the 700 18px/1.35 title and the 34px ghost
   close, in a 56px head, and the 1px --border edge every floating panel has. A drawer is a fixed overlay, so it never
   takes the page's vertical rhythm — placed inside .page-container, the owl margin pushed it and its mask 24px down. */
.ant-drawer {
    margin: 0 !important;
}

.ant-drawer-mask {
    background: var(--scrim) !important;
}

/* Open only: a closed drawer waits just off-screen, where its shadow would bleed in at the viewport edge */
.ant-drawer-open .ant-drawer-content-wrapper {
    box-shadow: var(--shadow) !important;
}

.ant-drawer-content {
    background: var(--color-bg-elevated) !important;
    backdrop-filter: blur(24px);
}

.ant-drawer-right .ant-drawer-content {
    border-left: 1px solid var(--border);
}

.ant-drawer-left .ant-drawer-content {
    border-right: 1px solid var(--border);
}

/* flex: none — AntD's `flex: 0 1 0%` would hold a two-line head (the detail drawer's title + subtitle) at the 56px floor */
.ant-drawer-header {
    flex: none;
    min-height: 56px;
    background: transparent !important;
    border-color: var(--line) !important;
    position: relative;
    padding: 15px 56px 15px 24px !important;
}

.ant-drawer-title {
    color: var(--text-primary) !important;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.ant-drawer-close {
    display: grid !important;
    place-items: center;
    width: 34px;
    height: 34px;
    color: var(--text-2) !important;
    position: absolute !important;
    top: 11px !important;
    right: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 18px;
    border-radius: 8px;
}

.ant-drawer-close:hover {
    color: var(--text-primary) !important;
    background: var(--panel-3) !important;
}

.ant-drawer-close:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.ant-drawer-body {
    background: transparent !important;
    color: var(--text-primary) !important;
}

.ant-drawer-body p {
    color: var(--text-secondary) !important;
}

/* EntityFormDrawer — full-bleed body so footer can sit sticky at bottom */
.entity-drawer .ant-drawer-body {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Mobile (≤768px): EntityFormDrawer expands to full viewport width */
@media (max-width: 768px) {
    .entity-drawer.ant-drawer-right .ant-drawer-content-wrapper,
    .entity-drawer .ant-drawer-content-wrapper {
        width: 100vw !important;
        max-width: 100vw !important;
    }
}

/* ===============================================
   Image Adjustment Editor - Dark Theme
   =============================================== */

.image-adjustment-editor {
    background: var(--color-bg-elevated) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow) !important;
}

.image-adjustment-editor .editor-header {
    border-bottom: 1px solid var(--border) !important;
}

.image-adjustment-editor .editor-title {
    color: var(--text-primary) !important;
}

.image-adjustment-editor .editor-header .ant-btn-text {
    color: var(--text-2) !important;
}

.image-adjustment-editor .editor-header .ant-btn-text:hover {
    color: var(--text-primary) !important;
    background: var(--neu-bg) !important;
}

/* Platform tabs */
.image-adjustment-editor .platform-tabs .ant-tabs-nav::before {
    border-color: var(--border) !important;
}

.image-adjustment-editor .platform-tabs .ant-tabs-tab {
    color: var(--text-2) !important;
}

.image-adjustment-editor .platform-tabs .ant-tabs-tab:hover {
    color: var(--color-primary) !important;
}

.image-adjustment-editor .platform-tabs .ant-tabs-tab-active .ant-tabs-tab-btn {
    color: var(--color-primary) !important;
}

.image-adjustment-editor .platform-tabs .ant-tabs-ink-bar {
    background: var(--color-primary) !important;
}

/* Preview container */
.image-adjustment-editor .preview-container {
    background-color: var(--panel-2) !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
}

.image-adjustment-editor .preview-wrapper {
    background-color: var(--panel-3) !important;
}

/* Controls panel */
.image-adjustment-editor .controls-panel {
    background-color: var(--panel) !important;
    border: 1px solid var(--line) !important;
    border-radius: 12px !important;
}

.image-adjustment-editor .controls-panel .ant-divider {
    border-color: var(--border) !important;
}

/* Slider labels */
.image-adjustment-editor .slider-label,
.image-adjustment-editor .control-label {
    color: var(--text-primary) !important;
}

.image-adjustment-editor .slider-value {
    color: var(--color-primary) !important;
}

/* Offset controls */
.image-adjustment-editor .offset-label {
    color: var(--muted) !important;
}

.image-adjustment-editor .offset-header .ant-btn {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    color: var(--text) !important;
}

.image-adjustment-editor .offset-header .ant-btn:hover {
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
}

/* InputNumber styling */
.image-adjustment-editor .ant-input-number {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    color: var(--text-primary) !important;
}

.image-adjustment-editor .ant-input-number:hover {
    border-color: var(--ctl-bd-h) !important;
}

.image-adjustment-editor .ant-input-number:focus,
.image-adjustment-editor .ant-input-number-focused {
    border-color: var(--focus) !important;
    box-shadow: 0 0 0 3px var(--pri-bg) !important;
}

.image-adjustment-editor .ant-input-number-input {
    color: var(--text-primary) !important;
}

.image-adjustment-editor .ant-input-number-handler-wrap {
    background: var(--ctl-bg) !important;
    border-left: 1px solid var(--ctl-bd) !important;
}

.image-adjustment-editor .ant-input-number-handler {
    border-color: var(--border) !important;
}

.image-adjustment-editor .ant-input-number-handler:hover {
    background: var(--pri-bg) !important;
}

.image-adjustment-editor .ant-input-number-handler-up-inner,
.image-adjustment-editor .ant-input-number-handler-down-inner {
    color: var(--text-2) !important;
}

.image-adjustment-editor .ant-input-number-handler:hover .ant-input-number-handler-up-inner,
.image-adjustment-editor .ant-input-number-handler:hover .ant-input-number-handler-down-inner {
    color: var(--color-primary) !important;
}

/* Control hint */
.image-adjustment-editor .control-hint {
    color: var(--text-2) !important;
    background-color: var(--pri-bg) !important;
    border: 1px solid rgba(var(--pri-rgb), .2) !important;
    border-radius: 8px !important;
}

.image-adjustment-editor .control-hint .anticon {
    color: var(--color-primary) !important;
}

/* Quick buttons */
.image-adjustment-editor .quick-buttons .ant-btn,
.image-adjustment-editor .scale-presets .ant-btn {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    color: var(--text) !important;
}

.image-adjustment-editor .quick-buttons .ant-btn:hover,
.image-adjustment-editor .scale-presets .ant-btn:hover {
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
}

/* Toolbar */
.image-adjustment-editor .adjustment-toolbar {
    background-color: var(--panel) !important;
    border-top: 1px solid var(--border) !important;
    border-radius: 0 0 16px 16px !important;
}

.image-adjustment-editor .adjustment-toolbar .ant-btn-default {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    color: var(--text) !important;
}

.image-adjustment-editor .adjustment-toolbar .ant-btn-default:hover:not(:disabled) {
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
}

.image-adjustment-editor .adjustment-toolbar .ant-btn-default:disabled {
    background: var(--panel) !important;
    border-color: var(--line) !important;
    color: var(--text-disabled) !important;
}

/* Platform overlay - Orange crop guide */
.platform-overlay .margin-guide {
    border-color: rgba(var(--pri-rgb), .6) !important;
}

/* Platform label tag - Orange theme */
.platform-overlay .platform-label .ant-tag,
.platform-overlay .platform-label .ant-tag-blue {
    background: var(--pri-bg) !important;
    color: var(--color-primary-light) !important;
    border-color: rgba(var(--pri-rgb), .25) !important;
}

/* ===============================================
   Progress Bar Overrides - Orange Theme
   =============================================== */

.ant-progress-bg {
    background: var(--gradient-primary) !important;
}

.ant-progress-inner {
    background: var(--neu-bg) !important;
}

.ant-progress-text {
    color: var(--text) !important;
}

/* Tones (I-041): Class="progress--ok|warn|err" on the Progress root. The default bar keeps the gradient above.
   I-049 AD17: progress--neutral (--text-2) is the tone of a progress that is not good or bad news — the wizard shell's
   bar and the case page's „Касније“ deadline band; it replaces their two local rules. */
.ant-progress.progress--ok .ant-progress-bg {
    background: var(--ok) !important;
}

.ant-progress.progress--warn .ant-progress-bg {
    background: var(--warn) !important;
}

.ant-progress.progress--err .ant-progress-bg {
    background: var(--err) !important;
}

.ant-progress.progress--neutral .ant-progress-bg {
    background: var(--text-2) !important;
}

.ant-progress-success-bg {
    background: var(--color-primary) !important;
}

/* Progress circle (if used) */
.ant-progress-circle-path {
    stroke: var(--color-primary) !important;
}

.ant-progress-circle-trail {
    stroke: var(--neu-bg) !important;
}

/* ===============================================
   Result Component Overrides — Brand Color Map
   success=green  warning=orange  error=red  info=orange(not blue)
   =============================================== */

/* Success icon — semantic green */
.ant-result-success .ant-result-icon > .anticon {
    color: var(--color-success) !important;
}

.ant-result-success .ant-result-icon svg {
    fill: var(--color-success) !important;
}

/* Warning icon — semantic yellow/orange */
.ant-result-warning .ant-result-icon > .anticon {
    color: var(--color-warning) !important;
}

.ant-result-warning .ant-result-icon svg {
    fill: var(--color-warning) !important;
}

/* Error icon — semantic red */
.ant-result-error .ant-result-icon > .anticon {
    color: var(--color-error) !important;
}

.ant-result-error .ant-result-icon svg {
    fill: var(--color-error) !important;
}

/* Info icon — brand orange, NOT default blue */
.ant-result-info .ant-result-icon > .anticon {
    color: var(--color-primary) !important;
}

.ant-result-info .ant-result-icon svg {
    fill: var(--color-primary) !important;
}

/* Result text colors for dark theme */
.ant-result-title {
    color: var(--text) !important;
}

.ant-result-subtitle {
    color: var(--text-2) !important;
}

/* ===============================================
   BatchProgress Component - Dark Theme
   =============================================== */

.batch-progress {
    padding: 24px;
}

.batch-progress .progress-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.batch-progress .progress-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary) !important;
    margin: 0 0 4px 0;
}

.batch-progress .progress-subtitle {
    font-size: 14px;
    color: var(--text-2) !important;
    margin: 0;
}

.batch-progress .progress-stats {
    display: flex;
    gap: 12px;
    font-size: 14px;
}

.batch-progress .stat-completed {
    color: var(--color-primary) !important;
}

.batch-progress .stat-failed {
    color: var(--color-error-light) !important;
}

.batch-progress .stat-total {
    color: var(--text-2) !important;
}

/* Connection status badges - dark theme */
.batch-progress .connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.batch-progress .connection-status.connected {
    background-color: var(--pri-bg) !important;
    color: var(--color-primary-light) !important;
    border: 1px solid rgba(var(--pri-rgb), .25);
}

.batch-progress .connection-status.connecting {
    background-color: var(--warn-bg) !important;
    color: var(--color-warning-light) !important;
    border: 1px solid var(--warn-bd);
}

.batch-progress .connection-status.disconnected {
    background-color: var(--err-bg) !important;
    color: var(--color-error-light) !important;
    border: 1px solid var(--err-bd);
}

/* Image grid - dark theme */
.batch-progress .image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.batch-progress .image-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.batch-progress .image-preview {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--panel-2) !important;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.batch-progress .image-item.pending .image-preview {
    border-color: var(--border-2) !important;
}

.batch-progress .image-item.processing .image-preview {
    border-color: var(--color-primary) !important;
}

.batch-progress .image-item.completed .image-preview {
    border-color: var(--color-primary) !important;
}

.batch-progress .image-item.failed .image-preview {
    border-color: var(--color-error-light) !important;
}

.batch-progress .image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.batch-progress .image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted) !important;
    font-size: 24px;
}

/* Status overlay - dark glass */
.batch-progress .status-overlay {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: var(--float) !important;
    border-radius: 50%;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.batch-progress .status-icon {
    font-size: 18px;
}

.batch-progress .status-icon.pending {
    color: var(--muted) !important;
}

.batch-progress .status-icon.completed {
    color: var(--color-primary) !important;
}

.batch-progress .status-icon.failed {
    color: var(--color-error-light) !important;
}

/* Step text */
.batch-progress .image-info {
    text-align: center;
}

.batch-progress .step-text {
    font-size: 12px;
    color: var(--text-2) !important;
}

.batch-progress .step-text.success {
    color: var(--color-primary) !important;
    font-weight: 500;
}

.batch-progress .step-text.error {
    color: var(--color-error-light) !important;
    font-weight: 500;
}

/* Processing step - ensure full width */
.step-processing > * {
    width: 100%;
}

/* Result component in processing step - full width */
.step-processing .ant-result {
    width: 100%;
    max-width: 100%;
    padding: 48px 24px;
}

/* ===============================================
   Subscription Page - Dark Glassmorphism Theme
   =============================================== */

.subscription-page,
div.subscription-page,
.ant-layout-content .subscription-page {
    min-height: calc(100vh - var(--shell-header-h));
    padding: var(--space-xl);
    background: transparent !important;
    background-color: transparent !important;
}

/* Direct card overrides with high specificity */
.subscription-page .ant-card,
.subscription-page .ant-card.subscription-card,
.subscription-page .ant-card.usage-card {
    background: var(--panel-2) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    box-shadow: none !important;
}

.subscription-page .ant-card .ant-card-body,
.subscription-page .ant-card-body {
    background: transparent !important;
}

.subscription-page .ant-card .ant-card-head {
    background: transparent !important;
    border-color: var(--border) !important;
}

/* Left-aligned like every App column (I-049 TASK_22, PLAN LP7) */
.subscription-page .page-container {
    max-width: 800px;
}

.subscription-page .page-header {
    margin-bottom: var(--space-xl);
    animation: slideUp 0.5s ease-out;
}

.subscription-page .page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm) 0;
    letter-spacing: -0.02em;
}

.subscription-page .page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

.subscription-page .loading-container {
    display: flex;
    justify-content: center;
    padding: var(--space-2xl);
}

.subscription-page .subscription-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    animation: slideUp 0.6s ease-out 0.1s both;
}

@media (max-width: 768px) {
    .subscription-page .subscription-content {
        grid-template-columns: 1fr;
    }
}

/* Glass Card Styling */
.subscription-page .subscription-card.ant-card,
.subscription-page .usage-card.ant-card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-lg) !important;
    transition: all var(--transition-base);
    height: 100%;
}

.subscription-page .subscription-card.ant-card:hover,
.subscription-page .usage-card.ant-card:hover {
    border-color: var(--glass-border-light) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--shadow-color);
}

.subscription-page .subscription-card .ant-card-body,
.subscription-page .usage-card .ant-card-body {
    padding: var(--space-xl) !important;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.subscription-page .usage-card .ant-card-head {
    background: transparent !important;
    border-bottom: 1px solid var(--glass-border) !important;
    padding: var(--space-md) var(--space-xl) !important;
}

.subscription-page .usage-card .ant-card-head-title {
    color: var(--text-primary) !important;
    font-family: var(--font-display);
    font-weight: 600;
}

/* Subscription Header */
.subscription-page .subscription-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.subscription-page .plan-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.subscription-page .plan-name {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-transform: capitalize;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Tags */
.subscription-page .subscription-header .ant-tag {
    background: var(--neu-bg) !important;
    border: 1px solid var(--neu-bd) !important;
    border-radius: 6px !important;
    color: var(--text-secondary) !important;
    font-weight: 500;
}

.subscription-page .subscription-header .ant-tag-blue {
    background: var(--color-tier-starter-bg) !important;
    border-color: color-mix(in srgb, var(--color-tier-starter) 25%, transparent) !important;
    color: var(--color-tier-starter) !important;
}

.subscription-page .subscription-header .ant-tag-green {
    background: var(--ok-bg) !important;
    border-color: var(--ok-bd) !important;
    color: var(--color-success) !important;
}

.subscription-page .subscription-header .ant-tag-orange {
    background: var(--pri-bg) !important;
    border-color: rgba(var(--pri-rgb), .25) !important;
    color: var(--color-primary-light) !important;
}

.subscription-page .subscription-header .ant-tag-red {
    background: var(--err-bg) !important;
    border-color: var(--err-bd) !important;
    color: var(--color-error-light) !important;
}

/* Subscription Details */
.subscription-page .subscription-details {
    margin-bottom: var(--space-lg);
}

.subscription-page .renewal-info {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9375rem;
}

.subscription-page .renewal-info strong {
    color: var(--text-primary);
}

/* Divider */
.subscription-page .ant-divider {
    border-color: var(--glass-border) !important;
    margin: var(--space-lg) 0 !important;
}

/* Action Buttons */
.subscription-page .subscription-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: auto;
}

.subscription-page .subscription-actions .ant-btn {
    height: 40px !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-fast) !important;
}

.subscription-page .subscription-actions .ant-btn-default {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-secondary) !important;
}

.subscription-page .subscription-actions .ant-btn-default:hover:not(:disabled) {
    background: var(--neu-bg) !important;
    border-color: var(--glass-border-light) !important;
    color: var(--text-primary) !important;
}

.subscription-page .subscription-actions .ant-btn-dangerous {
    background: var(--err-bg) !important;
    border: 1px solid var(--err-bd) !important;
    color: var(--color-error-light) !important;
}

.subscription-page .subscription-actions .ant-btn-dangerous:hover:not(:disabled) {
    background: var(--err-bd) !important;
    border-color: color-mix(in srgb, var(--err) 40%, transparent) !important;
}

/* Usage Card Content */
.subscription-page .usage-info {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.subscription-page .usage-stat {
    margin-bottom: var(--space-lg);
}

.subscription-page .usage-label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
    font-size: 0.875rem;
}

.subscription-page .usage-value {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.subscription-page .usage-remaining {
    color: var(--text-muted);
    margin-top: var(--space-md);
    font-size: 0.875rem;
}

.subscription-page .unlimited-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-primary-light);
    background: linear-gradient(135deg, var(--pri-bg) 0%, color-mix(in srgb, var(--color-amber) 15%, transparent) 100%);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(var(--pri-rgb), .3);
}

.subscription-page .unlimited-badge .anticon {
    color: var(--color-primary);
}

/* Alerts */
.subscription-page .subscription-details .ant-alert {
    background: var(--panel-2) !important;
    backdrop-filter: blur(16px);
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
}

.subscription-page .subscription-details .ant-alert-warning {
    background: var(--warn-bg) !important;
    border-color: var(--warn-bd) !important;
}

.subscription-page .subscription-details .ant-alert-warning .ant-alert-message {
    color: var(--color-warning-light) !important;
}

.subscription-page .subscription-details .ant-alert-info {
    background: var(--color-tier-starter-bg) !important;
    border-color: color-mix(in srgb, var(--color-tier-starter) 25%, transparent) !important;
}

.subscription-page .subscription-details .ant-alert-info .ant-alert-message {
    color: var(--color-tier-starter) !important;
}

/* ===============================================
   Checkout Success Page - Dark Glassmorphism Theme
   =============================================== */

.checkout-success-page,
div.checkout-success-page,
.ant-layout-content .checkout-success-page,
.checkout-result-page {
    min-height: calc(100vh - var(--shell-header-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    background: transparent !important;
    background-color: transparent !important;
    position: relative;
    overflow: hidden;
}

/* Override any Result component container */
.checkout-success-page .result-container,
.checkout-result-page .result-container,
.checkout-success-page .success-container {
    background: var(--panel-2) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid var(--border) !important;
    border-radius: 24px !important;
    padding: 48px !important;
    max-width: 500px !important;
    box-shadow: 0 4px 24px var(--shadow-color) !important;
}

/* Background orbs */
.checkout-success-page .bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    pointer-events: none;
}

.checkout-success-page .bg-orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(var(--pri-rgb), .3) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    animation: float-slow 25s ease-in-out infinite;
}

.checkout-success-page .bg-orb-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, color-mix(in srgb, var(--ok) 20%, transparent) 0%, transparent 70%);
    bottom: -50px;
    left: -50px;
    animation: float-slow 20s ease-in-out infinite reverse;
}

.checkout-success-page .bg-orb-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(var(--pri-rgb), .25) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: success-pulse-glow 4s ease-in-out infinite;
}

@keyframes float-slow {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    75% {
        transform: translate(-30px, -20px) scale(1.02);
    }
}

@keyframes success-pulse-glow {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Success container */
.checkout-success-page .success-container {
    max-width: 500px;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
    box-shadow: 0 4px 24px var(--shadow-color),
    0 1px 1px var(--inset-hi) inset;
}

/* Success icon */
.checkout-success-page .success-icon-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto var(--space-xl);
}

.checkout-success-page .success-icon-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--color-success) 30%, transparent);
    animation: ring-pulse 2s ease-out infinite;
}

@keyframes ring-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.checkout-success-page .success-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-success);
    border-radius: 50%;
    box-shadow: 0 8px 32px color-mix(in srgb, var(--color-success) 40%, transparent),
    0 0 60px color-mix(in srgb, var(--color-success) 20%, transparent);
    animation: icon-appear 0.5s ease-out 0.3s both;
}

@keyframes icon-appear {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.checkout-success-page .success-icon .anticon {
    font-size: 48px;
    color: var(--on-ok);
    animation: checkmark 0.4s ease-out 0.6s both;
}

@keyframes checkmark {
    from {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

/* Title and subtitle */
.checkout-success-page .success-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm) 0;
    letter-spacing: -0.02em;
    animation: fadeIn 0.5s ease-out 0.5s both;
}

.checkout-success-page .success-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 var(--space-xl) 0;
    line-height: 1.6;
    animation: fadeIn 0.5s ease-out 0.6s both;
}

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

/* Plan badge */
.checkout-success-page .success-details {
    margin-bottom: var(--space-xl);
    animation: fadeIn 0.5s ease-out 0.7s both;
}

.checkout-success-page .plan-badge {
    display: inline-flex;
    flex-direction: column;
    gap: var(--space-xs);
    background: linear-gradient(135deg, var(--pri-bg) 0%, color-mix(in srgb, var(--color-amber) 15%, transparent) 100%);
    border: 1px solid rgba(var(--pri-rgb), .3);
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-xl);
}

.checkout-success-page .plan-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.checkout-success-page .plan-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary-light);
    text-transform: capitalize;
}

/* Action buttons */
.checkout-success-page .success-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    animation: fadeIn 0.5s ease-out 0.8s both;
}

@media (min-width: 400px) {
    .checkout-success-page .success-actions {
        flex-direction: row;
        justify-content: center;
    }
}

.checkout-success-page .success-actions .ant-btn {
    height: 48px !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600;
    font-size: 0.9375rem;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--transition-base) !important;
}

.checkout-success-page .success-actions .primary-action.ant-btn-primary {
    min-width: 180px;
}

.checkout-success-page .success-actions .primary-action.ant-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--pri-rgb), .45) !important;
}

.checkout-success-page .success-actions .secondary-action.ant-btn-default {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-secondary) !important;
    min-width: 180px;
}

.checkout-success-page .success-actions .secondary-action.ant-btn-default:hover {
    background: var(--neu-bg) !important;
    border-color: var(--glass-border-light) !important;
    color: var(--text-primary) !important;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .checkout-success-page .success-container {
        padding: var(--space-xl);
        border-radius: var(--radius-lg);
    }

    .checkout-success-page .success-icon-wrapper {
        width: 80px;
        height: 80px;
    }

    .checkout-success-page .success-icon .anticon {
        font-size: 36px;
    }

    .checkout-success-page .success-title {
        font-size: 1.5rem;
    }

    .checkout-success-page .success-actions .ant-btn {
        width: 100%;
    }
}

/* ===============================================
   OTP Input - Hide placeholder (cleaner look)
   Target any input with letter-spacing in its inline style
   =============================================== */

.ant-input[style*="letter-spacing"]::placeholder {
    color: transparent !important;
}

.ant-input[style*="letter-spacing"]::-webkit-input-placeholder {
    color: transparent !important;
}

.ant-input[style*="letter-spacing"]::-moz-placeholder {
    color: transparent !important;
}

.ant-input[style*="letter-spacing"]:-ms-input-placeholder {
    color: transparent !important;
}

/* ===============================================
   Form Loading Overlay - Dark Theme
   =============================================== */

.ant-spin-nested-loading > div > .ant-spin {
    max-height: unset;
}

.ant-spin-blur {
    opacity: 0.5;
}

.ant-spin-blur::after {
    background: transparent !important;
}

.ant-spin-container::after {
    background: var(--scrim) !important;
}

/* ===============================================
   Change Email Modal - Input Styling
   =============================================== */

.change-email-modal .ant-form-item-label > label {
    color: var(--text-2) !important;
}

.change-email-modal .ant-input {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    color: var(--text) !important;
    border-radius: var(--radius-md) !important;
}

.change-email-modal .ant-input:hover {
    border-color: var(--ctl-bd-h) !important;
}

.change-email-modal .ant-input:focus,
.change-email-modal .ant-input-focused {
    border-color: var(--focus) !important;
    box-shadow: 0 0 0 3px var(--pri-bg) !important;
}

.change-email-modal .ant-input::placeholder {
    color: var(--muted) !important;
}

/* Modal description text */
.change-email-modal .ant-modal-body p {
    color: var(--text-2) !important;
    margin: 0 0 24px 0 !important;
    line-height: 1.6;
}

/* Code expiry notice */
.change-email-modal .code-expiry {
    background: var(--pri-bg) !important;
    border: 1px solid rgba(var(--pri-rgb), .2) !important;
    border-radius: 8px !important;
    padding: 8px 16px !important;
    margin-bottom: 24px !important;
    color: var(--color-primary) !important;
    font-size: 0.875rem !important;
    text-align: center !important;
}

/* Modal action buttons */
.change-email-modal .modal-actions {
    display: flex !important;
    justify-content: flex-end !important;
    gap: 12px !important;
    margin-top: 16px !important;
}

/* Resend link */
.change-email-modal .resend-link {
    text-align: center !important;
    margin-top: 16px !important;
    padding-top: 16px !important;
    border-top: 1px solid var(--border) !important;
}

.change-email-modal .resend-link .ant-btn-link {
    color: var(--muted) !important;
    font-size: 0.875rem !important;
}

.change-email-modal .resend-link .ant-btn-link:hover {
    color: var(--color-primary) !important;
}

/* ===============================================
   Layout Overflow Fix - Prevent body scrolling
   =============================================== */

/* Outer layout (the sider and the content column): full height, the page ground shows through */
.layout-container.ant-layout {
    height: 100vh;
    background: transparent;
}

/* The content box (the prototype's .content): no scroll of its own — it grows with the page inside the scrolling
   content column below, and the sticky header stays above it there (I-056 TASK_02) */
.main-content.ant-layout-content,
.ant-layout-content.main-content,
main.main-content {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    flex: 1 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
}

/* The content column = the prototype's .main: the one scroll container of the App shell. It holds the sticky header
   (.hdr.hdr, app.css) and the content box, so the page scrolls under the header's blur; the document itself never
   scrolls (html / body / #app overflow: hidden, app.css). Hide the scrollbar but keep scrolling. Vertical only: content
   wider than the column is clipped (as main.main-content did before), never a sideways scroll of the whole column.
   scroll-padding-top keeps the 56px band under the sticky header out of the "visible" area (I-056 TASK_13, PR !778
   thread 12464 / review M1, WCAG 2.4.11): Tab / Shift+Tab focus scrolling and scrollIntoView({block:'nearest'}) stop
   below the header, never under its blur. */
.content-layout.ant-layout,
.ant-layout.content-layout {
    background: transparent !important;
    scroll-padding-top: var(--shell-header-h) !important;
    flex: 1 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE/Edge */
}

/* Hide scrollbar for Chrome/Safari/Opera */
.content-layout.ant-layout::-webkit-scrollbar,
.ant-layout.content-layout::-webkit-scrollbar {
    display: none;
}

/* Ensure the header doesn't shrink (the App has no footer bar since I-049 TASK_22 — the prototype's .main runs to the
   viewport bottom) */
.main-header.ant-layout-header,
.ant-layout-header.main-header {
    flex-shrink: 0 !important;
}


/* ===============================================
   Form Input Overrides - Glass Dark Theme
   Shared across all pages (auth, settings, tickets, etc.)
   =============================================== */

.ant-input {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text) !important;
    transition: all var(--transition-base) !important;
}

.ant-input::placeholder {
    color: var(--muted) !important;
}

.ant-input:is(:hover, .ds-force-hover):not(:disabled) {
    border-color: var(--ctl-bd-h) !important;
    background: var(--ctl-bg) !important;
}

/* I-049 AD7: a text control's focus is its border — the prototype's .ctl:focus (border --focus + a 3px --pri-bg
   halo), no outline. :focus, not :focus-visible: a click into a field puts the caret there and must show it. */
.ant-input:is(:focus, .ds-force-focus),
.ant-input-focused {
    border-color: var(--focus) !important;
    box-shadow: 0 0 0 3px var(--pri-bg) !important;
    background: var(--ctl-bg) !important;
    outline: none;
}

/* I-005: the glass border above is !important in every state, which hid AntD's error border
   (.ant-form-item-has-error) on every form — the field error had text but no red outline. Restore it,
   including hover and focus, so the invalid field is marked the way AntD intends. B-060: the affix wrapper
   (Input with ShowCount/prefix) draws the visible border, so it gets the same restore. B-061: the Select's
   selector and the DatePicker are glass-bordered the same way (app.css), so an invalid one gets it too, and
   so is the InputNumber (below in this file — the reports «Година» field). */
.ant-form-item-has-error .ant-select:not(.ant-select-disabled) .ant-select-selector,
.ant-form-item-has-error .ant-picker:not(.ant-picker-disabled),
.ant-form-item-has-error .ant-input-number:not(.ant-input-number-disabled),
.ant-form-item-has-error .ant-input,
.ant-form-item-has-error .ant-input:is(:hover, .ds-force-hover):not(:disabled),
.ant-form-item-has-error .ant-input:is(:focus, .ds-force-focus),
.ant-form-item-has-error .ant-input-affix-wrapper,
.ant-form-item-has-error .ant-input-affix-wrapper:is(:hover, .ds-force-hover),
.ant-form-item-has-error .ant-input-affix-wrapper-focused,
.ant-form-item-has-error .ant-input-affix-wrapper.ds-force-focus {
    border-color: var(--color-error) !important;
}

/* I-049 AD7: a focused invalid field keeps the --err border with an --err-bg halo instead of the --pri-bg one. */
.ant-form-item-has-error .ant-select-focused:not(.ant-select-disabled) .ant-select-selector,
.ant-form-item-has-error .ant-picker-focused:not(.ant-picker-disabled),
.ant-form-item-has-error .ant-input-number-focused:not(.ant-input-number-disabled),
.ant-form-item-has-error .ant-input:is(:focus, .ds-force-focus),
.ant-form-item-has-error .ant-input-affix-wrapper-focused,
.ant-form-item-has-error .ant-input-affix-wrapper.ds-force-focus {
    box-shadow: 0 0 0 3px var(--err-bg) !important;
}

/* I-062 TASK_13: a disabled text control is the prototype's .ctl:disabled (prototype.html 153) — its rest look (--ctl-bg,
   --ctl-bd, --text) at 60% opacity, for every kind, with no hover. The Select, the pickers and InputNumber kept the rest
   look outright (the glass rules overrule AntD's disabled greys), so they looked enabled; the Input dimmed to --panel-2 /
   --border / --muted at 80%. The opacity sits on the outermost box: an affix wrapper's inner input stays at 1. */
.ant-input:disabled,
.ant-input-affix-wrapper-disabled,
.ant-input-number-disabled,
.ant-input-number-affix-wrapper-disabled,
.ant-picker.ant-picker-disabled,
.ant-select.ant-select-disabled {
    cursor: not-allowed;
    opacity: .6;
}

/* The Select's selector already keeps the rest look (Select/Dropdown Overrides below). */
.ant-input:disabled,
.ant-input-affix-wrapper-disabled,
.ant-input-number-disabled,
.ant-picker.ant-picker-disabled {
    background: var(--ctl-bg) !important;
    border-color: var(--ctl-bd) !important;
    color: var(--text) !important;
}

.ant-input-affix-wrapper-disabled > .ant-input:disabled,
.ant-input-number-affix-wrapper-disabled .ant-input-number-disabled {
    opacity: 1;
}

/* B-009: read-only is content, not a placeholder - secondary text, full opacity */
.ant-input[readonly]:not(:disabled) {
    background: var(--glass-bg) !important;
    border-color: var(--glass-border) !important;
    color: var(--text-secondary) !important;
    cursor: default;
}

.ant-input-lg {
    height: 48px !important;
    font-size: 0.9375rem !important;
}

/* Input Affix Wrapper (e.g. password inputs with icons) */
.ant-input-affix-wrapper {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    border-radius: var(--radius-md) !important;
    padding: 4px 11px;
    transition: all var(--transition-base) !important;
}

.ant-input-affix-wrapper:where(:not(.ant-input-affix-wrapper-disabled)):is(:hover, .ds-force-hover) {
    border-color: var(--ctl-bd-h) !important;
}

.ant-input-affix-wrapper-focused,
.ant-input-affix-wrapper.ds-force-focus {
    border-color: var(--focus) !important;
    box-shadow: 0 0 0 3px var(--pri-bg) !important;
}

/* Prefix/suffix icons (search loupe, password eye, etc.) — match placeholder color */
.ant-input-affix-wrapper .ant-input-prefix .anticon,
.ant-input-affix-wrapper .ant-input-suffix .anticon {
    color: var(--text-muted) !important;
}

/* Inner .ant-input inside an affix wrapper is just the text node — the wrapper
   already draws the visible surface. Keep the inner element fully transparent
   so hover/focus don't paint a second layered background or focus ring on top
   of the wrapper. Fixes the "double overlay" effect on password/affix inputs. */
.ant-input-affix-wrapper > .ant-input,
.ant-input-affix-wrapper > .ant-input:is(:hover, .ds-force-hover):not(:disabled),
.ant-input-affix-wrapper > .ant-input:is(:focus, .ds-force-focus),
.ant-input-affix-wrapper > .ant-input-focused {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ===============================================
   Textarea Overrides - Glass Dark Theme
   =============================================== */

.ant-input-textarea textarea.ant-input,
textarea.ant-input {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text) !important;
}

.ant-input-textarea textarea.ant-input:is(:focus, .ds-force-focus),
textarea.ant-input:is(:focus, .ds-force-focus) {
    border-color: var(--focus) !important;
    box-shadow: 0 0 0 3px var(--pri-bg) !important;
}

.ant-input-textarea textarea.ant-input::placeholder,
textarea.ant-input::placeholder {
    color: var(--text-muted) !important;
}

.ant-input-textarea-show-count {
    background: transparent !important;
}

.ant-input-textarea-show-count::after,
.ant-input-data-count,
.ant-input-show-count-suffix {
    color: var(--text-muted) !important;
}

/* B-146 (manual walk): a single-line input's character counter („0 / 256“) sits under the field, right-aligned, like
   the textarea's and like the prototype's counter (.fi__row .fcount under the control). Inside the field it crowded the
   placeholder („npr. 351-12/2026… 0 / 256“). Only a suffix that holds nothing but the counter moves; space for it is
   reserved under the field, so the next row never overlaps it. Not inside a table: a cell's input (the delovodni
   oznaka table, the batch-archival rows) keeps its counter inline, so its row height and alignment do not change. */
.ant-input-affix-wrapper:not(.ant-table *):has(> .ant-input-suffix > .ant-input-show-count-suffix:only-child) {
    position: relative;
    margin-bottom: 18px;
}

.ant-input-affix-wrapper:not(.ant-table *) > .ant-input-suffix:has(> .ant-input-show-count-suffix:only-child) {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    margin: 0;
    pointer-events: none;
}

.ant-input-affix-wrapper:not(.ant-table *) > .ant-input-suffix > .ant-input-show-count-suffix:only-child {
    font: 12px/1 var(--mono);
    font-variant-numeric: tabular-nums;
}

/* TextArea with ShowCount wraps the <textarea> in span.ant-input-affix-wrapper.
   Promote the wrapper to BE the glass box and make the inner textarea transparent
   so its edge aligns with inputs/selects in the same form. */
.ant-input-textarea .ant-input-affix-wrapper {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    border-radius: var(--radius-md) !important;
    padding: 4px 11px !important;
}

.ant-input-textarea .ant-input-affix-wrapper:where(:not(.ant-input-affix-wrapper-disabled)):is(:hover, .ds-force-hover) {
    border-color: var(--ctl-bd-h) !important;
}

.ant-input-textarea .ant-input-affix-wrapper-focused,
.ant-input-textarea .ant-input-affix-wrapper.ds-force-focus {
    border-color: var(--focus) !important;
    box-shadow: 0 0 0 3px var(--pri-bg) !important;
}

.ant-input-textarea .ant-input-affix-wrapper textarea.ant-input {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.ant-input-textarea .ant-input-affix-wrapper textarea.ant-input:is(:focus, .ds-force-focus),
.ant-input-textarea .ant-input-affix-wrapper textarea.ant-input-focused {
    border: none !important;
    box-shadow: none !important;
}

/* B-060: the glass wrapper border above comes after the I-005 error restore at the same specificity, so a
   TextArea with ShowCount kept its grey border when invalid. Restore the error border on the wrapper here. */
.ant-form-item-has-error .ant-input-textarea .ant-input-affix-wrapper,
.ant-form-item-has-error .ant-input-textarea .ant-input-affix-wrapper:is(:hover, .ds-force-hover),
.ant-form-item-has-error .ant-input-textarea .ant-input-affix-wrapper-focused,
.ant-form-item-has-error .ant-input-textarea .ant-input-affix-wrapper.ds-force-focus {
    border-color: var(--color-error) !important;
}

/* ===============================================
   Form Item Overrides - Dark Theme
   =============================================== */

.ant-form-item {
    margin-bottom: 1.25rem;
}

.ant-form-item:last-child {
    margin-bottom: 0;
}

.ant-form-item-label > label {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
}

/* AntDesign colors .ant-form-item itself rgba(0, 0, 0, 0.85) and its hint rows
   (.ant-form-item-explain-default, .ant-form-item-extra) rgba(0, 0, 0, 0.45) via
   component styles that beat the inherited body color — same failure mode as the
   h1–h6 default above — so help text under inputs and inline labels next to bare
   Switch/Checkbox controls render near-black on dark surfaces (e.g. Подешавање
   отпреме). No !important: validation errors (.ant-form-item-explain-error) and
   components that set their own color still win. */
.ant-form-item {
    color: var(--text-primary);
}

.ant-form-item-explain-default,
.ant-form-item-extra {
    color: var(--text-muted);
}

/* I-062 TASK_13: the help line under a field is the prototype's .fi__hint (12.5px / 1.4, AntD 14px / 1.5715) and an
   error line its .fi__err (13px / 1.4) — App-wide (I-062 TASK_10 had it on the settings pages only) — 6px under the
   control, as .fi__row (AntD drew it flush; the 6px fits the 24px line AntD reserves under a validated item). */
.ant-form-item-explain,
.ant-form-item-extra {
    padding-top: 6px;
    font-size: 12.5px;
    line-height: 1.4;
}

/* I-049 TASK_17 (X3): a field error reads in the themed error ink — AntD's own #ff4d4f is 3.08:1 on the light panel.
   One global rule (it replaces the TASK_04 .auth-form and TASK_14 .settings-layout copies). */
.ant-form-item-explain-error {
    color: var(--err-ink);
    font-size: 13px;
}

/* The required mark is the prototype's .req — the „*“ after the label, 2px off, --err-ink in the label's font (AntD
   draws it before the label in #ff4d4f SimSun); the label is AntD's inline-flex row. I-062 TASK_13: App-wide (TASK_10
   had it on the settings pages). */
.ant-form-item-label > label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before {
    order: 1;
    margin: 0 0 0 2px;
    color: var(--err-ink);
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* ===============================================
   Select/Dropdown Overrides - Glass Dark Theme
   =============================================== */

.ant-select-selector {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text) !important;
}

.ant-select-arrow {
    color: var(--text-muted) !important;
}

.ant-select:where(:not(.ant-select-disabled)):is(:hover, .ds-force-hover) .ant-select-selector {
    border-color: var(--ctl-bd-h) !important;
}

.ant-select-focused .ant-select-selector,
.ant-select.ds-force-focus .ant-select-selector {
    border-color: var(--focus) !important;
    box-shadow: 0 0 0 3px var(--pri-bg) !important;
}

.ant-select-selection-item {
    color: var(--text-primary) !important;
}

.ant-select-selection-placeholder {
    color: var(--text-muted) !important;
}

/* ===============================================
   Default Button Overrides - Ghost Style
   F-263: ghost on --ctl-bd / --text, hover --ctl-bd-h (prototype .btn); keyboard focus keeps app.css's ring.
   =============================================== */

.ant-btn-default {
    background: transparent !important;
    border: 1px solid var(--ctl-bd) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text) !important;
    font-weight: 500;
    transition: all var(--transition-base) !important;
}

.ant-btn-default:is(:hover, .ds-force-hover):not(:disabled) {
    border-color: var(--ctl-bd-h) !important;
    color: var(--text) !important;
    background: var(--panel-2) !important;
}

/* Keyboard focus keeps the label on --text (the prototype's .btn shows only the --focus ring): app.css's shared
   hover/focus rule painted it raw --pri — a brand-text violation, 4.42:1 in light (F-266 TASK_03). */
.ant-btn-default:is(:focus-visible, .ds-force-focus):not(:disabled) {
    border-color: var(--ctl-bd-h) !important;
    color: var(--text) !important;
}

.ant-btn-default:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* B-009: dashed button - the add-row affordance; ghost like default, dashed border */
.ant-btn-dashed {
    background: transparent !important;
    border: 1px dashed var(--glass-border-light) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-secondary) !important;
}

/* B-028 (1340, 1341): highlight on :hover and :focus-visible (a mouse click no longer leaves it stuck), never on
   a disabled or danger button - Dashed Danger keeps the danger look. The .ant-btn prefix keeps it at (0,3,0) so a
   generic (0,2,0) `.ant-btn:focus-visible` cannot repaint the text of a hovered or keyboard-focused Dashed button.
   B-051 AD4, I-049 AD7: the keyboard focus outline is the app.css ring rule's.
   B-008 (2606): :not([disabled]) also covers an attribute-disabled anchor button. */
.ant-btn.ant-btn-dashed:is(:hover, .ds-force-hover):where(:not(:disabled):not([disabled]):not(.ant-btn-disabled):not(.ant-btn-dangerous)),
.ant-btn.ant-btn-dashed:is(:focus-visible, .ds-force-focus):where(:not(:disabled):not([disabled]):not(.ant-btn-disabled):not(.ant-btn-dangerous)) {
    border-color: var(--color-primary) !important;
    color: var(--color-primary) !important;
    background: rgba(var(--color-primary-rgb), 0.08) !important;
}

.ant-btn-dashed:disabled,
.ant-btn-dashed.ant-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===============================================
   Danger Button Overrides - Red Ghost Style
   =============================================== */

.ant-btn-dangerous {
    background: transparent !important;
    border: 1px solid var(--err-bd) !important;
    color: var(--err-ink) !important;
    border-radius: var(--radius-md) !important;
    font-weight: 500;
    transition: all var(--transition-base);
}

.ant-btn-dangerous:is(:hover, .ds-force-hover):not(:disabled) {
    background: var(--err-bg) !important;
    border-color: var(--err) !important;
    /* B-028 (1340/1346): pin the text so no other button type's hover colour leaks in */
    color: var(--err-ink) !important;
}

/* F-263: solid (primary) danger — --err fill, --on-err ink. The primary copies above (.ant-btn.ant-btn-primary, 0,2,0)
   out-ranked app.css's .ant-btn-primary.ant-btn-dangerous, so it painted --pri. (0,3,0) wins every state; the :where()
   guard leaves a disabled one to the disabled-primary rule; keyboard focus keeps this shadow and draws app.css's
   focus outline (I-049 AD7 — no ring rule of its own). */
.ant-btn.ant-btn-primary.ant-btn-dangerous:where(:not(:disabled):not([disabled]):not(.ant-btn-disabled)) {
    background: var(--err) !important;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--err) 35%, transparent) !important;
    color: var(--on-err) !important;
}

/* B-028 (1340/1346): the danger border above is solid; Dashed Danger keeps its dashed border */
.ant-btn-dangerous.ant-btn-dashed {
    border-style: dashed !important;
}

/* A small button is the prototype's .btn--sm: radius 7px. The default and danger radius above (--radius-md, 12px) is
   half the 24px height, so a small row action (edit / delete icons) drew as a circle. (0,3,0) over their (0,1,0). */
.ant-btn.ant-btn-sm:not(.ant-btn-link):not(.ant-btn-text) {
    border-radius: 7px !important;
}

/* ===============================================
   Button Loading - the prototype's .btn.is-loading (I-062 TASK_13)
   A loading button keeps its type's rest look at 55% opacity with the spinner in its ink (prototype.html 129, 140–143:
   U.btn disables it) — no glow, no lift, no hover, and not AntD's white wash (.ant-btn-loading::before, 35% #fff).
   A loading primary keeps --pri even when the page also disables it (the intake disables every bar button while it
   submits — the disabled primary is --neu-bg), a loading danger primary keeps --err. After the danger rules: (0,3,0)
   ties go to the later rule; the keyboard focus outline (app.css) stays.
   =============================================== */

.ant-btn.ant-btn-loading:is(.ant-btn-primary, .ant-btn-default, .ant-btn-dangerous, .ant-btn-dashed, .ant-btn-text, .ant-btn-link) {
    opacity: .55 !important;
    box-shadow: none !important;
    transform: none !important;
    pointer-events: none;
}

.ant-btn.ant-btn-loading::before {
    display: none;
}

.ant-btn.ant-btn-primary.ant-btn-loading:not(.ant-btn-dangerous) {
    background: var(--pri) !important;
    color: var(--on-pri) !important;
}

.ant-btn.ant-btn-primary.ant-btn-dangerous.ant-btn-loading {
    background: var(--err) !important;
    color: var(--on-err) !important;
}

/* ===============================================
   Divider Overrides - Dark Theme
   =============================================== */

.ant-divider {
    border-color: var(--glass-border) !important;
    margin: var(--space-lg) 0 !important;
}

.ant-divider-inner-text {
    color: var(--text-muted) !important;
    font-size: 0.8125rem;
}

/* ===============================================
   Typography Overrides - Dark Theme
   =============================================== */

.ant-typography {
    color: var(--text-secondary) !important;
}

/* ===============================================
   Radio Button Overrides - Dark Theme
   =============================================== */

.ant-radio-wrapper {
    color: var(--text-secondary) !important;
}

.ant-radio-checked .ant-radio-inner {
    border-color: var(--color-primary) !important;
    background-color: var(--color-primary) !important;
}

/* ===============================================
   Collapse Overrides - Dark Theme
   =============================================== */

.ant-collapse {
    background: transparent !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-md) !important;
}

.ant-collapse-header {
    color: var(--text-secondary) !important;
}

.ant-collapse-content {
    background: var(--glass-bg-light) !important;
    border-top: 1px solid var(--glass-border) !important;
    color: var(--text-secondary) !important;
}

.ant-collapse-content-box {
    padding: 16px !important;
}

/* ===============================================
   Badge Overrides - Brand Orange
   =============================================== */

/* F-263: the count is an alert — solid --err with --on-err ink (D12); the dot stays brand. */
.ant-badge-count {
    background: var(--err) !important;
    color: var(--on-err) !important;
    box-shadow: 0 0 0 2px var(--bg-2) !important;
}

.ant-badge-dot {
    background: var(--pri) !important;
    box-shadow: 0 0 0 2px var(--bg-2) !important;
}

/* Attention badge / dot (I-041 D10) — <AttentionBadge>, page content only: "waits for this user". The base count
   rule above is !important, so the three colour declarations are too. The sider's count is NavBadge (.nb*) and
   the bell's dot is .bell__dot (app.css shell block) — neither is styled here. */
.attn-badge {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

/* With an anchor the pill sits on the anchor's top-right corner, as AntD places a count on its own child */
.attn-badge--anchored {
    position: relative;
}

.attn-badge--anchored .attn-badge__pill {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    line-height: 1;
}

.attn-badge .ant-badge-count {
    background: var(--attn) !important;
    color: var(--on-attn) !important;
    box-shadow: none !important;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    font-size: 0.71875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.attn-dot {
    display: inline-block;
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--attn);
}

/* ===============================================
   Table Overrides - Dark Theme
   =============================================== */

.ant-table {
    background: transparent !important;
    color: var(--text-secondary) !important;
}

.ant-table-container,
.ant-table-content,
.ant-table table {
    background: transparent !important;
}

.ant-table-thead > tr > th {
    background: var(--th-bg) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    color: var(--text-secondary) !important;
    font-weight: var(--font-weight-th);
    font-size: var(--font-size-th);
    text-transform: none;
    letter-spacing: 0;
    /* A heading breaks between words only (the prototype's .tbl th never breaks one): AntD's overflow-wrap: break-word
       cut a word one or two pixels wider than its column („Озбиљнос / т“, „Колич / ина“). */
    overflow-wrap: normal;
}

.ant-table-tbody > tr > td {
    background: transparent !important;
    border-bottom: 1px solid var(--line) !important;
    color: var(--text-primary) !important;
    font-size: 0.875rem;
}

/* Tabular numerals (F-264 D5) — every number column, statistic, badge count and pager item aligns without
   per-page edits; text is unaffected. Elsewhere a page adds .tabular-nums. */
.ant-table-tbody > tr > td,
.ant-statistic-content,
.ant-badge-count,
.ant-pagination-item {
    font-variant-numeric: tabular-nums;
}

.ant-table-tbody > tr {
    background: transparent !important;
}

.ant-table-tbody > tr.ant-table-row:is(:hover, .ds-force-hover) > td,
.ant-table-tbody > tr:is(:hover, .ds-force-hover) > td {
    background: var(--row-h) !important;
}

/* F-263: a selected row is tinted --row-sel (the transparent td rule above hid AntD's own tint). Pinned cells take
   the same tint over their opaque base in the frozen-column rules below (B-054). */
.ant-table-tbody > tr.ant-table-row-selected > td:not(.ant-table-cell-fix-left):not(.ant-table-cell-fix-right) {
    background: var(--row-sel) !important;
}

/* Frozen columns need an opaque background or scrolling cells bleed through
   when they scroll under. Specificity must beat .ant-table-tbody > tr > td. */
.ant-table-tbody > tr > td.ant-table-cell-fix-left,
.ant-table-tbody > tr > td.ant-table-cell-fix-right,
.ant-table-thead > tr > th.ant-table-cell-fix-left,
.ant-table-thead > tr > th.ant-table-cell-fix-right {
    background: var(--color-bg-elevated) !important;
}

/* F-263 (PR !625): a hovered or selected row tints its pinned cells like its scrolling cells — the row colour as an
   image layer over the opaque base, so the band runs through the frozen columns and nothing shows through. Selected
   follows hover at equal weight ((0,4,2) for the tr.ant-table-row / :hover forms), so a hovered selected row keeps
   --row-sel, as its scrolling cells do. */
.ant-table-tbody > tr.ant-table-row:hover > td.ant-table-cell-fix-left,
.ant-table-tbody > tr.ant-table-row:hover > td.ant-table-cell-fix-right,
.ant-table-tbody > tr:hover > td.ant-table-cell-fix-left,
.ant-table-tbody > tr:hover > td.ant-table-cell-fix-right {
    background: linear-gradient(var(--row-h), var(--row-h)), var(--color-bg-elevated) !important;
}

.ant-table-tbody > tr.ant-table-row-selected > td.ant-table-cell-fix-left,
.ant-table-tbody > tr.ant-table-row-selected > td.ant-table-cell-fix-right,
.ant-table-tbody > tr.ant-table-row-selected:hover > td.ant-table-cell-fix-left,
.ant-table-tbody > tr.ant-table-row-selected:hover > td.ant-table-cell-fix-right {
    background: linear-gradient(var(--row-sel), var(--row-sel)), var(--color-bg-elevated) !important;
}

.ant-table-bordered > .ant-table-container {
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden;
}

.ant-table-bordered > .ant-table-container > .ant-table-content > table > thead > tr > th,
.ant-table-bordered > .ant-table-container > .ant-table-content > table > tbody > tr > td {
    border-right: 1px solid var(--line) !important;
}

.ant-table-bordered > .ant-table-container > .ant-table-content > table > thead > tr > th {
    background: var(--th-bg) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    color: var(--text-secondary) !important;
}

.ant-table-bordered > .ant-table-container > .ant-table-content > table > tbody > tr > td {
    background: transparent !important;
    border-bottom: 1px solid var(--line) !important;
    color: var(--text-primary) !important;
}

.ant-table-pagination.ant-pagination {
    margin: 16px 0 0 !important;
    padding: 12px 0 !important;
    align-items: center !important;
}

.ant-table-pagination.ant-pagination-mini .ant-pagination-item {
    min-width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    margin-right: 8px !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-sm) !important;
    background: transparent !important;
}

.ant-table-pagination.ant-pagination-mini .ant-pagination-item a {
    color: var(--text-secondary) !important;
}

.ant-table-pagination.ant-pagination-mini .ant-pagination-item:hover {
    border-color: var(--color-primary) !important;
}

.ant-table-pagination.ant-pagination-mini .ant-pagination-item:hover a {
    color: var(--color-primary-light) !important;
}

.ant-table-pagination.ant-pagination-mini .ant-pagination-item-active {
    background: var(--pri) !important;
    border-color: var(--pri) !important;
}

.ant-table-pagination.ant-pagination-mini .ant-pagination-item-active a {
    color: var(--on-pri) !important;
}

.ant-table-pagination.ant-pagination-mini .ant-pagination-prev,
.ant-table-pagination.ant-pagination-mini .ant-pagination-next {
    min-width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    margin-right: 8px !important;
}

.ant-table-pagination.ant-pagination-mini .ant-pagination-prev .ant-pagination-item-link,
.ant-table-pagination.ant-pagination-mini .ant-pagination-next .ant-pagination-item-link {
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-sm) !important;
    background: transparent !important;
    color: var(--text-secondary) !important;
    width: 32px !important;
    height: 32px !important;
}

.ant-table-pagination.ant-pagination-mini .ant-pagination-prev:hover .ant-pagination-item-link,
.ant-table-pagination.ant-pagination-mini .ant-pagination-next:hover .ant-pagination-item-link {
    border-color: var(--color-primary) !important;
    color: var(--color-primary-light) !important;
}

/* ===============================================
   Tabs Overrides - Brand Orange
   =============================================== */

.ant-tabs-tab {
    color: var(--text-secondary) !important;
    font-weight: 500;
}

.ant-tabs-tab:is(:hover, .ds-force-hover) {
    color: var(--color-primary-light) !important;
}

.ant-tabs-tab-active .ant-tabs-tab-btn {
    color: var(--pri-ink) !important;
}

/* A focused or pressed tab that is not the active one keeps its tab's colour (the prototype's .tab:focus-visible shows
   only the --focus outline below): AntD's `.ant-tabs-tab-btn:focus, :active { color: #096dd9 }` read 4.3:1 on the light
   panel (F-266 TASK_03). */
.ant-tabs-tab:not(.ant-tabs-tab-active) > .ant-tabs-tab-btn:is(:focus, :active) {
    color: inherit !important;
}

.ant-tabs-ink-bar {
    background: var(--pri) !important;
}

/* I-049 AD7: AntD's `.ant-tabs-tab-btn { outline: none }` loads after app.css's :focus-visible; the keyboard-focused
   tab gets the inset outline (prototype .tab:focus-visible, line 613) — the nav wrap clips what leaves the tab. */
.ant-tabs-tab:has(> .ant-tabs-tab-btn:focus-visible) {
    outline: 2px solid var(--focus);
    outline-offset: -2px;
    border-radius: 6px 6px 0 0;
}

.ant-tabs-nav::before {
    border-bottom-color: var(--glass-border) !important;
}

/* Tab pane content — inherit the page's light text instead of AntD's default
   black, otherwise plain <p>/<span> inside a tab on a dark glass-card become
   illegible (e.g. Billing "Current plan: …"). */
.ant-tabs-tabpane {
    color: var(--text-primary);
}

/* ===============================================
   Pagination Overrides - Brand Orange + Rounded
   =============================================== */

.ant-pagination-item {
    background: transparent !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-sm) !important;
}

.ant-pagination-item a {
    color: var(--text-secondary) !important;
}

.ant-pagination-item:hover {
    border-color: var(--color-primary) !important;
}

.ant-pagination-item:hover a {
    color: var(--color-primary-light) !important;
}

.ant-pagination-item-active {
    background: var(--pri) !important;
    border-color: var(--pri) !important;
}

/* I-049 AD7: AntD resets the outline of the prev / next / jump items ((0,1,0), after app.css); every pager item takes
   the focus outline from the keyboard. */
.ant-pagination :is(.ant-pagination-item, .ant-pagination-prev, .ant-pagination-next, .ant-pagination-jump-prev, .ant-pagination-jump-next):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.ant-pagination-item-active a {
    color: var(--on-pri) !important;
}

.ant-pagination-item-active:hover {
    background: var(--pri-h) !important;
    border-color: var(--pri-h) !important;
}

.ant-pagination-item-active:hover a {
    color: var(--on-pri) !important;
}

.ant-pagination-prev .ant-pagination-item-link,
.ant-pagination-next .ant-pagination-item-link {
    background: transparent !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-secondary) !important;
}

.ant-pagination-prev:hover .ant-pagination-item-link,
.ant-pagination-next:hover .ant-pagination-item-link {
    border-color: var(--color-primary) !important;
    color: var(--color-primary-light) !important;
}

.ant-pagination-disabled .ant-pagination-item-link {
    color: var(--text-muted) !important;
    border-color: var(--glass-border) !important;
}

.ant-pagination-jump-next .ant-pagination-item-ellipsis,
.ant-pagination-jump-prev .ant-pagination-item-ellipsis {
    color: var(--text-muted) !important;
}

.ant-pagination-jump-next .ant-pagination-item-link-icon,
.ant-pagination-jump-prev .ant-pagination-item-link-icon {
    color: var(--color-primary-light) !important;
}

.ant-pagination-options .ant-select-selector {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-secondary) !important;
}

/* ===============================================
   Switch Overrides - the prototype's neutral .sw (I-062 D1)
   =============================================== */

/* The prototype's .sw (prototype.html 550–556), verbatim: a 40 × 22 track, radius 11, 1px border; off — --panel-3 track,
   --border-2 border, a 16px --text-2 knob 2px inside the border; on — --text-2 track and border, a --bg knob moved 18px.
   The track is .ant-switch, the knob .ant-switch-handle painted by its ::before (AntD places the handle against the padding
   box, so `top` / `left: 2px` sit 2px inside the border as the prototype's ::after does). No brand colour in either state.
   The layout gate measures both states in both themes (`switch.track`, scripts/audit-page-design/layout-probe.js). */
.ant-switch {
    min-width: 40px;
    height: 22px;
    line-height: 20px;
    background-color: var(--panel-3);
    border: 1px solid var(--border-2);
    border-radius: 11px;
    transition: background-color 0.15s, border-color 0.15s;
}

.ant-switch-checked {
    background-color: var(--text-2);
    border-color: var(--text-2);
}

.ant-switch-handle {
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    transition: left 0.15s;
}

.ant-switch-checked .ant-switch-handle {
    left: calc(100% - 16px - 2px);
}

.ant-switch-handle::before {
    background-color: var(--text-2);
    border-radius: 50%;
    box-shadow: none;
}

.ant-switch-checked .ant-switch-handle::before {
    background-color: var(--bg);
}

/* The prototype's knob does not stretch while pressed (AntD widens it by 30%). */
.ant-switch:not(.ant-switch-disabled):active .ant-switch-handle::before {
    right: 0;
    left: 0;
}

/* D1: the switch carries no text — its meaning is the visible label beside or above it, as in the prototype (the
   „Укљ./Искљ.“ CheckedChildren are gone); an in-track label would also overflow the fixed 40px track. */
.ant-switch-inner {
    display: none;
}

/* Small size, kept proportional: AntD's 28 × 16 track, radius 8, the same 1px border and 2px knob inset as the default
   size, so the knob fills the 14px padding box less the inset (10px) and travels the 26px padding box less the knob and
   both insets (12px). */
.ant-switch-small {
    min-width: 28px;
    height: 16px;
    line-height: 14px;
    border-radius: 8px;
}

.ant-switch-small .ant-switch-handle {
    width: 10px;
    height: 10px;
}

.ant-switch-small.ant-switch-checked .ant-switch-handle {
    left: calc(100% - 10px - 2px);
}

/* Loading keeps AntD's spinner inside the knob, in the knob's opposite colour (the off knob is --text-2, the on knob --bg). */
.ant-switch-loading-icon.anticon {
    top: 1px;
    color: var(--bg);
}

.ant-switch-checked .ant-switch-loading-icon {
    color: var(--text-2);
}

.ant-switch-small .ant-switch-loading-icon {
    top: 0.5px;
}

/* Disabled / loading: the prototype's .sw has no disabled style, so the App's disabled-control opacity applies (0.5, as
   .ant-btn-dashed:disabled, .choice-card--disabled and .stat-card--disabled) instead of AntD's 0.4. */
.ant-switch-loading,
.ant-switch-disabled {
    opacity: 0.5;
}

/* The prototype's switch field (.sw inside .st-swf, prototype.html 550 / 5314 / 5442): a settings switch is a
   <label class="settings-layout__switch"> holding the switch and its own label text — the label names the switch and a
   click on it toggles it — and the field's help sits under that text, past the 40px track and the 10px gap. */
label.settings-layout__switch {
    cursor: pointer;
}

.ant-form-item-control:has(> .ant-form-item-control-input label.settings-layout__switch) .ant-form-item-explain,
label.settings-layout__switch ~ .form-field__hint {
    padding-left: 50px;
}

/* I-049 AD7: keyboard focus is the focus outline around the track (prototype .sw input:focus-visible + .sw__t, line
   553); AntD's own `.ant-switch:focus` grey ring, which a mouse click draws too, is cancelled. Both (0,2,0), later than
   AntD's `.ant-switch:focus { outline: 0 }`. */
.ant-switch:is(:focus, .ds-force-focus) {
    box-shadow: none;
}

.ant-switch:is(:focus-visible, .ds-force-focus) {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

/* ===============================================
   Popover/Popconfirm Overrides - Dark Theme
   =============================================== */

.ant-popover-inner {
    background: var(--float) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow) !important;
}

.ant-popover-inner-content {
    color: var(--text-primary) !important;
}

/* I-062 TASK_12 — the prototype's popovers (.pop) carry no arrow and float 8px off their trigger (AntD places the box 4px
   off, so the placement padding is the other 4); a titled popover's head is .pop__hd (14px 16px 10px on a --line rule,
   the 700 14.5px Manrope title). */
.ant-popover-arrow {
    display: none;
}

.ant-popover:is(.ant-popover-placement-top, .ant-popover-placement-topLeft, .ant-popover-placement-topRight) {
    padding-bottom: 4px;
}

.ant-popover:is(.ant-popover-placement-bottom, .ant-popover-placement-bottomLeft, .ant-popover-placement-bottomRight) {
    padding-top: 4px;
}

.ant-popover:is(.ant-popover-placement-left, .ant-popover-placement-leftTop, .ant-popover-placement-leftBottom) {
    padding-right: 4px;
}

.ant-popover:is(.ant-popover-placement-right, .ant-popover-placement-rightTop, .ant-popover-placement-rightBottom) {
    padding-left: 4px;
}

.ant-popover-title {
    min-height: 0;
    padding: 14px 16px 10px;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--line) !important;
    font: 700 14.5px/1.2 var(--head);
}

/* Popconfirm = the prototype's .pop.confirm: 300px, 14px 14px 10px; .confirm__row — the 16px --warn-ink icon 3px down,
   10px before the 14px/1.5 --text question; .confirm__ft — the buttons 12px under it, right-aligned 8px apart, each a
   .btn--sm (28px, 0 11px, radius 7, 500 13px/1; the primary 600). */
.ant-popover-inner:has(.ant-popover-buttons) {
    width: 300px;
    max-width: calc(100vw - 32px);
}

.ant-popover-inner:has(.ant-popover-buttons) .ant-popover-inner-content {
    padding: 14px 14px 10px;
}

.ant-popover-message {
    align-items: flex-start;
    gap: 10px;
    padding: 0;
    color: var(--text-primary) !important;
    font-size: 14px;
    line-height: 1.5;
}

.ant-popover-message-icon {
    flex: none;
    margin: 3px 0 0;
    line-height: 0;
}

.ant-popover-message-icon .anticon {
    position: static;
    color: var(--warn-ink) !important;
    font-size: 16px;
}

.ant-popover-message-title {
    padding: 0;
}

.ant-popover-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 12px 0 0;
}

/* The .btn--sm box is the shared app.css rule (with the feed and bell actions). The flex gap spaces the buttons, so
   AntD's `.ant-popover-buttons button:not(:first-child) { margin-left: 8px }` (0,2,1) is answered at its own weight. */
.ant-popover-buttons button.ant-btn {
    margin: 0;
}

.ant-popover-buttons .ant-btn-primary {
    font-weight: 600;
}

/* .confirm__ft's default .btn--sm: --text on --ctl-bg / --ctl-bd; hover, focus and the disabled guard are the global
   .ant-btn-default rules', as the dialog footer's */
.ant-popover-buttons .ant-btn-default {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    color: var(--text) !important;
}

/* ===============================================
   Button Focus/Wave Overrides - Brand Orange
   =============================================== */

/* B-008 (2592, 2608, 2649): keyboard focus only - a mouse click leaves no stuck highlight on any button type.
   B-051 AD4: one rule per state. Keyboard focus is app.css's per-type :focus-visible rules (border + text
   --color-primary, plus the focus ring); the `.ant-btn:focus-visible, .ant-btn-default:focus-visible` copy that painted
   --color-primary-light text is gone (it won only for the (0,2,0) anchor form, which now matches the <button>). This
   block keeps the Default press colour. */
.ant-btn-default:active {
    border-color: var(--color-primary) !important;
    color: var(--color-primary-light) !important;
}

.ant-btn-primary:active {
    background: var(--color-primary-dark) !important;
}

[ant-click-animating-without-extra-node='true']::after,
.ant-click-animating-node {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 0 var(--color-primary) !important;
}

/* ===============================================
   InputNumber Overrides - Dark Theme
   =============================================== */

.ant-input-number {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text) !important;
    transition: all var(--transition-base) !important;
}

.ant-input-number:where(:not(.ant-input-number-disabled)):is(:hover, .ds-force-hover) {
    border-color: var(--ctl-bd-h) !important;
}

.ant-input-number-focused,
.ant-input-number:is(:focus, .ds-force-focus) {
    border-color: var(--focus) !important;
    box-shadow: 0 0 0 3px var(--pri-bg) !important;
}

.ant-input-number-input {
    color: var(--text-primary) !important;
}

.ant-input-number-input::placeholder {
    color: var(--text-muted) !important;
}

.ant-input-number-handler-wrap {
    background: var(--ctl-bg) !important;
    border-left: 1px solid var(--ctl-bd) !important;
    border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
}

.ant-input-number-handler {
    border-color: var(--ctl-bd) !important;
    color: var(--text-secondary) !important;
}

.ant-input-number-handler:hover {
    color: var(--color-primary-light) !important;
}

.ant-input-number-handler-up-inner,
.ant-input-number-handler-down-inner {
    color: var(--text-secondary) !important;
}

.ant-input-number-handler:hover .ant-input-number-handler-up-inner,
.ant-input-number-handler:hover .ant-input-number-handler-down-inner {
    color: var(--color-primary-light) !important;
}

/* InputNumber affix wrapper (prefix) — MoneyInput draws it for its currency code (AntD 1.6.0 only renders Prefix
   inside a FormItem feedback wrapper). The wrapper is the visible surface; the inner InputNumber is just the field,
   like the .ant-input-affix-wrapper rules above. A feedback wrapper AntD nests inside it stays transparent. */
.ant-input-number-affix-wrapper {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    border-radius: var(--radius-md) !important;
    color: var(--text-primary) !important;
    transition: all var(--transition-base) !important;
}

.ant-input-number-affix-wrapper.input-number--block {
    width: 100%;
}

.ant-input-number-affix-wrapper:where(:not(.ant-input-number-affix-wrapper-disabled)):is(:hover, .ds-force-hover) {
    border-color: var(--ctl-bd-h) !important;
}

.ant-input-number-affix-wrapper:is(:focus-within, .ds-force-focus) {
    border-color: var(--focus) !important;
    box-shadow: 0 0 0 3px var(--pri-bg) !important;
}

.ant-input-number-affix-wrapper > .ant-input-number,
.ant-input-number-affix-wrapper > .ant-input-number-affix-wrapper {
    width: 100%;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.ant-input-number-affix-wrapper .ant-input-number-prefix {
    color: var(--text-muted);
}

/* Collapse panel dividers — dark theme */
.ant-collapse > .ant-collapse-item {
    border-bottom: 1px solid var(--glass-border) !important;
}

.ant-collapse > .ant-collapse-item:last-child {
    border-bottom: none !important;
}

/* ===============================================
   DatePicker/RangePicker Focus Overrides
   =============================================== */

.ant-picker-active-bar {
    background: var(--pri) !important;
}

.ant-picker-range .ant-picker-active-bar {
    background: var(--pri) !important;
}

/* ===============================================
   Skeleton Overrides - Dark Theme
   =============================================== */

.ant-skeleton-title,
.ant-skeleton-paragraph > li {
    background: var(--skel) !important;
    border-radius: var(--radius-sm) !important;
}

.ant-skeleton-avatar {
    background: var(--skel) !important;
}

.ant-skeleton-active .ant-skeleton-title,
.ant-skeleton-active .ant-skeleton-paragraph > li,
.ant-skeleton-active .ant-skeleton-avatar {
    background: linear-gradient(90deg, var(--skel) 25%, var(--skel-hi) 50%, var(--skel) 75%) !important;
    background-size: 200% 100% !important;
    animation: skeletonShimmer 1.5s ease-in-out infinite !important;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Loading indicators stand still for visitors who ask for less motion (I-041) */
@media (prefers-reduced-motion: reduce) {
    .ant-skeleton-active .ant-skeleton-title,
    .ant-skeleton-active .ant-skeleton-paragraph > li,
    .ant-skeleton-active .ant-skeleton-avatar,
    .ant-skeleton-element.ant-skeleton-active .ant-skeleton-button,
    .ant-skeleton-element.ant-skeleton-active .ant-skeleton-input,
    .ant-spin-dot-spin,
    .ant-spin-dot-item,
    .ant-skeleton-active .ant-skeleton-avatar::after,
    .ant-skeleton-active .ant-skeleton-button::after,
    .ant-skeleton-active .ant-skeleton-input::after {
        animation: none !important;
    }
}

/* ===============================================
   Breadcrumb Overrides - Dark Theme
   =============================================== */

.ant-breadcrumb { color: var(--text-muted) !important; }
.ant-breadcrumb-link { color: var(--text-secondary) !important; }
.ant-breadcrumb-link:hover { color: var(--color-primary-light) !important; }
.ant-breadcrumb-link a { color: var(--text-secondary) !important; }
.ant-breadcrumb-link a:hover { color: var(--color-primary-light) !important; }
.ant-breadcrumb-separator { color: var(--text-muted) !important; margin: 0 6px; } /* I-049 TASK_26: .crumbs li + li::before, 6px either side */
.ant-breadcrumb > span:last-child .ant-breadcrumb-link { color: var(--text-primary) !important; }

/* I-049 TASK_26 (PLAN LP13): the prototype's .crumbs row, verbatim — .crumbs ol { gap: 6px; font-size: 13px } on the
   body's 1.5 line height (19.5px); the separator's 6px either side is on its rule above. */
.ant-breadcrumb { font-size: 13px; line-height: 1.5; }

/* ===============================================
   Descriptions Overrides - Dark Theme
   =============================================== */

.ant-descriptions-header .ant-descriptions-title { color: var(--text-primary) !important; }
.ant-descriptions-bordered .ant-descriptions-view { border: 1px solid var(--glass-border) !important; border-radius: var(--radius-md) !important; overflow: hidden; }
.ant-descriptions-bordered .ant-descriptions-row { border-bottom: 1px solid var(--glass-border) !important; }
.ant-descriptions-bordered .ant-descriptions-item-label { background: var(--th-bg) !important; color: var(--text-secondary) !important; border-right: 1px solid var(--glass-border) !important; }
.ant-descriptions-bordered .ant-descriptions-item-content { color: var(--text-primary) !important; background: transparent !important; }
.ant-descriptions-item-label { color: var(--text-secondary) !important; }
.ant-descriptions-item-content { color: var(--text-primary) !important; }

/* ===============================================
   Statistic Overrides - Dark Theme
   =============================================== */

.ant-statistic-title { color: var(--text-secondary) !important; }
.ant-statistic-content { color: var(--text-primary) !important; }
.ant-statistic-content-prefix, .ant-statistic-content-suffix { color: var(--text-secondary) !important; }

/* ===============================================
   Timeline Overrides - Dark Theme
   =============================================== */

.ant-timeline-item-content { color: var(--text-primary) !important; }
.ant-timeline-item-tail { border-left-color: var(--glass-border) !important; }
.ant-timeline-item-head { background: transparent !important; }
.ant-timeline-item-head-blue { color: var(--color-info, #1890ff) !important; border-color: var(--color-info, #1890ff) !important; }
.ant-timeline-item-head-green { color: var(--color-success, #52c41a) !important; border-color: var(--color-success, #52c41a) !important; }
.ant-timeline-item-head-orange { color: var(--color-primary) !important; border-color: var(--color-primary) !important; }
.ant-timeline-item-head-gray { color: var(--text-muted) !important; border-color: var(--glass-border) !important; }

/* ===============================================
   Rate Overrides - Brand Orange
   =============================================== */

.ant-rate-star-full .anticon, .ant-rate-star-half .ant-rate-star-first .anticon { color: var(--color-primary) !important; }
.ant-rate-star-zero .anticon, .ant-rate-star-half .ant-rate-star-second .anticon { color: var(--text-muted) !important; }

/* ===============================================
   Segmented Overrides - Dark Theme + Brand Orange
   F-263: neutral thumb like the prototype .seg — track --seg-bg, thumb --seg-on, --seg-shadow.
   =============================================== */

.ant-segmented { background: var(--seg-bg) !important; border-radius: var(--radius-md) !important; padding: 2px !important; }
.ant-segmented-item { color: var(--text-secondary) !important; border-radius: var(--radius-sm) !important; transition: all var(--transition-base) !important; }
.ant-segmented-item:hover { color: var(--text-primary) !important; }
.ant-segmented-item-selected { background: var(--seg-on) !important; color: var(--text) !important; border-radius: var(--radius-sm) !important; box-shadow: var(--seg-shadow) !important; }
.ant-segmented-thumb { background: var(--seg-on) !important; border-radius: var(--radius-sm) !important; }
/* I-049 AD7: as the radio-button chips — the item's 0×0 input takes the keyboard focus, the item draws the outline. */
.ant-segmented-item:has(> .ant-segmented-item-input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }

/* Multi-select selected item tags */
.ant-select-multiple .ant-select-selection-item { background: var(--pri-bg) !important; border: 1px solid rgba(var(--pri-rgb), .3) !important; border-radius: var(--radius-sm) !important; color: var(--color-primary-light) !important; }
.ant-select-multiple .ant-select-selection-item-content { color: var(--color-primary-light) !important; }
.ant-select-multiple .ant-select-selection-item-remove { color: var(--color-primary) !important; }
.ant-select-multiple .ant-select-selection-item-remove:hover { color: var(--text-primary) !important; }

/* ===============================================
   Tooltip Overrides - Dark Theme
   =============================================== */

/* I-062 TASK_12 — the prototype's .tip: radius 7, 6px 10px, 500 13px/1.2 (AntD's 32px minimum height and 14px/1.57
   made it 36px), no arrow, 10px off its trigger (the collapsed sider's tip; AntD adds no offset of its own here). Long
   App tooltips still wrap at AntD's max width. */
.ant-tooltip-inner {
    min-height: 0;
    padding: 6px 10px;
    background: var(--float) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid var(--border) !important;
    border-radius: 7px !important;
    color: var(--text-primary) !important;
    box-shadow: var(--shadow) !important;
    font: 500 13px/1.2 var(--font);
}

.ant-tooltip-arrow {
    display: none;
}

.ant-tooltip:is(.ant-tooltip-placement-top, .ant-tooltip-placement-topLeft, .ant-tooltip-placement-topRight) {
    padding-bottom: 10px;
}

.ant-tooltip:is(.ant-tooltip-placement-bottom, .ant-tooltip-placement-bottomLeft, .ant-tooltip-placement-bottomRight) {
    padding-top: 10px;
}

.ant-tooltip:is(.ant-tooltip-placement-left, .ant-tooltip-placement-leftTop, .ant-tooltip-placement-leftBottom) {
    padding-right: 10px;
}

.ant-tooltip:is(.ant-tooltip-placement-right, .ant-tooltip-placement-rightTop, .ant-tooltip-placement-rightBottom) {
    padding-left: 10px;
}

@media (max-width: 768px) {
    .ant-picker-dropdown {
        max-width: 100vw !important;
    }

    .ant-picker-panel-container {
        overflow-x: auto !important;
    }

    .ant-picker-panels {
        flex-direction: column !important;
    }
}

/* ============================================================
   TextArea affix-wrapper alignment (F-174 — digidok polish)
   Promote the affix-wrapper to be the glass box so the wrapped
   <textarea> aligns pixel-perfect with sibling Input fields in
   the same form. Inner textarea stays transparent.
   ============================================================ */
.ant-input-affix-wrapper.ant-input-affix-wrapper-textarea {
    background: var(--ctl-bg) !important;
    border: 1px solid var(--ctl-bd) !important;
    border-radius: var(--radius-md) !important;
    padding: 0 !important;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.ant-input-affix-wrapper.ant-input-affix-wrapper-textarea:where(:not(.ant-input-affix-wrapper-disabled)):is(:hover, .ds-force-hover) {
    border-color: var(--ctl-bd-h) !important;
}

.ant-input-affix-wrapper.ant-input-affix-wrapper-textarea-focused,
.ant-input-affix-wrapper.ant-input-affix-wrapper-textarea:is(:focus-within, .ds-force-focus) {
    border-color: var(--focus) !important;
    box-shadow: 0 0 0 3px var(--pri-bg) !important;
}

.ant-input-affix-wrapper-textarea > textarea.ant-input {
    background: transparent !important;
    border: none !important;
    padding: var(--space-md) !important;
    color: var(--text-primary) !important;
}

/* ============================================================
   AntDesign Radio Button group (.ant-radio-button-wrapper) — restyled to be
   visually identical to .ant-segmented: translucent pill track on the group,
   borderless transparent buttons, selected pill = the Segmented thumb (F-263: --seg-on / --seg-shadow).
   Generalizes the calendar mode-switch treatment so every variant switcher in
   the app (Segmented or RadioGroup-with-buttons) shares one look.
   ============================================================ */

.ant-radio-group:has(> .ant-radio-button-wrapper) {
    background: var(--seg-bg);
    border-radius: var(--radius-md);
    padding: 2px;
    display: inline-flex;
    width: fit-content;
    /* I-008 (D9): a long switcher wraps onto more rows inside its container instead of running past it;
       a group that fits stays one row */
    flex-wrap: wrap;
    max-width: 100%;
    row-gap: 2px;
}

.ant-radio-button-wrapper {
    background: transparent !important;
    border: none !important;
    color: var(--text-secondary) !important;
    border-radius: var(--radius-sm) !important;
    transition: all var(--transition-base) !important;
    box-shadow: none !important;
}

/* AntDesign's inter-button separator line — no place in the pill-track look. */
.ant-radio-button-wrapper::before {
    display: none !important;
}

.ant-radio-button-wrapper:is(:hover, .ds-force-hover) {
    background: transparent !important;
    color: var(--text-primary) !important;
}

/* B-092 (B11): a disabled chip keeps its checked look — a reopened draft's locked act type showed no selection
   (prototype .segr: input:checked + span, input:disabled + span { opacity: .55 }). */
.ant-radio-button-wrapper-checked {
    background: var(--seg-on) !important;
    color: var(--text) !important;
    box-shadow: var(--seg-shadow) !important;
}

/* B-092: hovering a checked chip — a locked (disabled) one too — keeps its selection over the hover rule above. */
.ant-radio-button-wrapper-checked:is(:hover, .ds-force-hover) {
    background: var(--seg-on) !important;
    color: var(--text) !important;
}

/* A disabled chip is dimmed once — by the opacity, as the prototype does — and keeps the chip's own text colour (a muted
   colour under the opacity made it nearly unreadable on the dark glass); hover does not brighten it. */
.ant-radio-button-wrapper-disabled:not(.ant-radio-button-wrapper-checked) {
    background: transparent !important;
    color: var(--text-secondary) !important;
}

.ant-radio-button-wrapper-disabled {
    opacity: .55;
}

/* I-049 AD7: the chip's radio is a 0×0 input, so the keyboard focus outline goes on the chip (prototype .segr, line
   189); AntD's :focus-within ring is already gone (box-shadow above). */
.ant-radio-button-wrapper:has(input:focus-visible) {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
}

/* AntDesign colors .ant-radio-group rgba(0, 0, 0, 0.85) — any content nested
   inside a RadioGroup (e.g. the user drawer's OJ rows, which live inside the
   shared primary-OJ RadioGroup) inherits near-black on dark surfaces. Same
   failure mode as the h1–h6 / .ant-form-item defaults. No !important, so
   components that set their own color still win. */
.ant-radio-group {
    color: var(--text-primary);
}

/* ============================================================
   AntDesign Tree (.ant-tree) — dark theme overrides.
   Default AntDesign tree has a white background that leaks
   through the dark page. Override to glass tokens.
   ============================================================ */

.ant-tree {
    background: transparent !important;
    color: var(--text-primary) !important;
}

.ant-tree .ant-tree-treenode {
    background: transparent !important;
    padding: 2px 0;
}

.ant-tree .ant-tree-node-content-wrapper {
    background: transparent !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
    transition: background var(--transition-fast) !important;
}

.ant-tree .ant-tree-node-content-wrapper:hover {
    background: var(--row-h) !important;
}

.ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected {
    background: var(--row-sel) !important;
    color: var(--pri-ink) !important;
}

.ant-tree .ant-tree-switcher {
    color: var(--text-secondary) !important;
}

.ant-tree .ant-tree-switcher:hover {
    color: var(--text-primary) !important;
}

.ant-tree .ant-tree-title {
    color: var(--text-primary) !important;
}

.ant-tree .ant-tree-indent-unit {
    /* connecting lines for the tree */
    color: var(--glass-border);
}

.ant-tree-show-line .ant-tree-switcher {
    background: transparent !important;
}

@media (max-width: 768px) {
    .ant-tree .ant-tree-node-content-wrapper {
        padding: var(--space-xs) var(--space-sm);
    }
}

@media (max-width: 480px) {
    .ant-tree .ant-tree-node-content-wrapper {
        padding: var(--space-sm);
        min-height: var(--space-2xl);
    }
}

/* TreeSelect dropdown (used in filter selectors that pick OJs etc.) */
.ant-select-tree {
    background: var(--float) !important;
    color: var(--text-primary) !important;
}

.ant-select-tree .ant-select-tree-treenode {
    background: transparent !important;
}

.ant-select-tree .ant-select-tree-node-content-wrapper {
    background: transparent !important;
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm) !important;
}

.ant-select-tree .ant-select-tree-node-content-wrapper:hover {
    background: var(--row-h) !important;
}

.ant-select-tree .ant-select-tree-node-content-wrapper.ant-select-tree-node-selected {
    background: var(--row-sel) !important;
    color: var(--pri-ink) !important;
}
