:root {
  --bg: #f4f5f7; --panou: #fff; --text: #1c2430; --slab: #667085; --linie: #dfe3ea;
  --accent: #1d4f91; --accent-inchis: #163d70; --accent-pal: #e8eff8;
  --ok: #1a7f4b; --ok-pal: #e3f4ea; --atentie: #a15c00; --atentie-pal: #fdf1dc; --rau: #b3261e; --rau-pal: #fbe9e7;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.slab { color: var(--slab); }
.mic { font-size: 13px; }

/* structură */
.cadru { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.meniu { background: #14253d; color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.meniu .sigla { font-weight: 700; font-size: 17px; padding: 4px 10px 16px; letter-spacing: .3px; }
.meniu .sigla small { display: block; font-weight: 400; font-size: 12px; opacity: .65; }
.meniu a { color: #cfd8e6; padding: 9px 10px; border-radius: 7px; }
.meniu a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.meniu a.activ { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.meniu .jos { margin-top: auto; font-size: 13px; padding: 0 10px; opacity: .8; }
.meniu .jos button { background: none; border: 0; color: #cfd8e6; padding: 0; cursor: pointer; text-decoration: underline; font: inherit; }
main { padding: 24px 28px 60px; min-width: 0; }
.cap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cap h1 { margin: 0; flex: 1; }

.panou { background: var(--panou); border: 1px solid var(--linie); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.grila { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cifra { font-size: 28px; font-weight: 700; line-height: 1.1; }
.cifra + div { color: var(--slab); font-size: 13px; }

/* formulare */
label { display: block; font-size: 13px; color: var(--slab); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #c5ccd8; border-radius: 7px; font: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.camp { margin-bottom: 12px; }
.bifa { display: flex; align-items: center; gap: 7px; color: var(--text); font-size: 14px; margin: 0 0 6px; cursor: pointer; }
.bifa input { margin: 0; }
button, .btn { font: inherit; padding: 8px 14px; border-radius: 7px; border: 1px solid #c5ccd8; background: #fff; color: var(--text); cursor: pointer; display: inline-block; }
button:hover, .btn:hover { background: #f1f3f7; text-decoration: none; }
button.principal { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.principal:hover { background: var(--accent-inchis); }
button.pericol { color: var(--rau); border-color: #e3b5b1; }
button.mic { padding: 3px 9px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
.actiuni { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filtre { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.filtre > * { flex: 1 1 150px; }
.filtre input[type=search] { flex: 2 1 240px; }

/* tabele */
.tabel-cadru { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--slab); padding: 8px 10px; border-bottom: 1px solid var(--linie); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid #edf0f4; vertical-align: top; }
tr.clic { cursor: pointer; }
tr.clic:hover td { background: #f7f9fc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.eticheta { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 12px; background: #eceff4; color: #445; white-space: nowrap; }
.eticheta.ok { background: var(--ok-pal); color: var(--ok); }
.eticheta.atentie { background: var(--atentie-pal); color: var(--atentie); }
.eticheta.rau { background: var(--rau-pal); color: var(--rau); }
.eticheta.albastru { background: var(--accent-pal); color: var(--accent); }
.nota { background: var(--atentie-pal); color: #6b3f00; border-radius: 7px; padding: 9px 12px; font-size: 14px; margin-bottom: 12px; }
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { padding: 8px 0; border-bottom: 1px solid #edf0f4; display: flex; gap: 10px; align-items: baseline; }
.lista li:last-child { border-bottom: 0; }
.lista .cand { flex: 0 0 92px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--linie); border-left: 1px solid var(--linie); }
.cal > div { border-right: 1px solid var(--linie); border-bottom: 1px solid var(--linie); min-height: 96px; padding: 4px 5px; background: #fff; }
.cal .zi-cap { min-height: 0; background: #f7f8fa; font-size: 12px; text-transform: uppercase; color: var(--slab); text-align: center; padding: 6px 0; }
.cal .alta { background: #fafbfc; color: #aab; }
.cal .azi .nr { background: var(--accent); color: #fff; border-radius: 50%; }
.cal .nr { display: inline-block; width: 24px; height: 24px; line-height: 24px; text-align: center; font-size: 13px; cursor: pointer; }
.cal .ev { display: block; font-size: 12px; background: var(--accent-pal); color: var(--accent-inchis); border-radius: 4px; padding: 1px 5px; margin-top: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.cal .ev.zn { background: #fdeef3; color: #9b1c4a; cursor: default; }

/* autentificare, mesaje, dialog */
.centru { max-width: 380px; margin: 9vh auto; padding: 0 16px; }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: #1c2430; color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; z-index: 50; }
#toast.vizibil { opacity: 1; }
#toast.eroare { background: var(--rau); }
dialog { border: 0; border-radius: 12px; padding: 20px 22px; width: min(720px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(20,30,45,.45); }
.cutie-derulare { max-height: 220px; overflow: auto; border: 1px solid var(--linie); border-radius: 7px; padding: 8px 10px; }
.coloane-bife { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }

@media (max-width: 860px) {
  .cadru { grid-template-columns: 1fr; }
  .meniu { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .meniu .sigla { width: 100%; padding-bottom: 6px; }
  .meniu .jos { margin: 0 0 0 auto; align-self: center; }
  main { padding: 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .g4.cifre { grid-template-columns: repeat(2, 1fr); }
  .cal > div { min-height: 64px; }
  .coloane-bife { grid-template-columns: 1fr; }
}
