/*
 * GA1 Design System v2 — fundatia comuna pentru GA1 Core, Inbox, Finance si Hosting.
 * Sursa unica: GA1 Core, https://account.ga1.ro/css/ga1-ds.css?v=<versiune> (docs/design/README.md).
 * CSS simplu, fara build, fara dependinte externe; JS optional: /js/ga1-ds.js (taburi, modal/drawer, toast, selectie).
 *
 * 1. Tokens v2 (--ds-*) + aliasuri pentru numele vechi (--ga1-*), ca orice pagina existenta sa preia noua paleta.
 * 2. Baza modernizata: elementele si clasele vechi (.ga1-card, .ga1-btn, tabel, formular) arata ca v2.
 * 3. Componente .ds-*: cadru, antet de pagina, pagina de inregistrare, tabel de date, carduri, formulare, overlay-uri.
 *
 * Contrast WCAG AA verificat pe ambele teme pentru text (>= 4.5:1) si pentru contururile de focus / controale (>= 3:1).
 */

/* ------------------------------------------------------------------ 1. Tokens */
:root {
    /* Neutre (slate rece) */
    --ds-neutral-0: #ffffff;
    --ds-neutral-25: #fbfcfd;
    --ds-neutral-50: #f6f8fa;
    --ds-neutral-100: #eef1f5;
    --ds-neutral-200: #e2e7ee;
    --ds-neutral-300: #cdd5df;
    --ds-neutral-400: #9aa5b5;
    --ds-neutral-500: #697586;
    --ds-neutral-600: #4b5565;
    --ds-neutral-700: #364152;
    --ds-neutral-800: #202939;
    --ds-neutral-900: #121926;
    --ds-neutral-950: #0b111c;

    /* Accent GA1 (albastru) */
    --ds-accent-50: #eef4ff;
    --ds-accent-100: #dbe7fe;
    --ds-accent-200: #bfd3fe;
    --ds-accent-500: #3b76f6;
    --ds-accent-600: #2563eb;
    --ds-accent-700: #1d4ed8;
    --ds-accent-800: #1e40af;

    /* Semantice */
    --ds-canvas: var(--ds-neutral-50);
    --ds-surface: var(--ds-neutral-0);
    --ds-surface-raised: var(--ds-neutral-0);
    --ds-surface-sunken: var(--ds-neutral-100);
    --ds-surface-hover: var(--ds-neutral-50);
    --ds-border: var(--ds-neutral-200);
    --ds-border-strong: var(--ds-neutral-300);
    --ds-control-border: #8d98a8; /* 3:1 pe alb */
    --ds-text: var(--ds-neutral-900);
    --ds-text-secondary: var(--ds-neutral-600);
    --ds-text-muted: #5d6879; /* 5.6:1 pe alb, 5.2:1 pe canvas */
    --ds-text-disabled: var(--ds-neutral-400);
    --ds-accent: var(--ds-accent-600);
    --ds-accent-hover: var(--ds-accent-700);
    --ds-accent-subtle: var(--ds-accent-50);
    --ds-accent-subtle-text: var(--ds-accent-700);
    --ds-on-accent: #ffffff;
    --ds-link: var(--ds-accent-700);

    --ds-success: #15803d;
    --ds-success-subtle: #e9f7ee;
    --ds-success-text: #166534;
    --ds-warning: #b45309;
    --ds-warning-subtle: #fff5e5;
    --ds-warning-text: #92400e;
    --ds-danger: #c42b2b;
    --ds-danger-hover: #a51f1f;
    --ds-danger-subtle: #fdeeee;
    --ds-danger-text: #a51f1f;
    --ds-info: #0369a1;
    --ds-info-subtle: #e8f4fb;
    --ds-info-text: #075985;

    --ds-overlay: rgb(11 17 28 / 0.5);
    --ds-focus: 0 0 0 2px var(--ds-surface), 0 0 0 4px var(--ds-accent);

    /* Tipografie */
    --ds-font-sans: 'Urbanist', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ds-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --ds-text-xs: 12px;
    --ds-text-sm: 13px;
    --ds-text-md: 14px;
    --ds-text-lg: 16px;
    --ds-text-xl: 18px;
    --ds-text-2xl: 22px;
    --ds-text-3xl: 28px;
    --ds-text-4xl: 34px;
    --ds-leading-tight: 1.25;
    --ds-leading: 1.5;
    --ds-weight-regular: 500;
    --ds-weight-medium: 600;
    --ds-weight-bold: 700;
    --ds-weight-heavy: 800;

    /* Spatiere: scara de 4px */
    --ds-space-0: 0;
    --ds-space-1: 4px;
    --ds-space-2: 8px;
    --ds-space-3: 12px;
    --ds-space-4: 16px;
    --ds-space-5: 20px;
    --ds-space-6: 24px;
    --ds-space-7: 28px;
    --ds-space-8: 32px;
    --ds-space-10: 40px;
    --ds-space-12: 48px;
    --ds-space-16: 64px;

    /* Raze */
    --ds-radius-xs: 4px;
    --ds-radius-sm: 6px;
    --ds-radius-md: 8px;
    --ds-radius-lg: 12px;
    --ds-radius-xl: 16px;
    --ds-radius-full: 999px;

    /* Umbre */
    --ds-shadow-xs: 0 1px 2px rgb(16 24 40 / 0.05);
    --ds-shadow-sm: 0 1px 3px rgb(16 24 40 / 0.08), 0 1px 2px rgb(16 24 40 / 0.04);
    --ds-shadow-md: 0 4px 10px -2px rgb(16 24 40 / 0.08), 0 2px 4px -2px rgb(16 24 40 / 0.05);
    --ds-shadow-lg: 0 14px 28px -6px rgb(16 24 40 / 0.14), 0 4px 8px -4px rgb(16 24 40 / 0.06);
    --ds-shadow-overlay: 0 24px 56px -12px rgb(16 24 40 / 0.28);

    /* Dimensiuni de control si cadru */
    --ds-control-sm: 32px;
    --ds-control-md: 38px;
    --ds-control-lg: 44px;
    --ds-header-height: 60px;
    --ds-side-width: 248px;
    --ds-side-rail: 68px;
    --ds-content-max: 1320px;
    --ds-duration: 160ms;
    --ds-ease: cubic-bezier(0.2, 0, 0, 1);

    /* ---- Aliasuri: numele vechi (ga1-tokens.css, ga1-shell.css) trimit la v2 ---- */
    --ga1-font-sans: var(--ds-font-sans);
    --ga1-font-mono: var(--ds-font-mono);
    --ga1-gray-50: var(--ds-neutral-50);
    --ga1-gray-100: var(--ds-neutral-100);
    --ga1-gray-200: var(--ds-neutral-200);
    --ga1-gray-300: var(--ds-neutral-300);
    --ga1-gray-400: var(--ds-neutral-400);
    --ga1-gray-500: var(--ds-neutral-500);
    --ga1-gray-600: var(--ds-neutral-600);
    --ga1-gray-700: var(--ds-neutral-700);
    --ga1-gray-800: var(--ds-neutral-800);
    --ga1-gray-900: var(--ds-neutral-900);
    --ga1-gray-950: var(--ds-neutral-950);
    --ga1-accent: var(--ds-accent);
    --ga1-accent-strong: var(--ds-accent-hover);
    --ga1-on-accent: var(--ds-on-accent);
    --ga1-success: var(--ds-success);
    --ga1-warning: var(--ds-warning);
    --ga1-danger: var(--ds-danger);
    --ga1-info: var(--ds-info);
    --ga1-bg: var(--ds-surface);
    --ga1-surface: var(--ds-canvas);
    --ga1-border: var(--ds-border);
    --ga1-text: var(--ds-text);
    --ga1-text-muted: var(--ds-text-muted);
    --ga1-focus-ring: var(--ds-focus);
    --ga1-radius-sm: var(--ds-radius-sm);
    --ga1-radius: var(--ds-radius-md);
    --ga1-radius-lg: var(--ds-radius-lg);
    --ga1-space-1: var(--ds-space-1);
    --ga1-space-2: var(--ds-space-2);
    --ga1-space-3: var(--ds-space-3);
    --ga1-space-4: var(--ds-space-4);
    --ga1-space-5: var(--ds-space-5);
    --ga1-space-6: var(--ds-space-6);
    --ga1-space-8: var(--ds-space-8);
    --ga1-header-height: var(--ds-header-height);
    --ga1-shell-side: var(--ds-side-width);
    --ga1-shell-rail: var(--ds-side-rail);
    --ga1-tile-bg: var(--ds-neutral-100);
    --ga1-tile-fg: var(--ds-neutral-700);
    --ga1-tile-blue-bg: var(--ds-accent-subtle);
    --ga1-tile-blue-fg: var(--ds-accent-subtle-text);
    --ga1-active-bg: var(--ds-accent-subtle);
    --ga1-active-fg: var(--ds-accent-subtle-text);
    --ga1-hover-bg: var(--ds-neutral-100);
    --ga1-panel-shadow: var(--ds-shadow-overlay);
}

