/* ============================================================
   Rețele Locale — componente proprii, peste style.css și lab.css
   ============================================================ */

/* --- pe ecrane înguste, coloanele grilei nu au voie să fie împinse
       de conținutul lat: tabelele și diagramele derulează în cutia lor -- */
.lab-layout > .lab-toc,
.lab-layout > .lab-body { min-width: 0; }
.lab-body table { display: block; overflow-x: auto; max-width: 100%; }
@media (min-width: 620px) { .lab-body table { display: table; } }

/* --- bloc de consolă Cisco IOS ------------------------------------ */
.code-wrap.ios .code-head { background: #0d2419; }
.code-wrap.ios .code-head span::before { content: "IOS "; color: #a2ceeb; }
.code-wrap.ios pre { background: #091d13; }

/* --- caseta editabilă de reguli (evaluatorul de ACL) -------------- */
.rl-ta {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 12px 14px;
  background: #092015;
  color: #e4e0d4;
  border: 1px solid #224734;
  border-radius: 0 0 8px 8px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  white-space: pre;
  overflow-x: auto;
}
.rl-ta:focus { border-color: var(--accent, var(--teal)); }

/* --- „fișă de protocol”: definiție compactă ----------------------- */
.rl-def {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent, var(--teal));
  border-radius: 7px;
  background: #fff;
  padding: 11px 14px;
  margin: 12px 0 16px;
}
.rl-def .rd-t {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.7px; color: var(--accent, var(--teal)); margin-bottom: 4px;
}
.rl-def .rd-b { font-size: 0.95rem; }

/* --- două coloane pe ecrane largi --------------------------------- */
.rl-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 12px 0 16px; }
@media (max-width: 760px) { .rl-two { grid-template-columns: 1fr; } }

/* --- carduri de comparație (avantaje / dezavantaje) --------------- */
.rl-pro, .rl-con {
  border-radius: 8px; padding: 12px 15px; font-size: 0.9rem;
  border: 1px solid var(--border); border-top: 3px solid;
}
.rl-pro { border-top-color: var(--ok);  background: rgba(46,122,88,0.05); }
.rl-con { border-top-color: #c85a3e;      background: rgba(214,92,66,0.05); }
.rl-pro b, .rl-con b { display: block; font-family: var(--mono); font-size: 0.74rem;
  text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 6px; }
.rl-pro b { color: #34654c; } .rl-con b { color: #9c3f28; }
.rl-pro ul, .rl-con ul { margin: 0; padding-left: 18px; }

/* --- antet de protocol desenat din casete ------------------------- */
.rl-hdr { margin: 12px 0 16px; overflow-x: auto; }
.rl-hdr table { border-collapse: collapse; width: 100%; min-width: 520px; font-family: var(--mono); }
.rl-hdr td {
  border: 1px solid #adb5a1; padding: 8px 6px; text-align: center;
  font-size: 0.76rem; background: #fff; color: var(--navy); line-height: 1.35;
}
.rl-hdr td .b { display: block; font-size: 0.66rem; color: var(--muted); margin-top: 2px; }
.rl-hdr td.hi { background: var(--accent-soft, rgba(62,106,138,0.12)); font-weight: 700; }
.rl-hdr td.dim { background: rgba(18,53,38,0.04); color: var(--muted); }
.rl-hdr caption { caption-side: bottom; font-size: 0.8rem; color: var(--muted);
  font-family: var(--mono); padding-top: 7px; text-align: left; }

/* --- etichete de verdict / stare ---------------------------------- */
.rl-tag {
  display: inline-block; font-family: var(--mono); font-size: 0.72rem;
  padding: 1px 8px; border-radius: 3px; font-weight: 700; white-space: nowrap;
}
.rl-tag.ok   { background: rgba(46,122,88,0.16); color: #34654c; }
.rl-tag.no   { background: rgba(214,92,66,0.16);  color: #9c3f28; }
.rl-tag.warn { background: rgba(184,101,42,0.18); color: #9a4e18; }
.rl-tag.neut { background: rgba(18,53,38,0.08);   color: var(--muted); }

/* --- widgeturi: bara de butoane ----------------------------------- */
.rl-btn {
  font-family: var(--mono); font-size: 0.78rem; padding: 6px 13px;
  border: 1px solid var(--accent, var(--teal)); color: var(--accent, var(--teal));
  background: #fff; border-radius: 5px; cursor: pointer; transition: all 0.12s ease;
}
.rl-btn:hover  { background: var(--accent, var(--teal)); color: #fff; }
.rl-btn.ghost  { border-color: var(--border); color: var(--muted); }
.rl-btn.ghost:hover { background: rgba(18,53,38,0.06); color: var(--navy); }
.rl-btn[disabled] { opacity: 0.45; cursor: default; }
.rl-btn.on { background: var(--accent, var(--teal)); color: #fff; }

/* --- tabelă mică în interiorul unui widget ------------------------ */
.rl-mini { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.8rem; }
.rl-mini th {
  text-align: left; padding: 5px 8px; background: rgba(18,53,38,0.06);
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--navy);
}
.rl-mini td { padding: 5px 8px; border-bottom: 1px solid var(--border); }
.rl-mini tr.new td { background: rgba(46,122,88,0.10); }
.rl-mini tr.hit td { background: rgba(62,106,138,0.12); font-weight: 700; }
.rl-mini tr.dead td { opacity: 0.45; text-decoration: line-through; }
.rl-mini .empty { color: var(--muted); font-style: italic; }

/* --- binar pe biți, aliniat pe octeți ----------------------------- */
.rl-bin { font-family: var(--mono); font-size: 0.82rem; letter-spacing: 0.5px; white-space: nowrap; }
div.rl-bin { display: block; max-width: 100%; overflow-x: auto; }
.rl-bin .net  { color: #2e7a58; font-weight: 700; }
.rl-bin .host { color: #c85a3e; }
.rl-bin .dot  { color: var(--muted); }
.rl-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.78rem;
  font-family: var(--mono); color: var(--muted); margin-top: 8px; }
.rl-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 4px; }

/* --- forma de undă pentru codări de linie ------------------------- */
.rl-wave { overflow-x: auto; background: #123526; border-radius: 8px; padding: 12px; }
.rl-wave svg { display: block; min-width: 560px; }

/* --- listă de pași scurți, fără cerculețe ------------------------- */
.rl-flow { list-style: none; padding-left: 0; margin: 12px 0 16px; counter-reset: fl; }
.rl-flow li {
  counter-increment: fl; position: relative; padding: 8px 12px 8px 40px;
  border-bottom: 1px solid var(--border); font-size: 0.92rem;
}
.rl-flow li:last-child { border-bottom: none; }
.rl-flow li::before {
  content: counter(fl); position: absolute; left: 8px; top: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft, rgba(62,106,138,0.14)); color: var(--accent, var(--teal));
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* --- „de reținut” la finalul unei secțiuni ------------------------ */
.rl-key {
  border-left: 4px solid var(--navy); background: rgba(18,53,38,0.045);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 16px 0;
  font-size: 0.93rem;
}
.rl-key b { display: block; font-family: var(--mono); font-size: 0.74rem;
  text-transform: uppercase; letter-spacing: 0.7px; color: var(--navy); margin-bottom: 4px; }

/* --- exercițiu rezolvat, cu răspuns ascuns ------------------------ */
.rl-ex {
  border: 1px dashed var(--accent, var(--teal)); border-radius: 8px;
  padding: 12px 15px; margin: 14px 0; background: #fff; font-size: 0.93rem;
}
.rl-ex > .rx-t { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.7px; color: var(--accent, var(--teal)); margin-bottom: 5px; }
.rl-ex summary {
  cursor: pointer; font-family: var(--mono); font-size: 0.8rem;
  color: var(--accent, var(--teal)); margin-top: 8px; list-style: none;
}
.rl-ex summary::before { content: "▸ "; }
.rl-ex details[open] summary::before { content: "▾ "; }
.rl-ex details > div { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

/* --- lista de materiale / topologie a laboratorului ---------------- */
.rl-topo { background: #fbfdfe; }
.rl-plan { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin: 12px 0 16px; }
.rl-plan th, .rl-plan td { border: 1px solid var(--border); padding: 6px 9px; }
.rl-plan th { background: var(--accent-soft, rgba(62,106,138,0.12)); font-family: var(--mono);
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.4px; }
.rl-plan td { font-family: var(--mono); font-size: 0.82rem; }
.rl-plan td.txt { font-family: inherit; font-size: 0.86rem; }

/* ============================================================
   Versiunea extinsă: buget de timp, componente pentru începători
   și widgeturile noi
   ============================================================ */

/* --- minutele alocate unei secțiuni ------------------------------- */
.lab-body h2 .h-min {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: rgba(18,53,38,0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 10px;
  flex-shrink: 0;
  white-space: nowrap;
}
.st-l .n { font-size: 0.72rem; }
.lab-toc a i { font-style: normal; font-family: var(--mono); font-size: 0.7rem;
  color: var(--muted); margin-left: 6px; opacity: 0.75; }
.lab-toc a.active i { color: var(--accent, var(--teal)); }

/* --- caseta „dacă e prima dată când auzi asta" -------------------- */
.rl-zero {
  border: 1px solid rgba(46,122,88,0.35);
  border-left: 4px solid var(--teal);
  background: linear-gradient(90deg, rgba(46,122,88,0.09), rgba(46,122,88,0.02));
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  margin: 16px 0;
}
.rl-zero > .rz-t {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.9px; color: #34654c; margin-bottom: 6px;
  display: flex; align-items: center; gap: 7px;
}
.rl-zero > .rz-t::before { content: "◐"; font-size: 0.9rem; }
.rl-zero p:last-child { margin-bottom: 0; }
.rl-zero ul, .rl-zero ol { margin-bottom: 0; }

/* --- analogie din viața de zi cu zi ------------------------------- */
.rl-analog {
  border-left: 4px solid #ca7985;
  background: rgba(202,121,133,0.08);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px; margin: 14px 0; font-size: 0.94rem;
}
.rl-analog b:first-child {
  display: block; font-family: var(--mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.8px; color: #924b57; margin-bottom: 4px;
}

/* --- recapitulare din cursul anterior ----------------------------- */
.rl-recap {
  border: 1px dashed var(--border);
  border-radius: 9px; padding: 13px 17px; margin: 0 0 18px;
  background: rgba(18,53,38,0.025); font-size: 0.93rem;
}
.rl-recap > b:first-child {
  display: block; font-family: var(--mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.8px; color: var(--navy); margin-bottom: 6px;
}
.rl-recap ul { margin: 0; padding-left: 20px; }
.rl-recap li { margin-bottom: 3px; }

/* --- glosarul de la finalul cursului ------------------------------ */
.rl-gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 10px; margin: 14px 0 18px; }
.rl-gloss > div {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 13px; background: #fff;
}
.rl-gloss dt, .rl-gloss > div > b {
  display: block; font-family: var(--mono); font-size: 0.83rem;
  color: var(--accent, var(--teal)); margin-bottom: 3px;
}
.rl-gloss > div > span { font-size: 0.87rem; color: var(--ink); }

/* --- greșeli frecvente -------------------------------------------- */
.rl-mist { list-style: none; padding-left: 0; margin: 14px 0 18px; }
.rl-mist > li {
  border: 1px solid var(--border); border-left: 3px solid #c85a3e;
  border-radius: 7px; padding: 11px 14px; margin-bottom: 9px; background: #fff;
}
.rl-mist > li > b { display: block; color: #9c3f28; margin-bottom: 4px; font-size: 0.95rem; }
.rl-mist > li > span { font-size: 0.9rem; }
.rl-mist .fix { display: block; margin-top: 6px; font-size: 0.88rem; color: #34654c; }
.rl-mist .fix::before { content: "→ "; font-weight: 700; }

/* ---------------- widget: sisteme de numerație -------------------- */
.nz-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.nz-bits { display: flex; gap: 4px; flex-wrap: wrap; margin: 10px 0; }
.nz-bit {
  width: 52px; border: 1px solid var(--border); border-radius: 6px; text-align: center;
  cursor: pointer; user-select: none; background: #fff; overflow: hidden; transition: all .12s ease;
}
.nz-bit .v { font-family: var(--mono); font-size: 1.05rem; font-weight: 700; padding: 6px 0; color: var(--navy); }
.nz-bit .w { font-family: var(--mono); font-size: 0.66rem; background: rgba(18,53,38,0.05); color: var(--muted); padding: 2px 0; }
.nz-bit.on { border-color: var(--ok); background: rgba(46,122,88,0.12); }
.nz-bit.on .v { color: #34654c; }
.nz-bit.on .w { background: rgba(46,122,88,0.18); color: #34654c; }
.nz-bit:hover { border-color: var(--accent, var(--teal)); }

/* ---------------- widget: stiva de niveluri ----------------------- */
.st-wrap { display: grid; grid-template-columns: 1fr 1.15fr; gap: 14px; align-items: start; }
@media (max-width: 700px) { .st-wrap { grid-template-columns: 1fr; } }
.st-l {
  border: 1px solid var(--border); border-radius: 7px; padding: 9px 12px; margin-bottom: 5px;
  cursor: pointer; background: #fff; font-size: 0.88rem; display: flex; align-items: center; gap: 8px;
  transition: all .12s ease;
}
.st-l:hover { border-color: var(--accent, var(--teal)); }
.st-l.sel { background: var(--accent, var(--teal)); border-color: var(--accent, var(--teal)); color: #fff; }
.st-l .n { font-family: var(--mono); font-size: 0.75rem; opacity: 0.7; }
.st-l.sel .n { opacity: 0.9; }
.st-d { border: 1px solid var(--border); border-top: 3px solid var(--accent, var(--teal));
  border-radius: 8px; padding: 13px 16px; background: #fff; font-size: 0.9rem; }
.st-d h5 { margin: 0 0 8px; font-size: 1rem; color: var(--navy); }
.st-d table { margin: 8px 0 0; font-size: 0.84rem; }

/* ---------------- widget: explorator de antet --------------------- */
.fl-strip { display: flex; flex-wrap: wrap; gap: 3px; margin: 10px 0 12px; }
.fl-f {
  border: 1px solid #adb5a1; border-radius: 5px; padding: 8px 6px; cursor: pointer;
  text-align: center; background: #fff; transition: all .12s ease; min-width: 54px; flex: 1 1 auto;
}
.fl-f .fn { font-family: var(--mono); font-size: 0.74rem; color: var(--navy); display: block; }
.fl-f .fb { font-family: var(--mono); font-size: 0.63rem; color: var(--muted); display: block; margin-top: 2px; }
.fl-f:hover { border-color: var(--accent, var(--teal)); }
.fl-f.sel { background: var(--accent, var(--teal)); border-color: var(--accent, var(--teal)); }
.fl-f.sel .fn, .fl-f.sel .fb { color: #fff; }
.fl-f.k-addr { background: rgba(62,106,138,0.10); }
.fl-f.k-ctrl { background: rgba(184,101,42,0.10); }
.fl-f.k-data { background: rgba(46,122,88,0.10); }
.fl-f.k-chk  { background: rgba(202,121,133,0.12); }
.fl-f.sel.k-addr, .fl-f.sel.k-ctrl, .fl-f.sel.k-data, .fl-f.sel.k-chk { background: var(--accent, var(--teal)); }
.fl-d { border: 1px solid var(--border); border-left: 3px solid var(--accent, var(--teal));
  border-radius: 7px; padding: 12px 15px; background: #fff; font-size: 0.92rem; min-height: 62px; }
.fl-d b { color: var(--navy); }
.fl-leg { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--mono); font-size: 0.72rem;
  color: var(--muted); margin-top: 9px; }
.fl-leg i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 4px;
  border: 1px solid #adb5a1; }

/* ---------------- widget: scenă pas cu pas ------------------------ */
.sc-stage { background: #123526; border-radius: 8px; padding: 10px; overflow-x: auto; }
.sc-stage svg { display: block; width: 100%; height: auto; }
.sc-bar { display: flex; align-items: center; gap: 10px; margin: 11px 0 9px; flex-wrap: wrap; }
.sc-prog { flex: 1 1 140px; height: 6px; background: rgba(18,53,38,0.08); border-radius: 3px; overflow: hidden; min-width: 120px; }
.sc-prog i { display: block; height: 100%; background: var(--accent, var(--teal)); transition: width .2s ease; }
.sc-n { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); white-space: nowrap; }
.sc-txt { border: 1px solid var(--border); border-left: 3px solid var(--accent, var(--teal));
  border-radius: 7px; padding: 12px 15px; background: #fff; font-size: 0.93rem; }
.sc-txt b.sc-t { display: block; color: var(--navy); margin-bottom: 4px; }
.sc-txt b { color: var(--navy); }

/* ---------------- widget: potrivire ------------------------------- */
.mt-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 620px) { .mt-wrap { grid-template-columns: 1fr; } }
.mt-col h5 { margin: 0 0 8px; font-family: var(--mono); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); }
.mt-i {
  border: 1px solid var(--border); border-radius: 7px; padding: 9px 12px; margin-bottom: 7px;
  cursor: pointer; background: #fff; font-size: 0.89rem; transition: all .12s ease;
}
.mt-i:hover { border-color: var(--accent, var(--teal)); }
.mt-i.sel { border-color: var(--accent, var(--teal)); background: var(--accent-soft, rgba(62,106,138,0.12)); }
.mt-i.ok { background: rgba(46,122,88,0.14); border-color: var(--ok); cursor: default; }
.mt-i.no { background: rgba(214,92,66,0.16); border-color: #c85a3e; }
.mt-i .tag { font-family: var(--mono); font-size: 0.68rem; color: var(--teal); float: right; }

/* ---------------- widget: ordonare -------------------------------- */
.or-l { list-style: none; padding-left: 0; margin: 0 0 12px; }
.or-l li {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 7px; padding: 9px 12px; margin-bottom: 7px;
  background: #fff; font-size: 0.9rem;
}
.or-l li.ok { background: rgba(46,122,88,0.12); border-color: var(--ok); }
.or-l li.no { background: rgba(214,92,66,0.12); border-color: #c85a3e; }
.or-l .num { font-family: var(--mono); font-weight: 700; color: var(--accent, var(--teal));
  width: 20px; flex: none; }
.or-l .txt { flex: 1; }
.or-btn { border: 1px solid var(--border); background: #fff; border-radius: 5px; cursor: pointer;
  font-family: var(--mono); font-size: 0.8rem; width: 26px; height: 26px; line-height: 1; color: var(--navy); }
.or-btn:hover { border-color: var(--accent, var(--teal)); color: var(--accent, var(--teal)); }
.or-btn[disabled] { opacity: 0.3; cursor: default; }

/* ---------------- widget: terminal simulat ------------------------ */
.tm-box { background: #091d13; border: 1px solid #224734; border-radius: 8px; padding: 12px 14px;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.6; color: #e4e0d4;
  max-height: 340px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.tm-box .p { color: #a2ceeb; }
.tm-box .c { color: #ffd08a; }
.tm-box .e { color: #ff9d7a; }
.tm-box .o { color: #afd3bd; white-space: pre-wrap; }
.tm-in { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.tm-in span { font-family: var(--mono); font-size: 0.82rem; color: var(--accent, var(--teal)); }
.tm-in input {
  flex: 1; font-family: var(--mono); font-size: 0.82rem; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--ink); min-width: 0;
}
.tm-in input:focus { outline: none; border-color: var(--accent, var(--teal)); }

/* ---------------- widget: canale Wi-Fi ---------------------------- */
.ch-wrap { background: #123526; border-radius: 8px; padding: 12px; overflow-x: auto; }
.ch-wrap svg { display: block; width: 100%; height: auto; min-width: 520px; }

/* configuratie de widget invalida — semnalare vizibila, nu esec tacut */
.rl-broken {
  border: 1px solid #c85a3e;
  background: rgba(200, 90, 62, 0.08);
  color: #8a3a24;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.86rem;
  line-height: 1.5;
}
.rl-broken code { background: rgba(200, 90, 62, 0.14); padding: 1px 4px; border-radius: 3px; }
