/* ============================================================
   NudgeApp — design tokens ("calm & dense", light-only)
   Layered over Bootstrap 5.1. Loaded after bootstrap.min.css,
   before tables.css. Semantic colours (ok / warn / danger) are
   for state only — never used as the accent.

   Palette: NudgeApp's, the same as the mobile app's
   (Mobile/Resources/Styles/Colors.xaml) — the symbol's purple as
   the one accent, cool grey surfaces and text, Night (the
   wordmark's ink) for dark grounds. Green is left for states
   only: done, delivered, closed, online (--ok, --online).

   Philosophy: Dieter Rams / Swiss — quiet surfaces, one accent,
   a dense 4px rhythm, type that recedes. No dark mode by design
   (internal LAN tool, single lighting context).
   ============================================================ */
:root {
    /* surfaces — cool greys with a faint violet lean */
    --bg: #f3f4f8;
    --card: #ffffff;
    --card-2: #f7f8fb;
    --border: #e1e3ea;
    --border-soft: #eceef3;
    /* text (the app's Ink / Ink2 / Muted) */
    --ink: #111b21;
    --ink-2: #54656f;
    --ink-muted: #8696a0;
    /* accent — the brand purple; --accent-hover is BrandInk, the darker step for hovers and for accent text */
    --accent: #5047e8;
    --accent-hover: #3a32b8;
    --accent-soft: #eeecfd;
    --accent-line: #d5d0f7;
    --accent-ink: #ffffff;
    /* primary buttons: the brand purple as a gradient, the light stop on top */
    --accent-grad-from: #6a62f0;
    --accent-grad-to: #4239cc;
    /* brand grounds: Night (dark headers, the sign-in page) and the symbol's lavender */
    --night: #17103c;
    --night-deep: #0f0a2b;
    --on-night: #ffffff;
    --on-night-muted: #c3bee0;
    --lavender: #c8bff6;
    /* semantic (state only) — green means done / delivered / closed; --online is the "active now" dot */
    --ok: #0b8a50;
    --ok-soft: #ddf6e9;
    --ok-line: #b3e4c8;
    --online: #16a05b;
    /* teal — "not necessary" stages, kept apart from the done green */
    --teal: #1c6e7a;
    --teal-soft: #e6f2f3;
    --teal-line: #bcdde1;
    --warn: #9c6b1f;
    --warn-soft: #f7f0e0;
    --warn-line: #e8d6a8;
    --danger: #b13434;
    --danger-soft: #faeaea;
    --danger-line: #eec7c7;
    /* editable-field fill (variant C) — the app's Field grey */
    --field-bg: #f0f2f5;
    --field-bg-hover: #e7e9ef;
    /* spacing scale (4px base) */
    --s0: 0;
    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 20px;
    --s6: 24px;
    --s7: 28px;
    --s8: 32px;
    --s10: 40px;
    --s12: 48px;
    --s16: 64px;
    /* radius / elevation */
    --r-sm: 6px;
    --r-md: 8px;
    --r-lg: 12px;
    --r-pill: 999px;
    --sh-xs: 0 1px 2px rgba(16, 24, 40, .06);
    --sh-sm: 0 1px 3px rgba(16, 24, 40, .10), 0 1px 2px rgba(16, 24, 40, .05);
    --sh-pop: 0 8px 24px rgba(16, 24, 40, .12);
    /* soft, layered card shadow (replaces --sh-xs on .details-panel) — a hairline border still does
       the edge, this just lifts the card off the page instead of reading as flat-bordered */
    --sh-card: 0 1px 3px rgba(30, 33, 31, .06), 0 1px 2px rgba(30, 33, 31, .05);
    /* type family */
    --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
    /* type scale — fixed px (the user, 2026-10-04: "mai condensat pe toate ferestrele"): the root is 14px at every
       width now, and in px the small steps don't drop with it. Steps map to real uses in this app; it is
       intentionally dense at the small end. (Was rem against a 16px desktop root: 10/11/12/13/14/16/18/24.) */
    --fs-3xs: 10px;       /* stage-chip date */
    --fs-2xs: 10.5px;     /* section eyebrows, badges, state pill, summary labels */
    --fs-xs: 11.5px;      /* form labels, help text, grid column headers, note meta */
    --fs-sm: 12.5px;      /* filter input, table pager, link actions */
    --fs-md: 13px;        /* grid body, modal copy — the default step */
    --fs-base: 14px;      /* body copy */
    --fs-lg: 16px;        /* sub-headings */
    --fs-xl: 20px;        /* page title */
    /* font weight */
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    /* line height */
    --lh-none: 1.1;       /* stage chips — single glyph */
    --lh-tight: 1.2;      /* page title */
    --lh-snug: 1.4;       /* compact controls, pager */
    --lh-normal: 1.45;    /* read-only summary values */
    --lh-relaxed: 1.55;   /* note body text */
    /* letter spacing */
    --ls-tight: -0.01em;  /* page title, brand wordmark */
    --ls-normal: 0;
    --ls-label: 0.05em;   /* uppercase micro-labels (grid headers) */
    --ls-eyebrow: 0.07em; /* section eyebrow headers, summary labels */
    /* motion */
    --dur-fast: 0.1s;     /* hover state changes */
    --dur-normal: 0.18s;  /* disclosure carets, small transitions */
    --dur-slow: 0.25s;
    --ease: ease;
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    /* layout maxima — available tokens; not yet wired to the Bootstrap .container */
    --maxw-content: 72ch;
    --maxw-form: 640px;
    --maxw-page: 1320px;
    /* focus ring — the brand purple */
    --focus: 0 0 0 3px rgba(80, 71, 232, .28);
}

