/* Dark Brand Orange - variant of dark-brand.
 *
 * The original dark-brand with its teal-green accents replaced, and primary
 * moved to the brand orange. Every colour here already existed in the palette:
 * the orange #ED6B19 family, and the #A92C4C crimson that light-brand declares
 * as --danger.
 *
 * This replaced an earlier theme of the same name that recoloured the whole
 * chrome warm - background, surfaces, border and navbar included. That one was
 * dropped in favour of this, which keeps dark-brand's slate structure and only
 * moves the accents.
 *
 * What is deliberately NOT changed: --background, --surface, --surface-alt,
 * --border and --primary-alt (the navbar). Those read as teal to a hue scan but
 * are 9-17% saturation slate - they are the structure, not the accent, and the
 * brief was to keep them. Only the saturated teals move.
 *
 * The requested #A92C4C is the accent, used where it is a filled background
 * carrying white text: info buttons, info notifications and the sidebar
 * border. It is NOT used for text - at 1.98:1 on --surface it
 * is less legible than the teal it replaces.
 *
 * Colour roles, after the danger/primary split:
 *   primary   #B4571A  brand orange, darkened to carry white text (4.86:1)
 *   accent    #A92C4C  the requested crimson, info surfaces + sidebar border
 *   selected  #B4571A  menu selection, same orange as primary
 *   danger    #C0392B  filled destructive surfaces (5.44:1 with white),
 *                      and the outlined delete button, so the two match
 *   info/link #CFA6A2  muted rose for text, links and table headers
 *
 * The intent tokens --danger and --info each serve two incompatible jobs on a
 * dark theme: a filled surface with white text on it wants a dark value, while
 * text sitting on --surface wants a light one. No single value does both - the
 * best simultaneous value is 3.63:1 in each direction. So each intent token
 * holds the light, text-legible value, and the filled tokens that put white on
 * top (--button-*-bg, --notification-*-bg) name the dark value directly.
 *
 * That is why --danger is #E57373 rather than the deep red: --danger drives
 * .has-text-danger, tags and borders, where the deep red measures 2.35:1. The
 * red lives on --button-danger-bg and --notification-danger-bg, which is
 * where a destructive action is actually seen.
 *
 * --success-light moves from the teal-grey #445b56 to a green tint, since it is
 * the backing for success messages and was only teal by accident.
 */
