/* ==========================================================================
   Metalcom Prod — design system
   Stil: Minimalism / Swiss (ui-ux-pro-max): curat, funcțional, contrast mare.
   Mobile-first. Fără framework. Teme: luminoasă + întunecată (tokeni semantici).
   ========================================================================== */

:root {
    --font: "Fira Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* culori — luminos */
    --bg:        #f4f7fb;
    --surface:   #ffffff;
    --surface-2: #f1f5fa;
    --surface-3: #e7edf5;
    --ink:       #0f172a;
    --ink-2:     #334155;
    --muted:     #556377;   /* 5.6:1 pe alb */
    --border:    #dbe3ee;
    --border-2:  #c6d2e1;

    --primary:     #2563eb;  /* tracking blue — 5.2:1 cu alb */
    --primary-ink: #1d4ed8;
    --primary-050: #eaf1fe;
    --on-primary:  #ffffff;
    --accent:      #c2410c;  /* portocaliu livrare — 5.2:1 cu alb */
    --accent-050:  #fff1e8;

    --good:  #15803d; --good-050: #e7f6ec;
    --warn:  #a16207; --warn-050: #fdf5dc;
    --crit:  #dc2626; --crit-050: #fdecec;
    --info:  #0369a1; --info-050: #e3f2fb;
    --prim:  #4f46e5;
    --gray:  #64748b;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow:    0 1px 3px rgba(15, 23, 42, .07), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .14);
    --scrim:     rgba(15, 23, 42, .48);

    --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-pill: 999px;
    --nav-h: 60px;
    --side-w: 236px;
    --bn-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
    --safe-r: env(safe-area-inset-right, 0px);
    --t-fast: 150ms; --t: 200ms;

    color-scheme: light;
}


/* ------------------------------------------------------------------ bază */
*, *::before, *::after { box-sizing: border-box; }
html {
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
    overflow-x: clip;               /* nicio pagină nu se mișcă stânga-dreapta */
    scrollbar-gutter: stable;       /* loc rezervat pentru bara de scroll: lățimea nu sare la deschiderea ferestrelor */
    -webkit-tap-highlight-color: transparent;
}
@supports not (overflow-x: clip) { html { overflow-x: hidden; } }
body {
    margin: 0; min-height: 100vh; min-height: 100dvh;
    background: var(--bg); color: var(--ink);
    font: 400 15px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
    font-variant-numeric: tabular-nums;
}
img, svg { max-width: 100%; }
a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; color: var(--ink); }
p { margin: 0 0 .75rem; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--primary-050); }

.ic { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 24px; height: 24px; }
.muted { color: var(--muted); }
.grow { flex: 1 1 auto; }
.nowrap { white-space: nowrap; }
.wrap-any { overflow-wrap: anywhere; min-width: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: fixed; left: 8px; top: 8px; z-index: 3000; background: var(--primary); color: #fff; padding: .6rem 1rem; border-radius: var(--r-sm); transform: translateY(-160%); transition: transform var(--t-fast); }
.skip:focus { transform: none; }

/* -------------------------------------------------------------- shell */
.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 900;
    display: flex; align-items: center; gap: .5rem;
    min-height: calc(var(--nav-h) + var(--safe-t));
    padding: var(--safe-t) calc(.75rem + var(--safe-r)) 0 calc(.75rem + var(--safe-l));
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
    background: var(--primary); color: #fff; flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 1rem; font-weight: 700; }
.brand-text small { font-size: .72rem; color: var(--muted); font-weight: 500; white-space: nowrap; }

.icon-btn {
    position: relative;
    width: 44px; height: 44px; border-radius: var(--r);
    display: inline-grid; place-items: center; flex: 0 0 auto;
    border: 1px solid transparent; background: transparent; color: var(--ink-2);
    cursor: pointer; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn:active { background: var(--surface-3); }
.icon-btn.bordered { border-color: var(--border); background: var(--surface); }
.icon-btn .dot {
    position: absolute; top: 6px; right: 5px; min-width: 18px; height: 18px; padding: 0 4px;
    border-radius: 9px; background: var(--crit); color: #fff; font-size: .68rem; font-weight: 700;
    display: grid; place-items: center; pointer-events: none; border: 2px solid var(--surface);
}

.usermenu { position: relative; }
.user-chip {
    display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: 4px 8px 4px 4px;
    border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); cursor: pointer;
}
.user-chip:hover { background: var(--surface-2); }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    background: var(--primary-050); color: var(--primary-ink); font-weight: 700; font-size: .8rem;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.user-meta strong { font-size: .84rem; }
.user-meta small { font-size: .7rem; color: var(--muted); }
.menu {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 950;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
    box-shadow: var(--shadow-lg); padding: .35rem;
}
.menu-head { padding: .55rem .7rem .6rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; display: flex; flex-direction: column; }
.menu-head small { color: var(--muted); }
.menu-item {
    display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 44px; padding: 0 .7rem;
    border: 0; background: transparent; border-radius: var(--r-sm); color: var(--ink); cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--surface-2); text-decoration: none; }
