/* ViseMTA web kit: a vise_gui/uikit.lua v3 pipeline CSS mása (paletta, tint/lift, focusRing, shine, banner, iconBox ...) */

@font-face { font-family: 'Rubik'; font-weight: 400; font-display: swap; src: url('../fonts/Rubik-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Rubik'; font-weight: 500; font-display: swap; src: url('../fonts/Rubik-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Rubik'; font-weight: 600; font-display: swap; src: url('../fonts/Rubik-SemiBold.ttf') format('truetype'); }

:root {
  color-scheme: dark;
  --accent: #49b0ff; --accent-hi: #80ccff; --accent-lo: #2274de;
  --green: #22c55e; --red: #ef4444; --red-soft: #f87171; --purple: #9668ff;
  --gold: #f0c658; --teal: #2dd4bf; --orange: #fb923c; --pink: #ec4899;
  --text: #ececf0; --text2: #96969e; --text3: #6c6c74;
  --window: #0f0f12; --surface: #19191d; --control: #36363c; --well: #0a0a0c; --base: #131316;
  --page: #0b0b0e;
  --r1: 6px; --r2: 8px; --r3: 12px;
  --c: var(--accent);
  --font: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.22, .8, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--page);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
img, svg { display: block; max-width: 100%; }

.tone-accent { --c: var(--accent); } .tone-green { --c: var(--green); } .tone-red { --c: var(--red); }
.tone-gold { --c: var(--gold); } .tone-purple { --c: var(--purple); } .tone-teal { --c: var(--teal); }
.tone-orange { --c: var(--orange); } .tone-pink { --c: var(--pink); } .tone-gray { --c: #8a8a94; }

.t1 { color: var(--text); } .t2 { color: var(--text2); } .t3 { color: var(--text3); }
.lift { color: color-mix(in srgb, var(--c), #fff 30%); }
.mono { font-variant-numeric: tabular-nums; }

/* B.focusRing: halo + körvonal, ami vastagabbról húzódik rá; B.shine: egyszeri csík hover elején */
.fr { position: relative; isolation: isolate; --rr: var(--r1); }
.fr::after {
  content: ''; position: absolute; inset: -6px; pointer-events: none; z-index: 2;
  border-radius: calc(var(--rr) + 6px);
  border: 6px solid color-mix(in srgb, var(--c), #fff 30%);
  box-shadow: 0 0 14px 2px color-mix(in srgb, var(--c) 22%, transparent);
  opacity: 0;
  transition: inset .2s var(--ease), border-width .2s var(--ease), border-radius .2s var(--ease), opacity .2s var(--ease);
}
.fr:hover::after, .fr:focus-visible::after, .fr.focus::after {
  inset: -2px; border-width: 2px; border-radius: calc(var(--rr) + 2px); opacity: .67;
}
.fr::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  background: linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, .065) 50%, transparent 62%) no-repeat;
  background-size: 260% 100%; background-position: 160% 0; opacity: 0;
}
.fr:hover::before { animation: kit-shine .68s ease-out 1; }
@keyframes kit-shine {
  0% { background-position: 160% 0; opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { background-position: -60% 0; opacity: 0; }
}
.fr:focus-visible { outline: none; }

/* felületek */
.win {
  background: rgba(15, 15, 18, .86); border-radius: var(--r3);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .38);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.surface { background: rgba(25, 25, 29, .75); border-radius: var(--r2); transition: background .2s var(--ease); }
.surface.fr { --rr: var(--r2); }
a.surface:hover, .surface.hov:hover { background: rgba(33, 33, 38, .8); }
.well { background: rgba(10, 10, 12, .55); border-radius: var(--r2); }
.sep { height: 1px; background: rgba(255, 255, 255, .035); border: 0; margin: 0; }

.banner {
  position: relative; border-radius: var(--r2); overflow: hidden;
  background:
    radial-gradient(60% 170% at 22% 0%, color-mix(in srgb, var(--c) 10%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--c) 22%, rgba(19, 19, 22, .88)), color-mix(in srgb, var(--c) 5%, rgba(19, 19, 22, .75)));
}

.kicker {
  font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: color-mix(in srgb, var(--c), #fff 10%);
}
.icon-box {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r2);
  background: color-mix(in srgb, var(--c) 24%, var(--base));
  color: color-mix(in srgb, var(--c), #fff 15%); font-size: 16px;
}
.icon-box.sm { width: 32px; height: 32px; border-radius: var(--r1); font-size: 13px; }
.icon-box.lg { width: 52px; height: 52px; font-size: 20px; }

.section-head { display: flex; align-items: center; gap: 14px; }
.section-head h2, .section-head h3 { margin: 0; font-size: 19px; font-weight: 500; line-height: 1.2; }
.section-head p { margin: 2px 0 0; color: var(--text3); font-size: 13px; }

/* gombok (B.buttonVisual) */
.btn {
  --rr: var(--r1);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border: 0; border-radius: var(--r1); cursor: pointer;
  font-size: 14px; font-weight: 500; white-space: nowrap; user-select: none;
  background: rgba(54, 54, 60, .75); color: #c4c4ca;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.btn:hover { background: rgba(68, 68, 74, .82); color: #fff; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 48px; padding: 0 24px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.soft { background: rgba(40, 40, 45, .75); color: #b0b0b8; }
.btn.soft:hover { background: rgba(53, 53, 58, .82); color: #fff; }
.btn.primary, .btn.success, .btn.danger, .btn.gold, .btn.purple, .btn.orange {
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 36%, var(--base)), color-mix(in srgb, var(--c) 20%, var(--base)));
  color: color-mix(in srgb, var(--c), #fff 45%);
}
.btn.primary:hover, .btn.success:hover, .btn.danger:hover, .btn.gold:hover, .btn.purple:hover, .btn.orange:hover {
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 50%, var(--base)), color-mix(in srgb, var(--c) 32%, var(--base)));
  color: color-mix(in srgb, var(--c), #fff 85%);
}
.btn.success { --c: var(--green); } .btn.danger { --c: var(--red); } .btn.gold { --c: var(--gold); }
.btn.purple { --c: var(--purple); } .btn.orange { --c: var(--orange); }
.btn.danger-ghost { --c: var(--red); background: color-mix(in srgb, var(--red) 13%, var(--base)); color: color-mix(in srgb, var(--red), #fff 30%); }
.btn.danger-ghost:hover { background: color-mix(in srgb, var(--red) 28%, var(--base)); color: color-mix(in srgb, var(--red), #fff 75%); }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; }
.btn .spin { display: none; }
.btn.busy { pointer-events: none; }
.btn.busy .spin { display: inline-block; }
.icon-btn { width: 40px; padding: 0; }
.icon-btn.sm { width: 32px; }

/* chip / segmented (B.chip, B.segmented) */
.chip {
  --rr: var(--r1);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 14px; border: 0; border-radius: var(--r1); cursor: pointer;
  background: rgba(48, 48, 53, .7); color: #a0a0a8; font-size: 13px; font-weight: 500;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.chip:hover { background: rgba(62, 62, 67, .8); color: #fff; }
.chip.active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 34%, var(--base)), color-mix(in srgb, var(--c) 18%, var(--base)));
  color: color-mix(in srgb, var(--c), #fff 45%);
}
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r2); background: rgba(10, 10, 12, .55); }
.seg .chip { background: transparent; }
.seg .chip:hover { background: rgba(48, 48, 53, .7); }
.seg .chip.active { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 34%, var(--base)), color-mix(in srgb, var(--c) 18%, var(--base))); }

/* címkék / rang jelvény */
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 5px;
  background: color-mix(in srgb, var(--c) 16%, var(--base)); color: color-mix(in srgb, var(--c), #fff 25%);
  font-size: 11px; font-weight: 500; white-space: nowrap; letter-spacing: .02em;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); flex: none; }
.dot.pulse { animation: kit-pulse 2s infinite; }
@keyframes kit-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 0%, transparent); } }

