/* =====================================================================
   styles.css — Design interfață (limba română)
   Stil: panou de control / aplicație de facturare, curat și intuitiv.
   ===================================================================== */

:root {
  --c-bg: #f4f6fb;
  --c-surface: #ffffff;
  --c-surface-2: #f8fafc;
  --c-border: #e3e8f0;
  --c-text: #1e2a3a;
  --c-text-soft: #5b6b82;
  --c-muted: #8a99ad;
  --c-primary: #0e7c86;
  --c-primary-dark: #0b626a;
  --c-primary-soft: #e3f4f5;
  --c-accent: #2563eb;
  --c-danger: #dc2626;
  --c-danger-soft: #fdecec;
  --c-warning: #b45309;
  --c-warning-soft: #fef3e2;
  --c-success: #15803d;
  --c-success-soft: #e7f6ec;
  --c-sidebar: #0f2230;
  --c-sidebar-soft: #18394a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(16, 30, 54, .08), 0 6px 24px rgba(16, 30, 54, .06);
  --shadow-sm: 0 1px 2px rgba(16, 30, 54, .08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--c-accent); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--c-text); }

/* ----------------------- Autentificare ----------------------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 600px at 10% -10%, #12414b 0%, transparent 55%),
    radial-gradient(1000px 500px at 110% 110%, #0c5a63 0%, transparent 50%),
    var(--c-sidebar);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--c-surface);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  padding: 32px;
}
.login-logo {
  display: flex; align-items: center; gap: 12px; margin-bottom: 6px;
}
.login-logo .mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--c-primary), #14b8a6);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px;
}
.login-mark-img { height: 46px; max-width: 64px; width: auto; object-fit: contain; flex: none; }
.login-card h1 { font-size: 18px; }
.login-card .sub { color: var(--c-muted); font-size: 12.5px; margin: 2px 0 22px; }
.login-hint {
  margin-top: 18px; padding: 12px 14px; background: var(--c-surface-2);
  border: 1px dashed var(--c-border); border-radius: var(--radius-sm);
  font-size: 12px; color: var(--c-text-soft);
}
.login-hint b { color: var(--c-text); }

/* ----------------------- Layout aplicație ----------------------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--c-sidebar);
  color: #cdd9e3;
  display: flex; flex-direction: column;
  padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.brand .mark {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--c-primary), #14b8a6);
  display: grid; place-items: center; color: #fff; font-weight: 800;
}
.brand .name { font-size: 13.5px; font-weight: 700; color: #fff; line-height: 1.25; }
.brand .name small { display: block; font-weight: 500; color: #8da3b3; font-size: 11px; }
.brand-mark-img { height: 38px; max-width: 56px; width: auto; object-fit: contain; flex: none; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav .label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6d8496; padding: 14px 10px 6px; }
.nav button {
  display: flex; align-items: center; gap: 11px;
  background: transparent; border: 0; color: #c0cdd8;
  padding: 9px 11px; border-radius: 9px; cursor: pointer;
  text-align: left; width: 100%; font-size: 13.5px; font-weight: 500;
}
.nav button .ic { width: 18px; text-align: center; opacity: .9; }
.nav button:hover { background: var(--c-sidebar-soft); color: #fff; }
.nav button.active { background: var(--c-primary); color: #fff; font-weight: 600; }
.nav .spacer { flex: 1; }

.sidebar-user {
  margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: 12px; display: flex; align-items: center; gap: 10px;
}
.sidebar-user .avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--c-primary-dark); color: #fff; display: grid; place-items: center; font-weight: 700;
}
.sidebar-user .meta { line-height: 1.2; min-width: 0; }
.sidebar-user .meta b { color: #fff; font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .meta span { font-size: 11px; color: #8da3b3; }
.sidebar-user .logout { margin-left: auto; background: transparent; border: 0; color: #8da3b3; cursor: pointer; font-size: 16px; }
.sidebar-user .logout:hover { color: #fff; }

.main { min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 28px; background: var(--c-surface);
  border-bottom: 1px solid var(--c-border); position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 18px; }
.topbar .hamburger { display: none; }
.topbar .crumb { color: var(--c-muted); font-size: 12.5px; }
.topbar .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.content { padding: 24px 28px 60px; }

/* ----------------------- Componente ----------------------- */
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card .card-head { padding: 16px 18px; border-bottom: 1px solid var(--c-border); display: flex; align-items: center; gap: 12px; }
.card .card-head h3 { font-size: 15px; }
.card .card-head .right { margin-left: auto; display: flex; gap: 8px; }
.card .card-body { padding: 18px; }
.card .card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