/* Tema intunecata: preferinta sistemului (fara clasa .light) sau fortata cu .dark pe <html>. */
@media (prefers-color-scheme: dark) {
    :root:not(.light) {
        --ds-canvas: #0b111c;
        --ds-surface: #121a27;
        --ds-surface-raised: #182233;
        --ds-surface-sunken: #0e1521;
        --ds-surface-hover: #1a2537;
        --ds-border: #243044;
        --ds-border-strong: #33415a;
        --ds-control-border: #5b6a82;
        --ds-text: #eef2f7;
        --ds-text-secondary: #c3ccd8;
        --ds-text-muted: #9aa7b9;
        --ds-text-disabled: #5b6a82;
        --ds-accent: #6aa1ff;
        --ds-accent-hover: #8db6ff;
        --ds-accent-subtle: #15284a;
        --ds-accent-subtle-text: #a9c8ff;
        --ds-on-accent: #0b111c;
        --ds-link: #8db6ff;
        --ds-success: #4ade80;
        --ds-success-subtle: #0f2a1b;
        --ds-success-text: #86efac;
        --ds-warning: #fbbf24;
        --ds-warning-subtle: #2c2110;
        --ds-warning-text: #fcd34d;
        --ds-danger: #f87171;
        --ds-danger-hover: #fca5a5;
        --ds-danger-subtle: #301616;
        --ds-danger-text: #fca5a5;
        --ds-info: #38bdf8;
        --ds-info-subtle: #0c2636;
        --ds-info-text: #7dd3fc;
        --ds-overlay: rgb(0 0 0 / 0.62);
        --ds-shadow-xs: 0 1px 2px rgb(0 0 0 / 0.4);
        --ds-shadow-sm: 0 1px 3px rgb(0 0 0 / 0.45);
        --ds-shadow-md: 0 4px 12px rgb(0 0 0 / 0.45);
        --ds-shadow-lg: 0 14px 30px rgb(0 0 0 / 0.5);
        --ds-shadow-overlay: 0 24px 60px rgb(0 0 0 / 0.6);
        --ga1-tile-bg: #1a2537;
        --ga1-tile-fg: #c3ccd8;
        --ga1-hover-bg: #1a2537;
    }
}
:root.dark {
    --ds-canvas: #0b111c;
    --ds-surface: #121a27;
    --ds-surface-raised: #182233;
    --ds-surface-sunken: #0e1521;
    --ds-surface-hover: #1a2537;
    --ds-border: #243044;
    --ds-border-strong: #33415a;
    --ds-control-border: #5b6a82;
    --ds-text: #eef2f7;
    --ds-text-secondary: #c3ccd8;
    --ds-text-muted: #9aa7b9;
    --ds-text-disabled: #5b6a82;
    --ds-accent: #6aa1ff;
    --ds-accent-hover: #8db6ff;
    --ds-accent-subtle: #15284a;
    --ds-accent-subtle-text: #a9c8ff;
    --ds-on-accent: #0b111c;
    --ds-link: #8db6ff;
    --ds-success: #4ade80;
    --ds-success-subtle: #0f2a1b;
    --ds-success-text: #86efac;
    --ds-warning: #fbbf24;
    --ds-warning-subtle: #2c2110;
    --ds-warning-text: #fcd34d;
    --ds-danger: #f87171;
    --ds-danger-hover: #fca5a5;
    --ds-danger-subtle: #301616;
    --ds-danger-text: #fca5a5;
    --ds-info: #38bdf8;
    --ds-info-subtle: #0c2636;
    --ds-info-text: #7dd3fc;
    --ds-overlay: rgb(0 0 0 / 0.62);
    --ds-shadow-xs: 0 1px 2px rgb(0 0 0 / 0.4);
    --ds-shadow-sm: 0 1px 3px rgb(0 0 0 / 0.45);
    --ds-shadow-md: 0 4px 12px rgb(0 0 0 / 0.45);
    --ds-shadow-lg: 0 14px 30px rgb(0 0 0 / 0.5);
    --ds-shadow-overlay: 0 24px 60px rgb(0 0 0 / 0.6);
    --ga1-tile-bg: #1a2537;
    --ga1-tile-fg: #c3ccd8;
    --ga1-hover-bg: #1a2537;
}
:root.light { color-scheme: light; }
:root.dark { color-scheme: dark; }

/* ------------------------------------------------------------------ 2. Baza */
body {
    background: var(--ds-canvas);
    color: var(--ds-text);
    font-family: var(--ds-font-sans);
    font-size: var(--ds-text-md);
    font-weight: var(--ds-weight-regular);
    line-height: var(--ds-leading);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--ds-link); }
:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; box-shadow: none; }
h1, h2, h3, h4 { color: var(--ds-text); font-weight: var(--ds-weight-heavy); letter-spacing: -0.015em; }
h1 { font-size: var(--ds-text-3xl); line-height: var(--ds-leading-tight); }
h2 { font-size: var(--ds-text-xl); line-height: var(--ds-leading-tight); }
h3 { font-size: var(--ds-text-lg); line-height: var(--ds-leading-tight); margin: 0 0 var(--ds-space-2); }
::selection { background: var(--ds-accent-100); color: var(--ds-neutral-900); }

/* Cadrul de continut din shell: mai lat, aerisit, fundal canvas */
/* Coloana meniului continua alba (cu linia ei) si sub meniul sticky, pe paginile lungi */
.ga1-shell { --ds-rail-w: var(--ga1-shell-side); background: linear-gradient(to right, var(--ds-surface) calc(var(--ds-rail-w) - 1px), var(--ds-border) calc(var(--ds-rail-w) - 1px), var(--ds-border) var(--ds-rail-w), var(--ds-canvas) var(--ds-rail-w)); }
.ga1-shell:has(> .ga1-rail-toggle:checked) { --ds-rail-w: var(--ga1-shell-rail); }
.ga1-main.ga1-shell-main { max-width: var(--ds-content-max); padding: var(--ds-space-6) var(--ds-space-8) var(--ds-space-12); }
.ga1-stack > * + * { margin-top: var(--ds-space-5); }
.ga1-muted { color: var(--ds-text-muted); }

