/* vm.zonanet.id panel */
:root {
  --bg: #f4f6f9; --panel: #ffffff; --panel-2: #f8f9fb; --ink: #151a23; --muted: #667085; --line: #e3e7ee;
  --brand: #2f6bff; --brand-ink: #ffffff; --brand-soft: #e8efff;
  --ok: #0f9d58; --ok-soft: #e3f6ec; --warn: #b7791f; --warn-soft: #fdf3dc; --bad: #d92d20; --bad-soft: #fdecea;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 12px; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117; --panel: #151a23; --panel-2: #1a202b; --ink: #e7ebf2; --muted: #8f99ab; --line: #262d3a;
    --brand: #5b8cff; --brand-ink: #0b1020; --brand-soft: #1b2745;
    --ok: #3ccf87; --ok-soft: #12291f; --warn: #e5b04b; --warn-soft: #2d2410; --bad: #ff6b60; --bad-soft: #341916;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14.5px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 24px; } h3 { font-size: 15.5px; margin-bottom: 10px; } h4 { font-size: 13px; margin: 14px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0 0 8px; }
a { color: var(--brand); text-decoration: none; }
code { font-family: var(--mono); font-size: .92em; background: var(--panel-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .nowrap { white-space: nowrap; } .r { text-align: right; }
.ok-t { color: var(--ok); } .error { color: var(--bad); }

/* ---------- boot / login */
.boot { position: fixed; inset: 0; display: grid; place-items: center; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 30px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.login-card p { margin: 0; }

/* ---------- brand / logo */
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.brand.big { font-size: 22px; }
.logo { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); position: relative; flex: none; }
.logo::after { content: ""; position: absolute; inset: 7px 6px 9px; border: 2px solid var(--brand-ink); border-radius: 2px; }

/* ---------- layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; }
.side nav { flex: 1; display: grid; align-content: start; gap: 16px; overflow-y: auto; }
.navlabel { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 0 10px 6px; }
.navgroup { display: grid; gap: 2px; }
.side nav a { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.side nav a:hover { background: var(--panel-2); }
.side nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.count { background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; font-size: 11.5px; padding: 0 7px; color: var(--muted); }
.side-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.who { display: grid; line-height: 1.25; min-width: 0; } .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.burger { display: none; }
.main { padding: 26px clamp(16px, 3vw, 36px) 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); }

/* ---------- primitives */
.row { display: flex; gap: 10px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.end { justify-content: flex-end; margin-top: 18px; }
.grow { flex: 1; min-width: 200px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; } .grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.cols > .card, .grid > .card { margin-bottom: 0; }
.card.flush { padding: 0; overflow-x: auto; }
.box { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.error.box { background: var(--bad-soft); } .notice { background: var(--brand-soft); color: var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.banner { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; } .banner.bad { background: var(--bad-soft); color: var(--bad); }
.empty { display: grid; justify-items: center; gap: 8px; padding: 50px 20px; text-align: center; background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); } .kv:last-child { border-bottom: 0; } .kv span { color: var(--muted); } .kv b { font-weight: 600; text-align: right; }

/* ---------- buttons / inputs */
.btn { appearance: none; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; font-weight: 550; padding: 8px 14px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background .12s, border-color .12s, transform .05s; }
.btn:hover:not(:disabled) { background: var(--panel-2); border-color: color-mix(in srgb, var(--line), var(--ink) 18%); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; } .btn.block { width: 100%; padding: 10px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); } .btn.primary:hover:not(:disabled) { background: var(--brand); filter: brightness(1.08); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; } .btn.danger:hover:not(:disabled) { background: var(--bad); filter: brightness(1.08); }
.btn.danger-o { color: var(--bad); } .btn.ghost { border-color: transparent; background: transparent; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input, select { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; width: 100%; min-width: 0; }
input:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
input[type=checkbox], input[type=radio] { width: auto; }
.search { max-width: 240px; }
.field { display: grid; gap: 5px; margin-bottom: 14px; } .field > span { font-weight: 550; font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 6px 0 0; padding: 4px 14px 2px; } legend { padding: 0 6px; color: var(--muted); font-size: 12.5px; }

/* ---------- badges / bars */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 10px 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; } .badge.ok i { animation: pulse 2.2s ease-in-out infinite; }
.badge.busy { background: var(--warn-soft); color: var(--warn); border-color: transparent; } .badge.busy i { animation: pulse .9s ease-in-out infinite; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
@keyframes pulse { 50% { opacity: .35; } }
.pill { font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.pill.admin { background: var(--brand-soft); color: var(--brand); border-color: transparent; } .pill.client { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.bar { height: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .6s ease; }
.bar.lg { height: 9px; } .gauge { margin-bottom: 14px; } .gl { display: flex; justify-content: space-between; margin-bottom: 5px; } .gl span { color: var(--muted); }

/* ---------- vm cards */
.vm { padding: 0; display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.vm:hover { border-color: color-mix(in srgb, var(--brand), var(--line) 55%); }
.vm.ok { border-top: 3px solid var(--ok); } .vm.bad { border-top: 3px solid var(--bad); } .vm.busy { border-top: 3px solid var(--warn); } .vm.off { border-top: 3px solid var(--line); }
.vm-main { display: grid; gap: 8px; padding: 16px 18px 12px; color: inherit; flex: 1; }
.vm-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .vm-top h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec { display: flex; gap: 6px; flex-wrap: wrap; } .spec span { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; font-size: 12.5px; }
.meters { display: grid; gap: 6px; margin-top: 2px; } .meters > div { display: grid; grid-template-columns: 34px 1fr 38px; align-items: center; gap: 8px; } .meters small { color: var(--muted); font-size: 12px; } .meters small:last-child { text-align: right; }
.vm-actions { display: flex; gap: 8px; padding: 10px 18px 14px; }
.vm-actions .btn { flex: 1; }
.danger-zone { border-color: color-mix(in srgb, var(--bad), var(--line) 70%); }

/* ---------- create */
.create { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.summary { position: sticky; top: 20px; } .quota { margin-bottom: 14px; }
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.plan { position: relative; display: grid; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 11px; cursor: pointer; background: var(--panel); transition: border-color .12s, background .12s; }
.plan:hover { border-color: color-mix(in srgb, var(--brand), var(--line) 50%); }
.plan.on { border-color: var(--brand); background: var(--brand-soft); } .plan.off { opacity: .5; cursor: not-allowed; }
.plan input { position: absolute; opacity: 0; pointer-events: none; } .plan span { font-size: 13px; }

/* ---------- kpis / tables */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 2px; box-shadow: var(--shadow); }
.kpi small { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 11.5px; } .kpi b { font-size: 26px; letter-spacing: -.02em; } .kpi b.ok { color: var(--ok); } .kpi b.bad { color: var(--bad); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 11px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; } .table tr:last-child td { border-bottom: 0; } .table tr.dim td { opacity: .55; }
.card .table th, .card .table td { padding-left: 10px; padding-right: 10px; } .card.flush .table th, .card.flush .table td { padding-left: 16px; padding-right: 16px; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; } .switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 99px; cursor: pointer; transition: background .15s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + i { background: var(--ok); } .switch input:checked + i::after { transform: translateX(16px); }

/* ---------- modal / toast / spinner */
.overlay { position: fixed; inset: 0; background: rgba(8, 12, 20, .55); display: grid; place-items: center; padding: 20px; z-index: 50; backdrop-filter: blur(2px); }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; width: 100%; max-width: 540px; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.modal h3 { font-size: 18px; margin-bottom: 12px; }
.secret { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 10px 0; } .secret code { font-size: 15px; background: none; border: 0; user-select: all; word-break: break-all; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-weight: 500; }
.toast.bad { background: var(--bad); color: #fff; } .toast.warn { background: var(--warn); color: #fff; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.spinner.sm { width: 15px; height: 15px; border-width: 2px; } @keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: sticky; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 10px 14px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .burger { display: inline-block; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; font-size: 18px; padding: 2px 10px; margin-left: auto; }
  .side nav, .side-foot { display: none; width: 100%; } .side.open nav, .side.open .side-foot { display: grid; }
  .side.open .side-foot { display: flex; }
  .create { grid-template-columns: 1fr; } .summary { position: static; }
  .grid2, .grid3 { grid-template-columns: 1fr; } .grid4 { grid-template-columns: 1fr 1fr; }
  .search { max-width: none; flex: 1; }
}

input.invalid { border-color: var(--bad); }
input.invalid:focus { box-shadow: 0 0 0 3px var(--bad-soft); }
.hint { margin: 10px 2px 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.hint.bad { color: var(--bad); }

.grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.cdrow { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.cdlabel { display: grid; width: 74px; line-height: 1.2; }
.cdnow { margin: 6px 0 0 84px; }
optgroup { font-style: normal; }
.drop { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 26px 16px; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; background: var(--panel-2); transition: border-color .12s, background .12s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop.busy { opacity: .55; cursor: not-allowed; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.upl { margin-top: 14px; display: grid; gap: 8px; justify-items: start; } .upl .gl { width: 100%; }
.bar i.done { background: var(--ok); }
@media (max-width: 860px) { .grid5 { grid-template-columns: 1fr 1fr; } .cdnow { margin-left: 0; } .cdlabel { width: 100%; grid-auto-flow: column; justify-content: start; gap: 8px; } }
