/* ============================================================
   Siteap — stylesheet ("Calm Document" refinement)
   PALETTE: exactly 3 brand colors (change them here, once).
   ============================================================ */
:root {
    /* Matched to the ModumBuild design language (2026-09-04) */
    --c-dark:   #111827;   /* 1) ink    — headings, strong text        */
    --c-accent: #2563eb;   /* 2) blue   — primary action, links, focus */
    --c-light:  #f1f5f9;   /* 3) grey   — hover fills                  */

    /* neutrals (not brand colors) */
    --c-white:         #FFFFFF;
    --c-text:          #374151;
    --c-muted:         #6b7280;   /* secondary body text */
    --c-muted-2:       #9ca3af;   /* quiet micro-labels  */
    --c-border:        #e5e7eb;   /* card / panel hairlines */
    --c-border-strong: #d1d5db;   /* form controls */
    --c-row-line:      #eef2f7;   /* inner table rows */
    --c-row-hover:     #f8fafc;

    --radius:    8px;
    --radius-sm: 6px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 2px rgba(27,38,59,.05);
    --shadow:    0 1px 2px rgba(27,38,59,.05), 0 1px 3px rgba(27,38,59,.06);
    --shadow-md: 0 4px 16px rgba(27,38,59,.10);
    --shadow-lg: 0 16px 40px rgba(27,38,59,.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Arial, sans-serif;
    background: #F8F7F2;
    color: var(--c-text);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -0.006em;
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ===================== TOPBAR ===================== */
.topbar {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #1e293b;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 1px 0 #e2e8f0;
}
.topbar-inner {
    max-width: 1560px; margin: 0 auto; padding: 0 32px;
    height: 60px; display: flex; align-items: center; gap: 28px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
    width: 32px; height: 32px; background: var(--c-accent); color: #fff;
    border-radius: var(--radius-sm); display: grid; place-items: center;
    font-weight: 700; font-size: 18px;
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand-logo { height: 32px; width: auto; max-width: 150px; object-fit: contain; display: block; border-radius: var(--radius-sm); }
.auth-brand .brand-logo { height: 40px; max-width: 200px; }

.nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-item { position: relative; }
.nav-link {
    display: flex; align-items: center; gap: 4px;
    padding: 8px 12px; border-radius: var(--radius-sm);
    color: #374151; font-size: 13.5px; font-weight: 500;
    cursor: pointer; white-space: nowrap; transition: background .15s, color .15s;
}
.nav-link:hover { background: #f1f5f9; color: #1d4ed8; }
.nav-link.active { background: transparent; color: #1d4ed8; box-shadow: inset 0 -2px 0 var(--c-accent); border-radius: 0; }
.caret { font-size: 9px; opacity: .55; margin-left: 4px; }

.dropdown {
    position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px;
    background: var(--c-white); border: 1px solid var(--c-border);
    border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 6px;
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.nav-item.has-children:hover .dropdown,
.nav-item.open .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-link { display: block; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--c-text); font-size: 14px; }
.dropdown-link:hover { background: var(--c-light); color: var(--c-dark); }

.topbar-right { display: flex; align-items: center; gap: 18px; }
.lang { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.lang-link { color: #9ca3af; font-weight: 600; padding: 2px 4px; }
.lang-link.active, .lang-link:hover { color: #111827; }
.lang-sep { color: #d1d5db; }

.user-chip { display: flex; align-items: center; gap: 8px; }
a.user-chip { padding: 4px 6px; border-radius: var(--radius-sm); transition: background .15s; }
a.user-chip:hover { background: #f1f5f9; }
.user-avatar {
    width: 30px; height: 30px; background: var(--c-accent); border-radius: 50%;
    display: grid; place-items: center; font-weight: 600; font-size: 13px; color: #fff;
}
.user-name { font-size: 13.5px; font-weight: 500; }
img.user-avatar { object-fit: cover; }

/* User avatars (photo or initials) */
.uavatar {
    border-radius: 50%; object-fit: cover; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(37,99,235,.12); color: var(--c-accent); font-weight: 600; overflow: hidden;
}
.uavatar--sm { width: 30px; height: 30px; font-size: 12px; }
.uavatar--md { width: 40px; height: 40px; font-size: 15px; }
.uavatar--lg { width: 64px; height: 64px; font-size: 22px; }
.avatar-upload { display: flex; align-items: center; gap: 16px; }
.avatar-controls { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.avatar-remove-btn { background: none; border: 0; padding: 0; color: var(--c-muted); font-size: 12px; cursor: pointer; text-decoration: underline; }
.avatar-remove-btn:hover { color: #b91c1c; }

/* Role cards (Utilizatori) */
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.role-card { display: flex; flex-direction: column; padding: 20px; }
.role-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.role-card-head h2 { font-size: 15px; font-weight: 600; color: var(--c-dark); margin: 0; }
.role-count { display: inline-block; margin-left: 4px; font-size: 12px; font-weight: 600; color: var(--c-muted); background: var(--c-light); border-radius: 999px; padding: 1px 8px; }
.link-btn { background: none; border: none; color: var(--c-accent); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.role-card-list { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.role-card-user { display: flex; align-items: center; gap: 10px; }
.rcu-info { flex: 1; min-width: 0; }
.rcu-name { font-size: 14px; font-weight: 600; color: var(--c-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcu-email { font-size: 12px; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcu-empty { font-size: 13px; padding: 8px 0; }
.role-card-manage { margin-top: 16px; width: 100%; text-align: center; }

/* Status badges */
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.status-active   { background: #dcfce7; color: #15803d; }
.status-pending  { background: #fef9c3; color: #a16207; }
.status-inactive { background: #eef1f6; color: #6b7686; }

/* Users toolbar (tabs + search) */
.users-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--c-border); flex-wrap: wrap; }
.user-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.user-tab { background: none; border: none; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--c-muted); cursor: pointer; padding: 6px 12px; border-radius: var(--radius-sm); }
.user-tab:hover { background: var(--c-light); color: var(--c-dark); }
.user-tab.active { background: rgba(37,99,235,.10); color: var(--c-accent); }
.tab-count { font-size: 12px; opacity: .8; }
.user-search { width: 260px; max-width: 100%; padding: 8px 12px; border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; }
.user-search:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* Account cell (avatar + name) */
.account-cell { display: flex; align-items: center; gap: 10px; }

@media (max-width: 980px) {
    .role-cards { grid-template-columns: 1fr; }
    .users-toolbar { flex-direction: column; align-items: stretch; }
    .user-search { width: 100%; }
}

.logout-form { margin: 0; }
.logout-btn {
    background: transparent; border: 1px solid #d1d5db;
    color: #374151; font: inherit; font-size: 13px; font-weight: 500;
    padding: 6px 12px; border-radius: var(--radius-sm); cursor: pointer;
    transition: background .15s, color .15s;
}
.logout-btn:hover { background: #f1f5f9; color: #111827; }

/* ===================== PAGE ===================== */
.page { max-width: 1280px; margin: 0 auto; padding: 40px 32px; }
.page.layout-wide { max-width: 1560px; }
.page.layout-full { max-width: none; }
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; color: var(--c-dark); }
.page-head p { margin-top: 6px; }
.muted { color: var(--c-muted); }
.page-head--row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-block; color: var(--c-accent); font-size: 14px; margin-bottom: 8px; }
.back-link:hover { text-decoration: underline; }

/* ===================== CARDS ===================== */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.card { background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.card-label { font-size: 13px; color: var(--c-muted-2); font-weight: 500; margin-bottom: 8px; }
.card-value { font-size: 26px; font-weight: 700; color: var(--c-dark); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.card-unit { font-size: 14px; font-weight: 600; color: var(--c-muted); }

/* ===================== PANELS ===================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.panel h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--c-dark); margin-bottom: 20px; }
.panel--flush { padding: 0; overflow: hidden; }
.panel--narrow { max-width: 560px; }

/* ===================== BUTTONS ===================== */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
    display: inline-block; padding: 9px 16px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; cursor: pointer;
    background: var(--c-white); color: var(--c-text); border: 1px solid var(--c-border-strong);
    transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--c-light); border-color: #CDD5E3; }
.btn-primary { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn-block { width: 100%; text-align: center; padding: 11px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger { background: var(--c-white); color: #b91c1c; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.inline { display: inline; }

/* ===================== EMPTY STATE ===================== */
.empty-state { text-align: center; padding: 72px 20px; }
.empty-state h1 { font-size: 16px; font-weight: 600; color: var(--c-dark); margin-bottom: 6px; }
.empty-state .btn { margin-top: 20px; }

/* ===================== ALERTS ===================== */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alert-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-error ul { margin: 0; padding-left: 18px; }

/* ===================== TABLE ===================== */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table thead th {
    text-align: left; padding: 12px 20px; background: #f8fafc;
    color: #334155; font-weight: 700; font-size: 12px;
    text-transform: uppercase; letter-spacing: .02em;
    border-bottom: 1px solid var(--c-border);
}
.table tbody td { padding: 14px 20px; border-bottom: 1px solid var(--c-row-line); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--c-row-hover); }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table .strong { font-weight: 600; color: var(--c-dark); }
.ta-right { text-align: right; font-variant-numeric: tabular-nums; }
/* headers of right-aligned columns (ACTIUNI, amounts): ".table thead th" would otherwise keep them left */
.table thead th.ta-right { text-align: right; }
.nowrap { white-space: nowrap; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--c-row-line); color: var(--c-muted); }
.badge--accent { background: rgba(37,99,235,.10); color: var(--c-accent); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.dot--on  { background: #16a34a; }
.dot--off { background: #c0c6d0; }

.pagination-wrap { padding: 16px 24px; }

/* ===================== FORMS ===================== */
.form .field { margin-bottom: 20px; }
.form label { display: block; font-size: 13px; font-weight: 600; color: var(--c-dark); margin-bottom: 6px; }
.form input[type=text],
.form input[type=email],
.form input[type=password],
.form input[type=date],
.form input[type=number],
.form select,
.form textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit; color: var(--c-text); background: #fff;
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus {
    outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form .hint { display: block; margin-top: 5px; font-size: 12px; color: var(--c-muted-2); }
.form input[type=file] { font-size: 13px; }

.field--check { margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--c-accent); }
.check--block { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; }

/* Field label wrapping an input (used in modals) */
.field-label { display: block; margin-bottom: 16px; font-size: 13px; font-weight: 600; color: var(--c-dark); }
.field-label input[type=text],
.field-label input[type=email],
.field-label input[type=password],
.field-label select {
    display: block; width: 100%; margin-top: 6px;
    padding: 10px 12px; border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm);
    font-size: 14px; font-family: inherit; font-weight: 400; color: var(--c-text); background: #fff;
}
.field-label input:focus, .field-label select:focus {
    outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.field-label .hint { display: block; margin-top: 5px; font-weight: 400; }

/* Permissions section (Editor role) */
.perms-section { display: none; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; background: #fff; }
.perms-title { font-size: 13px; font-weight: 600; color: var(--c-dark); margin-bottom: 4px; }
.perm-group { margin-top: 14px; }
.perm-group:first-of-type { margin-top: 8px; }
.perm-group-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted-2); margin-bottom: 8px; }
.perm-items { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.perm-item { font-size: 13px; font-weight: 500; }
.perm-item input { width: 15px; height: 15px; accent-color: var(--c-accent); }

/* Projects assignment in user modal */
.user-projects { margin-bottom: 16px; }
.ulabel { font-size: 13px; font-weight: 600; color: var(--c-dark); margin-bottom: 8px; }

/* Form sections + responsive grid */
.form-section {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    color: var(--c-muted-2); margin: 28px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--c-border);
}
.form-section:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 24px; }

/* Larger contract-form fields */
.form-lg input[type=text],
.form-lg input[type=email],
.form-lg input[type=password],
.form-lg input[type=date],
.form-lg input[type=number],
.form-lg select { padding-top: 15px; padding-bottom: 15px; }
.form-lg .tagselect-box { min-height: 52px; }

/* Nice file upload button */
.file-field { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.file-input { position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; overflow: hidden; }
.file-btn {
    display: inline-block; padding: 11px 20px;
    background: var(--c-white); color: var(--c-text);
    border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; transition: background .15s, border-color .15s;
}
.file-field:hover .file-btn { background: var(--c-light); border-color: #CDD5E3; }
.file-name { font-size: 13px; color: var(--c-muted); }

/* Inline link */
.link { color: var(--c-accent); font-weight: 500; }
.link:hover { text-decoration: underline; }

/* Topbar project switcher */
.proj-switch-current { background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.proj-switch-option { width: 100%; text-align: left; background: none; border: none; cursor: pointer; font: inherit; }
.proj-switch-option.is-active { color: var(--c-accent); font-weight: 600; }
.dropdown--right { left: auto; right: 0; }

/* No-project banner */
.project-banner {
    background: #fff7e6; color: #8a5a00; border-bottom: 1px solid #fde68a;
    text-align: center; padding: 10px 16px; font-size: 14px;
}

/* Project picker choices (login pop-up) */
.project-choices { display: flex; flex-direction: column; gap: 8px; }
.project-choice {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    padding: 12px; background: #fff; border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm); cursor: pointer; transition: background .15s, border-color .15s;
}
.project-choice:hover { background: var(--c-light); border-color: var(--c-accent); }
.project-choice-text { display: flex; flex-direction: column; }
.project-choice-name { font-weight: 600; color: var(--c-dark); font-size: 14px; }
.project-choice-addr { font-size: 13px; color: var(--c-muted); }

/* Project photo thumbnail + preview */
.project-thumb {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    object-fit: cover; background: var(--c-light); color: var(--c-muted-2);
    font-weight: 600; font-size: 15px; vertical-align: middle;
}
.project-thumb--empty { border: 1px solid var(--c-border); }
.foto-preview { margin-bottom: 10px; }
.foto-preview img { max-width: 180px; max-height: 130px; border-radius: var(--radius-sm); border: 1px solid var(--c-border); display: block; }

/* Actiune/detalii picker: dropdown on the left, chosen field on the right */
.detalii-row { display: flex; gap: 12px; align-items: flex-start; }
.detalii-select { flex: 0 0 220px; }
.detalii-inputs { flex: 1; min-width: 0; }
.detalii-inputs input { display: none; }
.detalii-inputs input.active { display: block; }
@media (max-width: 980px) {
    .detalii-row { flex-direction: column; }
    .detalii-select { flex: none; width: 100%; }
}

/* Combined "Detalii" cell (Descriere | Avans | Comenzi) */
.detalii-cell { max-width: 360px; font-size: 14px; line-height: 1.5; }
.detalii-label { font-weight: 600; color: var(--c-dark); }
.detalii-sep { color: var(--c-border); margin: 0 7px; font-weight: 600; }

/* Contract documents */
.doc-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--c-border); border-radius: var(--radius-sm); }
.doc-name { flex: 1; min-width: 0; word-break: break-all; }
.new-docs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.new-doc-row { display: flex; gap: 10px; align-items: center; }
.new-doc-cat { flex: 0 0 200px; }
.new-doc-file { flex: 1; font-size: 13px; }
.doc-chip { display: inline-block; font-size: 13px; margin: 1px 8px 1px 0; white-space: nowrap; }
@media (max-width: 980px) {
    .new-doc-row { flex-direction: column; align-items: stretch; }
    .new-doc-cat { flex: none; width: 100%; }
}

/* Contract status badges (functional semantic tints) */
.cstatus-rezolvat      { background: #dcfce7; color: #15803d; }
.cstatus-asteptam      { background: #fef9c3; color: #a16207; }
.cstatus-nu_impune     { background: #eef1f6; color: #6b7686; }
.cstatus-in_ofertare   { background: rgba(37,99,235,.10); color: var(--c-accent); }
.cstatus-de_finalizat  { background: #fdf0e6; color: #b5651d; }
.cstatus-in_curs       { background: rgba(37,99,235,.10); color: var(--c-accent); }
.cstatus-cauta_solutie { background: #eef1f6; color: #6b7686; }
.status-note { font-size: 12px; color: var(--c-muted); margin-top: 3px; max-width: 220px; }
.status-detail-wrap { display: none; }

/* Responsabili tag select */
.tagselect { position: relative; }
.tagselect-box {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding: 6px 8px; min-height: 42px;
    border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm); background: #fff;
}
.tagselect-box:focus-within { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.tagselect-chips { display: contents; }
.tag-chip {
    display: inline-flex; align-items: center; gap: 2px;
    background: rgba(37,99,235,.10); color: var(--c-accent);
    border-radius: 999px; padding: 3px 6px 3px 11px; font-size: 13px; font-weight: 500;
}
.tag-chip button { background: none; border: none; color: var(--c-accent); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 3px; }
.tag-chip button:hover { color: #1d4ed8; }
.tagselect-input { flex: 1; min-width: 150px; border: none; outline: none; font: inherit; font-size: 14px; padding: 4px; background: transparent; }
.tagselect-dropdown {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50;
    background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md); max-height: 240px; overflow-y: auto; display: none;
}
.tagselect-dropdown.open { display: block; }
.tagselect-option { padding: 9px 12px; font-size: 14px; cursor: pointer; }
.tagselect-option:hover { background: var(--c-light); color: var(--c-accent); }

/* ===================== MODAL ===================== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(20,28,46,.45);
    display: none; align-items: center; justify-content: center;
    padding: 24px; z-index: 200;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--c-white); border-radius: var(--radius-lg); width: 100%; max-width: 460px;
    box-shadow: var(--shadow-lg); animation: modalIn .15s ease-out;
    display: flex; flex-direction: column; max-height: calc(100vh - 48px);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.modal--lg { max-width: 540px; }
.modal--add { max-width: 860px; }
.modal--xl { max-width: 780px; }

/* Two fields side by side (Prenume+Nume, Email+Telefon) */
.field-row { display: flex; gap: 16px; align-items: flex-start; }
.field-row .field-label { flex: 1 1 0; min-width: 0; }

/* Drepturi: Administrator toggle + per project, one block per menu category (its pages under "Pagini") */
.drepturi { margin: 6px 0 4px; }
.drepturi-admin { margin: 8px 0 16px; font-weight: 600; }
.perm-hint { margin: -6px 0 2px; }
.perm-projects { display: flex; flex-direction: column; gap: 16px; }
.perm-project-title { font-size: 14px; font-weight: 700; color: var(--c-dark); margin-bottom: 6px; }
.perm-cat { border: 1px solid var(--c-border); border-radius: 8px; margin-bottom: 6px; }
.perm-cat-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
/* (.drepturi prefix: stronger than the modal form's ".form label" / ".form select" rules) */
.drepturi label.check { display: inline-flex; margin-bottom: 0; }
.drepturi .perm-cat-name { flex: 1; font-weight: 600; }
.drepturi .perm-level { flex: none; width: 130px; height: 32px; padding: 4px 8px; font-size: 13px; border: 1px solid var(--c-border); border-radius: 6px; background: #fff; }
.drepturi .perm-level:disabled { opacity: .45; }
.perm-cat-toggle { background: none; border: 1px solid var(--c-border); border-radius: 6px; padding: 6px 10px; font-size: 13px; color: var(--c-muted); cursor: pointer; white-space: nowrap; }
.perm-cat-toggle:hover, .perm-cat-toggle[aria-expanded="true"] { color: var(--c-dark); border-color: var(--c-muted); }
.perm-cat-pages { border-top: 1px solid var(--c-border); background: #f8fafc; padding: 4px 12px 6px 34px; border-radius: 0 0 8px 8px; }
.perm-page { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; }
.perm-page .check { font-weight: 500; }
@media (max-width: 560px) {
    .perm-cat-head { flex-wrap: wrap; }
    .perm-cat-name { flex-basis: 100%; }
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--c-border); }
.modal-head h2 { font-size: 15px; font-weight: 600; color: var(--c-dark); }
.modal-close { background: none; border: none; font-size: 22px; line-height: 1; color: var(--c-muted); cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--c-dark); }
.modal-body { padding: 20px 24px 24px; overflow-y: auto; }

/* ===================== LOGIN ===================== */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #1B263B 0%, #2a3a57 100%); }
.auth-card { width: 100%; max-width: 400px; background: var(--c-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 36px 32px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 22px; }
.auth-brand .brand-name { color: var(--c-dark); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.auth-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--c-dark); text-align: center; }
.auth-sub { text-align: center; margin-bottom: 24px; font-size: 14px; }
.btn-block { width: 100%; text-align: center; padding: 11px; }
.auth-forgot { text-align: center; margin-top: 16px; font-size: 13px; }
.auth-forgot a { color: var(--c-accent); }
.auth-forgot a:hover { text-decoration: underline; }
.auth-lang { text-align: center; margin-top: 20px; font-size: 13px; }
.auth-lang a { color: var(--c-accent); }
.auth-lang a:hover { text-decoration: underline; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 980px) {
    .page { padding: 28px 20px; }
    .topbar-inner { padding: 0 20px; }
    .cards { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .nav { display: none; } /* a mobile menu can be added later */
}

/* ===================== CONTRACTS TRACKING ===================== */
/* Generic form helpers (used in modals outside a .form wrapper) */
.form-control { width: 100%; padding: 10px 12px; border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; color: var(--c-text); background: #fff; }
.form-control:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
textarea.form-control { resize: vertical; }

/* Uniform single-line field heights inside modals */
.modal-body input.form-control:not([type=file]),
.modal-body select.form-control { height: 42px; }
.modal-body input[type=file].form-control { height: 42px; padding-top: 9px; padding-bottom: 9px; }
.modal-body .ac-box { min-height: 42px; }
.modal-body textarea.form-control { min-height: 42px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--c-dark); margin-bottom: 6px; }
.form-error { display: block; margin-top: 5px; font-size: 12px; color: #b91c1c; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .field { flex: 1; min-width: 140px; }
.modal-body .field { margin-bottom: 18px; }

/* Table layout */
.contracts-table th.th-narrow, .contracts-table td.hist-cell, .contracts-table td.nr-crt { width: 1%; white-space: nowrap; }
.contracts-table .th-termen { width: 130px; }
.contracts-table .th-status { width: 155px; }
.contracts-table .th-docs { width: 135px; }
.contracts-table td { vertical-align: middle; }
.nr-crt { text-align: center; color: var(--c-muted); font-weight: 600; }

/* Tracking expander arrow */
.hist-btn { background: none; border: none; cursor: pointer; font-size: 26px; line-height: 1; color: var(--c-muted); padding: 0 6px; border-radius: var(--radius-sm); transition: transform .15s, color .15s; }
.hist-btn:hover { color: var(--c-dark); }
.hist-btn.open { transform: rotate(180deg); color: var(--c-accent); }
.contracts-table td.hist-cell { text-align: center; }

/* Compact rows + wider Obiect Contract column */
.contracts-table thead th { padding: 9px 12px; }
.contracts-table tbody td { padding: 7px 12px; }
.contracts-table th:first-child, .contracts-table td:first-child { padding-left: 18px; }
.contracts-table th:last-child, .contracts-table td:last-child { padding-right: 14px; }
.contracts-table .th-obiect { width: 400px; }

/* Contracts filter bar */
.contracts-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end; padding: 14px 18px; border-bottom: 1px solid var(--c-border); }
.filter-input, .filter-select { padding: 8px 12px; border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm); font-size: 13.5px; font-family: inherit; color: var(--c-text); background: #fff; }
.filter-input { flex: 0 1 440px; min-width: 150px; }
.filter-select { flex: 0 0 auto; min-width: 170px; cursor: pointer; }
.filter-input:focus, .filter-select:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* Editable cells */
.cell-editable { display: block; width: 100%; text-align: left; background: none; border: 1px dashed transparent; border-radius: var(--radius-sm); padding: 6px 8px; font: inherit; color: var(--c-text); cursor: pointer; white-space: normal; }
.cell-editable:hover { border-color: var(--c-border-strong); background: #fbfcfe; }

/* Termen — colored pill, like Status */
.termen-cell { padding: 6px 10px; }
.termen-input, .termen-pill {
    display: inline-block; border: 1px solid var(--c-border-strong); border-radius: 999px;
    padding: 5px 12px; font-size: 13px; font-weight: 500; font-family: inherit; background: #fff;
    cursor: pointer; text-align: center;
}
.termen-input { width: 116px; }
.termen-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.termen-green  { background: #e9f7ef; color: #15803d; border-color: #86efac; }
.termen-orange { background: #fdf3e3; color: #a16207; border-color: #fde68a; }
.termen-red    { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

/* Status inline */
.status-select-inline { border: 1px solid var(--c-border-strong); border-radius: 999px; padding: 5px 10px; font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer; background: #fff; }
.status-select-inline:focus { outline: none; border-color: var(--c-accent); }
.cstatus-ofertare    { background: #fef9c3; color: #a16207; border-color: #fde68a; }
.cstatus-contractare { background: #e8f0fe; color: #1a56c4; border-color: #c9dcfb; }
.cstatus-rezolvat    { background: #dcfce7; color: #15803d; border-color: #86efac; }
span.badge.cstatus-ofertare, span.badge.cstatus-contractare, span.badge.cstatus-rezolvat { font-weight: 500; }

/* Documents */
.doc-btn { white-space: nowrap; }
.docs-list { margin-bottom: 16px; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--c-border); }
.doc-row:last-child { border-bottom: none; }
.doc-name { flex: 1; min-width: 0; word-break: break-word; }
.doc-add-form { border-top: 1px solid var(--c-border); padding-top: 14px; }
.doc-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.doc-add-row select { flex: 0 0 130px; }
.doc-add-row input[type=file] { flex: 1; min-width: 140px; }

/* Documents inside the Add-contract form */
.add-doc-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.add-doc-row .filepick { flex: 0 0 auto; }
.add-doc-desc { flex: 1 1 220px; }
.add-doc-remove { flex: 0 0 auto; line-height: 1; }
/* "+ Adauga document" — a tidy accent-tinted add button, with breathing room before the hint. */
#addDocRowBtn { margin-top: 4px; color: var(--c-accent); background: rgba(37,99,235,.06); border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm); padding: 8px 14px; font-size: 13px; font-weight: 600; }
#addDocRowBtn:hover { background: rgba(37,99,235,.12); border-color: var(--c-accent); }
#addDocRowBtn + .hint { margin-top: 14px; }

/* Custom file picker — guaranteed visible, styled button + filename */
.filepick { position: relative; display: inline-flex; align-items: center; gap: 10px; vertical-align: middle; }
.filepick-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.filepick-btn { display: inline-block; background: var(--c-accent); color: #fff; padding: 9px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; white-space: nowrap; }
.filepick:hover .filepick-btn { filter: brightness(.93); }
.filepick-btn--err { box-shadow: 0 0 0 2px #b91c1c; }
.filepick-name { font-size: 13px; color: var(--c-muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Autocomplete (responsabil / membri) */
.ac { position: relative; }
.ac-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 42px; padding: 6px 8px; border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm); background: #fff; }
.ac-box:focus-within { border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.ac-chips { display: contents; }
.ac-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(37,99,235,.10); color: var(--c-accent); border-radius: 999px; padding: 3px 6px 3px 10px; font-size: 13px; font-weight: 500; }
.ac-chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: 15px; line-height: 1; padding: 0; }
.ac-input { flex: 1; min-width: 120px; border: none; outline: none; font: inherit; padding: 4px; background: none; }
.ac-dropdown { display: none; position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(27,38,59,.12); z-index: 20; max-height: 220px; overflow-y: auto; }
.ac-dropdown.open { display: block; }
.ac-option { padding: 9px 12px; cursor: pointer; font-size: 14px; }
.ac-option:hover { background: var(--c-light); }

/* Inline tracking timeline (expands under the contract) */
.tracking-row > .tracking-cell { background: #fff; padding: 14px 20px 16px 48px; border-bottom: 2px solid var(--c-border); }

/* Main contract line uses the pale tone; the preview + full history are white. */
.contracts-table tbody tr.contract-row > td { border-bottom: none; background: #f8fafc; }
.contracts-table tbody tr.contract-row:hover > td { background: #eef2f8; }
.last-mod-row > .last-mod-cell { background: #fff; padding: 4px 18px 8px; border-bottom: 1px solid var(--c-border); }
.last-mod-cell .track-item { padding: 0; border: none; font-size: 12.5px; }
.last-mod-cell .track-date, .last-mod-cell .track-sep, .last-mod-cell .track-text { color: var(--c-muted); }
.last-mod-cell .track-user { font-weight: 600; color: var(--c-dark); }
.tracking { font-size: 13.5px; }
/* Normal text flow (not flexbox) so the note continues right after the name and wraps
   full-width, instead of the long text dropping to its own line. */
.track-item { padding: 7px 0; border-bottom: 1px solid var(--c-row-line); line-height: 1.55; }
.track-item:last-of-type { border-bottom: none; }
.track-date { color: var(--c-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.track-sep { color: var(--c-border-strong); margin: 0 3px; }
.track-user { font-weight: 600; color: var(--c-dark); white-space: nowrap; }
.track-text { color: var(--c-text); }
.track-note-editable { cursor: text; border-bottom: 1px dashed var(--c-border-strong); }
.track-note-editable:hover { background: #fff6da; }
.track-item--editing { display: flex; align-items: flex-start; }
.track-item--editing .track-date, .track-item--editing .track-sep, .track-item--editing .track-user { padding-top: 7px; }
.track-edit { display: flex; align-items: flex-start; gap: 6px; flex: 1; min-width: 0; }
textarea.track-note-edit { flex: 1; min-width: 0; padding: 6px 10px; resize: none; overflow: hidden; line-height: 1.5; }
.track-edit-btn { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; border: 1px solid var(--c-border-strong); background: #fff; cursor: pointer; font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.track-edit-save { color: #15803d; border-color: #86efac; }
.track-edit-save:hover { background: #dcfce7; }
.track-edit-cancel { color: #b91c1c; border-color: #fecaca; }
.track-edit-cancel:hover { background: #fee2e2; }
.track-add { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.track-doc-link { color: var(--c-accent); font-weight: 500; text-decoration: underline; }
.track-doc-link:hover { text-decoration: none; }
.track-old { color: var(--c-muted); text-decoration: line-through; }
/* Former (inactive/pending) members: name stays visible but dimmed & italic. */
.user-off { font-style: italic; color: var(--c-muted); font-weight: 400; }
.track-user.user-off { font-weight: 400; }
.track-arrow { color: var(--c-accent); font-weight: 700; margin: 0 4px; }
.track-note-input { flex: 1; }
.track-loading, .track-empty { padding: 8px 0; }

/* Document description fields */
.add-doc-desc { flex: 1 1 200px; margin-top: 0; }
/* The remove (×) sits to the right of the description; hidden on the first row
   (you always keep one document slot — the × only appears on rows you add). */
#addDocsRows > .add-doc-row:first-child .add-doc-remove { display: none; }
.doc-add-desc { margin-top: 8px; width: 100%; }

.empty-cell { text-align: center; padding: 40px 0; }

/* ===================== Aprobari Oferte ===================== */
.offers-table .th-nr { width: 70px; }
.offers-table .th-actions { width: 190px; }
.offers-table td { vertical-align: top; }
.offer-obiect { max-width: 560px; }
.offer-obs { font-size: 12.5px; margin-top: 4px; }
.offer-approver { white-space: nowrap; }
.offer-valoare { white-space: nowrap; font-variant-numeric: tabular-nums; }
.offer-decided { font-size: 12px; margin-top: 5px; white-space: nowrap; }
.offer-actions { white-space: nowrap; }
.offer-actions form { display: inline-block; margin-right: 6px; }
.offer-actions form:last-child { margin-right: 0; }

/* Offer status badges (reuse .status-badge shape) */
.ostatus-in_asteptare { background: #fef9c3; color: #a16207; }
.ostatus-aprobata     { background: #dcfce7; color: #15803d; }
.ostatus-respinsa     { background: #fee2e2; color: #b91c1c; }

/* Approve / reject buttons */
.btn-approve { background: #dcfce7; color: #15803d; border-color: #86efac; }
.btn-approve:hover { background: #bbf7d0; border-color: #15803d; }
.btn-reject { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.btn-reject:hover { background: #fecaca; border-color: #b91c1c; }

/* Hints inside modal forms (the generic .form .hint rule doesn't reach these) */
.modal-body .hint { display: block; margin-top: 5px; font-size: 12px; color: var(--c-muted-2); }

/* ===================== Flux aprobari (approval flow designer) ===================== */
.flow-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--c-border); flex-wrap: wrap; }
.flow-module .form-control { width: auto; min-width: 240px; }
.flow-scroll { overflow-x: auto; padding: 38px 24px; }
.flow-canvas { display: flex; align-items: center; min-width: max-content; }

/* Nodes */
.fs-node { padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap; flex: 0 0 auto; }
.fs-start { background: var(--c-dark); color: #fff; box-shadow: var(--shadow-sm); }
.fs-ends { display: flex; flex-direction: column; gap: 10px; flex: 0 0 auto; }
.fs-end-ok { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.fs-end-no { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* Connectors */
.fs-arrow { width: 44px; height: 2px; background: var(--c-border-strong); position: relative; flex: 0 0 auto; }
.fs-arrow::after { content: ''; position: absolute; right: -1px; top: 50%; transform: translateY(-50%); border-left: 7px solid var(--c-border-strong); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }

/* Step cards */
.fs-card { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); width: 230px; padding: 14px 16px 10px; cursor: pointer; flex: 0 0 auto; }
.fs-card:hover { border-color: var(--c-accent); box-shadow: var(--shadow-md); }
.fs-card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.fs-num { width: 24px; height: 24px; border-radius: 50%; background: var(--c-accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; flex: 0 0 auto; }
.fs-title { font-weight: 600; font-size: 14px; color: var(--c-dark); word-break: break-word; padding-top: 2px; }
.fs-mode { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; color: var(--c-muted-2); margin: 0 0 10px 34px; }
.fs-people { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.fs-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--c-light); border-radius: 999px; padding: 3px 10px 3px 4px; font-size: 12.5px; color: var(--c-text); }
.fs-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--c-dark); color: #fff; font-size: 9.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.fs-tools { display: flex; gap: 4px; justify-content: flex-end; margin-top: 10px; border-top: 1px solid var(--c-row-line); padding-top: 6px; }
.fs-tool { background: none; border: none; border-radius: var(--radius-sm); color: var(--c-muted); cursor: pointer; font: inherit; font-size: 14px; line-height: 1; padding: 5px 9px; }
.fs-tool:hover { background: var(--c-light); color: var(--c-dark); }
.fs-tool--del:hover { background: #fee2e2; color: #b91c1c; }

/* Add-step card */
.fs-add { border: 1.5px dashed var(--c-border-strong); border-radius: var(--radius); background: none; color: var(--c-accent); font: inherit; font-size: 13.5px; font-weight: 600; padding: 15px 18px; cursor: pointer; white-space: nowrap; flex: 0 0 auto; }
.fs-add:hover { border-color: var(--c-accent); background: rgba(37,99,235,.05); }

.flow-hint { padding: 0 24px 18px; margin: 0; }

/* Unsaved-changes badge */
.unsaved-badge { display: none; font-size: 12px; font-weight: 600; color: #a16207; background: #fef9c3; border-radius: 999px; padding: 5px 12px; }
.unsaved-badge.show { display: inline-block; }

/* Step popup: mode radios + approver list */
.fm-modes { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.fm-users { max-height: 260px; overflow-y: auto; border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 6px; }
.fm-user { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.fm-user:hover { background: var(--c-light); }
.fm-user input { margin: 0; }

/* Flux aprobari — person cards */
.fs-card--person { width: 250px; }
.fs-card--person .fs-card-head { align-items: center; margin-bottom: 8px; }
.fs-avatar--lg { width: 30px; height: 30px; font-size: 12px; }
.fs-card--off { opacity: .75; }
.fs-card--person .fs-mode { margin-left: 0; }

/* ===================== Financiar (Plati) ===================== */
.colpanel { padding: 12px 18px; margin-bottom: 14px; }
.colpanel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 9px; flex-wrap: wrap; }
.colpanel-head .micro-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted-2); }
.colchips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 32px; border-radius: var(--radius-sm); }
.colchips.dragover { outline: 2px dashed var(--c-accent); outline-offset: 3px; }
.colchip { padding: 5px 13px; border: 1px dashed var(--c-border-strong); border-radius: 999px; font-size: 12.5px; color: var(--c-text); background: var(--c-light); cursor: grab; user-select: none; }
.colchip:active { cursor: grabbing; }
.hint-warn { color: #b91c1c; font-weight: 600; }

.fin-filters { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.fin-filter-select { width: auto; padding: 8px 12px; font-size: 13.5px; }

.fin-table th[data-col] { cursor: grab; white-space: nowrap; }
.fin-table th.dragover { box-shadow: inset 3px 0 0 var(--c-accent); }
.fin-table td { vertical-align: top; }
.th-x { border: none; background: none; color: var(--c-muted-2); cursor: pointer; margin-left: 5px; font-size: 13px; line-height: 1; padding: 0 2px; }
.th-x:hover { color: #b91c1c; }
.th-arrow { width: 34px; }
.fin-cell-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fin-desc { max-width: 420px; }
.fin-late { font-size: 11.5px; margin-top: 3px; white-space: nowrap; }

.fstatus-achitat  { background: #dcfce7; color: #15803d; }
.fstatus-de_plata { background: #fef9c3; color: #a16207; }
.fstatus-restanta { background: #fee2e2; color: #b91c1c; }

.fin-detail > td { background: #F7F8FA; }
.fin-detail-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 24px; padding: 12px 6px; }
.fin-detail-grid .lbl { display: block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted-2); margin-bottom: 2px; }
.fin-detail-wide { grid-column: span 2; }
.fin-detail-actions { display: flex; gap: 8px; padding: 2px 6px 10px; }
.fin-detail-actions form { display: inline; }
@media (max-width: 980px) { .fin-detail-grid { grid-template-columns: repeat(2, 1fr); } }

.fin-pagebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 4px; font-size: 13.5px; color: var(--c-muted); flex-wrap: wrap; }
.fin-pager { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fin-perpage { width: auto; padding: 6px 10px; font-size: 13px; display: inline-block; margin-left: 6px; }
.fin-page-off { opacity: .45; pointer-events: none; }

.fin-tva { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; padding: 10px 0; }
.fin-preview { min-height: 18px; font-variant-numeric: tabular-nums; }
.modal--bill { max-width: 1060px; }
.fin-extra-sec { margin: 14px 0 2px; padding-top: 12px; border-top: 1px solid var(--c-row-line); }
.fin-extra-sec h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted-2); margin-bottom: 12px; }
.fin-ac-wrap { position: relative; }
.fin-ac { display: none; position: absolute; z-index: 40; left: 0; right: 0; top: 100%; margin-top: 2px; background: #fff; border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); max-height: 220px; overflow-y: auto; }
.fin-ac-item { padding: 8px 12px; font-size: 13.5px; cursor: pointer; }
.fin-ac-item:hover { background: var(--c-light); }

.nom-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 980px) { .nom-grid { grid-template-columns: 1fr; } }
.nom-panel h2 { margin-bottom: 12px; }
.nom-add { display: flex; gap: 8px; margin-bottom: 12px; }
.nom-add .form-control { flex: 1; }
.nom-table td { padding: 8px 6px; }
.nom-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.nom-actions form { display: inline; }
.nom-inactive { color: var(--c-muted-2); text-decoration: line-through; }
.nom-empty { padding: 8px 0; }

/* Financiar — Cash overview */

/* Period bar: Tot proiectul | year stepper | An intreg + months | TVA toggle */
.cash-periodbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 6px; }
.cash-pill {
    border: 1px solid var(--c-border-strong); background: #fff; color: var(--c-text);
    font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
    padding: 7px 13px; border-radius: 999px; transition: background .15s, border-color .15s, color .15s;
    text-decoration: none; display: inline-block;
}
.cash-pill:hover { border-color: var(--c-accent); color: var(--c-accent); }
.cash-pill--on { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.cash-pill--on:hover { color: #fff; }
.cash-pill--proj { font-weight: 700; }
.cash-psep { width: 1px; height: 26px; background: var(--c-border); flex: 0 0 auto; }
.cash-yearzone { display: inline-flex; align-items: center; gap: 6px; transition: opacity .15s; }
.cash-year { font-size: 19px; font-weight: 800; color: var(--c-accent); font-variant-numeric: tabular-nums; padding: 0 2px; }
.cash-ystep {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border: 1px solid var(--c-border-strong); border-radius: 999px;
    background: #fff; color: var(--c-text); font-size: 11px; cursor: pointer;
}
.cash-ystep:hover { border-color: var(--c-accent); color: var(--c-accent); }
.cash-ystep--off { opacity: .35; cursor: default; pointer-events: none; }
.cash-months { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; transition: opacity .15s; }
.cash-dim { opacity: .4; }
.cash-tva { margin-left: auto; display: inline-flex; border: 1px solid var(--c-border-strong); border-radius: 999px; overflow: hidden; }
.cash-tva-btn {
    border: none; background: #fff; color: var(--c-muted); font: inherit;
    font-size: 13px; font-weight: 600; cursor: pointer; padding: 7px 14px;
}
.cash-tva-btn--on { background: var(--c-accent); color: #fff; }
.cash-tva-note { margin: 0 4px 14px; }

/* Financiar > Rapoarte (one page, report picker) */
.rap-table th, .rap-table td { border: 1px solid var(--c-border); }
.rap-table td { white-space: nowrap; }
.rap-table td:first-child { white-space: normal; min-width: 260px; }
.rap-indent { padding-left: 28px !important; }

.cash-scroll { overflow-x: auto; }
.cash-table { font-size: 13px; border-collapse: collapse; }
.cash-table th, .cash-table td { white-space: nowrap; border: 1px solid var(--c-border); }
.cash-first { min-width: 260px; white-space: normal !important; }
.cash-table thead th.cash-mod-th { position: relative; text-align: center; padding-right: 26px; }
.colchip--click { cursor: pointer; user-select: none; }
.colchip--click:hover { border-color: #15803d; color: #15803d; }
.colchip--on { background: #dcfce7; border: 1px solid #15803d; color: #15803d; font-weight: 600; }
.cash-mod-th .th-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); margin-left: 0; }
.cash-table thead th.cash-sub-th { font-size: 11px; text-transform: uppercase; letter-spacing: .02em; text-align: left; }
.cash-table thead th.cash-band { text-align: center; }
td.cash-num { text-align: left; font-variant-numeric: tabular-nums; }
.cash-main td { background: #dcfce7; color: #14532d; font-weight: 700; }
.cash-main td.cash-first { letter-spacing: .03em; }
.cash-main .hist-btn { color: #15803d; }
.cash-main .hist-btn:hover { color: #14532d; }
.cash-group td { background: #f0fdf4; font-weight: 600; color: var(--c-dark); }
.cash-grandtotal td { background: #dcfce7; color: #14532d; font-weight: 800; border-top: 2px solid #86efac; }
.cash-furn { padding-left: 34px !important; color: var(--c-text); }
.cash-furn--direct { padding-left: 34px !important; }
.cash-toggle-main, .cash-toggle-sub { font-size: 14px; margin-right: 4px; vertical-align: -1px; }
.cash-toggle-main.open, .cash-toggle-sub.open { transform: rotate(90deg); }

/* Personal — Prezenta (pontaj) */
.luna-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.luna-label { font-weight: 700; font-size: 16px; color: var(--c-dark); font-variant-numeric: tabular-nums; }
.prez-firm-total { margin-left: 12px; font-size: 13.5px; }
.range-select { width: auto; padding: 7px 10px; font-size: 13px; margin-left: auto; }
.range-step { min-width: 32px; font-weight: 700; }
.range-step:disabled { opacity: .4; cursor: default; }
.prez-total td { border-top: 2px solid var(--c-border-strong); }
.pachet-add { display: flex; gap: 10px; flex-wrap: wrap; }
.pachet-add .pachet-cod { flex: 0 0 220px; }
.pachet-add .form-control { flex: 1; min-width: 180px; }
.pontaj-scroll { overflow-x: auto; }
.pontaj-table { font-size: 12px; border-collapse: collapse; }
.pontaj-table th, .pontaj-table td { border: 1px solid var(--c-border); padding: 3px 4px !important; text-align: center; }
.pontaj-name { min-width: 190px; text-align: left !important; white-space: normal; }
.wmove { float: left; display: flex; flex-direction: column; align-items: center; margin-right: 8px; line-height: 1; }
.wmove-grip { color: var(--c-muted-2); font-size: 11px; cursor: grab; user-select: none; }
.wmove-grip:hover { color: var(--c-accent); }
body.dragging-worker { cursor: grabbing; user-select: none; }
body.dragging-worker .wmove-grip { cursor: grabbing; }
tr.drag-rows td { background: #eaf1fd !important; opacity: .85; }
.wmove-btn { border: none; background: none; cursor: pointer; color: var(--c-muted-2); font-size: 8px; padding: 1px 4px; line-height: 1; }
.wmove-btn:hover { color: var(--c-accent); }
.pontaj-worker { cursor: pointer; border-bottom: 1px dashed var(--c-border-strong); }
.pontaj-worker:hover { color: var(--c-accent); }
.pontaj-rate { font-size: 11px; margin-top: 2px; }
.pontaj-day { min-width: 44px; font-variant-numeric: tabular-nums; }
.pontaj-we { background: #f3f5f9; }
.pontaj-cell { padding: 2px !important; }
.pontaj-ore { width: 40px; border: none; background: transparent; text-align: center; font: inherit; padding: 4px 2px; border-radius: 4px; }
.pontaj-ore:focus { outline: 2px solid var(--c-accent); border-radius: 3px; background: #fff; }
.pontaj-ore.ore-g { background: #dcfce7; color: #15803d; font-weight: 600; }
.pontaj-ore.ore-y { background: #fef9c3; color: #a16207; font-weight: 600; }
.pontaj-ore.ore-r { background: #fee2e2; color: #b91c1c; font-weight: 600; }
span.pontaj-ore { display: inline-block; min-width: 26px; }
.pontaj-pk { width: 100%; min-width: 44px; border: none; background: transparent; font-size: 10.5px; text-align: center; padding: 2px 0; color: var(--c-muted); }
.pontaj-pk:focus { outline: 2px solid var(--c-accent); border-radius: 3px; background: #fff; }
.pontaj-pk-in { width: 100%; min-width: 46px; border: none; background: transparent; font-size: 10.5px; text-align: center; padding: 3px 0; color: var(--c-muted); font-family: inherit; }
.pontaj-pk-in:focus { outline: 2px solid var(--c-accent); border-radius: 3px; background: #fff; color: var(--c-text); }
.pk-drop { display: none; position: fixed; z-index: 80; background: #fff; border: 1px solid var(--c-border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); max-height: 240px; overflow-y: auto; }
.pk-item { padding: 6px 12px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.pk-item:hover { background: var(--c-light); }
.pontaj-row1 td { border-bottom: none; }
.pontaj-row2 td { border-top: none; }
.pontaj-row2 { border-bottom: 2px solid var(--c-border-strong); }
.pontaj-pay { min-width: 90px; font-weight: 600; }
.pontaj-off td { opacity: .55; }
.pontaj-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.worker-add-bottom { margin: 2px 0 14px; }
.worker-row { border-bottom: 1px solid var(--c-row-line); margin-bottom: 12px; }
.worker-row-line { display: flex; gap: 10px; align-items: center; }
.worker-row-line .wr-nume { flex: 2; min-width: 160px; }
.worker-row-line .wr-tip { flex: 1.4; min-width: 150px; }
.worker-row-line .wr-tarif { flex: 1; min-width: 100px; }
.worker-row-line .wr-remove { flex: 0 0 auto; font-size: 16px; }
.worker-row-activ { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; margin: 8px 0 12px; }

/* Financiar — import wizard */
.imp-upload { max-width: 640px; }
.imp-upload h2 { margin-bottom: 6px; }
.imp-upload-form { display: flex; gap: 12px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.imp-options { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; font-size: 13.5px; }
.imp-options label { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; }
.imp-options .form-control { width: auto; padding: 7px 10px; font-weight: 400; }
.imp-num { width: 90px; }
.imp-preview-wrap { margin-bottom: 14px; }
.imp-preview { overflow-x: auto; max-width: 100%; }
.imp-table { font-size: 12px; }
.imp-table th, .imp-table td { padding: 5px 8px; white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.imp-table th { position: sticky; left: auto; }
.imp-rownr { color: var(--c-muted-2); font-variant-numeric: tabular-nums; }
.imp-header-row td { background: #fef9c3; font-weight: 600; }
.imp-preview-hint { padding: 8px 16px 12px; margin: 0; }
.imp-range { margin-bottom: 14px; }
.imp-range h2, .imp-map h2 { margin-bottom: 8px; }
.imp-range-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.imp-range-row label { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; font-size: 13.5px; }
.imp-map { margin-bottom: 14px; }
.imp-map-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 20px; margin-top: 12px; }
@media (max-width: 980px) { .imp-map-grid { grid-template-columns: 1fr; } }
.imp-map-item { display: flex; flex-direction: column; gap: 4px; }
.imp-map-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted-2); }
.imp-actions { display: flex; justify-content: flex-end; margin-bottom: 20px; }
.imp-warn { border-left: 3px solid #a16207; background: #fef9c3; margin-bottom: 14px; }
.imp-warn p { margin: 0 0 10px; font-weight: 600; color: #a16207; }
.imp-wipe { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.imp-report { border-left: 3px solid #15803d; margin-bottom: 16px; }
.imp-report h2 { margin-bottom: 8px; }
.imp-report-line { margin: 4px 0; }
.imp-skip-list { margin: 8px 0 12px 18px; font-size: 13px; color: var(--c-muted); }
.imp-report .btn { margin-top: 6px; }

/* ModumBuild: Romanian only (spec 22 oct) — the RO/EN switch is hidden, not removed */
.lang, .auth-lang .lang-link, .auth-lang .lang-sep { display: none; }

/* Inactive rows (deactivated projects, etc.) */
.row-inactive td { color: var(--c-muted-2); }
.row-inactive .strong { color: var(--c-muted); }
.row-inactive .project-thumb { opacity: .55; }

/* Nomenclatoare */
.nom-desc { font-size: 12.5px; margin-top: 2px; max-width: 460px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nom-filter { display: flex; align-items: center; gap: 12px; }

/* Tablet / phone: Siteap hides the menu below 980px; here the topbar wraps instead (logo + user on top,
   menu below) without pushing pages sideways, and menu drop-downs open full width under the tapped item */
@media (max-width: 980px) {
    .topbar-inner { height: auto; flex-wrap: wrap; padding: 8px 16px; gap: 4px 12px; }
    .topbar-right { margin-left: auto; gap: 10px; }
    .nav { display: flex; order: 3; flex: 1 1 100%; flex-wrap: wrap; }
    .nav-link { padding: 8px 9px; }
    .nav .dropdown { position: fixed; top: auto; left: 16px; right: 16px; min-width: 0; z-index: 10; }
    .user-name { display: none; }
    .proj-switch-current { max-width: 140px; overflow: hidden; }
    .page { padding: 24px 16px; }
}
@media (max-width: 520px) {
    .brand-name { display: none; }   /* the MB logo alone, so project + user fit on the first row */
}
.nom-project { margin-top: 6px; font-size: 13.5px; }

/* "Actiuni" menu (js/actions-menu.js): one button with an arrow, the cell's actions in a list under it.
   (margins !important: the module styles space the buttons out in a row — .fz-actions, .actions-cell...) */
.act-menu { display: inline-block; }
.act-toggle { white-space: nowrap; }
.act-caret { display: inline-block; margin-left: 2px; font-size: 13px; color: var(--c-muted); transition: transform .15s; }
.act-menu.open .act-caret { transform: rotate(180deg); }
.act-list { display: none; position: fixed; z-index: 300; min-width: 170px; padding: 4px; background: #fff;
    border: 1px solid var(--c-border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); text-align: left; white-space: nowrap; }
.act-menu.open .act-list { display: block; }
.act-list .btn, .act-list form { margin: 0 !important; }
table td .act-menu .act-list form { display: block; }
table td .act-menu .act-list .btn { display: block; width: 100%; padding: 8px 12px; border: 0; border-radius: 4px; background: none;
    box-shadow: none; text-align: left; font-family: inherit; font-size: 13.5px; font-weight: 500; color: var(--c-text); height: auto; }
table td .act-menu .act-list .btn:hover { background: var(--c-light); }
table td .act-menu .act-list .btn-danger { color: #b91c1c; }
table td .act-menu .act-list .btn-danger:hover { background: #fef2f2; }