/* Clasele vechi, in stilul v2 */
.ga1-card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-xs);
    padding: var(--ds-space-5) var(--ds-space-6);
}
.ga1-card > h2:first-child { font-size: var(--ds-text-lg); margin-bottom: var(--ds-space-3); }
.ga1-app { border-radius: var(--ds-radius-lg); background: var(--ds-surface); box-shadow: var(--ds-shadow-xs); transition: border-color var(--ds-duration) var(--ds-ease), box-shadow var(--ds-duration) var(--ds-ease); }
.ga1-app:hover { border-color: var(--ds-accent-200); box-shadow: var(--ds-shadow-md); }

.ga1-btn, .ds-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--ds-space-2);
    min-height: var(--ds-control-md); padding: 0 var(--ds-space-4);
    border: 1px solid transparent; border-radius: var(--ds-radius-md);
    background: var(--ds-accent); color: var(--ds-on-accent);
    font: inherit; font-size: var(--ds-text-md); font-weight: var(--ds-weight-bold); line-height: 1.2; white-space: nowrap;
    box-shadow: var(--ds-shadow-xs); cursor: pointer; text-decoration: none;
    transition: background-color var(--ds-duration) var(--ds-ease), border-color var(--ds-duration) var(--ds-ease), color var(--ds-duration) var(--ds-ease);
}
.ga1-btn:hover, .ds-btn:hover { background: var(--ds-accent-hover); color: var(--ds-on-accent); text-decoration: none; }
.ga1-btn-secondary, .ds-btn--secondary { background: var(--ds-surface); color: var(--ds-text); border-color: var(--ds-border-strong); }
.ga1-btn-secondary:hover, .ds-btn--secondary:hover { background: var(--ds-surface-hover); color: var(--ds-text); border-color: var(--ds-control-border); }
.ga1-btn-danger, .ds-btn--danger-outline { background: var(--ds-surface); color: var(--ds-danger-text); border-color: var(--ds-border-strong); }
.ga1-btn-danger:hover, .ds-btn--danger-outline:hover { background: var(--ds-danger-subtle); color: var(--ds-danger-text); border-color: var(--ds-danger); }
.ds-btn--danger { background: var(--ds-danger); color: #fff; }
.ds-btn--danger:hover { background: var(--ds-danger-hover); color: #fff; }
.ds-btn--ghost { background: transparent; color: var(--ds-text-secondary); box-shadow: none; }
.ds-btn--ghost:hover { background: var(--ds-surface-sunken); color: var(--ds-text); }
.ds-btn--sm { min-height: var(--ds-control-sm); padding: 0 var(--ds-space-3); font-size: var(--ds-text-sm); }
.ds-btn--lg { min-height: var(--ds-control-lg); padding: 0 var(--ds-space-5); font-size: var(--ds-text-lg); }
.ds-btn--icon { width: var(--ds-control-md); padding: 0; }
.ds-btn--icon.ds-btn--sm { width: var(--ds-control-sm); }
.ga1-btn-block, .ds-btn--block { width: 100%; }
.ga1-btn:disabled, .ds-btn:disabled, .ds-btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.ds-btn .ga1-icon, .ds-btn .ds-icon { flex-shrink: 0; }

input, select, textarea { font-size: var(--ds-text-md); }
input:where(:not([type="checkbox"], [type="radio"], [type="file"], [type="color"], [type="range"])), select, textarea {
    min-height: var(--ds-control-md); padding: 0 var(--ds-space-3);
    background: var(--ds-surface); color: var(--ds-text);
    border: 1px solid var(--ds-control-border); border-radius: var(--ds-radius-md);
    transition: border-color var(--ds-duration) var(--ds-ease), box-shadow var(--ds-duration) var(--ds-ease);
}
textarea { padding: var(--ds-space-2) var(--ds-space-3); line-height: var(--ds-leading); }
input:where(:hover:not(:focus, :disabled)), select:where(:hover:not(:focus, :disabled)), textarea:where(:hover:not(:focus, :disabled)) { border-color: var(--ds-neutral-500); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ds-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-accent) 28%, transparent); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--ds-danger); }
input:disabled, select:disabled, textarea:disabled { background: var(--ds-surface-sunken); color: var(--ds-text-disabled); cursor: not-allowed; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ds-accent); width: 16px; height: 16px; }
::placeholder { color: var(--ds-neutral-500); opacity: 1; }
.ga1-field label { font-size: var(--ds-text-sm); font-weight: var(--ds-weight-bold); color: var(--ds-text-secondary); }

.ga1-badge {
    display: inline-flex; align-items: center; gap: var(--ds-space-1);
    padding: 1px var(--ds-space-2); border: 1px solid transparent; border-radius: var(--ds-radius-full);
    background: var(--ds-surface-sunken); color: var(--ds-text-secondary);
    font-size: var(--ds-text-xs); font-weight: var(--ds-weight-bold); line-height: 18px; white-space: nowrap;
}
.ga1-badge-ok { background: var(--ds-success-subtle); color: var(--ds-success-text); border-color: transparent; }
.ga1-badge-warn { background: var(--ds-warning-subtle); color: var(--ds-warning-text); border-color: transparent; }

.ga1-alert {
    display: block; padding: var(--ds-space-3) var(--ds-space-4);
    border: 1px solid var(--ds-border); border-left-width: 4px; border-radius: var(--ds-radius-md);
    background: var(--ds-surface); color: var(--ds-text); font-size: var(--ds-text-md);
}
.ga1-alert-ok { border-color: var(--ds-success); background: var(--ds-success-subtle); color: var(--ds-success-text); }
.ga1-alert-error { border-color: var(--ds-danger); background: var(--ds-danger-subtle); color: var(--ds-danger-text); }

table { font-size: var(--ds-text-md); }
th, td { padding: var(--ds-space-3) var(--ds-space-3); border-bottom: 1px solid var(--ds-border); }
th { font-size: var(--ds-text-xs); font-weight: var(--ds-weight-heavy); color: var(--ds-text-muted); background: var(--ds-neutral-25); letter-spacing: 0.05em; }
.ga1-table-wrap { border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-surface); }
.ga1-table-wrap tbody tr:last-child td { border-bottom: 0; }
.ga1-table-wrap tbody tr:hover td { background: var(--ds-surface-hover); }
code, .ga1-mono { font-family: var(--ds-font-mono); font-size: 0.92em; }
:not(pre) > code { padding: 1px 5px; border-radius: var(--ds-radius-xs); background: var(--ds-surface-sunken); }

.ga1-page-head { margin-bottom: var(--ds-space-5); }
.ga1-page-head h1 { font-size: var(--ds-text-3xl); }
.ga1-kicker { color: var(--ds-accent-subtle-text); font-size: var(--ds-text-xs); }
.ga1-kicker a { color: inherit; }

/* Lista de branduri (folosita si in /design) */
.ga1-brand-item { border-radius: var(--ds-radius-lg); background: var(--ds-surface); }
.ga1-brand-item:hover { box-shadow: var(--ds-shadow-md); }
.ga1-footer { color: var(--ds-text-muted); font-size: var(--ds-text-sm); }