/* Breakpoints in use — hard-coded in @media rules below and in tables.css, because
   CSS custom properties cannot be referenced inside a media query. Kept here as the
   single source of truth for the numbers:
     380px / 560px  — project summary grid reflow (3 → 2 → 1 col)
     767.98px       — phone: wrap section headers
     (pointer: coarse) — coarse pointers get larger tap targets (paired with 767.98px)
     992px          — dashboard rows: stacked → 60/40 side-by-side
*/

/* 14px at every width (was 16px from 768px up): Bootstrap's rem-based controls, spacing utilities and the rem sizes
   here shrink by an eighth — the whole app denser, the same look (the user, 2026-10-04). */
html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
}

/* Auth pages (Login...) — no top bar, just the form centered on Night (the app's sign-in ground), with a
   faint glow of the brand purple; the logo there is the white-lettered one. */
.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(900px 520px at 50% -10%, rgba(80, 71, 232, .38), transparent 65%),
        radial-gradient(700px 420px at 50% 110%, rgba(200, 191, 246, .10), transparent 70%),
        var(--night);
    color: var(--on-night);
}

    /* the card on it keeps the page's ink */
    .auth-body .details-panel {
        color: var(--ink);
        box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .55);
    }

.auth-note {
    color: var(--on-night-muted);
    font-size: var(--fs-xs);
}

    .auth-note a {
        color: var(--on-night);
    }

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* one focus ring, visible on any ground (replaces the template's white+blue double ring) */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.btn-primary:focus,
.btn-outline-primary:focus,
.btn-outline-secondary:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: var(--focus);
}

/* ============================================================
   BOOTSTRAP 5.1 COMPONENT OVERRIDES (token-driven)
   ============================================================ */

.btn {
    border-radius: var(--r-sm);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-sm);
    padding: 5px 12px;
}

.btn-sm {
    font-size: var(--fs-xs);
    padding: 3px 9px;
}

/* The brand purple as a top-to-bottom gradient (as the app's buttons) + a soft accent-tinted shadow,
   so the button reads as slightly domed rather than a flat color chip; hover steps it all darker. */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-sm);
    padding: 6px 13px;
    color: var(--accent-ink);
    background-color: var(--accent);
    background-image: linear-gradient(var(--accent-grad-from), var(--accent-grad-to));
    border-color: var(--accent-grad-to);
    box-shadow: 0 8px 24px -6px color-mix(in srgb, var(--accent) 35%, transparent);
}

    .btn-primary:hover,
    .btn-primary:focus,
    .btn-primary:active,
    .btn-primary.active {
        color: var(--accent-ink);
        background-color: var(--accent-hover);
        background-image: linear-gradient(var(--accent), var(--accent-hover));
        border-color: var(--accent-hover);
        box-shadow: 0 10px 26px -6px color-mix(in srgb, var(--accent) 45%, transparent);
    }

    .btn-primary:disabled,
    .btn-primary.disabled {
        background-color: var(--accent);
        background-image: none;
        border-color: var(--accent);
        box-shadow: none;
        opacity: .55;
    }

    .btn-primary.btn-sm {
        font-size: var(--fs-xs);
        padding: 3px 10px;
    }

.btn-outline-primary {
    color: var(--accent);
    border-color: var(--border);
}

    .btn-outline-primary:hover,
    .btn-outline-primary:focus {
        color: var(--accent-hover);
        background-color: var(--accent-soft);
        border-color: var(--accent);
    }

    .btn-outline-primary:active,
    .btn-outline-primary.active {
        color: var(--accent-ink);
        background-color: var(--accent);
        border-color: var(--accent);
    }

.btn-outline-secondary {
    color: var(--ink);
    background-color: var(--card);
    border-color: var(--border);
}

    .btn-outline-secondary:hover,
    .btn-outline-secondary:focus {
        color: var(--ink);
        background-color: var(--card-2);
        border-color: var(--ink-muted);
    }

    .btn-outline-secondary:active,
    .btn-outline-secondary.active {
        color: var(--ink);
        background-color: var(--card-2);
        border-color: var(--ink-muted);
    }

.btn-outline-danger {
    border-color: var(--border);
}