/* mezők (B.textField) */
.field { display: grid; gap: 6px; }
.field > label { font-size: 12px; font-weight: 500; color: var(--text2); }
.input {
  --rr: var(--r1);
  position: relative; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px;
  border-radius: var(--r1); background: rgba(36, 36, 41, .7); transition: background .2s var(--ease);
}
.input:hover { background: rgba(42, 42, 48, .78); }
.input:focus-within { background: rgba(30, 30, 35, .9); }
.input:focus-within::after { inset: -2px; border-width: 2px; border-radius: calc(var(--rr) + 2px); opacity: .67; }
.input > i { color: var(--text3); width: 16px; text-align: center; }
.input:focus-within > i { color: color-mix(in srgb, var(--c), #fff 20%); }
.input input, .input select, .input textarea {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px;
}
.input select { cursor: pointer; }
.input select option { background: var(--surface); }
.input input::placeholder, .input textarea::placeholder { color: var(--text3); }
.input.area { height: auto; padding: 12px 14px; align-items: flex-start; }
.input textarea { resize: vertical; min-height: 160px; line-height: 1.55; }
.input .eye { border: 0; background: none; color: var(--text3); cursor: pointer; padding: 4px; }
.input .eye:hover { color: var(--text); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text2); user-select: none; }
.switch input { display: none; }
.switch .knob { position: relative; width: 38px; height: 22px; border-radius: 11px; background: rgba(54, 54, 60, .8); transition: background .2s var(--ease); }
.switch .knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #b8b8c0; transition: transform .2s var(--ease), background .2s var(--ease); }
.switch input:checked + .knob { background: color-mix(in srgb, var(--accent) 45%, var(--base)); }
.switch input:checked + .knob::after { transform: translateX(16px); background: #fff; }

/* B.meter */
.meter { display: grid; gap: 8px; }
.meter .bar { position: relative; height: 8px; border-radius: 4px; background: rgba(10, 10, 12, .7); overflow: hidden; }
.meter .fill {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #000), var(--c));
  transition: width .8s var(--ease);
}
.meter .labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--text3); }