.menu-item.danger { color: var(--crit); }

.shell { flex: 1; display: flex; width: 100%; min-width: 0; } /* fără lățime maximă: meniul lipit de margine, conținutul ocupă tot ecranul */
.sidebar { display: none; }
.main {
    flex: 1 1 auto; min-width: 0;
    padding: 1rem calc(1rem + var(--safe-r)) calc(var(--bn-h) + var(--safe-b) + 1.25rem) calc(1rem + var(--safe-l));
}

/* bară de jos (telefon + tabletă portrait) */
.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    display: flex; align-items: stretch; justify-content: space-around;
    min-height: calc(var(--bn-h) + var(--safe-b));
    padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
    background: var(--surface); border-top: 1px solid var(--border);
}
.bn-item {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--muted); font-size: .7rem; font-weight: 600; border: 0; background: transparent; cursor: pointer;
    padding: 6px 2px; text-align: center;
}
.bn-item span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-item:hover { text-decoration: none; color: var(--ink); }
.bn-item.active { color: var(--primary-ink); }
.bn-item.active .bn-ic { background: var(--primary-050); }
.bn-ic { display: grid; place-items: center; width: 48px; height: 30px; border-radius: var(--r-pill); transition: background var(--t-fast); }
.bn-item.accent .bn-ic { background: #c2410c; color: #fff; width: 48px; height: 34px; } /* 5.2:1 cu alb, în ambele teme */
.bn-item.accent { color: var(--ink-2); }

@media (min-width: 1024px) {
    .sidebar {
        display: block; width: var(--side-w); flex: 0 0 var(--side-w);
        padding: 1rem .75rem; position: sticky; top: var(--nav-h); align-self: flex-start;
        background: var(--surface); border-right: 1px solid var(--border);
        height: calc(100vh - var(--nav-h)); overflow-y: auto;
    }
    .nav-link {
        display: flex; align-items: center; gap: .75rem; min-height: 44px; padding: 0 .8rem; margin-bottom: 2px;
        border-radius: var(--r); color: var(--ink-2); font-weight: 500;
        transition: background var(--t-fast), color var(--t-fast);
    }
    .nav-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
    .nav-link.active { background: var(--primary-050); color: var(--primary-ink); font-weight: 600; }
    .bottom-nav { display: none; }
    .main { padding: 1.5rem 1.75rem 3rem; }
    .topbar { padding-left: 1.25rem; padding-right: 1.25rem; }
}
@media (max-width: 479.98px) {
    .user-meta, .hide-xs { display: none; }
    .user-chip { padding: 4px; }
    .brand-text small { display: none; }
}

/* ------------------------------------------------------------ titluri */
.page-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.45rem; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: .86rem; margin-top: .15rem; }
.page-head .titles { flex: 1 1 220px; min-width: 0; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 1.5rem 0 .6rem; }

/* ------------------------------------------------------------- butoane */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: 44px; padding: 0 1rem; border-radius: var(--r);
    border: 1px solid var(--border); background: var(--surface); color: var(--ink);
    font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { background: var(--surface-3); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn.accent { background: #c2410c; border-color: #c2410c; color: #fff; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.danger { color: var(--crit); }
.btn.danger:hover { background: var(--crit-050); border-color: var(--crit); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 36px; padding: 0 .75rem; font-size: .82rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .6; pointer-events: none; }
@media (pointer: coarse) { .btn.sm { min-height: 44px; } }

/* ------------------------------------------------------------ statistici */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; } .stats.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat {
    display: flex; align-items: center; gap: .7rem; min-width: 0;
    padding: .8rem .9rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border);
    color: var(--ink); box-shadow: var(--shadow-sm); text-align: left; cursor: default;
}
a.stat, button.stat { cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
a.stat:hover, button.stat:hover { border-color: var(--border-2); box-shadow: var(--shadow); text-decoration: none; }
.stat.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.stat-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; background: var(--surface-2); color: var(--ink-2); }
.stat-ic.prim { background: var(--primary-050); color: var(--primary-ink); }
.stat-ic.good { background: var(--good-050); color: var(--good); }
.stat-ic.warn { background: var(--warn-050); color: var(--warn); }
.stat-ic.crit { background: var(--crit-050); color: var(--crit); }
.stat-ic.acc  { background: var(--accent-050); color: var(--accent); }
.stat-txt { min-width: 0; }
.stat-val { display: block; font-size: 1.45rem; font-weight: 700; line-height: 1.05; }
.stat-lbl { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; overflow-wrap: anywhere; line-height: 1.25; margin-top: 2px; }
@media (max-width: 379.98px) { .stat { padding: .7rem; gap: .55rem; } .stat-ic { width: 34px; height: 34px; } .stat-val { font-size: 1.25rem; } }