/* editable fields — subtle fill + an accent focus line (variant C) */
.form-control,
.form-select {
    border-color: var(--border);
    border-radius: var(--r-sm);
    background-color: var(--field-bg);
    color: var(--ink);
    font-size: var(--fs-md);
}

    .form-control:hover:not(:focus):not(:disabled):not([readonly]),
    .form-select:hover:not(:focus):not(:disabled) {
        background-color: var(--field-bg-hover);
    }

    .form-control:focus,
    .form-select:focus {
        border-color: var(--accent);
        background-color: var(--card);
        box-shadow: inset 3px 0 0 var(--accent), var(--focus);
    }

    .form-control::placeholder {
        color: var(--ink-muted);
    }

.form-control-sm,
.form-select-sm {
    font-size: var(--fs-sm);
}

.form-label {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    color: var(--ink-2);
    margin-bottom: .35rem;
}

/* A compact form — tight enough that its fields fit in view together
   without the card growing into a long scroll. */
.project-form-compact .form-label {
    margin-bottom: .15rem;
}

.project-form-compact .form-control,
.project-form-compact .form-select {
    padding: .3rem .6rem;
    font-size: var(--fs-sm);
    min-height: unset;
}

.project-form-compact textarea.form-control {
    min-height: unset;
}

.project-form-compact .form-check {
    margin-top: .3rem;
}

    /* required-field marker sitting next to a .form-label */
    .form-label + .req {
        color: var(--danger);
        font-weight: var(--fw-bold);
        margin-left: 2px;
    }

.form-text {
    color: var(--ink-muted);
    font-size: var(--fs-xs);
    margin-top: .3rem;
}

    .form-text code {
        color: var(--ink-2);
    }

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* ============================================================
   APP SHELL — floating "glass" top nav. One sticky bar holds the brand,
   the segmented control (Sarcini / Calendar / Setări), the page's search
   and the company and user menus. One accent, a horizontal bar.
   ============================================================ */
.app-shell {
    min-height: 100vh;
    /* The top bar's 8px top margin must not collapse out of the shell (that shifted a window-tall shell down by 8px: a vertical scrollbar
       on every page, even when the content fits). */
    display: flow-root;
    background:
        radial-gradient(1100px 420px at 50% -160px, rgba(80, 71, 232, .08), transparent 60%),
        var(--bg);
}

.app-topnav {
    position: sticky;
    top: 8px;
    z-index: 1030;
    margin: 8px 16px 12px;
    border-radius: var(--r-lg);
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 1px 1px rgba(23, 16, 60, .04), 0 18px 36px -14px rgba(23, 16, 60, .16);
}

.app-topnav-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 10px 0 12px;
}

.app-topnav-brand {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    text-decoration: none;
}

    /* NudgeApp's icon, the same as the mobile app's (images/brand/nudgeapp-icon-*.png, from Mobile/Resources/AppIcon) —
       the mark only, no lettering (the user, 2026-10-03). */
    .app-topnav-brand-logo {
        display: block;
        width: 30px;
        height: 30px;
    }

.app-topnav-pill-caret {
    opacity: .55;
}

.app-topnav-menu {
    margin-top: 8px !important;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-pop);
}

.app-topnav-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--ink-2);
}

    .app-topnav-menu-item svg {
        flex: 0 0 auto;
        color: var(--ink-muted);
    }

    .app-topnav-menu-item:hover {
        background: var(--card-2);
        color: var(--ink);
    }

    .app-topnav-menu-item.is-active {
        background: var(--accent-soft);
        color: var(--accent-hover);
        font-weight: var(--fw-semibold);
    }

        .app-topnav-menu-item.is-active svg {
            color: var(--accent-hover);
        }

.app-topnav-menu-username {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 4px;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    color: var(--ink);
    white-space: nowrap;
}

.app-topnav-menu-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex: 0 0 auto;
}

/* The page's search box in the top bar: pill, 32px tall, tinted icon chip; Ctrl/⌘ E jumps here from anywhere. */
.app-topnav-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 200px;
    height: 32px;
    background: rgba(30, 33, 31, .045);
    border: 1px solid rgba(30, 33, 31, .06);
    border-radius: var(--r-pill);
    padding: 0 10px 0 6px;
    color: var(--ink-muted);
    transition: box-shadow var(--dur-fast);
}

    .app-topnav-search:focus-within {
        box-shadow: var(--sh-xs);
    }

    .app-topnav-search-icon {
        display: grid;
        place-items: center;
        width: 22px;
        height: 22px;
        flex: 0 0 auto;
        border-radius: var(--r-pill);
        background: var(--accent-soft);
        color: var(--accent-hover);
    }

    .app-topnav-search input {
        flex: 1 1 auto;
        min-width: 0;
        border: 0;
        background: transparent;
        outline: none;
        padding: 0;
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        color: var(--ink);
    }

        .app-topnav-search input::placeholder {
            color: var(--ink-muted);
        }

    /* Sarcini / Calendar: the page's own search, wider (the page's filters no longer carry it), with its shortcut. */
    .app-topnav-search.is-page {
        width: 300px;
        padding-right: 6px;
    }

        /* The browser's own × is replaced by .app-topnav-search-clear: it shows only on hover (and not at all in some browsers). */
        .app-topnav-search.is-page input::-webkit-search-cancel-button {
            -webkit-appearance: none;
            appearance: none;
            display: none;
        }

    /* There whenever the field has text; the shortcut hint steps aside then. */
    .app-topnav-search.is-page input:not(:placeholder-shown) ~ .app-topnav-search-clear {
        display: inline-grid;
    }

    .app-topnav-search.is-page input:not(:placeholder-shown) ~ .app-topnav-kbd {
        display: none;
    }