[data-theme="dark-brand-orange"] {
    --button-info-outline: #E8C55E;
    --button-primary-outline: #e37f3d;
    --button-danger-outline: #C0392B;

    --basemap-filter: brightness(0.62) saturate(0.85) contrast(1.05);
    --admin-navbar-bg: var(--background);
    --admin-navbar-border: var(--border);
    --admin-navbar-hover-bg: var(--surface);
    --admin-navbar-hover-text: var(--text-primary);
    --admin-navbar-text: var(--text-primary);
    --box-shadow: none;
    --card-header-title-color: var(--text-primary);
    --grey-text-color: var(--text-secondary);
    --menu-bg: var(--surface);
    --menu-link-hover-color: var(--text-primary);
    --subtitle-color: var(--title-color);
    --title-color: var(--text-primary);
    --background: #222222;
    --surface: #2b3133;
    --surface-alt: #354549;
    --text-primary: #f1f2f2;
    --text-secondary: #b9c1c3;
    --border: #435A5F;
    --primary: #ED6B19;
    --primary-alt: #435A5F;
    --info: #EDA05C;
    --success: #39ae6f;
    --warning: #bc9621;
    --danger: #E57373;
    --button-primary-bg: #B4571A;
    --button-primary-text: #ffffff;
    --button-success-bg: #39ae6f;
    --button-success-text: #1c1c1c;
    --button-info-bg: #E8C55E;
    --button-info-text: #1c1c1c;
    --button-warning-bg: #bc9621;
    --button-warning-text: #1c1c1c;
    --button-danger-bg: #C0392B;
    --button-danger-text: #ffffff;
    --accent-brown: #7B6A58;
    --accent-yellow: #FEDB00;
    --primary-light: #4a3528;
    --primary-alt-light: #2c3942;
    --success-light: #2c4034;
    --info-light: #4E2F10;
    --warning-light: #3c3f2a;
    --danger-light: #3d1414;
    --notification-primary-light-bg: var(--primary-light);
    --notification-primary-light-text: #f39a66;
    --notification-primary-alt-light-bg: var(--primary-alt-light);
    --notification-primary-alt-light-text: #7a9fae;
    --notification-info-light-bg: var(--info-light);
    --notification-info-light-text: #EDA05C;
    --notification-success-light-bg: var(--success-light);
    --notification-success-light-text: #3ebd78;
    --notification-warning-light-bg: var(--warning-light);
    --notification-warning-light-text: #cda424;
    --notification-danger-light-bg: var(--danger-light);
    --notification-danger-light-text: var(--danger);
    --card-header-bg: var(--surface-alt);
    --card-header-border: var(--border);
    --sidebar-bg: #1f2324;
    --sidebar-border: rgba(237, 107, 25, 0.45);
    --menu-label-color: #A4AF56;
    --menu-link-color: var(--text-primary);
    --menu-link-hover-bg: #3E2716;
    --menu-link-active-bg: #B4571A;
    --menu-link-active-color: #fff;
    --navbar-bg: var(--primary-alt);
    --navbar-border: var(--primary);
    --navbar-shadow: none;
    --navbar-item-color: var(--text-primary);
    --navbar-item-hover-bg: var(--menu-link-hover-bg);
    --navbar-item-hover-color: var(--text-primary);
    --navbar-dropdown-bg: var(--background);
    --navbar-dropdown-border: var(--border);
    --navbar-dropdown-item-color: var(--text-primary);
    --navbar-dropdown-shadow: 0 0 0 0.125em color-mix(in srgb, var(--success) 25%, transparent);
    --navbar-burger-color: #fff;
    --navbar-divider-bg: var(--border);
    --input-bg: var(--surface-alt);
    --input-text: var(--text-primary);
    --input-border: var(--border);
    --input-focus-border: var(--primary);
    --input-focus-shadow: 0 0 0 0.125em rgba(237, 107, 25, 0.28);
    --label-color: var(--text-primary);
    --notification-bg: #3a3a3a;
    --notification-primary-bg: var(--primary);
    --notification-primary-text: #fff;
    --notification-info-bg: #E8C55E;
    --notification-info-text: #1c1c1c;
    --notification-success-bg: var(--success);
    --notification-success-text: #1c1c1c;
    --notification-warning-bg: var(--warning);
    --notification-warning-text: #1c1c1c;
    --notification-danger-bg: #C0392B;
    --notification-danger-text: #fff;
    --box-contrast-bg: #252a2b;
    --box-contrast-border: #353b3d;
    --timeline-bar-bg-color: var(--surface-alt, #f5f5f5);
    --timeline-bar-border: var(--border, #dbdbdb);
    --timeline-past-color: var(--text-secondary, #999);
    --timeline-ongoing-color: var(--success, #ED6B19);
    --timeline-future-color: var(--info, #007D72);
    --timeline-empty-color: var(--text-secondary, #999);
    --timeline-labels-color: var(--text-secondary, #999);
    --table-bg: var(--surface);
    --table-text: var(--text-primary);
    --table-header-bg: var(--surface-alt);
    --table-header-text: var(--text-primary);
    --table-cell-text: var(--text-primary);
    --table-border: var(--border);
    --table-container-bg: var(--surface);
    --table-container-border: var(--border);
    --table-row-hover: #5A3A22;
    --table-header-link-hover: #F2B27A;
    --table-striped-row: rgba(255, 255, 255, 0.03);
    --table-link-color: #EDA05C;
    --table-link-hover-color: #F2B27A;
    --table-row-hover-soft: var(--table-row-hover);
    --table-row-hover-striped: var(--table-row-hover);
    --table-footer-bg: var(--surface-alt);
    --modal-card-head-bg: var(--primary-alt);
    --modal-card-head-text: var(--text-primary);
    --tree-node-bg: var(--surface);
    --tree-node-border: var(--border);
    --tree-node-text: var(--text-primary);
    --tree-node-hover-border: var(--success);
    --tree-node-hover-shadow: 0 0 0 0.125em color-mix(in srgb, var(--success) 25%, transparent);
    --tree-level-0-bg: var(--surface-alt);
    --tree-connector-color: var(--border);
    --message-bg: var(--surface-alt);
    --message-border: var(--border);
    --message-text: var(--text-primary);
    --message-body-bg: var(--surface);
    --message-body-text: var(--text-primary);
    --message-body-border: var(--border);
    --message-icon-color: currentColor;
    --message-primary-header-bg: var(--notification-primary-bg);
    --message-primary-header-text: var(--notification-primary-text);
    --message-info-header-bg: var(--notification-info-bg);
    --message-info-header-text: var(--notification-info-text);
    --message-success-header-bg: var(--notification-success-bg);
    --message-success-header-text: var(--notification-success-text);
    --message-warning-header-bg: var(--notification-warning-bg);
    --message-warning-header-text: var(--notification-warning-text);
    --message-danger-header-bg: var(--notification-danger-bg);
    --message-danger-header-text: var(--notification-danger-text);
}

    [data-theme="dark-brand-orange"] strong {
        color: inherit;
    }

    [data-theme="dark-brand-orange"] code {
        color: inherit;
        background-color: var(--background);
    }

    [data-theme="dark-brand-orange"] .title,
    [data-theme="dark-brand-orange"] .subtitle,
    [data-theme="dark-brand-orange"] .card-header-title {
        color: var(--text-primary);
    }

    [data-theme="dark-brand-orange"] .has-text-grey {
        color: var(--text-secondary) !important;
    }

    /* Sidebar */
    [data-theme="dark-brand-orange"] #sidebar {
        background-color: var(--sidebar-bg);
        border-right: 1px solid var(--sidebar-border);
    }

    [data-theme="dark-brand-orange"] .navbar-dropdown .navbar-item:hover {
            background-color: var(--surface);
            color: var(--menu-link-hover-color);
        }

    [data-theme="dark-brand-orange"] .admin-navbar {
    background-color: var(--admin-navbar-bg);
    color: var(--admin-navbar-text);
    border-bottom: 1px solid var(--admin-navbar-border);
}

    [data-theme="dark-brand-orange"] .admin-navbar .navbar-item,
    [data-theme="dark-brand-orange"] .admin-navbar .navbar-link {
        color: var(--admin-navbar-text);
    }

        [data-theme="dark-brand-orange"] .admin-navbar .navbar-item:hover,
        [data-theme="dark-brand-orange"] .admin-navbar .navbar-link:hover {
            background-color: var(--admin-navbar-hover-bg);
            color: var(--admin-navbar-hover-text);
        }

[data-theme="dark-brand-orange"] .tree-node-content {
    background: var(--tree-node-bg);
    border-color: var(--tree-node-border);
    color: var(--tree-node-text);
}

    [data-theme="dark-brand-orange"] .tree-node-content:hover {
        border-color: var(--tree-node-hover-border);
        box-shadow: var(--tree-node-hover-shadow);
    }