
/* ==========================================================
   AGENTAI THEME PRESETS + SETTINGS PROFESSIONAL V3
   ========================================================== */

html[data-theme-preset="executive"][data-theme="light"] {
    --background: #f3f6f8;
    --surface: #ffffff;
    --surface-secondary: #edf2f4;
    --surface-tertiary: #e4ebee;
    --text: #172126;
    --text-secondary: #55636b;
    --text-muted: #7f8d95;
    --border: #d2dce1;
    --border-strong: #afbec6;
    --accent: #0f766e;
    --accent-hover: #0b625c;
    --accent-soft: #d9efec;
    --sidebar: #eef3f5;
    --theme-radius: 6px;
    --theme-radius-lg: 10px;
    --theme-glow: rgba(15, 118, 110, 0.14);
}

html[data-theme-preset="executive"][data-theme="dark"] {
    --background: #0f1518;
    --surface: #161e22;
    --surface-secondary: #1d272c;
    --surface-tertiary: #263238;
    --text: #eef4f5;
    --text-secondary: #afbdc3;
    --text-muted: #7f9198;
    --border: #303d43;
    --border-strong: #45565e;
    --accent: #43b5a7;
    --accent-hover: #62c8bb;
    --accent-soft: #173c38;
    --sidebar: #131b1f;
    --theme-radius: 6px;
    --theme-radius-lg: 10px;
    --theme-glow: rgba(67, 181, 167, 0.14);
}

html[data-theme-preset="edge"][data-theme="light"] {
    --background: #f4f8fc;
    --surface: #ffffff;
    --surface-secondary: #eef5fb;
    --surface-tertiary: #e2edf8;
    --text: #132238;
    --text-secondary: #51657c;
    --text-muted: #7a8fa5;
    --border: #d1dfec;
    --border-strong: #aebfd0;
    --accent: #0f6cbd;
    --accent-hover: #0b5ca7;
    --accent-soft: #dceeff;
    --sidebar: #edf5fb;
    --theme-radius: 10px;
    --theme-radius-lg: 16px;
    --theme-glow: rgba(15, 108, 189, 0.18);
}

html[data-theme-preset="edge"][data-theme="dark"] {
    --background: #0d1520;
    --surface: #131e2b;
    --surface-secondary: #192737;
    --surface-tertiary: #213346;
    --text: #f2f7fb;
    --text-secondary: #b7c8d8;
    --text-muted: #8298ab;
    --border: #2b3e51;
    --border-strong: #415a70;
    --accent: #4aa8ff;
    --accent-hover: #73bcff;
    --accent-soft: #173a59;
    --sidebar: #101b27;
    --theme-radius: 10px;
    --theme-radius-lg: 16px;
    --theme-glow: rgba(74, 168, 255, 0.20);
}

html[data-theme-preset="graphite"][data-theme="light"] {
    --background: #f3f4f6;
    --surface: #ffffff;
    --surface-secondary: #f0f1f3;
    --surface-tertiary: #e5e7eb;
    --text: #181a1f;
    --text-secondary: #5d626c;
    --text-muted: #8b9099;
    --border: #d6d8dc;
    --border-strong: #b6bac1;
    --accent: #445266;
    --accent-hover: #303b4a;
    --accent-soft: #e4e9ef;
    --sidebar: #eff0f2;
    --theme-radius: 4px;
    --theme-radius-lg: 8px;
    --theme-glow: rgba(68, 82, 102, 0.12);
}

html[data-theme-preset="graphite"][data-theme="dark"] {
    --background: #0c0e11;
    --surface: #15181d;
    --surface-secondary: #1b1f25;
    --surface-tertiary: #242930;
    --text: #f3f4f6;
    --text-secondary: #b9bec7;
    --text-muted: #858c96;
    --border: #30353d;
    --border-strong: #474e58;
    --accent: #a7b4c6;
    --accent-hover: #c3cedd;
    --accent-soft: #29313b;
    --sidebar: #111419;
    --theme-radius: 4px;
    --theme-radius-lg: 8px;
    --theme-glow: rgba(167, 180, 198, 0.10);
}