/* The company chip (_CompanySwitch, as the phone's CompanyChip) — only for an account that has rows in several companies: the company
   the person works in, its name in its own colour (inline, the phone's CompanyColors) with a small arrow; a click opens "Firmele"
   (company-chooser.js). */
.app-topnav-company {
    flex: 0 0 auto;
}

.app-topnav-company-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 30px;
    padding: 0 9px 0 12px;
    border: 0;
    border-radius: var(--r-pill);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: var(--fw-bold);
    white-space: nowrap;
    cursor: pointer;
    transition: filter var(--dur-fast, .12s);
}

    .app-topnav-company-btn:hover {
        filter: brightness(.96);
    }

    .app-topnav-company-btn:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

.app-topnav-company-icon {
    display: none;
}

/* "Firmele": the chooser — a card for each company, its name in its colour, then "Lucrez" (round) and "Văd" (a tick). */
.nc-help, .nc-note { margin: 0 0 12px; font-size: 13.5px; color: var(--ink-muted); }
.nc-note { margin: 12px 0 0; font-size: 13px; }
.nc-list { display: flex; flex-direction: column; gap: 8px; }
.nc-row { display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 10px 8px 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--field-bg); }
.nc-row.is-on { background: var(--accent-soft); border-color: var(--accent-line); }
.nc-row.is-work { border-color: var(--accent); }
.nc-text { display: flex; flex: 1 1 auto; flex-direction: column; gap: 3px; min-width: 0; }
.nc-text small { margin-left: 2px; font-size: 12.5px; color: var(--ink-muted); }
.nc-pill { align-self: flex-start; padding: 3px 10px; border-radius: 12px; font-size: 15px; font-weight: var(--fw-bold); }
.nc-choice { display: flex; flex-direction: column; align-items: center; gap: 0; width: 56px; padding: 2px 0; border: 0; border-radius: 8px; background: none; color: var(--ink-muted); cursor: pointer; }
.nc-choice span { font-size: 11px; color: var(--ink-muted); }
.nc-choice.is-on { color: var(--accent-hover); }
.nc-choice.is-dim { opacity: .4; }
.nc-choice:hover { background: rgba(80, 71, 232, .08); }
.nc-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }


.app-topnav-user {
    flex: 0 0 auto;
}

.app-topnav-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: var(--r-pill);
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 12px;
    font-weight: var(--fw-bold);
    cursor: pointer;
}

    /* Avatar picture: the SVG brings its own round tinted background, the button just adds a soft ring. */
    .app-topnav-user-avatar.has-image {
        width: 32px;
        height: 32px;
        padding: 0;
        background: transparent;
        box-shadow: 0 0 0 2px var(--accent-soft);
        transition: box-shadow .15s, transform .15s;
    }

        .app-topnav-user-avatar.has-image:hover,
        .app-topnav-user-avatar.has-image[aria-expanded="true"] {
            box-shadow: 0 0 0 2px var(--accent);
            transform: scale(1.05);
        }

        .app-topnav-user-avatar.has-image img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            display: block;
        }

/* (Setări — Views/Settings/Index.cshtml — uses the rows of Setări cont, .acct-* in the site's nudge.css.) */

    .legal-body ol,
    .legal-body ul {
        padding-left: 20px;
    }

    .legal-body h3 {
        margin: 12px 0 4px;
        font-size: var(--fs-md);
        font-weight: var(--fw-semibold);
    }

    .account-toggle .form-check-input {
        margin-top: 2px;
        cursor: pointer;
    }

/* ================================================================
   UTILIZATORI — the people list and the side panel (Views/Users)
   ================================================================ */

/* Search, kinds, "Activi", order and the count, in one bar above the list. */
.people-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

    .people-search .list-filter-input {
        width: 300px;
        max-width: 100%;
    }