.kpi-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.kpi-card .k-label { font-size: 12px; color: var(--c-text-soft); display: flex; align-items: center; gap: 7px; }
.kpi-card .k-value { font-size: 26px; font-weight: 800; margin-top: 8px; letter-spacing: -.02em; }
.kpi-card .k-sub { font-size: 11.5px; color: var(--c-muted); margin-top: 2px; }
.kpi-card .k-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--c-primary-soft); color: var(--c-primary); font-size: 15px; }

/* Butoane */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--c-border);
  background: var(--c-surface); color: var(--c-text); cursor: pointer; font-weight: 600; font-size: 13px;
  transition: background .12s, border-color .12s, box-shadow .12s; white-space: nowrap;
}
.btn:hover { background: var(--c-surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn.primary:hover { background: var(--c-primary-dark); }
.btn.accent { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.btn.accent:hover { filter: brightness(.95); }
.btn.danger { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn.danger.ghost { background: var(--c-danger-soft); color: var(--c-danger); border-color: #f6cccc; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn-icon { padding: 7px 9px; }

/* Formulare */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--c-text-soft); margin-bottom: 6px; }
.field .req { color: var(--c-danger); }
.field .hint { font-weight: 400; color: var(--c-muted); font-size: 11.5px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-surface); outline: none; transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.input:disabled, .textarea:disabled, .select:disabled { background: var(--c-surface-2); color: var(--c-text-soft); cursor: not-allowed; }
.textarea { resize: vertical; min-height: 70px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 760px) { .form-row, .form-row.three { grid-template-columns: 1fr; } }

.switch-row { display: flex; gap: 10px; }
.switch {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  cursor: pointer; background: var(--c-surface); font-weight: 600; font-size: 13px; color: var(--c-text-soft);
}
.switch.on-yes.active { background: var(--c-success-soft); border-color: #bfe6cb; color: var(--c-success); }
.switch.on-no.active { background: var(--c-danger-soft); border-color: #f6cccc; color: var(--c-danger); }
.switch input { display: none; }

/* Tabele */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 11px 14px; background: var(--c-surface-2);
  color: var(--c-text-soft); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--c-border); white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: var(--c-surface-2); }
table.data .num { font-variant-numeric: tabular-nums; }
table.data .actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { text-align: center; color: var(--c-muted); padding: 40px 20px; }
.empty .big { font-size: 30px; margin-bottom: 8px; opacity: .5; }

/* Badge-uri / status */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.in_lucru { background: var(--c-warning-soft); color: var(--c-warning); }
.badge.inregistrat { background: #eaf1ff; color: var(--c-accent); }
.badge.finalizat { background: var(--c-success-soft); color: var(--c-success); }
.badge.lock { background: #eef0f3; color: #4a5568; }
.badge.role-owner { background: var(--c-primary-soft); color: var(--c-primary-dark); }
.badge.role-tehnician { background: #eef0f3; color: #4a5568; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; }
.toolbar .search input { padding-left: 34px; }
.toolbar .search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--c-muted); }
.toolbar .spacer { flex: 1; }

/* Diagrame (bare) */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 56px; align-items: center; gap: 12px; font-size: 12.5px; }
.bar-row .lbl { color: var(--c-text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: var(--c-surface-2); border-radius: 6px; height: 22px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--c-primary), #14b8a6); min-width: 2px; }
.bar-fill.alt { background: linear-gradient(90deg, var(--c-accent), #60a5fa); }
.bar-row .val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.columns { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 10px; }
.col-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.col-stack { width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 3px; }
.col-bar { width: 60%; max-width: 30px; border-radius: 5px 5px 0 0; background: linear-gradient(180deg, #14b8a6, var(--c-primary)); }
.col-bar.alt { background: linear-gradient(180deg, #60a5fa, var(--c-accent)); }
.col-num { font-size: 11px; font-weight: 700; color: var(--c-text); }
.col-lbl { font-size: 11px; color: var(--c-muted); }
.legend { display: flex; gap: 18px; margin-bottom: 4px; font-size: 12px; color: var(--c-text-soft); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.legend i.p { background: var(--c-primary); }
.legend i.a { background: var(--c-accent); }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(15, 34, 48, .55); display: grid; place-items: center; z-index: 100; padding: 24px; }
.modal { background: var(--c-surface); border-radius: 14px; box-shadow: 0 30px 70px rgba(0, 0, 0, .35); width: 100%; max-width: 520px; max-height: 90vh; display: flex; flex-direction: column; }
.modal.lg { max-width: 920px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--c-border); display: flex; align-items: center; gap: 12px; }
.modal-head h3 { font-size: 16px; }
.modal-head .x { margin-left: auto; background: transparent; border: 0; cursor: pointer; font-size: 20px; color: var(--c-muted); }
.modal-body { padding: 22px; overflow: auto; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--c-border); display: flex; gap: 10px; justify-content: flex-end; }

/* Notificări (toast) */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--c-text); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13px; max-width: 340px; animation: slideIn .2s ease; }
.toast.ok { background: #14543a; }
.toast.err { background: #7f1d1d; }
.toast.info { background: #1e3a5f; }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.alert.lock { background: var(--c-warning-soft); color: var(--c-warning); border: 1px solid #f3dcb6; }
.alert.info { background: #eef4ff; color: var(--c-accent); border: 1px solid #cfe0fb; }

.logo-uploader { display: flex; align-items: center; gap: 16px; }
.logo-preview { width: 180px; height: 70px; border: 1px dashed var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface-2); display: grid; place-items: center; flex: none; overflow: hidden; }
.logo-preview img { max-width: 168px; max-height: 60px; object-fit: contain; }
.logo-preview .muted { font-size: 11.5px; }

.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); font-weight: 700; margin: 22px 0 12px; }
.muted { color: var(--c-muted); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--c-text-soft); font-weight: 600; }
.kv dd { margin: 0; }

/* Marcaj informativ (i) cu explicație la hover */
.infotip {
  display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
  background: var(--c-border); color: var(--c-text-soft); font-size: 10px; font-weight: 700;
  font-style: italic; font-family: Georgia, 'Times New Roman', serif; cursor: help;
  position: relative; vertical-align: middle; margin-left: 5px; user-select: none; line-height: 1;
}
.infotip:hover, .infotip:focus { background: var(--c-primary); color: #fff; outline: none; }
.infotip[data-tip]:hover::after, .infotip[data-tip]:focus::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translateX(-50%);
  background: var(--c-sidebar); color: #fff; padding: 9px 11px; border-radius: 8px;
  font-size: 11.5px; font-weight: 500; font-style: normal; font-family: var(--font); line-height: 1.45;
  width: max-content; max-width: 250px; white-space: normal; text-align: left;
  box-shadow: var(--shadow); z-index: 400; pointer-events: none;
}
.infotip[data-tip]:hover::before, .infotip[data-tip]:focus::before {
  content: ''; position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--c-sidebar); z-index: 400; pointer-events: none;
}

/* =====================================================================
   PROCES-VERBAL printabil (format A4)
   ===================================================================== */
#print-area { display: none; }

.pv-doc {
  width: 210mm; min-height: 297mm; background: #fff; margin: 0 auto;
  padding: 16mm 16mm 14mm; color: #15202b; font-size: 11.5pt; line-height: 1.45;
  box-shadow: var(--shadow);
}
.pv-doc .pv-header { display: flex; align-items: flex-start; gap: 14px; border-bottom: 2px solid var(--c-primary); padding-bottom: 12px; }
.pv-doc .pv-logo { width: 54px; height: 54px; border-radius: 10px; background: linear-gradient(135deg, var(--c-primary), #14b8a6); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 22px; flex: none; }
.pv-doc .pv-logo-img { height: 48px; max-width: 210px; object-fit: contain; flex: none; }
.pv-doc .pv-company { flex: 1; }
.pv-doc .pv-company .cn { font-size: 16pt; font-weight: 800; }
.pv-doc .pv-company .ci { font-size: 9pt; color: #5b6b82; }
.pv-doc .pv-nr { text-align: right; font-size: 9.5pt; color: #5b6b82; }
.pv-doc .pv-nr b { font-size: 13pt; color: var(--c-primary-dark); display: block; }

.pv-doc h1.pv-title { font-size: 13pt; text-align: center; margin: 16px 0 4px; text-transform: uppercase; letter-spacing: .02em; }
.pv-doc .pv-subnr { text-align: center; color: #5b6b82; font-size: 10pt; margin-bottom: 14px; }

.pv-doc .pv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.pv-doc .pv-line { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px dotted #cdd6e2; font-size: 10.5pt; }
.pv-doc .pv-line .l { color: #5b6b82; min-width: 150px; font-weight: 600; }
.pv-doc .pv-line .v { flex: 1; font-weight: 600; }
.pv-doc .pv-block { margin-top: 4px; padding: 6px 0; }
.pv-doc .pv-block .l { color: #5b6b82; font-weight: 700; font-size: 9.5pt; text-transform: uppercase; letter-spacing: .03em; }
.pv-doc .pv-block .v { font-weight: 500; min-height: 18px; white-space: pre-wrap; }
.pv-doc .pv-block.box .v { border: 1px solid #d6deea; border-radius: 6px; padding: 8px 10px; margin-top: 4px; background: #fbfcfe; }
.pv-doc .pv-sectiune { font-size: 10pt; font-weight: 800; color: var(--c-primary-dark); margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid #e0e7f0; text-transform: uppercase; letter-spacing: .04em; }
.pv-doc .yesno { display: inline-block; padding: 1px 9px; border-radius: 4px; font-weight: 700; font-size: 9.5pt; }
.pv-doc .yesno.y { background: #e7f6ec; color: #15803d; }
.pv-doc .yesno.n { background: #fdecec; color: #dc2626; }
.pv-doc ul.pv-parts { margin: 4px 0 0; padding-left: 18px; }
.pv-doc ul.pv-parts li { padding: 1px 0; }
.pv-doc table.pv-cost { width: 100%; border-collapse: collapse; margin-top: 5px; font-size: 10pt; }
.pv-doc table.pv-cost th { text-align: left; background: #f1f5f9; color: #5b6b82; font-size: 8.5pt;
  text-transform: uppercase; letter-spacing: .03em; padding: 4px 8px; border: 1px solid #d6deea; }
.pv-doc table.pv-cost td { padding: 4px 8px; border: 1px solid #d6deea; }
.pv-doc table.pv-cost .r { text-align: right; white-space: nowrap; }
.pv-doc table.pv-cost tfoot td { font-weight: 800; background: #fbfcfe; color: var(--c-primary-dark); }
.pv-doc .pv-legal { margin-top: 16px; font-size: 8.5pt; color: #5b6b82; text-align: justify; border-top: 1px solid #e0e7f0; padding-top: 8px; }
.pv-doc .pv-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 26px; }
.pv-doc .pv-sign .s { text-align: center; }
.pv-doc .pv-sign .s .role { font-size: 9.5pt; font-weight: 700; }
.pv-doc .pv-sign .s .line { margin-top: 34px; border-top: 1px solid #1f2a37; padding-top: 4px; font-size: 8.5pt; color: #5b6b82; }

/* =====================================================================
   RESPONSIVE — telefon & tabletă (meniul devine sertar cu hamburger)
   ===================================================================== */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 264px; z-index: 60;
    transform: translateX(-100%); transition: transform .25s ease; will-change: transform;
    box-shadow: 0 0 50px rgba(0, 0, 0, .45);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 34, 48, .5); z-index: 55; }
  body.nav-open .nav-backdrop { display: block; }

  .topbar { padding: 11px 14px; gap: 10px; }
  .topbar .hamburger {
    display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
    border: 1px solid var(--c-border); border-radius: 9px; background: var(--c-surface);
    color: var(--c-text); font-size: 17px; cursor: pointer;
  }
  .topbar h2 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .right { gap: 6px; margin-left: auto; }
  .topbar .right .btn { padding: 8px 11px; font-size: 12px; }
  .content { padding: 16px 13px 56px; }

  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }
  .logo-uploader { flex-wrap: wrap; }

  .modal-back { display: flex; align-items: flex-end; justify-content: center; padding: 0; }
  .modal, .modal.lg { max-width: 100%; width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0; }
  .modal-body { padding: 18px; }
  .modal-foot { flex-wrap: wrap; padding: 14px 18px; }
  .modal-foot .btn { flex: 1; }

  .bar-row { grid-template-columns: 110px 1fr 48px; }

  /* Previzualizarea PV pe ecran (tipărirea rămâne A4 — vezi @media print) */
  .pv-doc { width: 100%; min-height: auto; padding: 16px; font-size: 11pt; box-shadow: none; }
  .pv-doc .pv-grid { grid-template-columns: 1fr; }
  .pv-doc .pv-sign { grid-template-columns: 1fr; gap: 16px; }
  .pv-doc .pv-header { flex-wrap: wrap; }
}

/* Tabelele devin carduri verticale pe telefon (fără scroll stânga-dreapta) */
@media (max-width: 720px) {
  .table-wrap { overflow-x: visible; }
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { padding: 10px 0; border-bottom: 1px solid var(--c-border); }
  table.data tbody tr:last-child { border-bottom: 0; }
  table.data tr:hover td { background: transparent; }
  table.data td { border: 0; text-align: right; padding: 6px 16px; min-height: 0; }
  table.data td::before {
    content: attr(data-label); float: left; margin-right: 14px; padding-top: 1px;
    color: var(--c-text-soft); font-weight: 700; font-size: 11px;
    text-transform: uppercase; letter-spacing: .03em;
  }
  table.data td[data-label=""] { padding-top: 8px; }
  table.data td[data-label=""]::before { content: ""; }
  table.data td .actions { justify-content: flex-end; }
}

/* Reguli de tipărire — compactare ca să încapă pe o singură coală A4 */
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  .pv-doc {
    box-shadow: none; width: auto; min-height: auto; margin: 0;
    padding: 7mm 12mm; font-size: 9.5pt; line-height: 1.25;
  }
  .pv-doc .pv-header { padding-bottom: 6px; }
  .pv-doc .pv-logo { width: 40px; height: 40px; font-size: 16px; }
  .pv-doc .pv-logo-img { height: 38px; max-width: 170px; }
  .pv-doc .pv-company .cn { font-size: 13pt; }
  .pv-doc h1.pv-title { font-size: 11pt; margin: 6px 0 2px; }
  .pv-doc .pv-subnr { margin-bottom: 5px; font-size: 8.5pt; }
  .pv-doc .pv-line { padding: 1.5px 0; font-size: 9pt; }
  .pv-doc .pv-sectiune { margin: 6px 0 3px; font-size: 9pt; }
  .pv-doc .pv-block { padding: 1.5px 0; }
  .pv-doc .pv-block.box .v { padding: 4px 7px; margin-top: 2px; }
  .pv-doc .pv-block .l { font-size: 8.5pt; }
  .pv-doc ul.pv-parts li { padding: 0; }
  /* tabele (produse primite / piese cu costuri) compacte la print */
  .pv-doc table.pv-cost th, .pv-doc table.pv-cost td { padding: 2.5px 7px; font-size: 8.5pt; }
  .pv-doc .pv-legal { margin-top: 6px; padding-top: 4px; font-size: 7.5pt; line-height: 1.25; }
  .pv-doc .pv-sign { margin-top: 9px; page-break-inside: avoid; }
  .pv-doc .pv-sign .s .role { font-size: 9pt; }
  .pv-doc .pv-sign .s .line { margin-top: 16px; font-size: 8pt; }
  .pv-qr { margin: 5px 0 2px !important; padding: 5px 8px !important; }
  .pv-qr div { font-size: 8pt; }
}

/* Badge status „Expediat" (portal medic) */
.badge.expediat { background: var(--c-primary-soft); color: var(--c-primary-dark); }

/* Indicator de progres piesă (Portal Medic): Primit → În lucru → Finalizat → Expediat */
.stepper { display: flex; margin: 16px 0 4px; }
.step { flex: 1; text-align: center; font-size: 11.5px; color: var(--c-muted); position: relative; padding-top: 19px; }
.step::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--c-border); position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2; }
.step::after { content: ''; position: absolute; top: 5px; left: calc(-50% + 7px); right: calc(50% + 7px); height: 2px; background: var(--c-border); }
.step:first-child::after { display: none; }
.step.done { color: var(--c-primary-dark); font-weight: 600; }
.step.done::before, .step.done::after { background: var(--c-primary); }
.step.current { color: var(--c-primary-dark); font-weight: 700; }
.step.current::before { background: var(--c-primary); box-shadow: 0 0 0 4px var(--c-primary-soft); }
.step.current::after { background: var(--c-primary); }
@media (max-width: 480px) { .step { font-size: 10px; } }

/* Feedback cu stele (portal medic + afișare owner) */
.stars { display: inline-flex; gap: 3px; }
.stars .st { font-size: 22px; line-height: 1; color: #cbd5e1; cursor: pointer; transition: color .1s, transform .1s; user-select: none; }
.stars .st:hover { transform: scale(1.15); }
.stars .st.on { color: #f59e0b; }
.stars.readonly .st { cursor: default; }
.stars.readonly .st:hover { transform: none; }

/* Poze pe PV (service → client) */
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ph-item { position: relative; border: 1px solid var(--c-border); border-radius: 10px; overflow: hidden; background: var(--c-surface-2); }
.ph-item img { width: 100%; height: 110px; object-fit: cover; display: block; cursor: zoom-in; }
.ph-item .ph-del { position: absolute; top: 6px; right: 6px; background: rgba(220,38,38,.92); color: #fff; border: 0; border-radius: 6px; width: 24px; height: 24px; cursor: pointer; font-size: 12px; line-height: 1; }
.ph-strip { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--c-border); }
.ph-strip img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--c-border); cursor: zoom-in; }

/* QR portal pe documente tipărite */
.pv-qr { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; padding: 8px 10px; border: 1px dashed #cdd6e2; border-radius: 8px; }
.pv-qr img { width: 74px; height: 74px; flex: none; }
.pv-qr div { font-size: 9pt; color: #5b6b82; line-height: 1.4; }
@media print { .pv-qr img { width: 16mm; height: 16mm; } }

/* Alertă roșie (avertisment ambalare etc.) */
.alert.danger { background: var(--c-danger-soft); color: #b91c1c; border: 1px solid #f5c6c6; }


/* Comutator de limbă RO | EN (în bara de sus / pe login) */
.lang-toggle { display: inline-flex; border: 1px solid var(--c-border); border-radius: 999px; overflow: hidden; background: var(--c-surface); }
.lang-toggle button { border: 0; background: transparent; cursor: pointer; font-weight: 700; font-size: 11.5px; color: var(--c-muted); padding: 5px 11px; line-height: 1; }
.lang-toggle button.on { background: var(--c-primary); color: #fff; }
.login-lang { position: absolute; top: 14px; right: 16px; }
.login-card { position: relative; }
@media print { .lang-toggle, .login-lang { display: none !important; } }

/* Ștampilă / semnătură reprezentant */
.pv-stamp { display: block; max-height: 68px; max-width: 210px; margin: 2px auto -2px; object-fit: contain; }
@media print { .pv-doc .pv-sign .pv-stamp { max-height: 56px; max-width: 180px; } }
.stamp-prev { display: flex; align-items: center; justify-content: center; padding: 10px; border: 1px dashed var(--c-border); border-radius: 10px; background: var(--c-surface-2); min-height: 96px; }
.stamp-prev img { max-height: 110px; max-width: 100%; object-fit: contain; }

/* ===================== DASHBOARD „centru de comandă" ===================== */
.dash-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: radial-gradient(700px 300px at 90% -40%, #14545f 0%, transparent 60%), linear-gradient(135deg, #0f2230, #123e47);
  color: #fff; border-radius: 16px; padding: 22px 26px; margin-bottom: 16px; box-shadow: var(--shadow); }
.dash-hero-l h1 { color: #fff; font-size: 22px; letter-spacing: -.01em; }
.dash-hero-l p { margin: 6px 0 0; color: #b7c7d3; font-size: 13.5px; }
.dash-hero-l p b { color: #fff; }
.dash-rating { margin-left: auto; text-align: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 12px 20px; }
.dr-stars { font-size: 15px; letter-spacing: 2px; }
.dr-num { font-size: 24px; font-weight: 800; margin-top: 3px; color: #fff; }
.dr-num span { font-size: 13px; color: #b7c7d3; font-weight: 600; }
.dr-sub { font-size: 11px; color: #b7c7d3; margin-top: 2px; }
.dash-todo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--c-warning-soft); border: 1px solid #f3d6a6; border-radius: 12px; padding: 13px 18px; margin-bottom: 16px; }
.dash-todo .dt-ic { font-size: 20px; }
.dash-todo .dt-txt { flex: 1; min-width: 200px; color: #8a5209; font-size: 13.5px; }
.dash-todo .dt-txt b { font-weight: 800; }
.dash-todo .dt-act { display: flex; gap: 8px; flex-wrap: wrap; }
.bc-svg { width: 100%; height: auto; display: block; max-height: 200px; }
.bc-bar { fill: url(#bcg); }
.bc-lbl { fill: var(--c-muted); font-size: 11px; font-weight: 600; text-transform: capitalize; }
.bc-val { fill: var(--c-text); font-size: 11px; font-weight: 800; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; }
.dn-svg { width: 150px; height: 150px; flex: none; }
.dn-total { font-size: 27px; font-weight: 800; fill: var(--c-text); }
.dn-cap { font-size: 11px; fill: var(--c-muted); }
.dn-legend { display: flex; flex-direction: column; gap: 9px; }
.dn-li { font-size: 13px; color: var(--c-text-soft); }
.dn-li b { color: var(--c-text); }
.dn-dot { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }

/* ===================== Aspect PREMIUM (animații & tranziții) ===================== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes barGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.content .fade-up { animation: fadeUp .5s cubic-bezier(.2,.75,.3,1) both; }
.content .fade-up:nth-child(1) { animation-delay: .02s; }
.content .fade-up:nth-child(2) { animation-delay: .09s; }
.content .fade-up:nth-child(3) { animation-delay: .16s; }
.content .fade-up:nth-child(4) { animation-delay: .23s; }
.content .fade-up:nth-child(5) { animation-delay: .30s; }
.bc-bar { transform-box: fill-box; transform-origin: bottom; animation: barGrow .6s cubic-bezier(.2,.75,.3,1) both; animation-delay: .2s; }

.kpi-card { transition: transform .16s ease, box-shadow .16s ease; }
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card { transition: box-shadow .16s ease; }
.card:hover { box-shadow: var(--shadow); }
.btn { transition: background .12s, border-color .12s, box-shadow .12s, transform .08s; }
.btn:active { transform: translateY(1px); }
.nav button { transition: background .14s, color .14s, padding-left .14s; }
.nav button:hover { padding-left: 14px; }
.modal-back { animation: fadeIn .18s ease both; }
.modal { animation: modalIn .22s cubic-bezier(.2,.75,.3,1) both; }
.toast { animation: toastIn .28s cubic-bezier(.2,.75,.3,1) both; }
.empty .big { animation: floaty 3.2s ease-in-out infinite; }
tbody tr { transition: background .12s ease; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
@media print { .fade-up, .bc-bar, .modal { animation: none !important; } }

/* Tranziție fină la schimbarea ecranelor */
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view-in { animation: viewIn .3s cubic-bezier(.2,.75,.3,1) both; }
@media (prefers-reduced-motion: reduce) { .view-in { animation: none !important; } }

/* Zona utilizator din sidebar — v2: nume complet + butoane cu etichete clare */
.sidebar-user.su-v2 { flex-direction: column; align-items: stretch; gap: 10px; }
.sidebar-user.su-v2 .su-top { display: flex; gap: 10px; align-items: center; min-width: 0; }
.sidebar-user.su-v2 .meta { flex: 1; }
.sidebar-user.su-v2 .meta b { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
.sidebar-user.su-v2 .su-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sidebar-user.su-v2 .su-actions button {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.13); color: #b7c7d3;
  font-size: 11px; font-weight: 600; padding: 6px 8px; border-radius: 8px; cursor: pointer;
  white-space: nowrap; transition: background .12s, color .12s;
}
.sidebar-user.su-v2 .su-actions button:hover { background: rgba(255,255,255,.13); color: #fff; }
