@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/ubuntu-latin-ext-400-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/ubuntu-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ubuntu-latin-ext-500-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/ubuntu-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/ubuntu-latin-ext-700-normal.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Ubuntu'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/ubuntu-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --ink: #1f2933; --muted: #6b7280; --line: #e3e6ea; --bg: #f6f7f8; --card: #fff;
  --brand: #003c82; --brand-ink: #fff; --brand-soft: #e3f3fb; --accent: #12a0d7;
  --ok: #1d7a46; --ok-bg: #e6f4ec; --err: #b42318; --err-bg: #fdecea; --warn: #9a6700; --warn-bg: #fff4d6;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 "Ubuntu", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
h1 { font-size: 1.45rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
.inline { display: inline; }

/* Header */
.top { background: var(--brand); border-bottom: 4px solid var(--accent); color: var(--brand-ink); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; position: sticky; top: 0; z-index: 10; }
.brand { color: var(--brand-ink); text-decoration: none; font-size: 1.15rem; display: inline-flex; align-items: center; gap: 8px; }
.brand b { font-weight: 700; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.nav a, .linkbtn { color: var(--brand-ink); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .92rem; }
.nav a.active, .nav a:hover, .linkbtn:hover { background: rgba(255,255,255,.16); }
.linkbtn { background: none; border: 0; cursor: pointer; font: inherit; }
@media (max-width: 720px) { .nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; } .nav a, .linkbtn { white-space: nowrap; } }

/* Cards, forms */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.narrow { max-width: 520px; }
label { display: block; margin: 0 0 12px; font-size: .9rem; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #cdd3da; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 120px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: auto; margin: 0; }
.btn { display: inline-block; padding: 9px 16px; border-radius: 8px; border: 1px solid #cdd3da; background: #fff; color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { color: var(--err); border-color: #f1b8b2; }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.btn.block { display: block; width: 100%; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 220px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Flash, badges */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }
.flash.info { background: var(--brand-soft); color: var(--brand); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: .78rem; font-weight: 600; }
.badge.grey { background: #eef0f2; color: var(--muted); }
.badge.red { background: var(--err-bg); color: var(--err); }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.scroll { overflow-x: auto; }
.matrix select { min-width: 140px; }
@media (max-width: 600px) {
  .tbl.matrix thead { display: none; }
  .tbl.matrix tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tbl.matrix td { display: block; border: 0; padding: 3px 0; }
  .tbl.matrix td:first-child { font-weight: 600; }
  .tbl.matrix select { min-width: 0; }
}
.card h2 + .actions, .actions + h2 { margin-top: 16px; }
.card h2:not(:first-child) { margin-top: 20px; }
pre.json { white-space: pre-wrap; word-break: break-word; background: #f3f4f6; padding: 6px 8px; border-radius: 6px; margin: 0; font-size: .8rem; max-height: 160px; overflow: auto; }

/* Stats */
.grid.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .n { font-size: 1.5rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .85rem; }
.stat.warn { border-color: #f0c36d; background: var(--warn-bg); }
dl.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

/* Auth */
body.bare { background: var(--bg); }
.bare-main { min-height: 100vh; }
.auth-wrap { display: grid; grid-template-columns: minmax(320px, 44%) 1fr; min-height: 100vh; }
.auth-side { position: relative; overflow: hidden; color: #fff; padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 18px;
  background: radial-gradient(circle at 85% 15%, rgba(18,160,215,.55) 0, rgba(18,160,215,0) 45%), linear-gradient(160deg, #0a4a9a 0%, #003c82 45%, #002456 100%); }
.auth-side::after { content: ""; position: absolute; right: -90px; bottom: -90px; width: 280px; height: 280px; border-radius: 50%; border: 36px solid rgba(255,255,255,.06); }
.auth-logo { display: flex; align-items: center; gap: 14px; font-size: 1.9rem; letter-spacing: -.01em; }
.auth-logo b { font-weight: 700; }
.auth-tag { font-size: 1.15rem; line-height: 1.45; max-width: 26em; margin: 0; color: #e8f4fb; }
.auth-points { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 10px; max-width: 28em; }
.auth-points li { position: relative; padding-left: 30px; color: #d6e9f5; }
.auth-points li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent);
  box-shadow: inset 0 0 0 5px var(--accent), inset 0 0 0 7px #fff; }
.auth-secure { margin-top: 18px; font-size: .85rem; color: #a9cbe6; }
.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 32px 20px; }
.auth { width: 100%; max-width: 420px; }
.auth .card { padding: 28px; box-shadow: 0 10px 30px rgba(0,36,86,.08); border-radius: 14px; }
.auth h1 { margin-bottom: .2rem; }
.auth h1 + .muted { margin: 0 0 18px; }
.auth-foot { color: var(--muted); font-size: .8rem; margin-top: 18px; }
.center { text-align: center; }
.pw { position: relative; display: block; }
.pw input { padding-right: 76px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); margin-top: 2px; border: 0; background: var(--brand-soft); color: var(--brand); border-radius: 6px; padding: 5px 9px; font: inherit; font-size: .8rem; cursor: pointer; }
.auth .btn.primary { padding: 12px 16px; font-size: 1rem; }
.code { font-size: 1.6rem !important; letter-spacing: .3em; text-align: center; font-family: ui-monospace, Menlo, monospace; }
.qr { text-align: center; margin: 8px 0; }
.qr img { width: 220px; height: 220px; image-rendering: pixelated; }
.secret { text-align: center; font-size: 1rem; word-break: break-all; }
.steps { padding-left: 20px; margin: 0 0 8px; }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; min-height: 0; }
  .auth-side { padding: 28px 22px 64px; gap: 10px; }
  .auth-side::after { width: 180px; height: 180px; right: -60px; bottom: -60px; border-width: 24px; }
  .auth-logo { font-size: 1.5rem; }
  .auth-logo img { width: 44px; height: 44px; }
  .auth-tag { font-size: 1rem; }
  .auth-points, .auth-secure { display: none; }
  .auth-main { padding: 0 14px 28px; margin-top: -44px; position: relative; z-index: 1; justify-content: flex-start; }
}

/* ---- Faza 1 ---- */
h3 { font-size: .95rem; margin: 14px 0 6px; color: var(--muted); }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pagehead h1 { margin-bottom: .6rem; }
.searchbar { display: flex; gap: 8px; margin-bottom: 14px; }
.searchbar input { margin-top: 0; }
.filters input[type=search] { margin-bottom: 10px; }
.filters .row select { margin-top: 0; }
.list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: inherit; }
a.item:hover { border-color: var(--accent); }
.card .item { border-left: 0; border-right: 0; border-top: 0; border-radius: 0; padding: 10px 0; }
.item.static { background: transparent; }
.item-main { display: flex; flex-direction: column; min-width: 0; }
.item-main strong { overflow-wrap: anywhere; }
.badge { white-space: nowrap; }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.txt-red { color: var(--err); }
.txt-warn { color: var(--warn); }
.ck { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ck:last-of-type { border-bottom: 0; }
.ck-text { flex: 1; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.ck.done .ck-text { color: var(--muted); text-decoration: line-through; }
.ckbox { width: 26px; height: 26px; border: 2px solid var(--brand); border-radius: 6px; background: #fff; color: #fff; font-weight: 700; cursor: pointer; line-height: 1; padding: 0; flex: none; }
.ck.done .ckbox { background: var(--brand); }
.ckbox:disabled { opacity: .5; cursor: default; }
.linkish { border: 0; background: none; color: var(--muted); font-size: 1.1rem; padding: 0 6px; }
.inline-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.inline-add input[type=text] { flex: 1 1 220px; margin-top: 0; }
.inline-add input[type=date], .inline-add select { width: auto; margin-top: 0; }
.small-input { width: auto !important; display: inline-block !important; padding: 4px 6px !important; margin: 0 !important; font-size: .85rem !important; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 6px 12px; border-radius: 99px; background: #fff; border: 1px solid var(--line); text-decoration: none; font-size: .88rem; color: var(--ink); }
.tabs a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.capture { display: flex; gap: 10px; align-items: flex-end; }
.capture textarea { min-height: 52px; margin-top: 0; }
.capture-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.capture-item:last-child { border-bottom: 0; }
.capture-text { white-space: normal; margin-bottom: 6px; }
.card.alert { border-color: #f1b8b2; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 2px; margin: 0 0 12px; }
legend { font-size: .85rem; font-weight: 600; color: var(--brand); padding: 0 6px; }
.seg { display: flex; gap: 16px; margin-bottom: 12px; }
details.edit { margin-top: 12px; }
details > summary { list-style: none; cursor: pointer; display: inline-block; margin: 6px 0; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: 10px; }
.statusbar { margin-bottom: 10px; }
.statusbar select { width: auto; display: inline-block; font-weight: 600; }
form[data-tip="PF"] .only-pj, form[data-tip="PJ"] .only-pf { display: none; }
@media (max-width: 600px) {
  .capture { flex-direction: column; align-items: stretch; }
  dl.kv { grid-template-columns: 100px 1fr; }
  .pagehead .btn { padding: 7px 12px; }
}
.kyc-res { border-left: 4px solid var(--line); padding: 8px 12px; margin: 10px 0; background: #fafbfc; border-radius: 6px; }
.kyc-ok { border-color: var(--ok); } .kyc-atentie { border-color: #f0c36d; } .kyc-risc, .kyc-eroare { border-color: var(--err); }
.kyc-res p { margin: 4px 0; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; color: var(--brand); margin: 8px 0 16px; }
.tbl th.num, .tbl td.num { text-align: right; white-space: nowrap; } .tbl tfoot th { border-top: 2px solid var(--line); color: var(--ink); text-transform: none; font-size: .92rem; }

/* KYC: detalii complete */
.kyc-res h3 { font-size: 1rem; margin: 18px 0 6px; color: var(--brand); }
.kyc-res .tbl.kv td:first-child { width: 38%; }
.kyc-sub { margin: 8px 0; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; background: #fff; }
.kyc-sub summary { cursor: pointer; font-weight: 600; }
.tbl-scroll { overflow-x: auto; }
.tbl .num, .tbl th.num { text-align: right; white-space: nowrap; }

/* Meniul de administrare (sub tabul Admin) */
.subnav { background: var(--brand-soft); border-bottom: 1px solid var(--line); display: flex; gap: 4px; align-items: center; padding: 6px 16px; overflow-x: auto; position: sticky; top: 58px; z-index: 9; }
.subnav a { color: var(--brand); text-decoration: none; padding: 5px 10px; border-radius: 8px; font-size: .9rem; white-space: nowrap; }
.subnav a.active, .subnav a:hover { background: #fff; font-weight: 600; }
.subnav-t { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 6px; }
@media (max-width: 720px) { .subnav { position: static; } }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.admin-grid a.card { display: block; text-decoration: none; color: inherit; margin: 0; }
.admin-grid a.card:hover { border-color: var(--accent); }
.admin-grid h2 { margin: 0 0 6px; font-size: 1.05rem; color: var(--brand); }