/* Shell: rafinari v2 (doar valori, structura ramane in ga1-shell.css) */
.ga1-header { height: var(--ds-header-height); background: var(--ds-surface); border-bottom: 1px solid var(--ds-border); box-shadow: var(--ds-shadow-xs); }
.ga1-search { height: var(--ds-control-md); border-radius: var(--ds-radius-md); background: var(--ds-surface-sunken); border-color: transparent; }
.ga1-search:focus-within { background: var(--ds-surface); border-color: var(--ds-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-accent) 28%, transparent); }
.ga1-search input:not([type="checkbox"]) { min-height: 0; border: 0; background: transparent; padding: 0; box-shadow: none; }
.ga1-icon-btn, .ga1-profile > summary { height: var(--ds-control-md); border-radius: var(--ds-radius-md); }
.ga1-menu-panel { background: var(--ds-surface-raised); border-radius: var(--ds-radius-lg); }
.ga1-side { background: var(--ds-surface); padding: var(--ds-space-3) var(--ds-space-2); }
.ga1-side-link, .ga1-rail-btn { min-height: 36px; border-radius: var(--ds-radius-md); color: var(--ds-text-secondary); font-weight: var(--ds-weight-medium); }
.ga1-side-link:hover { color: var(--ds-text); }
.ga1-side-link.is-active { position: relative; background: var(--ds-accent-subtle); color: var(--ds-accent-subtle-text); font-weight: var(--ds-weight-heavy); box-shadow: none; }
.ga1-side-link.is-active::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ds-accent); }
.ga1-side-link.is-active .ga1-tile { background: var(--ds-surface); color: var(--ds-accent-subtle-text); }
.ga1-side-link.is-active .ga1-side-app { color: var(--ds-accent-subtle-text); }
.ga1-tile { border-radius: var(--ds-radius-md); }
.ga1-side-label { color: var(--ds-text-muted); font-size: 11px; }
.ga1-tabbar { background: var(--ds-surface); }
.ga1-tabbar > a.is-active, .ga1-more[open] > summary { color: var(--ds-accent); }
.ga1-sheet-link.is-active { color: var(--ds-accent); }

/* ------------------------------------------------------------------ 3. Componente */
.ds-icon { flex-shrink: 0; vertical-align: middle; }
.ds-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ds-skip-link { position: absolute; left: var(--ds-space-4); top: -100px; z-index: 200; padding: var(--ds-space-2) var(--ds-space-4); border-radius: var(--ds-radius-md); background: var(--ds-accent); color: var(--ds-on-accent); font-weight: var(--ds-weight-bold); }
.ds-skip-link:focus { top: var(--ds-space-2); }

/* Utilitare de layout */
.ds-stack { display: flex; flex-direction: column; gap: var(--ds-space-4); }
.ds-stack--lg { gap: var(--ds-space-6); }
.ds-stack--sm { gap: var(--ds-space-2); }
.ds-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); }
.ds-spread { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-3); }
.ds-grid { display: grid; gap: var(--ds-space-4); grid-template-columns: repeat(auto-fill, minmax(var(--ds-grid-min, 240px), 1fr)); }
.ds-grid--kpi { --ds-grid-min: 200px; }
.ds-muted { color: var(--ds-text-muted); }
.ds-text-sm { font-size: var(--ds-text-sm); }
.ds-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ds-divider { height: 1px; margin: var(--ds-space-4) 0; border: 0; background: var(--ds-border); }

/* Antet de pagina: breadcrumb, titlu, actiuni */
.ds-page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--ds-space-4); margin-bottom: var(--ds-space-6); }
.ds-page-header__main { display: flex; align-items: center; gap: var(--ds-space-4); min-width: 0; flex: 1 1 320px; }
.ds-page-header__text { min-width: 0; }
.ds-page-header__title { margin: 0; font-size: var(--ds-text-3xl); font-weight: var(--ds-weight-heavy); line-height: var(--ds-leading-tight); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.ds-page-header__description { margin: var(--ds-space-1) 0 0; color: var(--ds-text-muted); font-size: var(--ds-text-md); max-width: 72ch; }
.ds-page-header__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); }
.ds-breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-1); margin: 0 0 var(--ds-space-2); padding: 0; list-style: none; font-size: var(--ds-text-sm); font-weight: var(--ds-weight-medium); color: var(--ds-text-muted); }
.ds-breadcrumb li { display: inline-flex; align-items: center; gap: var(--ds-space-1); }
.ds-breadcrumb li + li::before { content: ""; width: 6px; height: 6px; margin: 0 var(--ds-space-1); border-top: 1.5px solid var(--ds-neutral-400); border-right: 1.5px solid var(--ds-neutral-400); transform: rotate(45deg); }
.ds-breadcrumb a { color: var(--ds-text-muted); }
.ds-breadcrumb a:hover { color: var(--ds-link); }
.ds-breadcrumb [aria-current="page"] { color: var(--ds-text); }

/* Card */
.ds-card { display: flex; flex-direction: column; min-width: 0; background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-xs); }
.ds-card__header { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-3); min-height: 52px; padding: var(--ds-space-3) var(--ds-space-5); border-bottom: 1px solid var(--ds-border); }
.ds-card__title { display: flex; align-items: center; gap: var(--ds-space-2); margin: 0; font-size: var(--ds-text-lg); font-weight: var(--ds-weight-heavy); }
.ds-card__subtitle { margin: 2px 0 0; color: var(--ds-text-muted); font-size: var(--ds-text-sm); font-weight: var(--ds-weight-regular); }
.ds-card__body { padding: var(--ds-space-5); }
.ds-card__body--flush { padding: 0; }
.ds-card__footer { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-3); padding: var(--ds-space-3) var(--ds-space-5); border-top: 1px solid var(--ds-border); background: var(--ds-neutral-25); border-radius: 0 0 var(--ds-radius-lg) var(--ds-radius-lg); font-size: var(--ds-text-sm); }
:root.dark .ds-card__footer { background: var(--ds-surface-sunken); }
@media (prefers-color-scheme: dark) { :root:not(.light) .ds-card__footer, :root:not(.light) th { background: var(--ds-surface-sunken); } }
:root.dark th { background: var(--ds-surface-sunken); }
.ds-card--interactive { color: inherit; transition: box-shadow var(--ds-duration) var(--ds-ease), border-color var(--ds-duration) var(--ds-ease), transform var(--ds-duration) var(--ds-ease); }
.ds-card--interactive:hover { border-color: var(--ds-accent-200); box-shadow: var(--ds-shadow-md); text-decoration: none; color: inherit; }

/* KPI */
.ds-kpi { display: flex; flex-direction: column; gap: var(--ds-space-1); padding: var(--ds-space-4) var(--ds-space-5); background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-xs); color: inherit; }
a.ds-kpi:hover { border-color: var(--ds-accent-200); box-shadow: var(--ds-shadow-md); text-decoration: none; color: inherit; }
.ds-kpi__label { display: flex; align-items: center; gap: var(--ds-space-2); color: var(--ds-text-muted); font-size: var(--ds-text-sm); font-weight: var(--ds-weight-bold); }
.ds-kpi__value { font-size: var(--ds-text-3xl); font-weight: var(--ds-weight-heavy); line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ds-kpi__meta { color: var(--ds-text-muted); font-size: var(--ds-text-sm); }
.ds-trend { display: inline-flex; align-items: center; gap: 2px; font-weight: var(--ds-weight-bold); }
.ds-trend--up { color: var(--ds-success-text); }
.ds-trend--down { color: var(--ds-danger-text); }

/* Badge / stare */
.ds-badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px var(--ds-space-2); border-radius: var(--ds-radius-full); background: var(--ds-surface-sunken); color: var(--ds-text-secondary); font-size: var(--ds-text-xs); font-weight: var(--ds-weight-bold); line-height: 18px; white-space: nowrap; }
.ds-badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ds-badge--accent { background: var(--ds-accent-subtle); color: var(--ds-accent-subtle-text); }
.ds-badge--success { background: var(--ds-success-subtle); color: var(--ds-success-text); }
.ds-badge--warning { background: var(--ds-warning-subtle); color: var(--ds-warning-text); }
.ds-badge--danger { background: var(--ds-danger-subtle); color: var(--ds-danger-text); }
.ds-badge--info { background: var(--ds-info-subtle); color: var(--ds-info-text); }
.ds-badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--ds-border-strong); }
.ds-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--ds-radius-full); background: var(--ds-surface-sunken); color: var(--ds-text-secondary); font-size: var(--ds-text-xs); font-weight: var(--ds-weight-heavy); font-variant-numeric: tabular-nums; }