.people-toolbar-end {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.people-count {
    font-size: var(--fs-sm);
    color: var(--ink-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* One row per person: face, name + @username · e-mail, roles, groups (+ manager), the ⋯ menu. */
.people-list {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-card);
    overflow: hidden;
}

.people-face {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex: 0 0 auto;
    object-fit: cover;
    background: var(--card-2);
}

    .people-face.is-initials {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: hsl(var(--face-h, 250) 70% 93%);
        color: hsl(var(--face-h, 250) 45% 38%);
        font-size: var(--fs-sm);
        font-weight: var(--fw-bold);
    }

    .people-face.is-lg {
        width: 48px;
        height: 48px;
        font-size: var(--fs-md);
    }

.people-main {
    min-width: 0;
}

.people-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    color: var(--ink);
}

.people-sub {
    margin-top: 1px;
    font-size: var(--fs-xs);
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.people-dot {
    margin: 0 6px;
}

.people-pill {
    padding: 1px 7px;
    border-radius: var(--r-pill);
    font-size: var(--fs-3xs);
    font-weight: var(--fw-bold);
    letter-spacing: .02em;
    text-transform: uppercase;
    background: var(--card-2);
    color: var(--ink-2);
}

    .people-pill.is-you { background: var(--accent-soft); color: var(--accent-hover); }
    .people-pill.is-guest { background: #e8f4ff; color: #1d5fa8; }
    .people-pill.is-system { background: #eef0f3; color: #5b6673; }
    .people-pill.is-off { background: #f1f2f4; color: #6b7480; }
    .people-pill.is-warn { background: var(--warn-soft); color: var(--warn); }

    .people-manager > span {
        display: inline-flex;
        align-items: center;
        gap: 3px;
    }

    .people-activity-line svg {
        margin-right: 3px;
        vertical-align: -1px;
        color: var(--ink-muted);
    }

.people-muted {
    font-size: var(--fs-xs);
    color: var(--ink-muted);
}

.people-empty {
    padding: 36px 16px;
    text-align: center;
    color: var(--ink-muted);
    font-size: var(--fs-sm);
}

/* Narrow screens: face + name on one line, roles and groups under them. */
@media (max-width: 860px) {

    .people-toolbar-end {
        margin-left: 0;
    }
}

/* The side panel with the person's form. */
.user-drawer.offcanvas-end {
    width: min(640px, 100vw);
    border-left: 1px solid var(--border);
}

/* The person's panel is wide, in two columns, so the whole form is on one page (the user, 2026-10-09). */
.user-drawer.user-drawer-wide.offcanvas-end {
    width: min(1120px, 100vw);
}

.uform-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: start;
}

/* The person's form: three columns on a wide screen (the person · what they can reach · where they sit and how they sign in), two
   below it (the third under the first), one on a phone. */
.uform-cols.is-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1180px) {
    .uform-cols.is-three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

        .uform-cols.is-three > .uform-col:nth-child(3) {
            grid-column: 1 / -1;
        }
}

/* Three columns have less height to spare: tighter blocks, no section subtitles, the switches in pairs, a shorter group list. */
.uform-cols.is-three .uform-section {
    padding: 8px 10px;
}

.uform-cols.is-three .uform-section-head {
    margin-bottom: 6px;
}

    .uform-cols.is-three .uform-section-head p {
        display: none;
    }

.uform-cols.is-three .uform-grid {
    gap: 6px 10px;
}

.uform-cols.is-three .uform-switches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
    margin-top: 8px;
    padding-top: 8px;
}

/* A form with nothing for the second column: one column. */
.uform-cols.is-single {
    grid-template-columns: minmax(0, 1fr);
}

.uform-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

@media (max-width: 900px) {
    .uform-cols {
        grid-template-columns: minmax(0, 1fr);
    }
}

.user-drawer-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-soft);
}

.user-drawer-who {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.user-drawer-title {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    color: var(--ink);
}

.user-drawer-sub {
    font-size: var(--fs-xs);
    color: var(--ink-muted);
}

.user-drawer-body {
    padding: 0;
    background: var(--card-2);
}

/* The form: sections as cards, the save bar stuck to the bottom of the panel. */
.uform {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100%;
    padding: 10px 12px 0;
}

.uform-errors:empty,
.uform-errors.validation-summary-valid {
    display: none;
}

.uform-errors {
    padding: 10px 12px;
    border: 1px solid var(--danger-line);
    border-radius: var(--r-md);
    background: var(--danger-soft);
    color: var(--danger);
    font-size: var(--fs-sm);
}

    .uform-errors ul {
        margin: 0;
        padding-left: 18px;
    }

.uform-section {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--card);
}

.uform-section-head {
    margin-bottom: 8px;
}

    .uform-section-head h3 {
        margin: 0;
        font-size: var(--fs-md);
        font-weight: var(--fw-bold);
        color: var(--ink);
    }

    .uform-section-head p {
        margin: 2px 0 0;
        font-size: var(--fs-xs);
        color: var(--ink-muted);
    }

.uform-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}

@media (max-width: 560px) {
    .uform-grid {
        grid-template-columns: 1fr;
    }
}