html[data-theme-preset] .theme-button,
html[data-theme-preset] .logout-button,
html[data-theme-preset] .secondary-button,
html[data-theme-preset] .primary-button,
html[data-theme-preset] .ai-button,
html[data-theme-preset] input,
html[data-theme-preset] select,
html[data-theme-preset] textarea {
    border-radius: var(--theme-radius, 4px);
}

html[data-theme-preset] .settings-overview-card,
html[data-theme-preset] .settings-workbench,
html[data-theme-preset] .settings-language-card,
html[data-theme-preset] .settings-toggle-card,
html[data-theme-preset] .settings-module-card {
    border-radius: var(--theme-radius-lg, 8px);
}

html[data-theme-preset="edge"] .app-header,
html[data-theme-preset="edge"] .admin-header {
    background-image: linear-gradient(105deg, color-mix(in srgb, var(--surface) 92%, #0f6cbd 8%), var(--surface));
}

html[data-theme-preset="edge"] .brand-mark,
html[data-theme-preset="edge"] .user-avatar {
    box-shadow: 0 0 0 4px var(--theme-glow);
}

html[data-theme-preset="graphite"] .app-header,
html[data-theme-preset="graphite"] .admin-header,
html[data-theme-preset="graphite"] .workspace-rail,
html[data-theme-preset="graphite"] .admin-sidebar {
    box-shadow: none;
}

/* Settings professional */
.settings-shell {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px 30px 48px;
}

.settings-overview {
    gap: 16px;
    margin-bottom: 20px;
}

.settings-overview-card {
    position: relative;
    overflow: hidden;
    padding: 20px 22px;
    box-shadow: 0 8px 24px rgba(17, 31, 43, 0.045);
}

.settings-overview-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--accent);
}

.settings-workbench {
    overflow: hidden;
    min-height: 640px;
    box-shadow: 0 18px 50px rgba(17, 31, 43, 0.07);
}

.settings-tabs {
    padding: 18px 14px;
}

.settings-tab {
    min-height: 52px;
    margin-bottom: 5px;
    border-radius: var(--theme-radius, 6px);
    transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.settings-tab:hover {
    transform: translateX(2px);
}

.settings-tab.is-active {
    box-shadow: inset 3px 0 0 var(--accent);
    border-left-color: transparent;
}

.settings-panel {
    padding: 30px 32px 38px;
}

.settings-panel-heading {
    padding: 4px 0 24px;
}

.settings-panel-heading h2 {
    font-size: 24px;
    letter-spacing: -0.025em;
}

.settings-field input,
.settings-field select {
    height: 47px;
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.settings-theme-studio {
    margin-top: 26px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--theme-radius-lg, 10px);
    background: linear-gradient(145deg, var(--surface-secondary), var(--surface));
}

.settings-theme-studio-heading {
    display: grid;
    grid-template-columns: minmax(220px, .75fr) minmax(300px, 1.25fr);
    gap: 26px;
    align-items: end;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.settings-kicker {
    display: block;
    margin-bottom: 6px;
    color: var(--accent);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.settings-theme-studio h3 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
}

.settings-theme-studio-heading p,
.settings-theme-help {
    margin: 0;
    color: var(--text-secondary);
    font-size: 10px;
    line-height: 1.6;
}

.settings-theme-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}

.settings-theme-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.settings-theme-card {
    position: relative;
    min-width: 0;
    min-height: 170px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--theme-radius-lg, 10px);
    background: var(--surface);
    color: var(--text);
    text-align: left;
    transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.settings-theme-card:hover,
.settings-theme-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 10px 26px var(--theme-glow);
}

.settings-theme-card.is-active {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft), 0 12px 28px var(--theme-glow);
}

