/* NÓMADAS 2.12. Curated themes and shared component tokens.
   Change --button-bg here for ordinary buttons globally, or override
   --button-bg / --button-fg on a single element. Destructive actions keep
   their own semantic variant; they are not confused with primary actions. */
:root{
 --surface:var(--panel);--surface-raised:#20384D;--surface-input:#102334;--surface-subtle:#1D3346;
 --button-bg:var(--accent);--button-fg:#082934;--button-border:var(--button-bg);
 --button-secondary-bg:var(--surface-raised);--button-secondary-fg:var(--text);
 --danger:#FFACB0;--danger-surface:#502A35;--success:#64DCA2;--success-surface:#193D34;
 --warning:#EDC778;--warning-surface:#473E2C;--focus-ring:var(--accent);
 --nav-bg:#062B40;--nav-ink:#ECF6FC;--nav-muted:#BAD0DD;--nav-line:#47738A;
 --shadow:0 12px 36px #0002;--selected-bg:var(--surface-raised);--selected-ink:var(--accent);
}
:root[data-theme-preset="corporate-light"]{
 --surface-raised:#E7EFF3;--surface-input:#FFFFFF;--surface-subtle:#F3F7F9;
 --button-fg:#FFFFFF;--danger:#9E2735;--danger-surface:#FDECEF;--success:#176745;--success-surface:#E6F3EC;
 --warning:#775213;--warning-surface:#FFF2D6;--nav-bg:#E7EFF3;--nav-ink:#1B3442;--nav-muted:#536A78;--nav-line:#A8BEC9;
}
:root[data-theme-preset="warm-sunset"]{
 --surface-raised:#EEE1D1;--surface-input:#FFFDF9;--surface-subtle:#F8F1E8;
 --button-fg:#FFFFFF;--danger:#9B3435;--danger-surface:#F9E7E2;--success:#35633C;--success-surface:#EAF1E2;
 --warning:#76521B;--warning-surface:#F9EBD0;--nav-bg:#ECE0D1;--nav-ink:#3B3026;--nav-muted:#736151;--nav-line:#C9B49A;
}
:root .app-shell{background:var(--bg);color:var(--text)}
:root[data-theme-preset] .authenticated-shell{--member-side:var(--nav-bg);--member-ink:var(--nav-ink);--member-muted:var(--nav-muted);--member-line:var(--nav-line);--member-active-bg:var(--button-bg);--member-active-ink:var(--button-fg);--member-accent:var(--accent)}
/* The four role-aware navigation blocks: general / contact / personal / admin. */
:root .authenticated-shell .member-navigation>nav+nav{border-top:1px solid var(--nav-line);margin-top:14px;padding-top:14px}
:root .app-shell .workspace .panel,:root .app-shell .workspace .integration-card,:root .app-shell .workspace .tg-group-card{background:var(--surface);color:var(--text);border-color:var(--border)}
:root .app-shell .workspace :is(input,select,textarea){background:var(--surface-input);color:var(--text);border-color:var(--border);box-shadow:none}
:root .app-shell .workspace :is(input,textarea)::placeholder{color:var(--muted);opacity:1}
:root .app-shell .workspace :is(input,select,textarea):focus{border-color:var(--focus-ring);outline:2px solid var(--focus-ring);outline-offset:2px}
:root .app-shell .workspace :is(button,.button){background:var(--button-bg);color:var(--button-fg);border-color:var(--button-border);box-shadow:none;background-image:none}
:root .app-shell .workspace :is(button,.button):hover{filter:brightness(1.06)}
:root .app-shell .workspace :is(button,.button).quiet{background:transparent;color:var(--muted);border-color:transparent}
:root .app-shell .workspace :is(button,.button).danger{--button-bg:var(--danger-surface);--button-fg:var(--danger);--button-border:var(--danger)}
:root .app-shell .workspace :is(button,.button).secondary{--button-bg:var(--button-secondary-bg);--button-fg:var(--button-secondary-fg);--button-border:var(--border)}
:root .app-shell .workspace :is(button,.button):disabled{filter:none;opacity:.45}
:root .app-shell .workspace .tabs button{background:var(--surface-input);color:var(--text);border:1px solid var(--border);border-radius:9px;min-height:44px;font-weight:700}
:root .app-shell .workspace .tabs button:is(.selected,.active,[aria-selected="true"]){background:var(--button-bg);color:var(--button-fg);border-color:var(--button-border)}
:root .app-shell .workspace .tabs button:hover:not(:disabled){border-color:var(--accent)}
:root .app-shell .workspace th{background:var(--surface-raised);color:var(--text)}
:root .app-shell .workspace tbody tr:hover{background:var(--surface-subtle)}
:root .app-shell .workspace :is(label,.muted,small){color:var(--muted)}
:root .app-shell .workspace :is(h1,h2,h3,h4){color:var(--text)}
:root .app-shell .workspace :is(.hint,.callout,.empty,.admin-kpis>div,.stats>div){background:var(--surface-subtle);color:var(--text);border-color:var(--border)}
:root .app-shell .workspace .badge{background:var(--surface-raised);color:var(--text);border-color:var(--border)}
:root .app-shell .workspace :is(.badge.status-success,.badge.status-ok){background:var(--success-surface);color:var(--success)}
:root .app-shell .workspace :is(.badge.status-error,.badge.danger){background:var(--danger-surface);color:var(--danger)}
:root .app-shell .workspace .card-back{background:var(--surface);color:var(--text)}
:root .app-shell .workspace .card-back :is(p,small){color:inherit}
:root .app-shell .workspace :is(.card-code,.front-caption,.front-availability){color:#FFFFFF}
:root .app-shell .workspace .card-code{background:#102334E6}
:root .app-shell .workspace .front-availability{background:#164D3D}
:root .app-shell .workspace .member-session{color:var(--nav-ink)}
:root .app-shell .workspace pre{background:var(--surface-subtle);color:var(--text)}
:root .app-shell .toast{background:var(--surface);color:var(--text);border-color:var(--accent)}
:root .app-shell .toast.error{background:var(--danger-surface);color:var(--danger);border-color:var(--danger)}
:root .app-shell :focus-visible{outline:2px solid var(--focus-ring);outline-offset:3px}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* Definitive palette application; replaces legacy literals without recolouring branding. */
:root[data-theme-preset] .authenticated-shell .sidebar,
:root[data-theme-preset] .authenticated-shell .member-session{background:var(--nav-bg);border-color:var(--nav-line);color:var(--nav-ink)}
:root[data-theme-preset] .authenticated-shell .sidebar nav a{color:var(--nav-ink)}
:root[data-theme-preset] .authenticated-shell .sidebar nav a:hover{background:var(--surface-raised);border-color:var(--nav-line)}
:root[data-theme-preset] .authenticated-shell .sidebar nav a.active{background:var(--button-bg);border-color:var(--button-border);color:var(--button-fg)}
:root[data-theme-preset] .authenticated-shell .sidebar nav a .nav-icon{color:var(--accent)}
:root[data-theme-preset] .authenticated-shell .sidebar nav a.active .nav-icon{color:inherit}
:root .app-shell .workspace label.button{color:var(--button-fg)}
:root .app-shell .workspace .content-detail :is(input,textarea){font-weight:400}