/* Avatar */
.ds-avatar { --ds-avatar: 32px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: var(--ds-avatar); height: var(--ds-avatar); overflow: hidden; border-radius: var(--ds-radius-full); background: var(--ds-accent-subtle); color: var(--ds-accent-subtle-text); font-size: calc(var(--ds-avatar) * 0.38); font-weight: var(--ds-weight-heavy); line-height: 1; text-transform: uppercase; }
.ds-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ds-avatar--square { border-radius: var(--ds-radius-md); }
.ds-avatar--xs { --ds-avatar: 20px; }
.ds-avatar--sm { --ds-avatar: 24px; }
.ds-avatar--lg { --ds-avatar: 44px; }
.ds-avatar--xl { --ds-avatar: 56px; border-radius: var(--ds-radius-lg); }
.ds-avatar--xl:not(.ds-avatar--round) { border-radius: var(--ds-radius-lg); }
.ds-avatar[style*="--ds-avatar-bg"] { background: var(--ds-avatar-bg); color: #fff; }
.ds-avatar-group { display: inline-flex; }
.ds-avatar-group .ds-avatar { box-shadow: 0 0 0 2px var(--ds-surface); }
.ds-avatar-group .ds-avatar + .ds-avatar { margin-left: -8px; }

/* Pagina de inregistrare (stil Lightning): highlights + taburi + coloana cu liste corelate */
.ds-highlights { margin-bottom: var(--ds-space-5); background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-sm); }
.ds-highlights__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ds-space-4); padding: var(--ds-space-5) var(--ds-space-6); }
.ds-highlights__identity { display: flex; align-items: center; gap: var(--ds-space-4); min-width: 0; flex: 1 1 320px; }
.ds-highlights__object { margin: 0; color: var(--ds-text-muted); font-size: var(--ds-text-xs); font-weight: var(--ds-weight-heavy); letter-spacing: 0.06em; text-transform: uppercase; }
.ds-highlights__title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); margin: 2px 0 0; font-size: var(--ds-text-2xl); font-weight: var(--ds-weight-heavy); line-height: var(--ds-leading-tight); overflow-wrap: anywhere; }
.ds-highlights__actions { display: flex; flex-wrap: wrap; gap: var(--ds-space-2); }
.ds-highlights__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: 0; padding: var(--ds-space-3) var(--ds-space-6) var(--ds-space-4); border-top: 1px solid var(--ds-border); }
.ds-highlights__fields > div { min-width: 0; padding: var(--ds-space-1) var(--ds-space-4) var(--ds-space-1) 0; }
.ds-highlights__fields dt { color: var(--ds-text-muted); font-size: var(--ds-text-xs); font-weight: var(--ds-weight-bold); }
.ds-highlights__fields dd { margin: 2px 0 0; font-size: var(--ds-text-md); font-weight: var(--ds-weight-bold); overflow-wrap: anywhere; }
.ds-path { display: flex; gap: 2px; padding: 0 var(--ds-space-6) var(--ds-space-4); }

.ds-record { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--ds-space-5); align-items: start; }
.ds-record__main { min-width: 0; }
.ds-record__aside { display: flex; flex-direction: column; gap: var(--ds-space-4); min-width: 0; }

/* Taburi (ARIA tabs prin ga1-ds.js; fara JS se vad toate panourile, unul sub altul) */
.ds-tabs { background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-xs); }
.ds-tabs__list { display: flex; gap: var(--ds-space-1); padding: 0 var(--ds-space-4); overflow-x: auto; border-bottom: 1px solid var(--ds-border); scrollbar-width: thin; }
.ds-tabs__tab { position: relative; display: inline-flex; align-items: center; gap: var(--ds-space-2); min-height: 48px; padding: 0 var(--ds-space-3); border: 0; background: none; color: var(--ds-text-muted); font: inherit; font-size: var(--ds-text-md); font-weight: var(--ds-weight-bold); white-space: nowrap; cursor: pointer; text-decoration: none; }
.ds-tabs__tab:hover { color: var(--ds-text); text-decoration: none; }
.ds-tabs__tab[aria-selected="true"] { color: var(--ds-accent-subtle-text); }
.ds-tabs__tab[aria-selected="true"]::after { content: ""; position: absolute; left: var(--ds-space-2); right: var(--ds-space-2); bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--ds-accent); }
.ds-tabs__tab:focus-visible { outline-offset: -4px; }
.ds-tabs__panel { padding: var(--ds-space-5); }
.ds-tabs__panel + .ds-tabs__panel { border-top: 1px solid var(--ds-border); }
.ds-tabs[data-ds-ready] .ds-tabs__panel + .ds-tabs__panel { border-top: 0; }
.ds-tabs__panel > h2.ds-tabs__fallback-title { font-size: var(--ds-text-lg); }
.ds-tabs[data-ds-ready] .ds-tabs__fallback-title { display: none; }
.ds-section + .ds-section { margin-top: var(--ds-space-6); padding-top: var(--ds-space-6); border-top: 1px solid var(--ds-border); }
.ds-section__title { margin: 0 0 var(--ds-space-1); font-size: var(--ds-text-lg); }
.ds-section__description { margin: 0 0 var(--ds-space-4); color: var(--ds-text-muted); font-size: var(--ds-text-sm); }

/* Detalii cheie / valoare */
.ds-details { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 var(--ds-space-6); margin: 0; }
.ds-details > div { padding: var(--ds-space-2) 0; border-bottom: 1px solid var(--ds-border); }
.ds-details dt { color: var(--ds-text-muted); font-size: var(--ds-text-xs); font-weight: var(--ds-weight-bold); }
.ds-details dd { margin: 2px 0 0; overflow-wrap: anywhere; }

/* Lista corelata (related list) */
.ds-related { background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-xs); }
.ds-related__header { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-2); padding: var(--ds-space-3) var(--ds-space-4); border-bottom: 1px solid var(--ds-border); }
.ds-related__title { display: flex; align-items: center; gap: var(--ds-space-2); margin: 0; font-size: var(--ds-text-md); font-weight: var(--ds-weight-heavy); }
.ds-related__list { margin: 0; padding: var(--ds-space-1) 0; list-style: none; }
.ds-related__item { display: flex; align-items: center; gap: var(--ds-space-3); padding: var(--ds-space-2) var(--ds-space-4); color: var(--ds-text); min-width: 0; }
a.ds-related__item:hover { background: var(--ds-surface-hover); text-decoration: none; color: var(--ds-text); }
.ds-related__item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ds-related__item-text strong { font-weight: var(--ds-weight-bold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-related__item-text small { color: var(--ds-text-muted); font-size: var(--ds-text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-related__empty { margin: 0; padding: var(--ds-space-4); color: var(--ds-text-muted); font-size: var(--ds-text-sm); }
.ds-related__footer { display: block; padding: var(--ds-space-2) var(--ds-space-4); border-top: 1px solid var(--ds-border); font-size: var(--ds-text-sm); font-weight: var(--ds-weight-bold); text-align: center; }

/* Cronologie (activity timeline) */
.ds-timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.ds-timeline__item { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--ds-space-3); padding-bottom: var(--ds-space-4); }
.ds-timeline__item:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 34px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--ds-border); }
.ds-timeline__icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--ds-radius-full); background: var(--ds-accent-subtle); color: var(--ds-accent-subtle-text); }
.ds-timeline__icon--success { background: var(--ds-success-subtle); color: var(--ds-success-text); }
.ds-timeline__icon--warning { background: var(--ds-warning-subtle); color: var(--ds-warning-text); }
.ds-timeline__icon--danger { background: var(--ds-danger-subtle); color: var(--ds-danger-text); }
.ds-timeline__icon--neutral { background: var(--ds-surface-sunken); color: var(--ds-text-secondary); }
.ds-timeline__body { min-width: 0; padding-top: 5px; }
.ds-timeline__title { margin: 0; font-weight: var(--ds-weight-bold); }
.ds-timeline__meta { margin: 0; color: var(--ds-text-muted); font-size: var(--ds-text-sm); }
.ds-timeline__content { margin-top: var(--ds-space-2); padding: var(--ds-space-3); border-radius: var(--ds-radius-md); background: var(--ds-surface-sunken); font-size: var(--ds-text-sm); }

