:root {
  --bg: #0c0e12; --panel: #14171e; --panel2: #1a1e27; --line: #262b36; --line2: #323846;
  --text: #e8e4d9; --mute: #8e95a3; --gold: #e3c07a; --gold2: #b8914a; --gold-bg: rgba(227,192,122,.1);
  --ok: #4cc38a; --ok-bg: rgba(76,195,138,.12); --warn: #e6a23c; --warn-bg: rgba(230,162,60,.12);
  --bad: #ef5b52; --bad-bg: rgba(239,91,82,.12); --info: #6aa4ff;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, system-ui, sans-serif; }
body { background: radial-gradient(1200px 600px at 80% -10%, rgba(227,192,122,.06), transparent 60%), var(--bg); }
.hidden { display: none !important; }
code { font-family: var(--mono); font-size: .92em; background: var(--panel2); padding: 1px 6px; border-radius: 5px; color: var(--gold); }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-family: Cinzel, serif; font-size: 26px; letter-spacing: .5px; }
h2 { font-size: 15px; }
h3 { font-size: 14px; margin-bottom: 8px; }
p { margin: 4px 0 0; }
.muted { color: var(--mute); }
.tiny { font-size: 12px; }

/* butoane */
.btn { border: 1px solid var(--line2); background: var(--panel2); color: var(--text); padding: 8px 14px; border-radius: 9px; font-weight: 500; font: inherit; cursor: pointer; transition: .15s; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--gold2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; padding: 11px; }
.btn.gold { background: linear-gradient(180deg, #e9c983, #c99f55); color: #1a1408; border-color: transparent; font-weight: 600; }
.btn.gold:hover:not(:disabled) { filter: brightness(1.08); }
.btn.ok { color: var(--ok); border-color: rgba(76,195,138,.35); background: var(--ok-bg); }
.btn.warn { color: var(--warn); border-color: rgba(230,162,60,.35); background: var(--warn-bg); }
.btn.bad { color: var(--bad); border-color: rgba(239,91,82,.35); background: var(--bad-bg); }
.btn.ghost { background: transparent; }

input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; outline: none; }
input:focus, select:focus { border-color: var(--gold2); }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--mute); }

