:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1d2433; --muted: #6b7280; --line: #e3e6eb;
  --brand: #1f4e79; --brand-2: #2b6cb0; --ok: #0f7b4a; --okbg: #e8f6ee; --err: #b42318; --errbg: #fdecea;
  --warn: #8a5a00; --warnbg: #fff6e0; --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--brand-2); }
main { max-width: 1500px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
code { background: #eef1f5; padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .nowrap { white-space: nowrap; }

/* bară de sus */
.topbar { display: flex; align-items: center; gap: 18px; padding: 10px 20px; background: var(--brand); color: #fff; flex-wrap: wrap; }
.topbar a { color: #dce8f5; text-decoration: none; }
.topbar .brand { color: #fff; font-weight: 700; font-size: 16px; }
.topbar nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topbar nav a { padding: 6px 12px; border-radius: 6px; }
.topbar nav a:hover, .topbar nav a.on { background: rgba(255,255,255,.14); color: #fff; }
.topbar .who { display: flex; gap: 14px; font-size: 14px; }
.topbar .who .muted { color: #a9c0d8; }

/* carduri & formulare */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.card.narrow { max-width: 760px; margin: 20px auto; }
.card.login { max-width: 400px; margin: 60px auto; }
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.form.grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px 18px; }
.form .span2 { grid-column: 1 / -1; }
.form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: #374151; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); padding: 9px 11px; border: 1px solid #cfd5dd; border-radius: 7px; background: #fff; width: 100%; min-height: 40px; }
input[type=checkbox] { width: 18px; min-height: 18px; height: 18px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b6d0ee; border-color: var(--brand-2); }
.has-err input, .has-err select { border-color: var(--err); }
small.err { color: var(--err); font-weight: 400; }
.req { color: var(--err); }
.opbox { background: #f1f6fc; border: 1px solid #d7e5f5; border-radius: 7px; padding: 10px 12px; }
.formactions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 6px; }
.delform { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }

/* butoane */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 7px; border: 1px solid #cfd5dd; background: #fff; color: var(--ink); text-decoration: none; font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; min-height: 38px; }
.btn:hover { background: #f3f5f8; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #173d61; }
.btn.danger { color: var(--err); border-color: #f0c4bf; }
.btn.ghost { border-color: transparent; }
.btn.icon { padding: 6px 10px; }
.btn.small { min-height: 28px; padding: 3px 10px; font-size: 13px; }
.linkbtn { background: none; border: 0; color: var(--brand-2); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

/* mesaje */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: var(--okbg); color: var(--ok); border-color: #bfe5cf; }
.flash.err { background: var(--errbg); color: var(--err); border-color: #f4c7c1; }
.flash.warn { background: var(--warnbg); color: var(--warn); border-color: #f1dca6; }

/* filtre */
.toolbar { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 18px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters select, .filters input[type=search] { width: auto; min-width: 200px; }
.filters input[type=search] { flex: 1; }
.seg { display: inline-flex; border: 1px solid #cfd5dd; border-radius: 8px; overflow: hidden; }
.seg a { padding: 8px 13px; text-decoration: none; color: var(--ink); font-size: 14px; border-right: 1px solid #e4e7ec; }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--brand); color: #fff; }
.periodnav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.periodnav strong { min-width: 150px; text-align: center; }
.periodnav input[type=date] { width: auto; }
.periodnav label { display: flex; align-items: center; gap: 6px; font-size: 14px; }

.summary { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.summary .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { background: var(--card); border: 1px dashed #cbd2da; border-radius: var(--radius); padding: 40px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 14px; }

/* tabele */
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th { background: #f6f7f9; text-align: left; font-weight: 600; font-size: 12.5px; color: #4b5563; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: bottom; }
table.grid td { padding: 8px 10px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
table.grid tbody tr:hover { background: #fafbfc; }
table.grid tr.inactive { opacity: .55; }
table.records .num { color: var(--muted); width: 40px; }
table.records .c-detinator { min-width: 160px; font-weight: 600; }
table.records .c-adresa { min-width: 180px; }
table.records .c-data_pv, table.records .c-nr_pv { white-space: nowrap; }
.rowact { white-space: nowrap; width: 1%; }
.rowact a { display: inline-block; padding: 2px 6px; text-decoration: none; font-size: 13px; }
del { color: var(--err); } ins { color: var(--ok); text-decoration: none; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; background: #eef1f5; }
.tag.t-adaugat, .tag.t-restaurat { background: var(--okbg); color: var(--ok); }
.tag.t-modificat { background: #e8f0fb; color: var(--brand-2); }
.tag.t-sters { background: var(--errbg); color: var(--err); }

/* telefon */
@media (max-width: 760px) {
  main { padding: 14px 12px 50px; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar nav { order: 3; flex-basis: 100%; }
  .form.grid2 { grid-template-columns: minmax(0,1fr); }
  .card { padding: 16px; }
  .formactions .btn { white-space: normal; text-align: center; justify-content: center; flex: 1 1 100%; }
  .filters select, .filters input[type=search] { min-width: 0; width: 100%; }
  .seg { width: 100%; } .seg a { flex: 1; text-align: center; padding: 8px 4px; font-size: 13px; }
  .summary .actions .btn { flex: 1; justify-content: center; }
  .tablewrap { background: transparent; border: 0; }
  table.grid thead { display: none; }
  table.grid, table.grid tbody, table.grid tr, table.grid td { display: block; width: 100%; }
  table.grid tr { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 8px 12px; }
  table.grid td { border: 0; padding: 3px 0; display: flex; gap: 10px; }
  table.grid td[data-l]::before { content: attr(data-l); flex: 0 0 42%; color: var(--muted); font-size: 12px; }
  table.grid td:empty { display: none; }
  table.records td.rowact { order: 99; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
  table.records tr { display: flex; flex-direction: column; }
}

table.records .c-operator { white-space: nowrap; }

/* ===== v2 ===== */
.navsep { width: 1px; background: rgba(255,255,255,.25); margin: 4px 6px; }
.hint { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; }
.lbl { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.strong { font-weight: 600; }
.flash.info { background: #eef5fd; color: #1f4e79; border-color: #cfe0f3; }
.minirow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.domtabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.domtabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.domtabs a.on { color: var(--brand); border-bottom-color: var(--brand); }

/* formular verificare */
.vform { max-width: 1100px; }
.vform section.card { margin-bottom: 14px; }
.vform h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); margin-bottom: 4px; }
.formhead { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; }
.seg.radio { display: inline-flex; flex-wrap: wrap; }
.seg.radio label { display: block; cursor: pointer; margin: 0; }
.seg.radio label { position: relative; }
.seg.radio input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; }
.seg.radio span { display: block; padding: 9px 14px; font-size: 14px; font-weight: 500; border-right: 1px solid #e4e7ec; color: var(--ink); }
.seg.radio label:last-child span { border-right: 0; }
.seg.radio input:checked + span { background: var(--brand); color: #fff; }
.seg.radio input:focus-visible + span { outline: 2px solid #b6d0ee; }
.eqsearch { position: relative; margin: 10px 0 6px; }
.eqsearch label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: #374151; }
.eqsearch input { background: #f8fafc; }
.eqres { position: absolute; left: 0; right: 0; z-index: 20; background: #fff; border: 1px solid #cfd5dd; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 360px; overflow: auto; margin-top: 4px; }
.eqitem { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #eef0f3; padding: 9px 12px; cursor: pointer; font: inherit; }
.eqitem:hover { background: #f1f6fc; }
.eqsel { margin-top: 8px; padding: 8px 12px; background: var(--okbg); color: var(--ok); border-radius: 7px; font-size: 14px; }
.formactions.sticky { position: sticky; bottom: 0; background: rgba(244,245,247,.95); padding: 12px 0; z-index: 5; border-top: 1px solid var(--line); }

/* meniu rapoarte */
details.dropdown { position: relative; }
details.dropdown summary { list-style: none; }
details.dropdown summary::-webkit-details-marker { display: none; }
details.dropdown .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: #fff; border: 1px solid #cfd5dd; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 8px; min-width: 380px; }
.menugroup { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 8px 4px; font-weight: 600; }
.menurow { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 6px; }
.menurow:hover { background: #f6f7f9; }
.menurow span { flex: 1; }
.menurow a { text-decoration: none; font-weight: 600; font-size: 13px; padding: 3px 8px; border: 1px solid #d7e5f5; border-radius: 6px; background: #f1f6fc; }
.menunote { font-size: 12px; color: var(--muted); padding: 8px; border-top: 1px solid var(--line); margin-top: 6px; }

/* badge-uri scadență */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.red { background: var(--errbg); color: var(--err); }
.badge.orange { background: #fff0e0; color: #b45309; }
.badge.yellow { background: var(--warnbg); color: var(--warn); }
.badge.green { background: var(--okbg); color: var(--ok); }

.tiles { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; min-width: 130px; }
.tile b { display: block; font-size: 24px; line-height: 1.1; }
.tile span { font-size: 13px; color: var(--muted); }
.tile.red b { color: var(--err); } .tile.orange b { color: #b45309; } .tile.yellow b { color: var(--warn); } .tile.green b { color: var(--ok); }

.cols2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
dl.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 14px; margin: 8px 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.howto { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-top: 16px; font-size: 14px; }
.howto pre { background: #1d2433; color: #e5e7eb; padding: 8px 10px; border-radius: 6px; overflow-x: auto; font-size: 12.5px; margin: 8px 0; white-space: pre-wrap; word-break: break-all; }
.warnlist { margin-top: 14px; background: var(--warnbg); border: 1px solid #f1dca6; border-radius: 8px; padding: 10px 14px; color: var(--warn); }
.warnlist ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; }
.card h2 { margin-top: 0; }
table.grid input:not([type=checkbox]), table.grid select { min-height: 34px; padding: 5px 8px; }

@media (max-width: 760px) {
  .cols2 { grid-template-columns: minmax(0, 1fr); }
  details.dropdown .menu { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; min-width: 0; }
  .seg.radio { display: flex; width: 100%; }
  .seg.radio label { flex: 1; }
  .seg.radio span { text-align: center; padding: 9px 4px; font-size: 13px; }
  .navsep { display: none; }
  .formactions.sticky { position: static; border-top: 0; }
  .domtabs { overflow-x: auto; flex-wrap: nowrap; }
  .domtabs a { white-space: nowrap; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 8px; }
}
table.records td[data-l^="Loc"] { min-width: 210px; } table.records td[data-l="Deținător"] { min-width: 150px; } table.records td[data-l="Echipament"] { min-width: 140px; }

/* ===== câmpuri de dată zz/ll/aaaa ===== */
.datebox { position: relative; display: flex; align-items: stretch; gap: 0; width: 100%; }
.datebox .datetext { flex: 1; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; font-variant-numeric: tabular-nums; }
.datebox .datebtn { border: 1px solid #cfd5dd; border-left: 0; background: #f6f7f9; border-radius: 0 7px 7px 0; padding: 0 11px; cursor: pointer; font-size: 15px; line-height: 1; }
.datebox .datebtn:hover { background: #eef1f5; }
.datebox .datehidden { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.periodnav .datebox, .filters .datebox { width: 170px; }
.datetext:invalid { border-color: var(--err); }

/* ===== meniu centrat ===== */
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.topbar .brand { justify-self: start; }
.topbar nav { flex: none; justify-content: center; }
.topbar .who { justify-self: end; }
@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr auto; row-gap: 6px; }
  .topbar nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
}
@media (max-width: 760px) {
  .topbar nav { justify-content: flex-start; }
}

/* ===== logo EON GRUP ===== */
.topbar { padding-top: 7px; padding-bottom: 7px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.topbar .brand img { width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.25); flex: none; }
.topbar .brandtxt { display: flex; flex-direction: column; line-height: 1.1; }
.topbar .brandtxt b { color: #fff; font-size: 16px; letter-spacing: .06em; }
.topbar .brandtxt small { color: #b9cde3; font-size: 12px; font-weight: 500; }
.card.login { text-align: center; }
.card.login .form { text-align: left; }
.loginlogo { width: 190px; max-width: 70%; height: auto; display: block; margin: 0 auto 14px; }
@media (max-width: 760px) {
  .topbar .brand img { width: 34px; height: 34px; }
  .topbar .brandtxt small { display: none; }
}

/* ===== numere interne ===== */
.tile.next { background: var(--brand); border-color: var(--brand); }
.tile.next b { color: #fff; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.tile.next span { color: #cfe0f3; }
.tile a { text-decoration: none; color: inherit; display: block; }
table.alloc .seq { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand); white-space: nowrap; }
.numcode { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; background: #eef3f9; color: #173d61; padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.numcard { border-top: 4px solid var(--brand); }
.numpreview { text-align: center; padding: 6px 0 18px; margin-bottom: 14px; border-bottom: 1px dashed var(--line); }
.numpreview .lbl { margin-bottom: 8px; }
.bignum { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 30px; font-weight: 700; color: var(--brand); letter-spacing: .03em; word-break: break-all; }
.bignum.incomplete { color: #9aa6b5; }
.allocbox { margin-top: 14px; padding: 12px 14px; background: #f4f8fc; border: 1px dashed #c3d6ea; border-radius: 8px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.allocpanel { flex-basis: 100%; margin-top: 6px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 10px; }
.grid3 label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: #374151; }
input.flashok { border-color: var(--ok); background: var(--okbg); transition: background 1s; }
@media (max-width: 760px) {
  .grid3 { grid-template-columns: minmax(0, 1fr); }
  .bignum { font-size: 21px; }
}
input[type=radio] { width: 18px; min-height: 18px; height: 18px; flex: none; margin: 0; }

/* ===== pagini late, tabele care încap fără derulare laterală ===== */
main { max-width: 1880px; padding-left: 20px; padding-right: 20px; }
table.records { font-size: 13px; }
table.records th { padding: 8px 7px; font-size: 12px; }
table.records td { padding: 7px 7px; overflow-wrap: anywhere; }
table.records td.nowrap, table.records td[data-l="Data"], table.records td[data-l="Scadență"] { overflow-wrap: normal; }
table.records td[data-l^="Loc"] { min-width: 130px; max-width: 260px; }
table.records td[data-l="Deținător"] { min-width: 120px; }
table.records td[data-l="Echipament"] { min-width: 110px; }
table.records td[data-l="Nr. admitere / ISCIR"], table.records td[data-l="Nr. admitere"] { min-width: 110px; max-width: 170px; }
table.records td[data-l="Operator"] { white-space: normal; min-width: 90px; }
table.records .rowact { white-space: nowrap; }
table.records .rowact a { display: block; padding: 1px 0; font-size: 12.5px; }
table.records .badge { white-space: nowrap; font-size: 11.5px; padding: 2px 6px; }
@media (max-width: 760px) {
  main { padding-left: 12px; padding-right: 12px; }
  table.records .rowact a { display: inline-block; padding: 2px 8px 2px 0; }
  table.records td { max-width: none !important; }
}