/* Tabel de date: toolbar, chips, sortare, selectie, actiuni in masa, paginare */
.ds-table-card { background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-xs); }
.ds-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-2); padding: var(--ds-space-3) var(--ds-space-4); border-bottom: 1px solid var(--ds-border); }
.ds-toolbar__spacer { flex: 1; }
.ds-search { position: relative; display: flex; align-items: center; flex: 0 1 300px; min-width: 180px; }
.ds-search > svg { position: absolute; left: 10px; color: var(--ds-text-muted); pointer-events: none; }
.ds-search input:not([type="checkbox"]) { width: 100%; min-height: var(--ds-control-sm); padding-left: 34px; font-size: var(--ds-text-sm); }
.ds-chips { display: flex; flex-wrap: wrap; gap: var(--ds-space-2); }
.ds-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 var(--ds-space-3); border: 1px solid var(--ds-border-strong); border-radius: var(--ds-radius-full); background: var(--ds-surface); color: var(--ds-text-secondary); font: inherit; font-size: var(--ds-text-sm); font-weight: var(--ds-weight-bold); cursor: pointer; text-decoration: none; }
.ds-chip:hover { border-color: var(--ds-control-border); color: var(--ds-text); text-decoration: none; }
.ds-chip[aria-pressed="true"], .ds-chip[aria-current="true"], .ds-chip.is-active { border-color: var(--ds-accent); background: var(--ds-accent-subtle); color: var(--ds-accent-subtle-text); }
.ds-chip .ds-count { height: 18px; min-width: 18px; background: var(--ds-surface-sunken); }
.ds-bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-space-3); padding: var(--ds-space-2) var(--ds-space-4); border-bottom: 1px solid var(--ds-border); background: var(--ds-accent-subtle); color: var(--ds-accent-subtle-text); font-size: var(--ds-text-sm); font-weight: var(--ds-weight-bold); }
.ds-bulkbar[hidden] { display: none; }
.ds-table-scroll { overflow-x: auto; }
.ds-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--ds-text-md); }
.ds-table th, .ds-table td { padding: var(--ds-space-3) var(--ds-space-4); border-bottom: 1px solid var(--ds-border); text-align: left; vertical-align: middle; }
.ds-table th { position: sticky; top: 0; z-index: 1; background: var(--ds-neutral-25); color: var(--ds-text-muted); font-size: var(--ds-text-xs); font-weight: var(--ds-weight-heavy); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.ds-table tbody tr:hover td { background: var(--ds-surface-hover); }
.ds-table tbody tr[aria-selected="true"] td, .ds-table tbody tr.is-selected td { background: var(--ds-accent-subtle); }
.ds-table tbody tr:last-child td { border-bottom: 0; }
.ds-table .ds-col-check { width: 44px; padding-right: 0; }
.ds-table .ds-col-num { text-align: right; font-variant-numeric: tabular-nums; }
.ds-table .ds-col-actions { width: 1%; text-align: right; white-space: nowrap; }
.ds-table__primary { display: flex; align-items: center; gap: var(--ds-space-3); min-width: 0; }
.ds-table__primary a { font-weight: var(--ds-weight-bold); }
.ds-table__primary small { display: block; color: var(--ds-text-muted); font-size: var(--ds-text-sm); }
.ds-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.ds-sort:hover { color: var(--ds-text); text-decoration: none; }
.ds-sort::after { content: ""; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: 0.35; }
[aria-sort="ascending"] .ds-sort::after { border-top: 0; border-bottom: 5px solid currentColor; opacity: 1; }
[aria-sort="descending"] .ds-sort::after { opacity: 1; }
[aria-sort="ascending"] .ds-sort, [aria-sort="descending"] .ds-sort { color: var(--ds-text); }
.ds-table--compact th, .ds-table--compact td, [data-density="compact"] .ds-table th, [data-density="compact"] .ds-table td { padding-top: 6px; padding-bottom: 6px; font-size: var(--ds-text-sm); }
.ds-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ds-space-3); padding: var(--ds-space-3) var(--ds-space-4); border-top: 1px solid var(--ds-border); color: var(--ds-text-muted); font-size: var(--ds-text-sm); }
.ds-pagination__pages { display: flex; gap: var(--ds-space-1); }
.ds-pagination__pages a, .ds-pagination__pages span { display: inline-flex; align-items: center; justify-content: center; min-width: var(--ds-control-sm); height: var(--ds-control-sm); padding: 0 var(--ds-space-2); border-radius: var(--ds-radius-md); color: var(--ds-text-secondary); font-weight: var(--ds-weight-bold); }
.ds-pagination__pages a:hover { background: var(--ds-surface-sunken); text-decoration: none; }
.ds-pagination__pages [aria-current="page"] { background: var(--ds-accent); color: var(--ds-on-accent); }
.ds-pagination__pages [aria-disabled="true"] { opacity: 0.45; }

/* Canalele unui brand */
.ds-channel-list > li { justify-content: flex-start; padding: var(--ds-space-3) 0; }
.ds-channel-list > li > .ga1-brand-text { flex: 1 1 200px; }
.ds-channel-list details > summary { font-weight: var(--ds-weight-bold); color: var(--ds-link); }

/* Liste simple (inlocuiesc tabelele pe ecrane mici) */
.ds-list { margin: 0; padding: 0; list-style: none; }
.ds-list__item { display: flex; align-items: center; gap: var(--ds-space-3); padding: var(--ds-space-3) var(--ds-space-5); border-bottom: 1px solid var(--ds-border); min-width: 0; }
.ds-list__item:last-child { border-bottom: 0; }
a.ds-list__item { color: var(--ds-text); }
a.ds-list__item:hover { background: var(--ds-surface-hover); text-decoration: none; }
.ds-list__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ds-list__text strong { font-weight: var(--ds-weight-bold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-list__text small { color: var(--ds-text-muted); font-size: var(--ds-text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-list__meta { display: flex; align-items: center; gap: var(--ds-space-2); flex-shrink: 0; }

/* Formulare */
.ds-form-section { display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr); gap: var(--ds-space-6); padding: var(--ds-space-6) 0; border-bottom: 1px solid var(--ds-border); }
.ds-form-section:first-child { padding-top: 0; }
.ds-form-section:last-of-type { border-bottom: 0; }
.ds-form-section__title { margin: 0; font-size: var(--ds-text-lg); }
.ds-form-section__description { margin: var(--ds-space-1) 0 0; color: var(--ds-text-muted); font-size: var(--ds-text-sm); }
.ds-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--ds-space-4); }
.ds-form-grid > .ds-field--full { grid-column: 1 / -1; }
.ds-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ds-label { color: var(--ds-text-secondary); font-size: var(--ds-text-sm); font-weight: var(--ds-weight-bold); }
.ds-label .ds-required { color: var(--ds-danger-text); margin-left: 2px; }
.ds-input, .ds-select, .ds-textarea { width: 100%; }
.ds-help { margin: 0; color: var(--ds-text-muted); font-size: var(--ds-text-sm); }
.ds-error { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ds-danger-text); font-size: var(--ds-text-sm); font-weight: var(--ds-weight-bold); }
.ds-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--ds-space-2); padding-top: var(--ds-space-4); border-top: 1px solid var(--ds-border); }
.ds-toggle { display: inline-flex; align-items: center; gap: var(--ds-space-3); cursor: pointer; font-weight: var(--ds-weight-medium); }
.ds-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ds-toggle__track { position: relative; flex-shrink: 0; width: 40px; height: 22px; border-radius: var(--ds-radius-full); background: var(--ds-neutral-400); transition: background-color var(--ds-duration) var(--ds-ease); }
.ds-toggle__track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--ds-shadow-sm); transition: transform var(--ds-duration) var(--ds-ease); }
.ds-toggle input:checked + .ds-toggle__track { background: var(--ds-accent); }
.ds-toggle input:checked + .ds-toggle__track::after { transform: translateX(18px); }
.ds-toggle input:focus-visible + .ds-toggle__track { outline: 2px solid var(--ds-accent); outline-offset: 2px; }
.ds-toggle input:disabled + .ds-toggle__track { opacity: 0.5; }
.ds-check { display: inline-flex; align-items: center; gap: var(--ds-space-2); cursor: pointer; }