/* ------------------------------------------------------------- toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.search { position: relative; flex: 1 1 260px; min-width: 0; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
    width: 100%; height: 46px; padding: 0 2.75rem 0 2.6rem; border-radius: var(--r);
    border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px;
}
.search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-050); }
.search .clear { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.search input::-webkit-search-cancel-button { display: none; }

.seg { display: flex; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem; min-height: 38px; padding: 0 .8rem;
    border-radius: 9px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600; font-size: .84rem; cursor: pointer; white-space: nowrap;
}
.seg a:hover, .seg button:hover { color: var(--ink); text-decoration: none; }
.seg .on { background: var(--surface); color: var(--primary-ink); box-shadow: var(--shadow-sm); }
.seg .n { font-size: .72rem; padding: 0 .4rem; border-radius: var(--r-pill); background: var(--surface-3); color: var(--ink-2); }
.seg .on .n { background: var(--primary-050); color: var(--primary-ink); }

.select, .input, .textarea {
    width: 100%; min-height: 46px; padding: .55rem .8rem; border-radius: var(--r);
    border: 1px solid var(--border-2); background: var(--surface); color: var(--ink);
    font: inherit; font-size: 16px; /* 16px: iOS nu mai face zoom la focus */
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.select { appearance: none; -webkit-appearance: none; padding-right: 2.4rem; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23556377' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .8rem center; }
.select.auto { width: auto; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-050); }
.input[aria-invalid="true"] { border-color: var(--crit); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input[type="date"].input { min-width: 0; -webkit-appearance: none; appearance: none; display: block; }
input[type="date"].input::-webkit-date-and-time-value { text-align: left; }

/* ------------------------------------------------------------- formular */
.field { margin-bottom: 1rem; min-width: 0; }
.label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .35rem; color: var(--ink-2); }
.label .req { color: var(--crit); }
.hint { font-size: .8rem; color: var(--muted); margin: .3rem 0 0; }
.err-txt { font-size: .82rem; color: var(--crit); margin: .3rem 0 0; font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.toggle {
    display: flex; align-items: center; gap: .75rem; min-height: 52px; padding: .55rem .85rem;
    border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); cursor: pointer;
    transition: border-color var(--t-fast), background var(--t-fast); user-select: none; -webkit-user-select: none;
}
.toggle:hover { border-color: var(--border-2); }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .box {
    width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border-2); flex: 0 0 auto;
    display: grid; place-items: center; color: transparent; transition: all var(--t-fast); background: var(--surface);
}
.toggle .box .ic { width: 16px; height: 16px; stroke-width: 3; }
.toggle input:checked + .box { background: var(--good); border-color: var(--good); color: #fff; }
.toggle input:focus-visible + .box { outline: 3px solid var(--primary); outline-offset: 2px; }
.toggle:has(input:checked) { border-color: color-mix(in srgb, var(--good) 45%, var(--border)); background: var(--good-050); }
.toggle .t { flex: 1; min-width: 0; font-weight: 600; font-size: .92rem; }
.toggle .t small { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; }
.toggles { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; margin-bottom: 1rem; }
@media (min-width: 520px) { .toggles.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.pick { display: flex; flex-wrap: wrap; gap: .5rem; }
.pick label { position: relative; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick span {
    display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 1rem; border-radius: var(--r-pill);
    border: 1px solid var(--border-2); background: var(--surface); font-weight: 600; font-size: .88rem; cursor: pointer;
}
.pick input:checked + span { background: var(--primary-050); border-color: var(--primary); color: var(--primary-ink); }
.pick input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }

.drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; text-align: center;
    min-height: 120px; padding: 1rem; border: 2px dashed var(--border-2); border-radius: var(--r-lg);
    background: var(--surface-2); color: var(--muted); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast);
}
.drop:hover, .drop.drag { border-color: var(--primary); background: var(--primary-050); color: var(--primary-ink); }
.drop strong { color: var(--ink); }
.files { display: flex; flex-direction: column; gap: .4rem; margin-top: .6rem; }
.file-row {
    display: flex; align-items: center; gap: .6rem; min-height: 48px; padding: .4rem .5rem .4rem .75rem;
    border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); min-width: 0;
}
.file-row .name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .88rem; }
.file-row .ic { color: var(--crit); }

