/* ==================================================================
   AlbGIS Studio — guaska e përbashkët «si program» për veglat llogaritëse.
   Shiriti me skeda (si veglat e rrjeteve) · hapat majtas · pamjet në mes ·
   rezultatet djathtas · shiriti i gjendjes poshtë.
   Vegla e përshkruan veten me AlbStudio.init({...}) — shih assets/studio.js.
   E ndarë nga desktop.css/desktop.js (këto i gjeneron sesioni i rrjeteve nga Hydro).
   ================================================================== */
.st {
  --st-bg: #0e1016; --st-bg2: #12151c; --st-pan: #14171f; --st-card: #181b24; --st-in: #1e222d;
  --st-line: #232734; --st-line2: #2a3140; --st-text: #e8eaf0; --st-head: #f5f6fa; --st-muted: #9aa2b2; --st-faint: #6a7283;
  --st-acc: #f0476a; --st-teal: #46c7bd; --st-teal2: #2bb5ad; --st-ok: #36e08f; --st-warn: #ffc107; --st-bad: #ff6b6b;
  --st-fb: Inter, "Segoe UI", system-ui, sans-serif; --st-fm: "JetBrains Mono", ui-monospace, Consolas, monospace;
  position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0;
  background: var(--st-bg); color: var(--st-text); font: 13px/1.45 var(--st-fb); -webkit-font-smoothing: antialiased;
}
.st *, .st *::before, .st *::after { box-sizing: border-box; }
body.st-app { background: #0e1016; }
/* saas.js: shiriti i tij lundrues zëvendësohet nga shiriti i Studio-s */
body.st-app #albgis-pbar { display: none !important; }

/* ---------------------------------------------------------------- skedat + shiriti */
.st-tabs { display: flex; align-items: stretch; gap: 2px; flex: none; height: 34px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; background: #0b0e14; border-bottom: 1px solid #1c222d; }
.st-tabs::-webkit-scrollbar { display: none; }
.st-tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: #93a4c4; white-space: nowrap; font: 600 12.5px var(--st-fb); padding: 0 16px; cursor: pointer; transition: color .12s, border-color .12s, background .12s; }
.st-tab:hover { color: var(--st-text); background: #141a24; }
.st-tab[aria-selected="true"] { color: var(--st-teal); border-bottom-color: var(--st-teal2); background: var(--st-bg2); }
.st-title { margin-left: auto; align-self: center; display: flex; align-items: center; gap: 8px; padding-left: 14px; color: var(--st-muted); font: 600 12px var(--st-fb); white-space: nowrap; }
.st-title b, .st-title .st-h1 { color: var(--st-head); font-weight: 600; }
.st-title .st-h1 { margin: 0; padding: 0; border: 0; font: 600 12px var(--st-fb); letter-spacing: 0; }
.st-dirty { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--st-faint); }
.st-dirty.on { background: var(--st-warn); box-shadow: 0 0 0 3px rgba(255, 193, 7, .15); }

.st-ribbon { flex: none; display: flex; min-height: 86px; background: #0f131b; border-bottom: 1px solid #232a36; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.st-rpanel { display: none; align-items: stretch; padding: 4px 4px 0; }
.st-rpanel.on { display: flex; }
.st-rgroup { display: flex; flex-direction: column; padding: 0 6px; border-right: 1px solid #1f2633; flex: none; }
.st-rgroup:last-child { border-right: 0; }
.st-rbtns { flex: 1; display: flex; align-items: flex-start; gap: 2px; }
.st-rcol { display: flex; flex-direction: column; gap: 1px; padding-top: 2px; }
.st-rgt { font: 500 10.5px var(--st-fb); color: #6f7a8f; text-align: center; padding: 2px 0 4px; white-space: nowrap; }
.st-rb { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; min-width: 56px; max-width: 86px; height: 62px; padding: 5px 6px 2px; background: transparent; border: 1px solid transparent; border-radius: 7px; color: #cfd5e0; cursor: pointer; font: 500 11.5px/1.15 var(--st-fb); text-align: center; text-decoration: none; }
.st-rb:hover { background: #18202c; border-color: #263043; color: #fff; }
.st-rb:active { background: #1d2635; }
.st-rb:disabled, .st-rb.is-off { opacity: .42; cursor: default; background: transparent; border-color: transparent; }
.st-rb.on { background: rgba(70, 199, 189, .12); border-color: rgba(70, 199, 189, .35); color: #fff; }
.st-rb .ic { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; flex: none; }
.st-rb .ic svg { width: 30px; height: 30px; }
.st-rb.S { flex-direction: row; min-width: 0; max-width: none; height: 26px; padding: 2px 8px 2px 4px; gap: 6px; justify-content: flex-start; white-space: nowrap; }
.st-rb.S .ic { width: 18px; height: 18px; font-size: 14px; }
.st-rb.S .ic svg { width: 18px; height: 18px; }
.st-rb.pri { color: #fff; }
.st-rb.pri .lb { color: var(--st-teal); font-weight: 700; }
.st-rb .albgis-lockglyph { position: absolute; top: 1px; right: 2px; font-size: 9px; }
.st-kbd { font: 500 10px var(--st-fm); color: var(--st-faint); margin-left: 4px; }

/* ---------------------------------------------------------------- trupi */
.st-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 88px minmax(280px, 330px) minmax(0, 1fr) minmax(260px, 310px); }
.st-rail { background: #0f131b; border-right: 1px solid var(--st-line); overflow-y: auto; padding: 10px 6px; display: flex; flex-direction: column; gap: 4px; }
.st-rail-h { font: 500 9.5px var(--st-fm); letter-spacing: .12em; text-transform: uppercase; color: var(--st-faint); text-align: center; margin: 0 0 4px; }
.st-stepbtn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--st-muted); cursor: pointer; font: 600 11px/1.2 var(--st-fb); text-align: center; }
.st-stepbtn:hover { background: #161b26; color: var(--st-text); }
.st-stepbtn .n { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1.5px solid #2f3747; color: var(--st-muted); font: 700 12px var(--st-fb); background: var(--st-bg2); }
.st-stepbtn[aria-current="step"] { background: rgba(240, 71, 106, .09); border-color: rgba(240, 71, 106, .35); color: #fff; }
.st-stepbtn[aria-current="step"] .n { border-color: var(--st-acc); background: var(--st-acc); color: #fff; }
.st-stepbtn[data-st="ok"] .n::after, .st-stepbtn[data-st="warn"] .n::after, .st-stepbtn[data-st="bad"] .n::after { content: ""; position: absolute; top: 7px; right: 16px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid #0f131b; }
.st-stepbtn[data-st="ok"] .n::after { background: var(--st-ok); }
.st-stepbtn[data-st="warn"] .n::after { background: var(--st-warn); }
.st-stepbtn[data-st="bad"] .n::after { background: var(--st-bad); }
.st-rail-line { width: 1.5px; height: 8px; background: #252c3a; margin: -2px auto; }

.st-panel { background: var(--st-pan); border-right: 1px solid var(--st-line); display: flex; flex-direction: column; min-height: 0; }
.st-panel-h { flex: none; padding: 14px 16px 10px; border-bottom: 1px solid var(--st-line); }
.st-panel-h small { display: block; font: 500 10px var(--st-fm); letter-spacing: .12em; text-transform: uppercase; color: var(--st-acc); margin-bottom: 4px; }
.st-panel-h h2 { margin: 0; font: 700 16px Sora, var(--st-fb); color: var(--st-head); border: 0; padding: 0; }
.st-panel-h p { margin: 6px 0 0; color: var(--st-muted); font-size: 12px; line-height: 1.5; }
.st-panel-b { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.st-panel-f { flex: none; display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--st-line); }
.st-step { display: none; flex-direction: column; gap: 12px; }
.st-step.on { display: flex; }

/* formularët brenda hapave */
.st-f { display: flex; flex-direction: column; gap: 4px; }
.st-f > label, .st-lab { font-size: 12px; color: var(--st-muted); display: block; }
.st-f > label em, .st-lab em { float: right; font-style: normal; color: var(--st-faint); font-size: 11px; }
.st input[type="number"], .st input[type="text"], .st select {
  width: 100%; background: var(--st-in); border: 1px solid var(--st-line2); color: var(--st-head); border-radius: 7px; padding: 7px 9px; font: 13px var(--st-fb);
}
.st input[type="number"]:focus, .st input[type="text"]:focus, .st select:focus { outline: none; border-color: var(--st-acc); box-shadow: 0 0 0 3px rgba(240, 71, 106, .14); }
.st input[readonly] { color: var(--st-muted); }
.st-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-unit { position: relative; }
.st-unit input { padding-right: 44px; }
.st-unit > i { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 500 11px var(--st-fm); font-style: normal; color: var(--st-faint); pointer-events: none; }
.st-card { background: var(--st-card); border: 1px solid #1f2430; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.st-card-t { font: 700 10.5px var(--st-fb); letter-spacing: .06em; text-transform: uppercase; color: var(--st-teal); }
.st-note { font-size: 11.5px; color: var(--st-muted); line-height: 1.5; background: #161a23; border-left: 2px solid #2f3747; padding: 7px 10px; border-radius: 0 6px 6px 0; }
.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--st-line2); background: #1a1f2b; color: #dfe4ee; font: 600 12.5px var(--st-fb); cursor: pointer; text-decoration: none; }
.st-btn:hover { background: #222838; color: #fff; }
.st-btn.pri { background: var(--st-acc); border-color: var(--st-acc); color: #fff; }
.st-btn.pri:hover { background: #d83a5e; }
.st-btn.ghost { background: transparent; }
.st-btn.dash { border-style: dashed; border-color: rgba(70, 199, 189, .55); color: var(--st-teal); background: transparent; width: 100%; }
.st-btn.dash:hover { background: rgba(70, 199, 189, .08); }
.st-btn:disabled { opacity: .45; cursor: default; }
.st-panel-f .st-btn { flex: 1; }

/* ---------------------------------------------------------------- pamjet */
.st-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--st-bg); }
.st-vtabs { flex: none; display: flex; gap: 2px; padding: 6px 10px 0; border-bottom: 1px solid var(--st-line); background: var(--st-bg2); overflow-x: auto; scrollbar-width: none; }
.st-vtab { background: transparent; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; padding: 7px 14px; color: var(--st-muted); font: 600 12px var(--st-fb); cursor: pointer; white-space: nowrap; }
.st-vtab:hover { color: var(--st-text); }
.st-vtab[aria-selected="true"] { background: var(--st-bg); border-color: var(--st-line); color: #fff; margin-bottom: -1px; }
.st-views { flex: 1; min-height: 0; position: relative; }
.st-view { position: absolute; inset: 0; display: none; overflow: auto; }
.st-view.on { display: block; }
.st-view.pad { padding: 14px; }
.st-canvas-wrap { position: absolute; inset: 0; }
.st-canvas-wrap canvas { display: block; width: 100%; height: 100%; }

/* tabelat e rezultateve */
.st-tbl { width: 100%; border-collapse: collapse; font: 12px var(--st-fb); }
.st-tbl th { position: sticky; top: 0; background: #151923; color: var(--st-muted); font-weight: 600; text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--st-line2); white-space: nowrap; }
.st-tbl td { padding: 6px 10px; border-bottom: 1px solid #1b202b; text-align: right; font-family: var(--st-fm); font-size: 11.5px; color: #d7dce6; white-space: nowrap; }
.st-tbl th:first-child, .st-tbl td:first-child { text-align: left; }
.st-tbl tr:hover td { background: #141924; }

/* ---------------------------------------------------------------- rezultatet djathtas */
.st-side { background: var(--st-pan); border-left: 1px solid var(--st-line); overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.st-side-h { flex: none; padding: 10px 14px; font: 700 10.5px var(--st-fb); letter-spacing: .08em; text-transform: uppercase; color: var(--st-muted); border-bottom: 1px solid var(--st-line); background: #12151c; }
.st-side-b { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.st-kpi { border-radius: 12px; padding: 14px; background: var(--st-card); border: 1px solid #222837; text-align: center; }
.st-kpi small { display: block; font: 600 11px var(--st-fb); color: var(--st-muted); text-transform: uppercase; letter-spacing: .06em; }
.st-kpi b { display: block; margin-top: 4px; font: 800 28px/1.1 Sora, var(--st-fb); color: #fff; letter-spacing: -.01em; }
.st-kpi span { display: block; margin-top: 4px; font-size: 12px; color: var(--st-muted); }
.st-kpi.ok { background: #0d2a1d; border-color: #1c5a3c; } .st-kpi.ok b { color: #5ff0a8; }
.st-kpi.margin { background: #1a2a0c; border-color: #3d5a17; } .st-kpi.margin b { color: #b5e86a; }
.st-kpi.warn { background: #2e2108; border-color: #6b4c0c; } .st-kpi.warn b { color: #ffcf4d; }
.st-kpi.bad { background: #330c0c; border-color: #7a1f1f; } .st-kpi.bad b { color: #ff8a8a; }
.st-kv { display: flex; flex-direction: column; }
.st-kv > div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed #222836; font-size: 12.5px; }
.st-kv > div:last-child { border-bottom: 0; }
.st-kv span { color: var(--st-muted); }
.st-kv b { color: var(--st-head); font-weight: 600; font-family: var(--st-fm); font-size: 12px; text-align: right; }
.st-checks { display: flex; flex-direction: column; gap: 6px; }
.st-check { display: grid; grid-template-columns: 20px 1fr; gap: 8px; align-items: start; font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; background: var(--st-card); }
.st-check::before { content: "✓"; font-weight: 800; color: var(--st-ok); text-align: center; }
.st-check.warn::before { content: "!"; color: var(--st-warn); }
.st-check.bad::before { content: "✗"; color: var(--st-bad); }
.st-check small { display: block; color: var(--st-faint); font-size: 11px; }

/* ---------------------------------------------------------------- shiriti i gjendjes */
.st-status { flex: none; height: 28px; display: flex; align-items: center; gap: 14px; padding: 0 12px; background: #0b0e14; border-top: 1px solid #1c222d; font: 500 11.5px var(--st-fb); color: var(--st-muted); white-space: nowrap; overflow: hidden; }
.st-status .msg { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.st-status .msg b { color: var(--st-head); }
.st-status .sv { display: flex; align-items: center; gap: 6px; }

/* ---------------------------------------------------------------- dialogët dhe njoftimet */
.st-ov { position: fixed; inset: 0; z-index: 100080; background: rgba(5, 7, 12, .62); display: flex; align-items: center; justify-content: center; padding: 16px; }
.st-dlg { width: 440px; max-width: 100%; background: #181b24; border: 1px solid #2a3242; border-radius: 14px; padding: 20px 20px 16px; box-shadow: 0 24px 64px rgba(0, 0, 0, .5); color: var(--st-text, #e8eaf0); font: 13.5px/1.5 Inter, system-ui, sans-serif; }
.st-dlg h3 { margin: 0 0 12px; font: 700 17px Sora, Inter, sans-serif; color: #f5f6fa; border: 0; padding: 0; }
.st-dlg label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; font-size: 12px; color: #9aa2b2; }
.st-dlg input, .st-dlg select { width: 100%; background: #1e222d; border: 1px solid #2a3140; color: #f5f6fa; border-radius: 8px; padding: 9px 10px; font: 14px Inter, sans-serif; }
.st-dlg .err { color: #ff8a8a; font-size: 12px; min-height: 16px; }
.st-dlg .act { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.st-dlg .act button { border-radius: 9px; padding: 8px 14px; font: 600 13px Inter, sans-serif; cursor: pointer; border: 1px solid #2a3242; background: #1a1f2b; color: #cfd5e0; }
.st-dlg .act .go { background: #1f8a80; border-color: #1f8a80; color: #fff; }
.st-dlg .act .go:hover { background: #2bb5ad; }
.st-toast { position: fixed; left: 50%; bottom: 40px; width: max-content; transform: translateX(-50%) translateY(16px); z-index: 100090; display: flex; align-items: center; gap: 12px; max-width: 92vw; background: #181b24; border: 1px solid #2a3242; color: #e8eaf0; font: 600 13px Inter, sans-serif; padding: 10px 14px; border-radius: 11px; box-shadow: 0 12px 34px rgba(0, 0, 0, .5); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; }
.st-toast.show { opacity: 1; transform: translateX(-50%); pointer-events: auto; }
.st-toast.ok { border-color: rgba(54, 224, 143, .5); } .st-toast.err { border-color: rgba(240, 71, 106, .6); }
.st-toast button { background: none; border: 1px solid #364055; color: #46c7bd; border-radius: 7px; padding: 4px 9px; font: 600 12px Inter, sans-serif; cursor: pointer; }

/* ---------------------------------------------------------------- ekranet e mesëm: rezultatet poshtë pamjeve */
@media (max-width: 1180px) {
  .st-body { grid-template-columns: 76px minmax(270px, 310px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .st-side { grid-column: 3; grid-row: 2; max-height: 34vh; border-left: 0; border-top: 1px solid var(--st-line); }
  .st-side-b { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
  .st-rail, .st-panel { grid-row: 1 / span 2; }
}

/* ---------------------------------------------------------------- celulari: një kolonë që rrëshqet */
@media (max-width: 820px) {
  .st { position: static; min-height: 100%; }
  .st-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .st-ribbon { min-height: 74px; }
  .st-rb { height: 56px; min-width: 52px; font-size: 10.5px; }
  .st-rb .ic, .st-rb .ic svg { width: 24px; height: 24px; }
  .st-body { display: flex; flex-direction: column; }
  .st-rail { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 8px; gap: 6px; border-right: 0; border-bottom: 1px solid var(--st-line); position: sticky; top: 0; z-index: 5; scrollbar-width: none; }
  .st-rail-h, .st-rail-line { display: none; }
  .st-stepbtn { flex-direction: row; flex: none; padding: 6px 12px 6px 6px; gap: 7px; font-size: 12px; }
  .st-stepbtn .n { width: 24px; height: 24px; font-size: 11px; }
  .st-stepbtn[data-st] .n::after { top: 3px; right: auto; left: 22px; }
  .st-panel { border-right: 0; }
  .st-panel-b { overflow: visible; }
  .st input[type="number"], .st input[type="text"], .st select { font-size: 16px; min-height: 42px; }
  .st-main { height: 62vh; min-height: 340px; border-top: 1px solid var(--st-line); }
  .st-side { max-height: none; border-top: 1px solid var(--st-line); }
  .st-side-b { display: flex; }
  .st-status { position: sticky; bottom: 0; }
  .st-status .msg { display: none; }
  .st-status .sv { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) { .st-toast { transition: none; } }