/* Alerte si toast-uri */
.ds-alert { display: flex; align-items: flex-start; gap: var(--ds-space-3); padding: var(--ds-space-3) var(--ds-space-4); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-surface); color: var(--ds-text); }
.ds-alert .ds-icon { margin-top: 1px; }
.ds-alert__body { flex: 1; min-width: 0; }
.ds-alert__title { margin: 0; font-weight: var(--ds-weight-heavy); }
.ds-alert__body p { margin: 2px 0 0; }
.ds-alert__actions { display: flex; flex-wrap: wrap; gap: var(--ds-space-2); margin-top: var(--ds-space-2); }
.ds-alert--info { border-color: color-mix(in srgb, var(--ds-info) 35%, transparent); background: var(--ds-info-subtle); color: var(--ds-info-text); }
.ds-alert--success { border-color: color-mix(in srgb, var(--ds-success) 35%, transparent); background: var(--ds-success-subtle); color: var(--ds-success-text); }
.ds-alert--warning { border-color: color-mix(in srgb, var(--ds-warning) 40%, transparent); background: var(--ds-warning-subtle); color: var(--ds-warning-text); }
.ds-alert--danger { border-color: color-mix(in srgb, var(--ds-danger) 35%, transparent); background: var(--ds-danger-subtle); color: var(--ds-danger-text); }
.ds-alert a { color: inherit; font-weight: var(--ds-weight-heavy); text-decoration: underline; }
.ds-toasts { position: fixed; right: var(--ds-space-4); bottom: var(--ds-space-4); z-index: 120; display: flex; flex-direction: column; gap: var(--ds-space-2); width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.ds-toast { display: flex; align-items: flex-start; gap: var(--ds-space-3); padding: var(--ds-space-3) var(--ds-space-4); border-radius: var(--ds-radius-lg); background: var(--ds-neutral-900); color: #fff; box-shadow: var(--ds-shadow-lg); font-weight: var(--ds-weight-medium); pointer-events: auto; animation: ds-toast-in 220ms var(--ds-ease); }
:root.dark .ds-toast { background: var(--ds-surface-raised); color: var(--ds-text); border: 1px solid var(--ds-border-strong); }
@media (prefers-color-scheme: dark) { :root:not(.light) .ds-toast { background: var(--ds-surface-raised); color: var(--ds-text); border: 1px solid var(--ds-border-strong); } }
.ds-toast__body { flex: 1; }
.ds-toast__close { margin: -4px -8px -4px 0; color: inherit; }
.ds-toast--success .ds-icon { color: #4ade80; }
.ds-toast--danger .ds-icon { color: #f87171; }
@keyframes ds-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Modal si drawer: <dialog> nativ (focus captiv, Esc, ::backdrop) */
.ds-modal, .ds-drawer { padding: 0; border: 0; color: var(--ds-text); background: var(--ds-surface-raised); box-shadow: var(--ds-shadow-overlay); }
.ds-modal { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px); border-radius: var(--ds-radius-xl); }
.ds-modal--lg { width: min(880px, calc(100vw - 32px)); }
.ds-modal::backdrop, .ds-drawer::backdrop { background: var(--ds-overlay); }
.ds-modal[open] { animation: ds-modal-in 200ms var(--ds-ease); }
.ds-drawer { position: fixed; inset: 0 0 0 auto; width: min(480px, 100vw); max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; border-radius: var(--ds-radius-xl) 0 0 var(--ds-radius-xl); }
.ds-drawer[open] { display: flex; flex-direction: column; animation: ds-drawer-in 240ms var(--ds-ease); }
.ds-overlay__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ds-space-3); padding: var(--ds-space-5) var(--ds-space-6) var(--ds-space-3); }
.ds-overlay__title { margin: 0; font-size: var(--ds-text-xl); }
.ds-overlay__description { margin: 4px 0 0; color: var(--ds-text-muted); font-size: var(--ds-text-sm); }
.ds-overlay__body { padding: var(--ds-space-2) var(--ds-space-6) var(--ds-space-5); overflow-y: auto; }
.ds-drawer .ds-overlay__body { flex: 1; }
.ds-overlay__footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--ds-space-2); padding: var(--ds-space-4) var(--ds-space-6); border-top: 1px solid var(--ds-border); background: var(--ds-surface); border-radius: 0 0 var(--ds-radius-xl) var(--ds-radius-xl); }
.ds-drawer .ds-overlay__footer { border-radius: 0 0 0 var(--ds-radius-xl); }
@keyframes ds-modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes ds-drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Stare goala */
.ds-empty { display: flex; flex-direction: column; align-items: center; gap: var(--ds-space-2); padding: var(--ds-space-10) var(--ds-space-6); text-align: center; }
.ds-empty__icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: var(--ds-space-2); border-radius: var(--ds-radius-lg); background: var(--ds-accent-subtle); color: var(--ds-accent-subtle-text); }
.ds-empty__title { margin: 0; font-size: var(--ds-text-lg); }
.ds-empty__text { max-width: 46ch; margin: 0; color: var(--ds-text-muted); }
.ds-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--ds-space-2); margin-top: var(--ds-space-3); }
.ds-empty--compact { padding: var(--ds-space-6) var(--ds-space-4); }

/* Skeleton */
.ds-skeleton { display: block; height: 12px; border-radius: var(--ds-radius-sm); background: linear-gradient(90deg, var(--ds-surface-sunken) 25%, var(--ds-border) 37%, var(--ds-surface-sunken) 63%); background-size: 400% 100%; animation: ds-shimmer 1.4s ease infinite; }
.ds-skeleton--text { width: 100%; }
.ds-skeleton--title { width: 40%; height: 20px; }
.ds-skeleton--avatar { width: 40px; height: 40px; border-radius: 50%; }
.ds-skeleton--block { height: 88px; border-radius: var(--ds-radius-lg); }
@keyframes ds-shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

