/* Calcul salar — stiluri comune site + aplicatie */
:root {
  --accent: #c62828; --accent-2: #8e1b1b; --accent-bg: #fdecea;
  --bg: #f4f5f7; --card: #ffffff; --text: #1d1f23; --text-2: #5f6670; --line: #e3e6ea;
  --ok: #1b6e2a; --ok-bg: #e8f5ea; --warn-bg: #fff6dc; --warn: #7a5600;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #ef6461; --accent-2: #ff8a87; --accent-bg: #3a1d1d;
    --bg: #121315; --card: #1d1f22; --text: #eceef1; --text-2: #a5acb6; --line: #33373c;
    --ok: #7ccf8a; --ok-bg: #1c2d20; --warn-bg: #3a3112; --warn: #f3d27a; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --accent: #ef6461; --accent-2: #ff8a87; --accent-bg: #3a1d1d;
  --bg: #121315; --card: #1d1f22; --text: #eceef1; --text-2: #a5acb6; --line: #33373c;
  --ok: #7ccf8a; --ok-bg: #1c2d20; --warn-bg: #3a3112; --warn: #f3d27a; --shadow: none;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 32px; }

/* antet */
.top { background: var(--accent); color: #fff; padding: calc(12px + var(--sat, 0px)) 16px 0; position: sticky; top: 0; z-index: 10; }
.top .bar { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.top img { width: 34px; height: 34px; border-radius: 8px; background: #fff; }
.top .brand { font-size: 19px; margin: 0; font-weight: 650; flex: 1; }
.top .sub { font-size: 12px; opacity: .85; font-weight: 400; display: block; }
/* toate cele 5 taburi incap pe ecran, fara derulare ascunsa */
.tabs { max-width: 720px; margin: 8px auto 0; display: flex; }
.tabs button { flex: 1 1 0; min-width: 0; background: none; border: 0; color: rgba(255,255,255,.8); font: inherit; font-size: 14.5px;
  padding: 10px 2px 11px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .tabs button { font-size: 13px; } }
.tabs button.on { color: #fff; border-bottom-color: #fff; font-weight: 600; }

/* carduri si formulare */
.card { scroll-margin-top: 150px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-top: 14px; border: 1px solid var(--line); }
.card h2 { font-size: 17px; margin: 0 0 12px; }
.card h3 { font-size: 15px; margin: 16px 0 8px; color: var(--text-2); font-weight: 600; }
.seg { display: flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 14px; border: 1px solid var(--line); }
.seg button { flex: 1; border: 0; background: none; padding: 9px 4px; border-radius: 8px; font: inherit; font-size: 14px; color: var(--text-2); cursor: pointer; }
.seg button.on { background: var(--card); color: var(--accent); font-weight: 650; box-shadow: var(--shadow); }
label.f { display: block; margin: 10px 0 4px; font-size: 13.5px; color: var(--text-2); }
input[type=number], input[type=text], input[type=date], select {
  width: 100%; font: inherit; font-size: 17px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); outline: none; }
input:focus, select:focus { border-color: var(--accent); }
input.big { font-size: 26px; font-weight: 650; padding: 12px 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.sw { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.sw:first-of-type { border-top: 0; }
.sw small { display: block; color: var(--text-2); font-size: 12.5px; }
.sw input { width: 22px; height: 22px; accent-color: var(--accent); flex: 0 0 auto; }
.pers { display: flex; gap: 6px; }
.pers button { flex: 1; padding: 9px 0; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; cursor: pointer; }
.pers button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
details.more > summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 10px 0 2px; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸ "; }
details.more[open] > summary::before { content: "▾ "; }

/* rezultate */
.hero { text-align: center; padding: 6px 0 12px; }
.hero .lbl { color: var(--text-2); font-size: 14px; }
.hero .val { font-size: 38px; font-weight: 750; color: var(--ok); letter-spacing: -.5px; }
.hero .note { font-size: 13px; color: var(--text-2); }
.res { width: 100%; border-collapse: collapse; }
.res td { padding: 9px 4px; border-top: 1px solid var(--line); font-size: 15px; }
.res td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.res tr.k { cursor: pointer; }
.res tr.k td:first-child::after { content: " ⓘ"; color: var(--text-2); font-size: 12px; }
.res tr.tot td { font-weight: 700; }
.res tr.net td { font-weight: 750; color: var(--ok); font-size: 17px; }
.res tr.sec td { color: var(--text-2); font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; padding-top: 14px; border-top: 0; }
.res tr.ex td { border-top: 0; padding: 0 4px 10px; font-size: 13.5px; color: var(--text-2); text-align: left; white-space: normal; }
.minus { color: var(--accent); }
.warn { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-top: 10px; }
.info { background: var(--accent-bg); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-top: 10px; }
.muted { color: var(--text-2); font-size: 13px; }

/* butoane */
.acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.btn { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 11px; padding: 10px 6px; font: inherit; font-size: 13.5px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.btn .i { font-size: 20px; line-height: 1; }
.btn.p { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.w { flex-direction: row; justify-content: center; width: 100%; font-size: 15px; padding: 12px; margin-top: 10px; font-weight: 600; }

/* forme */
.forme { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.forma { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--bg); }
.forma.best { border-color: var(--ok); background: var(--ok-bg); }
.forma h4 { margin: 0 0 4px; font-size: 14.5px; }
.forma .v { font-size: 22px; font-weight: 750; }
.forma .p { font-size: 12.5px; color: var(--text-2); }
.forma details { margin-top: 6px; font-size: 13px; color: var(--text-2); }

/* salvate */
.sv { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.sv:first-child { border-top: 0; }
.sv .t { flex: 1; min-width: 0; }
.sv .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv .t span { font-size: 13px; color: var(--text-2); }
.sv button { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--text-2); padding: 6px; }
.sv input { width: 22px; height: 22px; accent-color: var(--accent); }
.cmp { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp th, .cmp td { padding: 8px 6px; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.cmp th:first-child, .cmp td:first-child { text-align: left; }
.cmp th { font-size: 13px; color: var(--text-2); vertical-align: bottom; }
.cmp tr.net td { font-weight: 750; color: var(--ok); }
.scroll { overflow-x: auto; }

/* dialog */
.dlg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: flex-end; justify-content: center; z-index: 50; }
.dlg.on { display: flex; }
.dlg .box { background: var(--card); width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + var(--sab, 0px)); max-height: 90vh; overflow: auto; }
.dlg h2 { margin: 0 0 8px; font-size: 18px; }
.dlg .acts2 { display: flex; gap: 8px; margin-top: 14px; }
.dlg .acts2 .btn { flex: 1; flex-direction: row; justify-content: center; font-size: 15px; padding: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--sab, 0px)); transform: translateX(-50%); background: #222; color: #fff; padding: 10px 16px;
  border-radius: 10px; font-size: 14px; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90%; }
.toast.on { opacity: 1; }
.anunt { background: var(--warn-bg); color: var(--warn); padding: 10px 16px; font-size: 14px; display: none; }
.anunt.on { display: flex; gap: 10px; align-items: flex-start; }
.anunt .x { margin-left: auto; background: none; border: 0; color: inherit; font-size: 18px; cursor: pointer; }

/* subsol */
.foot { text-align: center; font-size: 13px; color: var(--text-2); margin: 22px 0 calc(8px + var(--sab, 0px)); }
.foot a { font-weight: 600; }
.foot .cta { display: inline-block; margin-top: 8px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; color: var(--text); background: var(--card); }
.hidden { display: none !important; }
.only-web { }
body.app .only-web { display: none !important; }
body:not(.app) .only-app { display: none !important; }
.seo { margin-top: 18px; font-size: 15px; }
.seo h2 { font-size: 18px; margin: 18px 0 6px; }
.seo p, .seo li { color: var(--text); }
.playbadge { display: inline-flex; align-items: center; gap: 10px; background: #000; color: #fff; text-decoration: none; padding: 8px 14px; border-radius: 10px; font-size: 14px; }
.playbadge b { font-size: 17px; display: block; }
@media (max-width: 420px) {
  .hero .val { font-size: 34px; }
  .forme { grid-template-columns: 1fr; }
  .acts { gap: 6px; }
  .btn { font-size: 12.5px; }
}
@media print { .top, .acts, .foot, .tabs { display: none; } }

/* titlul paginii (doar pe site, pentru cititori si motoarele de cautare) */
.pagehead h1 { font-size: 22px; line-height: 1.25; margin: 16px 0 4px; }
.pagehead p { margin: 0; color: var(--text-2); font-size: 14.5px; }