/* stat csempe */
.tile { padding: 18px 20px; display: grid; gap: 6px; }
.tile .num { font-size: 28px; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .sub { font-size: 12px; color: var(--text3); }
.tile-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* lista sorok (B.row / lineItem) */
.rows { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 4px; }
.row {
  --rr: var(--r1);
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px;
  border-radius: var(--r1); background: rgba(25, 25, 29, .6);
}
.row.click { cursor: pointer; transition: background .2s var(--ease); }
.row.click:hover { background: rgba(36, 36, 41, .8); }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { font-size: 12px; color: var(--text3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .val { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 14px; border-bottom: 1px solid rgba(255, 255, 255, .035); }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--text2); }
.kv span:last-child { font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

/* táblázat */
.table-wrap { overflow-x: auto; }
table.kit { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 14px; }
table.kit th { text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); padding: 4px 14px; white-space: nowrap; }
table.kit td { padding: 11px 14px; background: rgba(25, 25, 29, .6); vertical-align: middle; }
table.kit td:first-child { border-radius: var(--r1) 0 0 var(--r1); }
table.kit td:last-child { border-radius: 0 var(--r1) var(--r1) 0; }
table.kit tr.click { cursor: pointer; }
table.kit tr.click:hover td { background: rgba(36, 36, 41, .8); }
table.kit td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.kit td.wrap { white-space: normal; word-break: break-word; }

/* pager (B.pager) */
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--text2); }

/* értesítés (vise_gui notification) */
#toasts { position: fixed; top: 84px; right: 18px; z-index: 200; display: grid; gap: 10px; width: min(360px, calc(100vw - 36px)); }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r2);
  background: rgba(15, 15, 18, .94); box-shadow: 0 12px 34px rgba(0, 0, 0, .45);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 14px; animation: kit-toast-in .35s var(--ease);
}
.toast.out { animation: kit-toast-out .3s var(--ease) forwards; }
@keyframes kit-toast-in { from { opacity: 0; transform: translateX(24px); } }
@keyframes kit-toast-out { to { opacity: 0; transform: translateX(24px); } }

/* modál */
.modal-back {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px;
  background: rgba(5, 5, 7, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: kit-fade .2s ease;
}
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; animation: kit-rise .3s var(--ease); }
.modal.wide { width: min(920px, 100%); }
.modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.modal-head .grow { flex: 1; min-width: 0; }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 500; }
.modal-head p { margin: 2px 0 0; font-size: 13px; color: var(--text3); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
@keyframes kit-fade { from { opacity: 0; } }
@keyframes kit-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* betöltés / üres állapot */
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); border-top-color: currentColor; animation: kit-rot .7s linear infinite; }
@keyframes kit-rot { to { transform: rotate(360deg); } }
.skel { border-radius: var(--r1); background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.07), rgba(255,255,255,.03)); background-size: 200% 100%; animation: kit-skel 1.3s linear infinite; }
@keyframes kit-skel { to { background-position: -200% 0; } }
.empty { display: grid; justify-items: center; gap: 10px; padding: 32px 16px; text-align: center; color: var(--text3); font-size: 14px; }
.empty i { font-size: 26px; opacity: .6; }

/* lépcsőzetes beúszás (B.begin) */
.rise { animation: kit-rise .55s var(--ease) both; }
.rise:nth-child(2) { animation-delay: .05s; } .rise:nth-child(3) { animation-delay: .1s; }
.rise:nth-child(4) { animation-delay: .15s; } .rise:nth-child(5) { animation-delay: .2s; }
.rise:nth-child(6) { animation-delay: .25s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