/* autentificare */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.err { background: var(--bad-bg); color: var(--bad); border: 1px solid rgba(239,91,82,.3); padding: 8px 10px; border-radius: 8px; font-size: 13px; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand b { font-family: Cinzel, serif; letter-spacing: 2px; color: var(--gold); display: block; font-size: 16px; }
.brand small { color: var(--mute); font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; }
.brand.big b { font-size: 22px; }
.brand { flex-direction: column; align-items: center; gap: 2px; }
.brand .logo { display: block; width: 190px; max-width: 100%; height: auto; filter: drop-shadow(0 0 12px rgba(80,150,255,.35)); }
.brand.big .logo { width: 270px; }
.brand.big { gap: 4px; margin-bottom: 4px; }
.brand small { text-align: center; }
.gem { width: 30px; height: 30px; flex: none; border-radius: 8px; background: conic-gradient(from 45deg, #e9c983, #8a6a33, #e9c983, #8a6a33, #e9c983); box-shadow: 0 0 18px rgba(227,192,122,.3); transform: rotate(45deg) scale(.78); }

/* layout */
.app { display: grid; grid-template-columns: 230px 1fr; min-height: 100%; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; }
.side-state { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 8px 10px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mute); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot.warn { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.dot.bad { background: var(--bad); box-shadow: 0 0 10px var(--bad); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
nav { display: flex; flex-direction: column; gap: 3px; }
nav button { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: var(--mute); padding: 9px 10px; border-radius: 9px; text-align: left; font: inherit; cursor: pointer; }
nav button i { font-style: normal; width: 22px; text-align: center; font-family: var(--mono); font-size: 13px; color: var(--gold2); }
nav button:hover { background: var(--panel2); color: var(--text); }
nav button.on { background: var(--gold-bg); color: var(--gold); }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.who { display: flex; flex-direction: column; font-size: 12px; min-width: 0; }
.who b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }

main { padding: 24px 28px 40px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
section { display: flex; flex-direction: column; gap: 16px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.panel-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }

/* carduri */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; position: relative; overflow: hidden; }
.card .k { color: var(--mute); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; }
.card .v { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.card .s { color: var(--mute); font-size: 12.5px; margin-top: 2px; }
.card.hero .v { font-family: Cinzel, serif; letter-spacing: 1px; }
.card.hero.ok { border-color: rgba(76,195,138,.4); background: linear-gradient(135deg, var(--ok-bg), var(--panel) 60%); }
.card.hero.ok .v { color: var(--ok); }
.card.hero.warn { border-color: rgba(230,162,60,.4); background: linear-gradient(135deg, var(--warn-bg), var(--panel) 60%); }
.card.hero.warn .v { color: var(--warn); }
.card.hero.bad { border-color: rgba(239,91,82,.45); background: linear-gradient(135deg, var(--bad-bg), var(--panel) 60%); }
.card.hero.bad .v { color: var(--bad); }
.bar { height: 5px; border-radius: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--gold2); border-radius: 3px; }
.bar > span.hi { background: var(--warn); }
.bar > span.crit { background: var(--bad); }

.alert { border-radius: 10px; padding: 10px 14px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start; }
.alert.bad { background: var(--bad-bg); border-color: rgba(239,91,82,.35); }
.alert.warn { background: var(--warn-bg); border-color: rgba(230,162,60,.35); }
.alert + .alert { margin-top: 8px; }

/* tabele */
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.grid th { text-align: left; color: var(--mute); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.grid tr:last-child td { border-bottom: 0; }
.grid td.num { font-variant-numeric: tabular-nums; }
.grid td.wrap { white-space: normal; word-break: break-word; }
.core-name b { display: block; }
.core-name small { color: var(--mute); font-family: var(--mono); font-size: 11.5px; }
.btns { display: flex; gap: 5px; justify-content: flex-end; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid; }
.pill.on { color: var(--ok); background: var(--ok-bg); border-color: rgba(76,195,138,.3); }
.pill.off { color: var(--mute); background: var(--panel2); border-color: var(--line2); }
.pill.down { color: var(--bad); background: var(--bad-bg); border-color: rgba(239,91,82,.3); }
.pill.paused { color: var(--warn); background: var(--warn-bg); border-color: rgba(230,162,60,.3); }

/* bara de operație */
.jobbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel2); }
.jobbar.run { border-color: rgba(227,192,122,.4); background: var(--gold-bg); }
.jobbar.ok { border-color: rgba(76,195,138,.4); background: var(--ok-bg); }
.jobbar.fail { border-color: rgba(239,91,82,.4); background: var(--bad-bg); }
.jobbar .grow { flex: 1; min-width: 0; }
.jobbar pre { margin: 6px 0 0; white-space: pre-wrap; font-family: var(--mono); font-size: 12px; color: var(--mute); max-height: 160px; overflow: auto; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--gold2); border-top-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* consolă */
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button { font-family: var(--mono); font-size: 12px; background: var(--panel); border: 1px solid var(--line2); color: var(--mute); border-radius: 7px; padding: 5px 9px; cursor: pointer; }
.quick button:hover { color: var(--gold); border-color: var(--gold2); }
.term-wrap { background: #090b0f; border: 1px solid var(--line); border-radius: var(--r); padding: 10px; height: calc(100vh - 230px); min-height: 360px; }
#term { width: 100%; height: 100%; }

/* loguri */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 9px; }
.logbox { margin: 0; background: #090b0f; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; height: calc(100vh - 270px); min-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: #c9ccd3; }
.logbox .e { color: #ff8a80; }
.logbox .w { color: #f3c26b; }
.logbox .s { color: #8fb3ff; }
.logbox mark { background: rgba(227,192,122,.35); color: #fff; border-radius: 2px; }
#logLive.on { background: var(--bad); color: #fff; }

/* erori */
.err-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; }
.err-card pre { margin: 0; font-family: var(--mono); font-size: 12px; background: #090b0f; border-radius: 8px; padding: 10px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: #ff9d95; }
.err-card pre.clean { color: var(--ok); }
.count { font-family: var(--mono); font-size: 12px; color: var(--mute); }

/* urgență */
.rescue { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.screen { background: #000; border-radius: 8px; border: 1px solid var(--line); min-height: 220px; display: grid; place-items: center; overflow: hidden; }
.screen img { width: 100%; display: block; image-rendering: pixelated; }
.screen img:not([src]) { display: none; }
.typebar { display: flex; gap: 8px; margin-top: 10px; }
.typebar input { flex: 1; min-width: 0; font-family: var(--mono); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.rowact { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; }
.help { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--line2); border-radius: 10px; }
.help ol { margin: 0; padding-left: 18px; color: var(--mute); }
.help li { margin: 4px 0; }

/* modal + notificări */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(3px); }
.modal-card { background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; padding: 22px; max-width: 440px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal-card p { color: var(--mute); margin: 10px 0 18px; white-space: pre-line; }
.modal-act { display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: calc(100vw - 32px); }
.toast { background: var(--panel2); border: 1px solid var(--line2); border-left: 3px solid var(--gold); border-radius: 9px; padding: 10px 14px; max-width: 380px; box-shadow: 0 8px 30px rgba(0,0,0,.4); animation: in .2s ease-out; }
.toast.bad { border-left-color: var(--bad); }
.toast.ok { border-left-color: var(--ok); }
@keyframes in { from { transform: translateY(8px); opacity: 0; } }

/* mobil */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; gap: 10px; }
  .side .brand small { display: none; }
  .side .brand .logo { width: 120px; }
  .side-state { order: 2; margin-left: auto; }
  nav { order: 3; flex-direction: row; overflow-x: auto; width: 100%; gap: 2px; }
  nav button { white-space: nowrap; padding: 7px 9px; }
  .side-foot { order: 2; margin: 0; border: 0; padding: 0; }
  .who { display: none; }
  main { padding: 16px; }
  .rescue { grid-template-columns: 1fr; }
  .err-grid { grid-template-columns: 1fr; }
  .term-wrap { height: 60vh; }
  .logbox { height: 60vh; }
  h1 { font-size: 22px; }
}

/* actualizări */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.steps .panel { display: flex; flex-direction: column; gap: 10px; }
.steps .panel-h { margin-bottom: 0; }
.stepn { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--gold-bg); color: var(--gold); font-size: 12px; margin-right: 8px; border: 1px solid rgba(227,192,122,.35); }
.drop { border: 1.5px dashed var(--line2); border-radius: 10px; padding: 22px 14px; text-align: center; background: var(--bg); transition: .15s; }
.drop.over { border-color: var(--gold); background: var(--gold-bg); }
.upbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.upbtns label.btn { flex-direction: row; display: inline-flex; color: var(--text); font-size: 13px; }
.upbtns label.btn.gold { color: #1a1408; }
.queue { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow: auto; }
.qrow { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.qname { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.qname code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow .bar { margin-top: 5px; }
.ok-t { color: var(--ok); }
.bad-t { color: var(--bad); }
.pubform { display: flex; flex-direction: column; gap: 10px; }
.pubform input { font-family: var(--mono); }
.check input[type=radio], .check input[type=checkbox] { accent-color: #c99f55; }
.check.auto { background: var(--gold-bg); border: 1px solid rgba(227,192,122,.3); border-radius: 8px; padding: 8px 10px; color: var(--text); }
@media (max-width: 1250px) { .steps { grid-template-columns: 1fr; } }

/* fișiere joc */
.loc { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-bottom: 12px; padding: 12px 14px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; }
.loc > div { display: flex; flex-direction: column; gap: 4px; }
code.big { font-size: 16px; padding: 4px 10px; }
.logbox.short { height: auto; min-height: 80px; max-height: 420px; }
#qOutActions { margin-top: 10px; }

/* ghid pas cu pas */
.howto { border-color: rgba(227,192,122,.35); background: linear-gradient(180deg, var(--gold-bg), var(--panel) 70%); }
.howto-list { margin: 0; padding-left: 22px; }
.howto-list li { margin: 6px 0; }
.howto-list li::marker { color: var(--gold); font-weight: 700; }
