* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: "Segoe UI", system-ui, sans-serif; background: #0f1115; color: #e8eaf0; }
header { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; background: #171a21; border-bottom: 1px solid #262b36; position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { font-size: 28px; }
.brand-sub { font-size: 12px; color: #8b93a7; }
h1 { font-size: 20px; }
.header-actions { display: flex; gap: 8px; }
.btn { background: #262b36; color: #e8eaf0; border: 1px solid #353b48; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 14px; }
.btn:hover { background: #333a48; }
.btn.primary { background: #3b6ef6; border-color: #3b6ef6; }
.btn.primary:hover { background: #2f5cd8; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { color: #ff7b72; }
.btn.big { padding: 12px 22px; font-size: 15px; margin-top: 14px; }
.muted { color: #8b93a7; font-size: 13px; }

main { padding: 20px 22px 50px; max-width: 1200px; margin: 0 auto; }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #171a21; border: 1px solid #262b36; border-radius: 12px; padding: 14px 16px; }
.kpi .k-label { font-size: 12px; color: #8b93a7; text-transform: uppercase; letter-spacing: .4px; }
.kpi .k-value { font-size: 20px; font-weight: 700; margin-top: 6px; }
.kpi .k-hint { font-size: 11.5px; color: #8b93a7; margin-top: 4px; }
.kpi.good .k-value { color: #4ade80; }
.kpi.warn .k-value { color: #fbbf24; }
.kpi.bad .k-value { color: #f87171; }

/* ---------- alerte ---------- */
.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.alert { background: #2a1d12; border: 1px solid #5a3d1a; border-radius: 10px; padding: 10px 16px; font-size: 13.5px; color: #fcd34d; }
.alert.bad { background: #2a1414; border-color: #5a1f1f; color: #fca5a5; }

/* ---------- secțiuni ---------- */
.sections { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.section { background: #171a21; border: 1px solid #262b36; border-radius: 12px; overflow: hidden; }
.section-head { padding: 12px 18px; background: #1d2330; font-weight: 700; font-size: 14.5px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.section-head .arrow { transition: transform .15s; color: #8b93a7; }
.section.collapsed .section-head .arrow { transform: rotate(-90deg); }
.section-body { padding: 6px 18px 12px; }
.sec-title { font-size: 16px; margin: 10px 0 12px; }
.row-item { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid #1f2530; font-size: 14px; }
.row-item:last-child { border-bottom: none; }
.row-item .ri-label { color: #b9c0cf; }
.row-item .ri-value { font-weight: 600; text-align: right; }
.row-item .ri-note { display: block; font-size: 11.5px; color: #8b93a7; font-weight: 400; }

/* ---------- recomandări ---------- */
.recos { background: #171a21; border: 1px solid #262b36; border-radius: 12px; padding: 16px 20px; margin-bottom: 18px; }
.recos h3 { font-size: 14.5px; margin-bottom: 10px; color: #7ea2ff; }
.recos ul { margin-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: #cfd6e4; }

/* ---------- tabel conturi ---------- */
.table-wrap { overflow-x: auto; background: #171a21; border: 1px solid #262b36; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 12px; background: #1d2330; color: #8b93a7; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; position: sticky; top: 0; }
td { padding: 8px 12px; border-top: 1px solid #1f2530; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total-row td { font-weight: 700; background: #1d2330; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 80px 22px; color: #8b93a7; }
.empty-icon { font-size: 52px; margin-bottom: 14px; }
.empty h2 { color: #e8eaf0; margin-bottom: 8px; }
.empty p { max-width: 520px; margin: 0 auto 6px; line-height: 1.55; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: #171a21; border: 1px solid #353b48; border-radius: 14px; width: min(560px, 92vw); max-height: 80vh; overflow: auto; padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
#balance-list { list-style: none; }
#balance-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid #262b36; }
#balance-list .bw { flex: 1 1 140px; font-weight: 600; }
#balance-list .meta { flex: 1 1 100%; order: 3; font-size: 12px; color: #8b93a7; }
#balance-list .actions { display: flex; gap: 6px; }

/* ---------- upload ---------- */
.upload-drop { border: 2px dashed #353b48; border-radius: 12px; padding: 40px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.upload-drop:hover, .upload-drop.drag { border-color: #3b6ef6; background: rgba(59,110,246,.06); }
.upload-icon { font-size: 42px; margin-bottom: 10px; }

/* ---------- autentificare (la fel ca Locuri de Muncă) ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 200; }
.overlay.hidden { display: none; }
#auth-box {
  background: linear-gradient(160deg, #1c2030, #12141d);
  border: 1px solid #2c3242; border-radius: 20px;
  padding: 34px 32px 26px; width: 400px; max-width: 92vw;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  animation: auth-in .3s ease-out;
}
@keyframes auth-in { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.auth-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.auth-logo-icon {
  font-size: 32px; width: 56px; height: 56px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3b6ef6, #7c3aed);
  border-radius: 15px; box-shadow: 0 8px 24px rgba(59,110,246,.4);
}
.auth-logo-title { font-size: 20px; font-weight: 800; }
.auth-logo-sub { font-size: 12.5px; color: #8b93a7; margin-top: 2px; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 20px; padding: 5px; background: #0f1115; border-radius: 11px; }
.auth-tabs .chip { flex: 1; padding: 9px; border: none; background: transparent; color: #8b93a7; font-weight: 600; font-size: 14px; border-radius: 9px; cursor: pointer; }
.auth-tabs .chip.active { background: #3b6ef6; color: #fff; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form.hidden { display: none; }
.field { position: relative; display: flex; align-items: center; background: #0f1115; border: 1px solid #353b48; border-radius: 11px; transition: border-color .15s, box-shadow .15s; }
.field:focus-within { border-color: #3b6ef6; box-shadow: 0 0 0 3px rgba(59,110,246,.18); }
.field-icon { position: absolute; left: 13px; font-size: 14px; opacity: .65; pointer-events: none; }
.field input { width: 100%; background: none; border: none; outline: none; color: #e8eaf0; font-size: 15px; padding: 12px 14px 12px 40px; }
.field input::placeholder { color: #8b93a7; opacity: .8; }
.auth-submit {
  background: linear-gradient(135deg, #3b6ef6, #7c3aed); border: none; border-radius: 11px;
  color: #fff; padding: 13px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 4px;
  box-shadow: 0 8px 24px rgba(59,110,246,.35); transition: filter .15s, transform .12s;
}
.auth-submit:hover { filter: brightness(1.12); transform: translateY(-1px); }
.link-btn { background: none; border: none; color: #7ea2ff; cursor: pointer; font-size: 13px; padding: 4px 0; text-align: center; }
.link-btn:hover { color: #a5bcff; }
.auth-hint { font-size: 12.5px; text-align: center; margin-top: -4px; }
#auth-msg { margin-top: 14px; text-align: center; font-size: 13px; min-height: 18px; font-weight: 500; }
#auth-msg.ok { color: #4ade80; }
#auth-msg.err { color: #f87171; }

@media (max-width: 640px) {
  header { flex-direction: column; gap: 10px; align-items: stretch; }
  .header-actions { justify-content: flex-end; }
  .kpis { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  main { padding: 14px 12px 40px; }
}