.uform-hint {
    margin-top: 4px;
    font-size: var(--fs-xs);
    color: var(--ink-muted);
}

    .uform-link-mode span {
        display: inline-block;
        padding: 4px 14px;
        border-radius: var(--r-pill);
        font-size: var(--fs-xs);
        font-weight: var(--fw-semibold);
        color: var(--ink-2);
    }

    .uform-role span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        height: 32px;
        padding: 0 12px;
        border: 1px solid var(--border);
        border-radius: var(--r-pill);
        background: var(--card);
        color: var(--ink-2);
        font-size: var(--fs-sm);
        font-weight: var(--fw-medium);
        transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
    }

/* A switch with its title and explanation. */
.uform-switch {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    font-size: var(--fs-sm);
    color: var(--ink);
}

    .uform-switch .form-check-input {
        margin-top: 2px;
    }

.uform-switches {
    display: grid;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}

    .uform-contact small {
        margin-left: auto;
        color: var(--ink-muted);
    }

    .uform-seg span {
        display: inline-block;
        min-width: 28px;
        padding: 3px 10px;
        border-radius: var(--r-pill);
        color: var(--ink-muted);
        font-size: var(--fs-xs);
        font-weight: var(--fw-semibold);
        text-align: center;
    }

.uform-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    /* Edge to edge: the same as .uform's side padding (12px). */
    margin: 0 -12px;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    background: var(--card);
    box-shadow: 0 -6px 16px -12px rgba(16, 24, 40, .25);
}

.uform-delete {
    padding-left: 0;
    font-size: var(--fs-sm);
    text-decoration: none;
}

/* ---- main column: page content ---- */
.app-main {
    flex: 1 1 auto;
    min-width: 0;
}

.app-content {
    flex: 1 1 auto;
    padding-top: 0;
}

/* Every page uses the window's width (up to 1680px), not Bootstrap's 1140 / 1320px column — tables and forms get
   their room (the user, 2026-10-04: "nu încape în ecran"); the same 16px from the sides as the top bar. */
@media (min-width: 768px) {
    .app-content.container,
    .app-footer .container {
        max-width: 1680px;
        padding-left: 16px;
        padding-right: 16px;
    }
}

    /* Sarcini: edge to edge under the top bar — the same 16px from the window's sides as .app-topnav's margins. */
    .app-content.app-content-full {
        max-width: none;
        padding-left: 16px;
        padding-right: 16px;
    }

.app-footer {
    padding: 8px 0;
    font-size: var(--fs-xs);
}

/* Laptop widths: the search box narrows. */
@media (max-width: 1279.98px) {

    .app-topnav-search {
        width: 150px;
    }
}

@media (max-width: 991.98px) {

    .app-topnav-search {
        display: none;
    }

    /* The page's own search (Sarcini, Calendar) stays: the page has no other. */
    .app-topnav-search.is-page {
        display: flex;
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        max-width: 300px;
    }

}

@media (max-width: 599.98px) {
    .app-topnav-inner {
        gap: 8px;
        padding-right: 8px;
    }

    /* The page's own search needs room: the company switch keeps its icon only. */
    .app-topnav-company-name {
        display: none;
    }

    .app-topnav-company-icon {
        display: inline-block;
    }

    .app-topnav-company-btn {
        padding: 0 8px;
    }

    .app-topnav-search.is-page {
        min-width: 96px;
    }

}

/* modal shell */
.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
}

.modal-header,
.modal-footer {
    border-color: var(--border);
}

/* shared text helpers */
.text-danger {
    color: var(--danger) !important;
}

.text-muted {
    color: var(--ink-muted) !important;
}

    .role-users-name small {
        font-size: var(--fs-xs);
        color: var(--ink-muted);
    }

    .org-card.is-compact {
        width: auto;
        max-width: 240px;
        align-items: center;
        padding: 5px 10px 5px 6px;
    }

    button.org-out-row:hover,
    button.org-out-row:focus-visible {
        background: var(--field-bg);
        outline: none;
    }

/* ---- User picker (wwwroot/js/user-picker.js): a searchable person chooser over a native <select data-user-picker>. ---- */
.up {
    position: relative;
    width: 100%;
}

    .up[hidden] { display: none; }

    /* next to a label in a panel header (TODO → Sarcini pentru) */
    .up.is-auto { width: auto; min-width: 250px; max-width: 340px; }

.up-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0;
    pointer-events: none;
}

.up-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 38px;
    padding-top: 4px;
    padding-bottom: 4px;
    background-image: none;
    text-align: left;
    cursor: pointer;
}

    .up-trigger > svg {
        flex: 0 0 auto;
        margin-left: auto;
        color: var(--ink-muted);
        transition: transform .15s;
    }

    .up-trigger[aria-expanded="true"] {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--accent-soft);
    }

        .up-trigger[aria-expanded="true"] > svg { transform: rotate(180deg); }

.up.is-compact .up-trigger { min-height: 31px; padding-top: 2px; padding-bottom: 2px; font-size: var(--fs-sm); }