/* Tooltip: textul este si in aria-describedby; apare la hover si la focus */
.ds-tooltip { position: relative; display: inline-flex; }
.ds-tooltip__bubble { position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 90; width: max-content; max-width: 260px; padding: 6px 10px; border-radius: var(--ds-radius-md); background: var(--ds-neutral-900); color: #fff; font-size: var(--ds-text-xs); font-weight: var(--ds-weight-bold); line-height: 1.4; opacity: 0; visibility: hidden; transform: translate(-50%, 4px); transition: opacity var(--ds-duration) var(--ds-ease), transform var(--ds-duration) var(--ds-ease); pointer-events: none; }
:root.dark .ds-tooltip__bubble { background: var(--ds-neutral-100); color: var(--ds-neutral-900); }
@media (prefers-color-scheme: dark) { :root:not(.light) .ds-tooltip__bubble { background: var(--ds-neutral-100); color: var(--ds-neutral-900); } }
.ds-tooltip:hover .ds-tooltip__bubble, .ds-tooltip:focus-within .ds-tooltip__bubble { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* Dropdown: <details> (fara JS); ga1-ds.js inchide la click in afara si la Esc */
.ds-dropdown { position: relative; display: inline-block; }
.ds-dropdown > summary { list-style: none; cursor: pointer; }
.ds-dropdown > summary::-webkit-details-marker { display: none; }
.ds-dropdown__menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 80; min-width: 200px; padding: var(--ds-space-1); background: var(--ds-surface-raised); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-lg); }
.ds-dropdown__menu--left { right: auto; left: 0; }
.ds-dropdown__item { display: flex; align-items: center; gap: var(--ds-space-2); width: 100%; min-height: 34px; padding: 0 var(--ds-space-3); border: 0; border-radius: var(--ds-radius-md); background: none; color: var(--ds-text); font: inherit; font-size: var(--ds-text-md); font-weight: var(--ds-weight-medium); text-align: left; cursor: pointer; }
.ds-dropdown__item:hover, .ds-dropdown__item:focus-visible { background: var(--ds-surface-hover); text-decoration: none; color: var(--ds-text); }
.ds-dropdown__item--danger { color: var(--ds-danger-text); }
form > .ds-dropdown__item { margin: 0; }
.ds-dropdown__menu form { margin: 0; }
.ds-dropdown__item--danger:hover { color: var(--ds-danger-text); background: var(--ds-danger-subtle); }
.ds-dropdown__separator { height: 1px; margin: var(--ds-space-1) 0; background: var(--ds-border); }
.ds-dropdown__label { padding: var(--ds-space-2) var(--ds-space-3) var(--ds-space-1); color: var(--ds-text-muted); font-size: 11px; font-weight: var(--ds-weight-heavy); letter-spacing: 0.06em; text-transform: uppercase; }

/* Tile de aplicatie (dashboard, launcher) */
.ds-app-tile { display: flex; align-items: flex-start; gap: var(--ds-space-3); padding: var(--ds-space-4); background: var(--ds-surface); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-xs); color: var(--ds-text); transition: border-color var(--ds-duration) var(--ds-ease), box-shadow var(--ds-duration) var(--ds-ease); }
.ds-app-tile:hover { border-color: var(--ds-accent-200); box-shadow: var(--ds-shadow-md); text-decoration: none; color: var(--ds-text); }
.ds-app-tile__icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: var(--ds-radius-md); background: var(--ds-accent-subtle); color: var(--ds-accent-subtle-text); font-weight: var(--ds-weight-heavy); }
.ds-app-tile__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ds-app-tile__text strong { font-size: var(--ds-text-lg); font-weight: var(--ds-weight-heavy); }
.ds-app-tile__text span { color: var(--ds-text-muted); font-size: var(--ds-text-sm); }
.ds-app-tile__meta { display: flex; flex-wrap: wrap; gap: var(--ds-space-1); margin-top: var(--ds-space-1); }

/* Swatch-uri (pagina /design) */
.ds-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--ds-space-3); }
.ds-swatch { overflow: hidden; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-surface); font-size: var(--ds-text-xs); }
.ds-swatch__color { height: 48px; }
.ds-swatch__label { display: block; padding: 6px 8px; font-family: var(--ds-font-mono); color: var(--ds-text-secondary); overflow-wrap: anywhere; }
.ds-anchor-nav { position: sticky; top: calc(var(--ds-header-height) + var(--ds-space-4)); display: flex; flex-direction: column; gap: 2px; font-size: var(--ds-text-sm); }
.ds-anchor-nav a { padding: 4px 10px; border-radius: var(--ds-radius-sm); color: var(--ds-text-secondary); font-weight: var(--ds-weight-medium); }
.ds-anchor-nav a:hover { background: var(--ds-surface-sunken); color: var(--ds-text); text-decoration: none; }
.ds-showcase { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--ds-space-6); align-items: start; }
.ds-specimen { padding: var(--ds-space-5); border: 1px dashed var(--ds-border-strong); border-radius: var(--ds-radius-lg); background: var(--ds-canvas); }

/* ------------------------------------------------------------------ Responsive */
@media (max-width: 1180px) {
    .ds-record { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .ga1-shell, .ga1-shell:has(> .ga1-rail-toggle:checked) { background: var(--ds-canvas); }
    .ga1-main.ga1-shell-main { padding: var(--ds-space-4) var(--ds-space-4) var(--ds-space-10); }
    .ds-showcase { grid-template-columns: minmax(0, 1fr); }
    .ds-anchor-nav { position: static; flex-direction: row; flex-wrap: wrap; }
    .ds-form-section { grid-template-columns: minmax(0, 1fr); gap: var(--ds-space-3); }
}
@media (max-width: 640px) {
    h1, .ds-page-header__title { font-size: var(--ds-text-2xl); }
    .ds-page-header { align-items: stretch; margin-bottom: var(--ds-space-4); }
    .ds-page-header__actions { width: 100%; }
    .ds-page-header__actions > .ds-btn, .ds-page-header__actions > .ga1-btn { flex: 1 1 auto; }
    .ds-highlights__head { padding: var(--ds-space-4); }
    .ds-highlights__title { font-size: var(--ds-text-xl); }
    .ds-highlights__actions { width: 100%; }
    .ds-highlights__actions > * { flex: 1 1 auto; }
    .ds-highlights__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: var(--ds-space-3) var(--ds-space-4); }
    .ds-tabs__panel { padding: var(--ds-space-4); }
    .ds-card__header, .ds-card__body { padding-left: var(--ds-space-4); padding-right: var(--ds-space-4); }
    .ds-list__item { padding-left: var(--ds-space-4); padding-right: var(--ds-space-4); }
    .ds-search { flex: 1 1 100%; }
    .ds-kpi__value { font-size: var(--ds-text-2xl); }
    .ds-drawer { width: 100vw; border-radius: 0; }
    .ga1-card { padding: var(--ds-space-4); }
    .ds-table--stack thead { display: none; }
    .ds-table--stack tr { display: block; padding: var(--ds-space-2) 0; border-bottom: 1px solid var(--ds-border); }
    .ds-table--stack td { display: flex; justify-content: space-between; gap: var(--ds-space-3); padding: 4px var(--ds-space-4); border: 0; }
    .ds-table--stack td[data-label]::before { content: attr(data-label); color: var(--ds-text-muted); font-size: var(--ds-text-xs); font-weight: var(--ds-weight-bold); }
    .ds-table--stack td:first-child { justify-content: flex-start; padding-top: var(--ds-space-2); font-size: var(--ds-text-lg); }
    .ds-table--stack td:first-child::before { display: none; }
    .ds-table--stack td.ds-col-actions { justify-content: flex-end; }
    .ds-table--stack td.ds-col-actions:empty { display: none; }
    .ds-table--stack .ds-col-check { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media print {
    .ga1-header, .ga1-side, .ga1-tabbar, .ds-toasts, .ds-page-header__actions, .ds-highlights__actions { display: none !important; }
    .ga1-shell { display: block; }
    .ds-card, .ds-highlights, .ds-tabs, .ds-related { box-shadow: none; }
}