.settings-theme-card > strong {
    font-size: 12px;
}

.settings-theme-card > small {
    color: var(--text-secondary);
    font-size: 9px;
    line-height: 1.5;
}

.settings-theme-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    opacity: 0;
    transform: scale(.8);
    transition: opacity 120ms ease, transform 120ms ease;
}

.settings-theme-card.is-active .settings-theme-check {
    opacity: 1;
    transform: scale(1);
}

.settings-theme-preview {
    position: relative;
    height: 74px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 28% 1fr;
    grid-template-rows: 22px 1fr;
    border: 1px solid rgba(80, 96, 112, .20);
    border-radius: calc(var(--theme-radius, 6px) + 2px);
}

.settings-theme-preview::before {
    content: "";
    grid-column: 1 / -1;
    background: rgba(255,255,255,.9);
    border-bottom: 1px solid rgba(80,96,112,.15);
}

.settings-theme-preview i {
    grid-row: 2;
    background: rgba(75, 91, 108, .14);
    border-right: 1px solid rgba(80,96,112,.12);
}

.settings-theme-preview b,
.settings-theme-preview em {
    position: absolute;
    left: 36%;
    right: 8%;
    height: 8px;
    border-radius: 5px;
}

.settings-theme-preview b { top: 36px; }
.settings-theme-preview em { top: 52px; width: 38%; }
.settings-theme-preview.is-executive { background: #f4f8f8; }
.settings-theme-preview.is-executive::before { background: #ffffff; box-shadow: inset 4px 0 #0f766e; }
.settings-theme-preview.is-executive b { background: #0f766e; }
.settings-theme-preview.is-executive em { background: #bcded9; }
.settings-theme-preview.is-edge { background: linear-gradient(135deg,#eef7ff,#ffffff); border-radius: 12px; }
.settings-theme-preview.is-edge::before { background: linear-gradient(90deg,#e9f5ff,#ffffff); }
.settings-theme-preview.is-edge b { background: #0f6cbd; }
.settings-theme-preview.is-edge em { background: #a9d8ff; }
.settings-theme-preview.is-graphite { background: #e9eaed; border-radius: 5px; }
.settings-theme-preview.is-graphite::before { background: #2c3138; }
.settings-theme-preview.is-graphite i { background: #cfd3d8; }
.settings-theme-preview.is-graphite b { background: #4d5968; }
.settings-theme-preview.is-graphite em { background: #a7afb9; }

.settings-theme-help {
    margin-top: 12px;
}

.settings-interface-controls {
    margin-top: 20px;
}

.settings-toggle-card {
    transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.settings-toggle-card:has(input:checked) {
    border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
    box-shadow: 0 6px 18px var(--theme-glow);
}

.settings-actions {
    padding: 15px 22px;
}

@media (max-width: 1050px) {
    .settings-theme-grid { grid-template-columns: 1fr; }
    .settings-theme-studio-heading { grid-template-columns: 1fr; gap: 8px; }
}

/* ==========================================================
   AGENTAI CHAT THEME BRIDGE V1
   Chat/Workspace inherits Theme Studio completely.
   ========================================================== */

html[data-theme-preset] .app-body {
    --workspace-purple: var(--surface);
    --workspace-purple-soft: var(--surface-secondary);
    --workspace-purple-hover: var(--surface-tertiary);
    --workspace-focus: var(--theme-glow);
    --workspace-radius: var(--theme-radius);

    background:
        var(--background);
    color:
        var(--text);
}


/* ==========================================================
   HEADER
   ========================================================== */

html[data-theme-preset] .app-header {
    background:
        var(--surface) !important;

    color:
        var(--text) !important;

    border-bottom:
        1px solid
        var(--border) !important;

    box-shadow:
        0 5px 22px
        var(--theme-glow) !important;
}

html[data-theme-preset]
.app-header .brand strong,

html[data-theme-preset]
.app-header .brand span:not(.brand-mark),

html[data-theme-preset]
.app-header .header-user strong,

html[data-theme-preset]
.app-header .header-user span:not(.user-avatar) {
    color:
        var(--text) !important;
}

html[data-theme-preset]
.app-header .brand span:not(.brand-mark),

html[data-theme-preset]
.app-header .header-user span:not(.user-avatar) {
    opacity: .72;
}

html[data-theme-preset]
.app-header .header-user {
    border-left-color:
        var(--border) !important;
}


/* Search */

html[data-theme-preset]
.workspace-search-trigger {
    background:
        var(--surface-secondary) !important;

    color:
        var(--text) !important;

    border:
        1px solid
        var(--border) !important;

    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.workspace-search-trigger:hover,

html[data-theme-preset]
.workspace-search-trigger:focus-visible {
    background:
        var(--accent-soft) !important;

    border-color:
        var(--accent) !important;

    box-shadow:
        0 0 0 3px
        var(--theme-glow) !important;
}

html[data-theme-preset]
.workspace-search-trigger kbd {
    color:
        var(--text-secondary);

    border-color:
        var(--border);
}


/* Header controls */

html[data-theme-preset]
.app-header-actions .theme-button,

html[data-theme-preset]
.app-header-actions .logout-button,

html[data-theme-preset]
.app-header-actions .language-switcher,

html[data-theme-preset]
.app-header-actions select {
    color:
        var(--text) !important;

    background:
        var(--surface-secondary) !important;

    border-color:
        var(--border) !important;

    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.app-header-actions .theme-button:hover,

html[data-theme-preset]
.app-header-actions .logout-button:hover {
    background:
        var(--accent-soft) !important;

    border-color:
        var(--accent) !important;
}


/* ==========================================================
   LEFT WORKSPACE RAIL
   ========================================================== */

html[data-theme-preset]
.workspace-rail {
    background:
        var(--sidebar) !important;

    color:
        var(--text) !important;

    border-right:
        1px solid
        var(--border) !important;
}

html[data-theme-preset]
.workspace-rail-button {
    color:
        var(--text-secondary) !important;

    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.workspace-rail-button:hover {
    background:
        var(--surface-secondary) !important;

    color:
        var(--text) !important;
}

html[data-theme-preset]
.workspace-rail-button.active {
    background:
        var(--accent-soft) !important;

    color:
        var(--accent) !important;
}

html[data-theme-preset]
.workspace-rail-button.active::before {
    background:
        var(--accent) !important;
}

html[data-theme-preset]
.workspace-rail-icon {
    background:
        var(--surface-tertiary) !important;

    color:
        var(--text) !important;

    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.workspace-rail-ai .workspace-rail-icon {
    background:
        var(--accent) !important;

    color:
        #ffffff !important;
}

html[data-theme-preset]
.workspace-rail-avatar:not(.avatar-with-photo) {
    background:
        var(--accent-soft) !important;

    color:
        var(--accent) !important;

    border:
        1px solid
        var(--accent);
}

/*
 * Avatar real:
 * tema nu trebuie sa suprascrie background-image
 * setat dinamic de applyUserAvatar().
 */
html[data-theme-preset]
.workspace-rail-avatar.avatar-with-photo {
    border:
        1px solid
        var(--border-strong) !important;

    color:
        transparent !important;

    background-size:
        cover !important;

    background-position:
        center !important;

    background-repeat:
        no-repeat !important;
}


/* ==========================================================
   CONVERSATION SIDEBAR
   ========================================================== */

html[data-theme-preset]
.sidebar {
    background:
        var(--sidebar) !important;

    color:
        var(--text) !important;

    border-right:
        1px solid
        var(--border) !important;
}

html[data-theme-preset]
.sidebar .nav-heading {
    color:
        var(--text-muted) !important;
}

html[data-theme-preset]
.sidebar .nav-item,

html[data-theme-preset]
.sidebar .conversation-list-item,

html[data-theme-preset]
.workspace-starred-item {
    color:
        var(--text-secondary) !important;

    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.sidebar .nav-item:hover,

html[data-theme-preset]
.sidebar .conversation-list-item:hover,

html[data-theme-preset]
.workspace-starred-item:hover {
    background:
        var(--surface-secondary) !important;

    color:
        var(--text) !important;
}

html[data-theme-preset]
.sidebar .nav-item.active,

html[data-theme-preset]
.sidebar .conversation-list-item.active {
    background:
        var(--accent-soft) !important;

    color:
        var(--accent) !important;

    box-shadow:
        inset 3px 0 0
        var(--accent);
}

html[data-theme-preset]
.workspace-starred-section {
    border-bottom-color:
        var(--border) !important;
}


/* ==========================================================
   CHAT WORKSPACE
   ========================================================== */

html[data-theme-preset]
.workspace {
    background:
        var(--background) !important;
}

html[data-theme-preset]
.conversation-header {
    background:
        var(--surface) !important;

    border-bottom:
        1px solid
        var(--border) !important;
}

html[data-theme-preset]
.conversation-area {
    background:
        var(--background) !important;
}

html[data-theme-preset]
.chat-message {
    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.chat-message:hover {
    background:
        var(--surface-secondary) !important;
}

html[data-theme-preset]
.chat-message::before {
    background:
        var(--surface-tertiary) !important;

    color:
        var(--text) !important;

    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.chat-message.ai-message {
    border-left-color:
        var(--accent) !important;

    background:
        color-mix(
            in srgb,
            var(--accent-soft) 55%,
            transparent
        ) !important;
}

html[data-theme-preset]
.chat-message.ai-message:hover {
    background:
        var(--accent-soft) !important;
}


/* ==========================================================
   COMPOSER
   ========================================================== */

html[data-theme-preset]
.composer {
    background:
        var(--surface) !important;

    border-top:
        1px solid
        var(--border) !important;
}

html[data-theme-preset]
.composer textarea {
    background:
        var(--surface-secondary) !important;

    color:
        var(--text) !important;

    border:
        1px solid
        var(--border) !important;

    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.composer textarea:focus {
    border-color:
        var(--accent) !important;

    box-shadow:
        0 0 0 3px
        var(--theme-glow) !important;
}


/* ==========================================================
   PANELS / ACTIVITY / TASKS / MODALS
   ========================================================== */

html[data-theme-preset]
.workspace-panel,

html[data-theme-preset]
.thread-panel,

html[data-theme-preset]
.workspace-modal-card,

html[data-theme-preset]
.task-card,

html[data-theme-preset]
.activity-item {
    background:
        var(--surface) !important;

    border-color:
        var(--border) !important;
}

html[data-theme-preset]
.workspace-panel-header,

html[data-theme-preset]
.thread-panel-header,

html[data-theme-preset]
.workspace-modal-header {
    background:
        var(--surface-secondary) !important;

    border-color:
        var(--border) !important;
}


/* ==========================================================
   EXECUTIVE
   ========================================================== */

html[data-theme-preset="executive"]
.app-header {
    background:
        linear-gradient(
            105deg,
            var(--surface),
            color-mix(
                in srgb,
                var(--surface) 92%,
                var(--accent) 8%
            )
        ) !important;
}

html[data-theme-preset="executive"]
.workspace-rail {
    background:
        color-mix(
            in srgb,
            var(--sidebar) 94%,
            var(--accent) 6%
        ) !important;
}


/* ==========================================================
   EDGE ANALYST
   ========================================================== */

html[data-theme-preset="edge"]
.app-header {
    background:
        linear-gradient(
            110deg,
            var(--surface),
            color-mix(
                in srgb,
                var(--surface) 82%,
                var(--accent) 18%
            )
        ) !important;

    box-shadow:
        0 7px 26px
        var(--theme-glow) !important;
}

html[data-theme-preset="edge"]
.workspace-rail {
    background:
        color-mix(
            in srgb,
            var(--sidebar) 87%,
            var(--accent) 13%
        ) !important;
}

html[data-theme-preset="edge"]
.sidebar {
    background:
        color-mix(
            in srgb,
            var(--sidebar) 94%,
            var(--accent) 6%
        ) !important;
}

html[data-theme-preset="edge"]
.chat-message.ai-message {
    box-shadow:
        inset 3px 0 0
        var(--accent);
}


/* ==========================================================
   GRAPHITE
   ========================================================== */

html[data-theme-preset="graphite"]
.app-header,

html[data-theme-preset="graphite"]
.workspace-rail,

html[data-theme-preset="graphite"]
.sidebar {
    box-shadow:
        none !important;
}

html[data-theme-preset="graphite"]
.workspace-search-trigger,

html[data-theme-preset="graphite"]
.workspace-rail-button,

html[data-theme-preset="graphite"]
.sidebar .nav-item,

html[data-theme-preset="graphite"]
.sidebar .conversation-list-item,

html[data-theme-preset="graphite"]
.chat-message {
    border-radius:
        4px !important;
}


/* ==========================================================
   TRANSITIONS
   ========================================================== */

html[data-theme-preset]
.app-header,

html[data-theme-preset]
.workspace-rail,

html[data-theme-preset]
.sidebar,

html[data-theme-preset]
.workspace,

html[data-theme-preset]
.conversation-header,

html[data-theme-preset]
.conversation-area,

html[data-theme-preset]
.composer {
    transition:
        background-color 160ms ease,
        color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

/* ==========================================================
   AGENTAI CHAT THEME BRIDGE V1
   Chat/Workspace inherits Theme Studio completely.
   ========================================================== */

html[data-theme-preset] .app-body {
    --workspace-purple: var(--surface);
    --workspace-purple-soft: var(--surface-secondary);
    --workspace-purple-hover: var(--surface-tertiary);
    --workspace-focus: var(--theme-glow);
    --workspace-radius: var(--theme-radius);

    background:
        var(--background);
    color:
        var(--text);
}


/* ==========================================================
   HEADER
   ========================================================== */

html[data-theme-preset] .app-header {
    background:
        var(--surface) !important;

    color:
        var(--text) !important;

    border-bottom:
        1px solid
        var(--border) !important;

    box-shadow:
        0 5px 22px
        var(--theme-glow) !important;
}

html[data-theme-preset]
.app-header .brand strong,

html[data-theme-preset]
.app-header .brand span:not(.brand-mark),

html[data-theme-preset]
.app-header .header-user strong,

html[data-theme-preset]
.app-header .header-user span:not(.user-avatar) {
    color:
        var(--text) !important;
}

html[data-theme-preset]
.app-header .brand span:not(.brand-mark),

html[data-theme-preset]
.app-header .header-user span:not(.user-avatar) {
    opacity: .72;
}

html[data-theme-preset]
.app-header .header-user {
    border-left-color:
        var(--border) !important;
}


/* Search */

html[data-theme-preset]
.workspace-search-trigger {
    background:
        var(--surface-secondary) !important;

    color:
        var(--text) !important;

    border:
        1px solid
        var(--border) !important;

    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.workspace-search-trigger:hover,

html[data-theme-preset]
.workspace-search-trigger:focus-visible {
    background:
        var(--accent-soft) !important;

    border-color:
        var(--accent) !important;

    box-shadow:
        0 0 0 3px
        var(--theme-glow) !important;
}

html[data-theme-preset]
.workspace-search-trigger kbd {
    color:
        var(--text-secondary);

    border-color:
        var(--border);
}


/* Header controls */

html[data-theme-preset]
.app-header-actions .theme-button,

html[data-theme-preset]
.app-header-actions .logout-button,

html[data-theme-preset]
.app-header-actions .language-switcher,

html[data-theme-preset]
.app-header-actions select {
    color:
        var(--text) !important;

    background:
        var(--surface-secondary) !important;

    border-color:
        var(--border) !important;

    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.app-header-actions .theme-button:hover,

html[data-theme-preset]
.app-header-actions .logout-button:hover {
    background:
        var(--accent-soft) !important;

    border-color:
        var(--accent) !important;
}


/* ==========================================================
   LEFT WORKSPACE RAIL
   ========================================================== */

html[data-theme-preset]
.workspace-rail {
    background:
        var(--sidebar) !important;

    color:
        var(--text) !important;

    border-right:
        1px solid
        var(--border) !important;
}

html[data-theme-preset]
.workspace-rail-button {
    color:
        var(--text-secondary) !important;

    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.workspace-rail-button:hover {
    background:
        var(--surface-secondary) !important;

    color:
        var(--text) !important;
}

html[data-theme-preset]
.workspace-rail-button.active {
    background:
        var(--accent-soft) !important;

    color:
        var(--accent) !important;
}

html[data-theme-preset]
.workspace-rail-button.active::before {
    background:
        var(--accent) !important;
}

html[data-theme-preset]
.workspace-rail-icon {
    background:
        var(--surface-tertiary) !important;

    color:
        var(--text) !important;

    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.workspace-rail-ai .workspace-rail-icon {
    background:
        var(--accent) !important;

    color:
        #ffffff !important;
}

html[data-theme-preset]
.workspace-rail-avatar:not(.avatar-with-photo) {
    background:
        var(--accent-soft) !important;

    color:
        var(--accent) !important;

    border:
        1px solid
        var(--accent);
}


/* ==========================================================
   CONVERSATION SIDEBAR
   ========================================================== */

html[data-theme-preset]
.sidebar {
    background:
        var(--sidebar) !important;

    color:
        var(--text) !important;

    border-right:
        1px solid
        var(--border) !important;
}

html[data-theme-preset]
.sidebar .nav-heading {
    color:
        var(--text-muted) !important;
}

html[data-theme-preset]
.sidebar .nav-item,

html[data-theme-preset]
.sidebar .conversation-list-item,

html[data-theme-preset]
.workspace-starred-item {
    color:
        var(--text-secondary) !important;

    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.sidebar .nav-item:hover,

html[data-theme-preset]
.sidebar .conversation-list-item:hover,

html[data-theme-preset]
.workspace-starred-item:hover {
    background:
        var(--surface-secondary) !important;

    color:
        var(--text) !important;
}

html[data-theme-preset]
.sidebar .nav-item.active,

html[data-theme-preset]
.sidebar .conversation-list-item.active {
    background:
        var(--accent-soft) !important;

    color:
        var(--accent) !important;

    box-shadow:
        inset 3px 0 0
        var(--accent);
}

html[data-theme-preset]
.workspace-starred-section {
    border-bottom-color:
        var(--border) !important;
}


/* ==========================================================
   CHAT WORKSPACE
   ========================================================== */

html[data-theme-preset]
.workspace {
    background:
        var(--background) !important;
}

html[data-theme-preset]
.conversation-header {
    background:
        var(--surface) !important;

    border-bottom:
        1px solid
        var(--border) !important;
}

html[data-theme-preset]
.conversation-area {
    background:
        var(--background) !important;
}

html[data-theme-preset]
.chat-message {
    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.chat-message:hover {
    background:
        var(--surface-secondary) !important;
}

html[data-theme-preset]
.chat-message::before {
    background:
        var(--surface-tertiary) !important;

    color:
        var(--text) !important;

    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.chat-message.ai-message {
    border-left-color:
        var(--accent) !important;

    background:
        color-mix(
            in srgb,
            var(--accent-soft) 55%,
            transparent
        ) !important;
}

html[data-theme-preset]
.chat-message.ai-message:hover {
    background:
        var(--accent-soft) !important;
}


/* ==========================================================
   COMPOSER
   ========================================================== */

html[data-theme-preset]
.composer {
    background:
        var(--surface) !important;

    border-top:
        1px solid
        var(--border) !important;
}

html[data-theme-preset]
.composer textarea {
    background:
        var(--surface-secondary) !important;

    color:
        var(--text) !important;

    border:
        1px solid
        var(--border) !important;

    border-radius:
        var(--theme-radius) !important;
}

html[data-theme-preset]
.composer textarea:focus {
    border-color:
        var(--accent) !important;

    box-shadow:
        0 0 0 3px
        var(--theme-glow) !important;
}


/* ==========================================================
   PANELS / ACTIVITY / TASKS / MODALS
   ========================================================== */

html[data-theme-preset]
.workspace-panel,

html[data-theme-preset]
.thread-panel,

html[data-theme-preset]
.workspace-modal-card,

html[data-theme-preset]
.task-card,

html[data-theme-preset]
.activity-item {
    background:
        var(--surface) !important;

    border-color:
        var(--border) !important;
}

html[data-theme-preset]
.workspace-panel-header,

html[data-theme-preset]
.thread-panel-header,

html[data-theme-preset]
.workspace-modal-header {
    background:
        var(--surface-secondary) !important;

    border-color:
        var(--border) !important;
}


/* ==========================================================
   EXECUTIVE
   ========================================================== */

html[data-theme-preset="executive"]
.app-header {
    background:
        linear-gradient(
            105deg,
            var(--surface),
            color-mix(
                in srgb,
                var(--surface) 92%,
                var(--accent) 8%
            )
        ) !important;
}

html[data-theme-preset="executive"]
.workspace-rail {
    background:
        color-mix(
            in srgb,
            var(--sidebar) 94%,
            var(--accent) 6%
        ) !important;
}


/* ==========================================================
   EDGE ANALYST
   ========================================================== */

html[data-theme-preset="edge"]
.app-header {
    background:
        linear-gradient(
            110deg,
            var(--surface),
            color-mix(
                in srgb,
                var(--surface) 82%,
                var(--accent) 18%
            )
        ) !important;

    box-shadow:
        0 7px 26px
        var(--theme-glow) !important;
}

html[data-theme-preset="edge"]
.workspace-rail {
    background:
        color-mix(
            in srgb,
            var(--sidebar) 87%,
            var(--accent) 13%
        ) !important;
}

html[data-theme-preset="edge"]
.sidebar {
    background:
        color-mix(
            in srgb,
            var(--sidebar) 94%,
            var(--accent) 6%
        ) !important;
}

html[data-theme-preset="edge"]
.chat-message.ai-message {
    box-shadow:
        inset 3px 0 0
        var(--accent);
}


/* ==========================================================
   GRAPHITE
   ========================================================== */

html[data-theme-preset="graphite"]
.app-header,

html[data-theme-preset="graphite"]
.workspace-rail,

html[data-theme-preset="graphite"]
.sidebar {
    box-shadow:
        none !important;
}

html[data-theme-preset="graphite"]
.workspace-search-trigger,

html[data-theme-preset="graphite"]
.workspace-rail-button,

html[data-theme-preset="graphite"]
.sidebar .nav-item,

html[data-theme-preset="graphite"]
.sidebar .conversation-list-item,

html[data-theme-preset="graphite"]
.chat-message {
    border-radius:
        4px !important;
}


/* ==========================================================
   TRANSITIONS
   ========================================================== */

html[data-theme-preset]
.app-header,

html[data-theme-preset]
.workspace-rail,

html[data-theme-preset]
.sidebar,

html[data-theme-preset]
.workspace,

html[data-theme-preset]
.conversation-header,

html[data-theme-preset]
.conversation-area,

html[data-theme-preset]
.composer {
    transition:
        background-color 160ms ease,
        color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}