.up-value {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

    .up-value.is-empty { color: var(--ink-muted); }

.up-value-text,
.up-option-text {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.up-full {
    font-weight: var(--fw-semibold);
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.up-user {
    font-size: 11.5px;
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .up-user::before { content: '@'; opacity: .6; }

.up-avatar {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
}

    .up-avatar.is-sm { width: 22px; height: 22px; }

.up-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10.5px;
    font-weight: var(--fw-bold);
    letter-spacing: .02em;
    color: hsl(var(--up-h), 45%, 32%);
    background: hsl(var(--up-h), 60%, 90%);
}

.up-avatar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-muted);
    background: var(--field-bg);
}

.up-panel {
    position: absolute;
    z-index: 1080;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 260px;
    border: 1px solid var(--border);
    border-radius: var(--r-md, 12px);
    background: var(--card);
    box-shadow: 0 12px 32px rgba(15, 23, 42, .14), 0 2px 6px rgba(15, 23, 42, .06);
    overflow: hidden;
    animation: up-in .12s ease-out;
}

.up.opens-up .up-panel {
    top: auto;
    bottom: calc(100% + 6px);
}

@keyframes up-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .up-panel { animation: none; }
}

.up-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--ink-muted);
}

.up-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: var(--fs-sm);
    color: var(--ink);
}

.up-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 4px;
    overscroll-behavior: contain;
}

.up-group {
    padding: 8px 10px 4px;
    font-size: 10.5px;
    font-weight: var(--fw-semibold);
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.up-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: var(--r-sm);
    cursor: pointer;
    font-size: var(--fs-sm);
}

    .up-option.is-active { background: var(--field-bg); }
    .up-option.is-selected { background: var(--accent-soft); }
    .up-option.is-selected.is-active { background: color-mix(in srgb, var(--accent-soft) 70%, var(--field-bg)); }
    .up-option.is-clear .up-full { font-weight: var(--fw-normal, 400); color: var(--ink-muted); }

    .up-option mark {
        padding: 0;
        border-radius: 2px;
        background: color-mix(in srgb, var(--accent) 22%, transparent);
        color: inherit;
    }

.up-check {
    margin-left: auto;
    font-weight: var(--fw-bold);
    color: var(--accent-hover);
}

.up-none {
    padding: 14px 12px;
    font-size: var(--fs-sm);
    color: var(--ink-muted);
    text-align: center;
}

.dm-level .seg-btn { padding: 5px 12px; }

/* ---- Grupuri — listă și panou ---------------------------------------------------------------------------------------
   One card per parent group with its subgroups under it (on a tree line), then the groups without a parent. A row: the group's
   tile, name + pills, the group's people, its actions. The cards, names, pills, faces and the side panel are the Utilizatori page's
   (people-*, user-drawer, uform). */
.gr-list {
    display: grid;
    gap: 12px;
}

.gr-section-title {
    margin: 2px 2px -6px;
    font-size: var(--fs-2xs);
    font-weight: var(--fw-bold);
    letter-spacing: var(--ls-label);
    text-transform: uppercase;
    color: var(--ink-muted);
}

.gr-row {
    position: relative;
    display: grid;
    grid-template-columns: 32px minmax(200px, 1.6fr) minmax(160px, 1fr) var(--row-acts-w, 96px);
    align-items: center;
    gap: 12px;
    min-height: 50px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-soft);
    cursor: pointer;
    transition: background var(--dur-fast);
}

    .gr-row .people-sub:empty {
        display: none;
    }

    .gr-row:last-child {
        border-bottom: 0;
    }

    .gr-row:hover {
        background: var(--card-2);
    }

    .gr-row:focus-visible {
        outline: none;
        box-shadow: inset 0 0 0 2px var(--accent);
    }

    /* The parent: the card's head. */
    .gr-row.is-parent {
        background: var(--card-2);
    }

        .gr-row.is-parent:hover {
            background: var(--field-bg);
        }

        .gr-row.is-parent .people-name {
            font-size: var(--fs-lg);
            font-weight: var(--fw-bold);
        }

    /* A subgroup: indented, hanging from the parent's tile on a line. */
    .gr-row.is-child {
        padding-left: 50px;
    }

        .gr-row.is-child::before,
        .gr-row.is-child::after {
            content: "";
            position: absolute;
            left: 30px;
            border-color: var(--border);
            border-style: solid;
            border-width: 0;
            pointer-events: none;
        }

        .gr-row.is-child::before {
            top: 0;
            bottom: 0;
            border-left-width: 1px;
        }

        .gr-row.is-child.is-last::before {
            bottom: 50%;
        }

        .gr-row.is-child::after {
            top: 50%;
            width: 12px;
            border-top-width: 1px;
        }