/* ------------------------------------------------------------- carduri */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-pad { padding: 1.1rem; }
@media (min-width: 640px) { .card-pad { padding: 1.4rem; } }
.form-card { max-width: none; }
@media (min-width: 1100px) {
    .form-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0 2rem; align-items: start; }
    .fc-side { position: sticky; top: calc(var(--nav-h) + 1rem); }
    .fc-side .textarea { min-height: 180px; }
}
@media (min-width: 1500px) { .grid-4w { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* circuit */
.chip.circ { font-weight: 700; border-width: 1.5px; white-space: nowrap; flex: none; }
.chip.circ-depozit { background: #e6f6f4; color: #0f766e; border-color: #0f766e; }
.chip.circ-fabrica { background: var(--accent-050); color: var(--accent); border-color: var(--accent); }
.circ-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.circ-opt { position: relative; display: flex; align-items: center; gap: .7rem; min-height: 64px; padding: .7rem .9rem; border: 1.5px solid var(--border); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.circ-opt input { position: absolute; opacity: 0; pointer-events: none; }
.circ-opt .co-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; background: var(--surface-2); color: var(--muted); }
.circ-opt .co-t { min-width: 0; }
.circ-opt .co-t strong { display: block; }
.circ-opt .co-t small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; }
.circ-opt:hover { border-color: var(--border-2); }
.circ-opt:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.circ-opt.circ-depozit:has(input:checked) { border-color: #0f766e; background: #e6f6f4; }
.circ-opt.circ-depozit:has(input:checked) .co-ic { background: #0f766e; color: #fff; }
.circ-opt.circ-fabrica:has(input:checked) { border-color: var(--accent); background: var(--accent-050); }
.circ-opt.circ-fabrica:has(input:checked) .co-ic { background: #c2410c; color: #fff; }
.circ-pick[aria-invalid="true"] .circ-opt { border-color: var(--crit); }
@media (max-width: 420px) { .circ-opt .co-t small { display: none; } .circ-opt { min-height: 56px; padding: .6rem; gap: .5rem; } }

.jobs { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem; }
@media (min-width: 700px) { .jobs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1360px) { .jobs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.job {
    position: relative; display: flex; flex-direction: column; gap: .75rem; min-width: 0;
    padding: .95rem 1rem 1rem 1.15rem; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-lg); box-shadow: var(--shadow-sm); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.job::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 4px; border-radius: 0 4px 4px 0; background: var(--row, transparent); }
.job:hover { border-color: var(--border-2); box-shadow: var(--shadow); }
.c-good { --row: var(--good); } .c-warn { --row: #eab308; } .c-crit { --row: var(--crit); }
.c-info { --row: #0ea5e9; } .c-prim { --row: var(--prim); } .c-gray { --row: var(--gray); }
.job-top { display: flex; align-items: flex-start; gap: .6rem; min-width: 0; }
.job-top .tt { flex: 1; min-width: 0; }
.job-title { display: block; font-weight: 700; font-size: 1.04rem; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
a.job-title:hover { color: var(--primary-ink); text-decoration: none; }
.job-sub { font-size: .8rem; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.job-meta { display: flex; flex-wrap: wrap; gap: .4rem; min-width: 0; }
.job-foot { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; padding-top: .7rem; border-top: 1px solid var(--border); }
.job { container-type: inline-size; }
@container (max-width: 430px) { .job-foot .lbl { display: none; } .job-foot .btn.sm { padding: 0 .6rem; } }
.job-foot .grow { min-width: 0; }

.kv { display: grid; grid-template-columns: minmax(0, 1fr); gap: .35rem; font-size: .86rem; }
.kv-row { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; min-width: 0; }
.kv-row .k { color: var(--muted); flex: 0 0 auto; }
.kv-row .v { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* inel progres */
.ring {
    --p: 0; --c: var(--primary);
    width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; position: relative;
    background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0);
}
.ring::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.ring b { position: relative; z-index: 1; font-size: .74rem; font-weight: 700; }
.ring.full { --c: var(--good); }

/* pipeline 3 etape */
.pipe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.pipe-step { min-width: 0; }
.pipe-bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.pipe-bar i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 3px; }
.pipe-step.done .pipe-bar i { background: var(--good); }
.pipe-lbl { display: flex; justify-content: space-between; gap: .25rem; margin-top: .3rem; font-size: .72rem; font-weight: 600; color: var(--muted); }
.pipe-lbl span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipe-step.active .pipe-lbl { color: var(--primary-ink); }
.pipe-step.done .pipe-lbl { color: var(--good); }

/* chip / badge */
.chip {
    display: inline-flex; align-items: center; gap: .3rem; max-width: 100%; min-width: 0;
    min-height: 28px; padding: .15rem .6rem; border-radius: var(--r-pill);
    background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border);
    font-size: .76rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere;
}
.chip .ic { width: 14px; height: 14px; }
a.chip:hover { border-color: var(--border-2); background: var(--surface-3); text-decoration: none; }
.chip.ok   { background: var(--good-050); color: var(--good); border-color: transparent; }
.chip.warn { background: var(--warn-050); color: var(--warn); border-color: transparent; }
.chip.crit { background: var(--crit-050); color: var(--crit); border-color: transparent; }
.chip.prim { background: var(--primary-050); color: var(--primary-ink); border-color: transparent; }
.chip.acc  { background: var(--accent-050); color: var(--accent); border-color: transparent; }
a.chip.pdf { min-height: 36px; padding: .2rem .75rem; background: var(--surface); }
a.chip.pdf .ic { color: var(--crit); width: 16px; height: 16px; }
@media (pointer: coarse) { a.chip.pdf { min-height: 44px; } }
.tbl td a.chip, .chip.nowrap { white-space: nowrap; overflow-wrap: normal; flex-shrink: 0; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: var(--r-pill); font-size: .74rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.badge.good { background: var(--good-050); color: var(--good); }
.badge.warn { background: var(--warn-050); color: var(--warn); }
.badge.crit { background: var(--crit-050); color: var(--crit); }
.badge.prim { background: var(--primary-050); color: var(--primary-ink); }

.steps { display: flex; flex-wrap: wrap; gap: .35rem; }
.step { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .55rem; border-radius: var(--r-pill); font-size: .74rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.step .ic { width: 13px; height: 13px; }
.step.done { background: var(--good-050); color: var(--good); border-color: transparent; }

/* observații pe card */
.note {
    display: block; width: 100%; text-align: left; padding: .6rem .75rem; border-radius: var(--r);
    background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; color: var(--ink); min-width: 0;
}
.note:hover { border-color: var(--border-2); }
.note .nl { display: flex; align-items: center; gap: .35rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.note .nl .ic { width: 14px; height: 14px; }
.note .nt { font-size: .86rem; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: .15rem 0 .35rem; }
.note .nt:last-of-type { margin-bottom: .2rem; }
.note .more { font-size: .76rem; font-weight: 700; color: var(--primary-ink); }
.note-sec + .note-sec { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.note-sec h3 { display: flex; align-items: center; gap: .4rem; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .4rem; }
.note-sec .txt { white-space: pre-wrap; overflow-wrap: anywhere; }

/* culoare rând */
.swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.swatch {
    width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; display: grid; place-items: center;
    background: var(--sw); color: #fff;
}
.swatch .ic { opacity: 0; }
.swatch.on .ic { opacity: 1; }
.swatch.none { --sw: var(--surface); color: var(--ink); }
.swatch.good { --sw: var(--good); } .swatch.warn { --sw: #eab308; } .swatch.crit { --sw: var(--crit); }
.swatch.info { --sw: #0ea5e9; } .swatch.prim { --sw: var(--prim); } .swatch.gray { --sw: var(--gray); }

/* ------------------------------------------------------------ tabel */
.table-wrap { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th, .tbl td { padding: .65rem .75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; white-space: nowrap; z-index: 1; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.name { font-weight: 600; min-width: 180px; }
.tbl td.name a { color: var(--ink); }
.tbl .row-c { position: relative; }
.tbl .row-c::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 0 3px 3px 0; background: var(--row, transparent); }
.tick { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.tick.y { background: var(--good-050); color: var(--good); }
.tick.n { background: var(--surface-2); color: var(--border-2); }
.tick .ic { width: 14px; height: 14px; stroke-width: 3; }

/* tabel -> carduri pe telefon */
@media (max-width: 767.98px) {
    .tbl.cards thead { display: none; }
    .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
    .table-wrap.cards-wrap { border: 0; background: transparent; overflow: visible; }
    .tbl.cards tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: .6rem; padding: .5rem 0; position: relative; }
    .tbl.cards td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 0; padding: .35rem 1rem; min-width: 0; }
    .tbl.cards td > * { min-width: 0; }
    .tbl.cards td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 600; flex: 0 0 auto; }
    .tbl.cards td.name { font-size: 1rem; min-width: 0; padding-top: .5rem; overflow-wrap: anywhere; }
    .tbl.cards td.name::before { display: none; }
    .tbl.cards td.actions { justify-content: flex-end; flex-wrap: wrap; }
    .tbl.cards td.actions::before { display: none; }
    .tbl.cards td[data-label=""]::before { display: none; }
    .tbl.cards .row-c::before { top: 14px; bottom: 14px; }
}

/* ------------------------------------------------------------ detaliu */
.detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 1100px) { .detail { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }
.stage { padding: 1rem 1.1rem; }
.stage + .stage { border-top: 1px solid var(--border); }
.stage-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .75rem; }
.stage-ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: 0 0 auto; }
.stage.active .stage-ic { background: var(--primary-050); color: var(--primary-ink); }
.stage.done .stage-ic { background: var(--good-050); color: var(--good); }
.stage-head h2 { font-size: 1.02rem; }
.stage-head .grow { min-width: 0; }
.dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: .1rem; margin-top: .75rem; }
@media (min-width: 560px) { .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .1rem 1.25rem; } }
.dl > div { display: flex; justify-content: space-between; gap: .75rem; padding: .45rem 0; border-bottom: 1px dashed var(--border); min-width: 0; font-size: .88rem; }
.dl dt { color: var(--muted); flex: 0 0 auto; }
.dl dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.txt-block { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: var(--r); padding: .7rem .85rem; font-size: .9rem; margin-top: .6rem; }
.side-card + .side-card { margin-top: 1rem; }
.side-card h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .75rem; }

/* ------------------------------------------------------------ modal / sheet */
.ov {
    position: fixed; inset: 0; z-index: 1500; display: flex; align-items: flex-end; justify-content: center;
    background: var(--scrim); padding: 0;
    animation: fade var(--t) ease-out;
}
.modal {
    width: 100%; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column;
    background: var(--surface); color: var(--ink); border-radius: 20px 20px 0 0; box-shadow: var(--shadow-lg);
    padding-bottom: var(--safe-b); animation: up 240ms cubic-bezier(.2, .8, .2, 1);
}
.modal-head { display: flex; align-items: center; gap: .5rem; padding: .7rem .7rem .7rem 1.1rem; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.modal-head h2 { flex: 1; min-width: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.modal-body { padding: 1.1rem; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; }
.modal-foot { display: flex; gap: .5rem; justify-content: flex-end; padding: .8rem 1.1rem; border-top: 1px solid var(--border); flex: 0 0 auto; background: var(--surface); }
.modal-foot .btn { flex: 1 1 0; }
@media (min-width: 640px) {
    .ov { align-items: center; padding: 1.5rem; }
    .modal { max-width: 560px; border-radius: 20px; padding-bottom: 0; animation: pop 200ms ease-out; max-height: 88vh; }
    .modal.wide { max-width: 760px; }
    .modal-foot .btn { flex: 0 0 auto; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
/* blocarea derulării se pune pe <html>: pe <body> ar transforma body în container de derulare și bara de sus (sticky) ar dispărea */
html.modal-open { overflow: hidden; }

.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.menu-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; min-height: 88px; padding: .6rem;
    border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: .82rem; text-align: center;
}
.menu-tile:hover { text-decoration: none; border-color: var(--border-2); }
.menu-tile.active { border-color: var(--primary); color: var(--primary-ink); background: var(--primary-050); }

/* notificări */
.noti { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 0; border-bottom: 1px solid var(--border); }
.noti:last-child { border-bottom: 0; }
.noti-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-050); color: var(--primary-ink); flex: 0 0 auto; }
.noti-ic.acc { background: var(--accent-050); color: var(--accent); }
.noti-txt { flex: 1; min-width: 0; }
.noti-txt a { color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.noti-txt p { margin: .1rem 0 0; font-size: .85rem; color: var(--muted); }
@media (min-width: 640px) {
    .ov-bell { align-items: flex-start; justify-content: flex-end; padding: calc(var(--nav-h) + 8px) 1rem 1rem; background: transparent; }
    .ov-bell .bell-panel { max-width: 400px; max-height: 70vh; border: 1px solid var(--border); }
}

/* ------------------------------------------------------------ alert / toast / gol */
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border-radius: var(--r); margin-bottom: 1rem; font-weight: 600; font-size: .9rem; }
.alert .ic { margin-top: 1px; }
.alert.ok { background: var(--good-050); color: var(--good); }
.alert.err { background: var(--crit-050); color: var(--crit); }
.alert.info { background: var(--info-050); color: var(--info); }

.toast-host {
    position: fixed; z-index: 2000; left: 50%; transform: translateX(-50%);
    bottom: calc(var(--bn-h) + var(--safe-b) + 12px);
    display: flex; flex-direction: column; gap: .5rem; width: min(92vw, 420px); pointer-events: none;
}
@media (min-width: 1024px) { .toast-host { bottom: 1.25rem; left: auto; right: 1.25rem; transform: none; } }
.toast {
    display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-radius: var(--r);
    background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 600; font-size: .9rem;
    pointer-events: auto; animation: up 200ms ease-out; transition: opacity var(--t), transform var(--t);
}
.toast.err { background: var(--crit); color: #fff; }
.toast .ic { flex: 0 0 auto; }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); border: 1px dashed var(--border-2); border-radius: var(--r-lg); background: var(--surface); }
.empty .ic { width: 36px; height: 36px; margin-bottom: .5rem; color: var(--border-2); }
.empty strong { display: block; color: var(--ink); margin-bottom: .2rem; }

.pager { display: flex; align-items: center; justify-content: center; gap: .4rem; margin-top: 1.25rem; flex-wrap: wrap; }
.pager .pg { min-width: 44px; height: 44px; padding: 0 .5rem; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); font: inherit; font-weight: 600; cursor: pointer; }
.pager .pg:hover { background: var(--surface-2); }
.pager .pg.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager .pg:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pager .icon-btn[disabled] { opacity: .4; cursor: default; }
.pager .pg-gap { color: var(--muted); padding: 0 .1rem; }
.pager .pg-info { flex-basis: 100%; text-align: center; color: var(--muted); font-size: .82rem; }

/* ------------------------------------------------------------ login */
.login-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem calc(1rem + var(--safe-r)) calc(1.25rem + var(--safe-b)) calc(1rem + var(--safe-l)); background: var(--bg); }
.login-card { width: 100%; max-width: 400px; padding: 1.75rem 1.4rem; }
@media (min-width: 480px) { .login-card { padding: 2.2rem 2rem; } }
.login-card .brand-mark { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 1rem; }
.login-card .brand-mark .ic { width: 26px; height: 26px; }
.login-card h1 { text-align: center; font-size: 1.4rem; }
.login-card .sub { text-align: center; color: var(--muted); margin: .25rem 0 1.5rem; font-size: .9rem; }
.pass-wrap { position: relative; }
.pass-wrap .input { padding-right: 3rem; }
.pass-wrap .icon-btn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }

/* ------------------------------------------------------------ calendar */
.cal-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.cal-head h2 { font-size: 1.15rem; min-width: 150px; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.cal-dow { padding: .5rem .25rem; text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cal-day {
    min-height: 92px; padding: .3rem; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: pointer; background: var(--surface); text-align: left; font: inherit; color: inherit;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.out { background: var(--surface-2); color: var(--muted); }
.cal-day .n { font-size: .8rem; font-weight: 700; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .n { background: var(--primary); color: #fff; }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--primary); }
.cal-ev { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: .7rem; font-weight: 600; padding: 2px 5px; border-radius: 5px; background: var(--primary-050); color: var(--primary-ink); white-space: nowrap; border-left: 3px solid currentColor; }
.cal-ev > span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-ev .ic { width: 12px; height: 12px; flex: 0 0 auto; }
/* tipuri: producție = portocaliu, expediere = verde, debitare = violet, eveniment = albastru */
.t-deb  { --tc: #6d28d9;  --tb: #f3efff; }
.t-expd { --tc: #0f766e;  --tb: #e6f6f4; }
.t-expa { --tc: var(--good); --tb: var(--good-050); }
.t-prod { --tc: var(--accent); --tb: var(--accent-050); }
.cal-ev[class*="t-"] { background: var(--tb); color: var(--tc); }
.cal-ev.more { border-left: 0; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.25rem 0 .75rem; }
.cal-tg { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; padding: .25rem .7rem; border-radius: var(--r-pill); border: 1px solid var(--tc); background: var(--tb); color: var(--tc); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.cal-tg .ic { width: 15px; height: 15px; }
.cal-tg[aria-pressed="false"] { background: transparent; color: var(--muted); border-color: var(--border); text-decoration: line-through; }
.cal-tg:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (pointer: coarse) { .cal-tg { min-height: 44px; } }
.ev-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; background: var(--tb); color: var(--tc); }
.ev-ic .ic { width: 18px; height: 18px; }
.ev-type { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--tc); }
.cal-ev.more { background: transparent; color: var(--muted); padding: 0 5px; }
@media (max-width: 639.98px) {
    .cal-day { min-height: 54px; align-items: center; padding: .25rem .1rem; }
    .cal-ev { display: none; }
    .cal-day .dots { display: flex; gap: 3px; justify-content: center; }
    .cal-day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
    .cal-day .dots i[class*="t-"] { background: var(--tc); }
}
@media (min-width: 640px) { .cal-day .dots { display: none; } }
.cal-list { margin-top: 1rem; }
.ev-row { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.ev-row:last-child { border-bottom: 0; }
.ev-bar { width: 4px; align-self: stretch; border-radius: 2px; background: var(--primary); flex: 0 0 auto; }
.ev-bar.job { background: var(--accent); }
.ev-row .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ev-row .t small { display: block; color: var(--muted); }

/* ------------------------------------------------------------ utilitare */
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1rem; }
.hide-mobile { display: none !important; }
@media (min-width: 768px) { .hide-mobile { display: revert !important; } .only-mobile { display: none !important; } }
/* ascuns unde există bara de jos (acolo e deja butonul „Adaugă") */
@media (max-width: 1023.98px) { .hide-bn { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media print {
    .topbar, .sidebar, .bottom-nav, .toolbar, .job-foot, .toast-host { display: none !important; }
    .main { padding: 0; }
    body { background: #fff; }
}
@media (max-width: 559px) {
    .cal-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
    .cal-tg { justify-content: flex-start; padding: .25rem .6rem; font-size: .76rem; }
}
@media (max-width: 400px) {
    .cal-head h2 { min-width: 0; flex: 1 1 auto; font-size: 1rem; text-align: center; }
    .cal-head .grow { display: none; }
    .cal-tg { font-size: .72rem; padding: .25rem .45rem; }
}
.input-locked { display: flex; align-items: center; gap: .5rem; background: var(--surface-2); color: var(--ink-2); cursor: not-allowed; user-select: none; }
.input-locked .ic { color: var(--muted); flex: 0 0 auto; }
@keyframes mcflash { from { box-shadow: 0 0 0 3px var(--primary); } to { box-shadow: 0 0 0 0 transparent; } }
.input.flash { animation: mcflash 1s ease-out; }

/* tabel Depozit / Fabrică */
.st-tbl .steps { margin: 0; gap: .25rem; flex-wrap: wrap; }
.st-tbl td .row { flex-wrap: wrap; gap: .3rem; }
@media (min-width: 768px) {
    .st-tbl td.actions { white-space: nowrap; } .st-tbl td.actions .row { flex-wrap: nowrap; }
    .st-tbl td[data-label="Aviz"] .row { min-width: 175px; }
    .st-tbl td[data-label="Pași"] .steps { min-width: 220px; }
}

/* secțiuni în ferestrele de actualizare */
.msec { border: 1px solid var(--border); border-radius: var(--r-lg); padding: .85rem .9rem .9rem; margin-bottom: .75rem; background: var(--surface); }
.msec[hidden] { display: none; }
.msec-t { display: flex; align-items: center; gap: .55rem; font-size: .9rem; font-weight: 700; margin: 0 0 .75rem; }
.msec-t small { margin-left: auto; font-size: .74rem; font-weight: 600; color: var(--muted); }
.msec-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-050); color: var(--primary-ink); flex: 0 0 auto; }
.msec-ic .ic { width: 16px; height: 16px; }
.msec .toggles:last-child, .msec .field:last-child { margin-bottom: 0; }
.st-tbl .chip { white-space: nowrap; }

/* ------------------------------------------------- comanda bOrg + aviz */
.alert.warn { background: var(--warn-050); color: var(--warn); }
a.chip.borg { min-height: 36px; padding: .2rem .75rem; background: var(--surface); }
a.chip.borg .ic { color: var(--primary); width: 16px; height: 16px; }
@media (pointer: coarse) { a.chip.borg { min-height: 44px; } }
.file-row .row-link { display: flex; align-items: center; gap: .6rem; min-width: 0; color: inherit; text-decoration: none; min-height: 40px; }
.file-row .row-link:hover .name { text-decoration: underline; }
.file-row .row-link .ic-sm { color: var(--muted); flex: none; }
.side-card.need-aviz { border-color: var(--warn); }

/* ------------------------------------------------- notificări pe evenimente + istoric */
.noti-meta { display: flex; gap: .5rem; align-items: baseline; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.noti-when { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 600; white-space: nowrap; }
.noti-txt p { color: var(--ink-2, #3b4744); }
.noti-ic.k-aviz, .hist .k-aviz::before { background: var(--warn-050); color: var(--warn); }
.noti-ic.k-plan, .hist .k-plan::before { background: var(--info-050); color: var(--info); }
.noti-ic.k-depozit, .hist .k-depozit::before { background: #e6f6f4; color: #0f766e; }
.noti-ic.k-livrare, .hist .k-livrare::before { background: var(--accent-050); color: var(--accent); }
.noti-ic.k-fabrica, .hist .k-fabrica::before { background: var(--accent-050); color: var(--accent); }
.noti-ic.k-gata, .hist .k-gata::before { background: var(--good-050); color: var(--good); }
.noti-ic.k-anulat, .hist .k-anulat::before { background: var(--crit-050); color: var(--crit); }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; max-height: 420px; overflow-y: auto; }
.hist li { position: relative; padding-left: 1.3rem; font-size: .86rem; line-height: 1.4; overflow-wrap: anywhere; }
.hist li::before { content: ""; position: absolute; left: 0; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--primary-050); box-shadow: inset 0 0 0 2px currentColor; color: var(--primary); }
.hist .hist-when { display: block; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

/* ------------------------------------------------- lucrare fără aviz (din resturi) */
.chip.resturi { background: var(--good-050); color: var(--good); border-color: transparent; font-weight: 700; white-space: nowrap; }

/* tabel lucrări: butonul de culoare/acțiuni lângă „Detalii”, pe același rând */
.tbl .row-act { display: flex; gap: .25rem; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.tbl .row-act .icon-btn { width: 38px; height: 38px; flex-shrink: 0; }