/* The group's tile: a parent group, a subgroup. */
.gr-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: var(--r-md);
    background: var(--accent-soft);
    color: var(--accent-hover);
}

    .gr-icon.is-parent { background: var(--night); color: var(--lavender); }

    .gr-icon.is-lg {
        width: 44px;
        height: 44px;
        border-radius: var(--r-lg);
    }

        .gr-icon.is-lg svg {
            width: 20px;
            height: 20px;
        }

.gr-sub-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

    .gr-sub-item svg {
        flex: 0 0 auto;
    }

/* The group's people: faces overlapping, then the first name (+ more). */
.gr-members-col {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.gr-people-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: var(--fs-xs);
    color: var(--ink-2);
}

.gr-faces {
    display: inline-flex;
    flex: 0 0 auto;
    padding-left: 5px;
}

    .gr-faces .people-face {
        width: 22px;
        height: 22px;
        margin-left: -5px;
        border: 2px solid var(--card);
        box-sizing: content-box;
        font-size: 9px;
    }

.gr-people-names {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gr-people-more {
    color: var(--ink-muted);
    font-weight: var(--fw-semibold);
}

/* The groups as a grid with a header (the user, 2026-10-05): Grup · Oameni · actions. The rows keep one left edge; a level's step in
   is inside the name cell (.cg-name), so every column lines up whatever the depth. */
.gr-list.is-grid {
    --cg-cols: minmax(240px, 2fr) minmax(150px, 1fr) var(--row-acts-w, 96px);
}

    .gr-list.is-grid .gr-row {
        grid-template-columns: var(--cg-cols);
        padding-left: 14px;
    }

        .gr-list.is-grid .gr-row.tree-row.is-child {
            padding-left: 14px;
        }

/* Narrow screens: no header; the name and the actions on the first line, each other cell under it with its label. */
@media (max-width: 860px) {

    .gr-list.is-grid .gr-row {
        grid-template-columns: minmax(0, 1fr) auto;
        row-gap: 4px;
    }

    .gr-list.is-grid .row-acts {
        grid-column: 2;
        grid-row: 1;
    }

}

/* A parent group nested under another one (any number of levels): its name stands out among the groups. */
.gr-row.is-subparent .people-name {
    font-weight: var(--fw-bold);
}

/* A row's actions, right on the row (Grupuri): quiet icon buttons that firm up into a small toolbar when the row is
   pointed at. The optional ones come first, so Editează and Șterge line up down the list. A click on the row itself opens it. */
.row-acts {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 2px;
    padding: 2px;
    border-radius: var(--r-pill);
    transition: background var(--dur-fast), box-shadow var(--dur-fast);
}

.gr-row:hover .row-acts,
.gr-row:focus-within .row-acts {
    background: var(--card);
    box-shadow: inset 0 0 0 1px var(--border-soft), var(--sh-xs);
}

.row-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
    transition: background var(--dur-fast), color var(--dur-fast);
}

    .row-act svg {
        width: 15px;
        height: 15px;
    }

    .row-act:hover {
        background: var(--accent-soft);
        color: var(--accent-hover);
    }

    .row-act:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 1px;
    }

    .row-act.is-danger:hover {
        background: var(--danger-soft);
        color: var(--danger);
    }

    .row-act:disabled,
    .row-act:disabled:hover {
        background: transparent;
        color: var(--ink-muted);
        opacity: .35;
        cursor: not-allowed;
    }

/* Grupuri: the rows on a tree of any depth — each level 36px in, its elbow on the parent's tile line, and the lines
   of the ancestors that still have siblings below running through (.tree-rail). */
.tree-row {
    --tree-x: 30px;
    --tree-step: 36px;
}

    .gr-row.tree-row.is-child {
        padding-left: calc(var(--tree-x) + 20px + var(--tree-step) * (var(--depth, 1) - 1));
    }

        .gr-row.tree-row.is-child::before,
        .gr-row.tree-row.is-child::after {
            left: calc(var(--tree-x) + var(--tree-step) * (var(--depth, 1) - 1));
        }

.tree-rail {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px solid var(--border);
    pointer-events: none;
}

/* Narrow screens: tile + name on one line, the people under them. */
@media (max-width: 860px) {
    .gr-row {
        grid-template-columns: 32px 1fr auto;
        row-gap: 6px;
    }

    .gr-members-col {
        grid-column: 2 / 3;
    }

        .gr-members-col:empty {
            display: none;
        }

    .gr-row .row-acts {
        grid-column: 3;
        grid-row: 1;
    }

    .tree-row {
        --tree-x: 22px;
        --tree-step: 30px;
    }

        .gr-row.tree-row.is-child {
            padding-left: calc(var(--tree-x) + 14px + var(--tree-step) * (var(--depth, 1) - 1));
        }

        .gr-row.tree-row.is-child::after {
            width: 8px;
        }

    .gr-row.is-child {
        padding-left: 36px;
    }

        .gr-row.is-child::before,
        .gr-row.is-child::after {
            left: 22px;
        }

        .gr-row.is-child::after {
            width: 8px;
        }
}

