:root {
  color-scheme: dark;
  --bg: #050812;
  --surface: rgba(15, 24, 42, .86);
  --surface-strong: #10182a;
  --field: #070d19;
  --border: #2a3855;
  --accent: #ff5f87;
  --accent-strong: #ff3f70;
  --text: #f5f7ff;
  --muted: #9cabc5;
  --green: #35e58a;
  --yellow: #ffc857;
  --red: #ff404f;
  --cyan: #45d7ff;
  font-family: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 12% 10%, #17203b 0, transparent 34%), linear-gradient(145deg, #050812, #080d1a 48%, #040710); overflow-x: hidden; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.ambient { position: fixed; width: 480px; height: 480px; border-radius: 50%; filter: blur(110px); opacity: .12; pointer-events: none; }
.ambient-one { background: var(--accent); top: -240px; right: -100px; }
.ambient-two { background: #3159ff; bottom: -300px; left: -160px; }
.glass { position: relative; background: linear-gradient(145deg, rgba(17,27,47,.94), rgba(7,12,24,.91)); border: 1px solid rgba(77,96,135,.54); box-shadow: 0 24px 70px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.025); backdrop-filter: blur(20px); }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .12em; margin: 0 0 8px; }
.muted { color: var(--muted); line-height: 1.55; }
.hidden { display: none !important; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 16px; border: 1px solid transparent; text-decoration: none; color: white; cursor: pointer; font-weight: 700; font-size: 13px; transition: .18s ease; }
.button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button-primary { background: linear-gradient(135deg, var(--accent), #e94575); box-shadow: 0 8px 26px rgba(255,95,135,.18); }
.button-ghost { background: #111c31; border-color: #30405f; }
.button-dark { background: #090f1c; border-color: #263651; }
.button-danger { background: #57172a; border-color: #b52d50; }
.button-wide { width: 100%; min-height: 46px; }
.notice { margin: 0 0 16px; padding: 12px 14px; border-left: 3px solid; background: #0b1323; font-size: 13px; }
.notice-error { color: #ff9ba3; border-color: var(--red); }
.notice-success { color: #8cf6bd; border-color: var(--green); }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 1.25fr) minmax(380px, .75fr); align-items: stretch; }
.login-art { position: relative; overflow: hidden; min-height: 560px; background: linear-gradient(90deg, rgba(5,8,18,.28), rgba(5,8,18,.9)), url("installer-art.png") center/cover no-repeat; }
.login-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #050812 0, transparent 44%); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 52px; height: 52px; object-fit: contain; }
.brand strong, .brand span { display: block; }
.brand strong { color: var(--accent); font-size: 21px; letter-spacing: .06em; }
.brand span { color: #a8b5cd; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.brand-large { position: absolute; z-index: 2; left: 48px; top: 42px; }
.brand-large img { width: 78px; height: 78px; }
.brand-large strong { font-size: 31px; }
.login-card { width: min(480px, calc(100% - 56px)); padding: 44px; margin: auto; border-left: 3px solid var(--accent); }
.login-card h1 { margin: 0; font-size: 34px; }
.form-stack { display: grid; gap: 16px; margin-top: 26px; }
.form-stack label > span { display: block; color: #c0caDD; font-size: 12px; font-weight: 700; margin-bottom: 7px; }
input, textarea { width: 100%; color: var(--text); background: var(--field); border: 1px solid #33435f; outline: none; padding: 12px 13px; transition: border-color .18s, box-shadow .18s; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,95,135,.11); }
.security-note { color: #7f8da7; font-size: 11px; text-align: center; margin-top: 22px; }
.security-note span { color: var(--accent); }

.app-shell { min-height: 100vh; }
.topbar { position: sticky; z-index: 20; top: 0; height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: rgba(5,8,18,.91); border-bottom: 1px solid #2b3852; backdrop-filter: blur(18px); }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.topbar-actions form { margin: 0; }
.admin-chip { display: inline-flex; align-items: center; gap: 8px; color: #c5cee0; font-size: 12px; font-weight: 700; padding: 9px 12px; background: #0c1424; border: 1px solid #283854; }
.admin-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }
.dashboard { width: min(1500px, calc(100% - 40px)); margin: 26px auto 56px; }
.hero { min-height: 270px; padding: 42px; overflow: hidden; display: grid; grid-template-columns: 1fr 390px; align-items: center; border-left: 4px solid var(--accent); }
.hero-copy { position: relative; z-index: 2; max-width: 650px; }
.hero h1 { font-size: clamp(34px, 5vw, 58px); margin: 0 0 12px; letter-spacing: -.03em; }
.hero-copy > p:last-child { max-width: 590px; color: var(--muted); line-height: 1.6; }
.hero-art { position: absolute; width: 520px; height: 370px; object-fit: contain; right: 250px; bottom: -125px; opacity: .18; filter: grayscale(.2); pointer-events: none; }
.latest-card { z-index: 2; padding: 22px; background: rgba(5,10,20,.76); border: 1px solid #344462; display: grid; gap: 9px; }
.latest-card strong { font-size: 25px; }
.latest-card small { color: #9dabc2; overflow-wrap: anywhere; }
.latest-card a { color: var(--cyan); font-size: 12px; font-weight: 700; }
.status { display: inline-flex; width: fit-content; font-size: 10px; letter-spacing: .1em; font-weight: 900; }
.status-success { color: var(--green); }
.status-warning { color: var(--yellow); }
.status-error { color: var(--red); }
.dashboard-grid { display: grid; grid-template-columns: 1.5fr .85fr; gap: 18px; margin-top: 18px; }
.upload-panel, .api-panel, .releases-panel { padding: 24px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 21px; }
.path-badge, .count-chip { max-width: 46%; color: #8fa1bf; background: #09111f; border: 1px solid #283a58; padding: 8px 11px; font: 700 10px "Segoe UI"; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone { width: 100%; min-height: 190px; border: 1px dashed #536482; background: linear-gradient(145deg, #0a1222, #090e1b); color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; transition: .2s; }
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: #11152a; box-shadow: inset 0 0 40px rgba(255,95,135,.06); }
.dropzone:disabled { opacity: .45; cursor: not-allowed; }
.dropzone span:last-child { color: var(--muted); font-size: 12px; }
.drop-icon { width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid var(--accent); color: var(--accent); border-radius: 50%; font-size: 25px; }
.upload-progress { padding: 18px; border: 1px solid #34435f; background: #080f1d; }
.progress-head, .progress-meta { display: flex; justify-content: space-between; gap: 15px; }
.progress-head span { color: var(--accent); font-weight: 800; }
.progress-track { height: 10px; margin: 14px 0 9px; background: #02050b; border: 1px solid #5b2743; overflow: hidden; }
.progress-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff3f70, #ff7498); transition: width .1s linear; }
.progress-meta { color: var(--muted); font-size: 11px; margin-bottom: 15px; }
.endpoint { display: grid; grid-template-columns: auto 1fr; align-items: stretch; margin: 22px 0 14px; border: 1px solid #30415f; background: #050b16; overflow: hidden; }
.endpoint span { display: grid; place-items: center; padding: 12px; background: #183329; color: var(--green); font-size: 11px; font-weight: 900; }
.endpoint code { padding: 12px; color: #b7c6df; overflow: auto; white-space: nowrap; }
.releases-panel { margin-top: 18px; }
.release-list { display: grid; gap: 8px; }
.release-row { display: grid; grid-template-columns: 110px minmax(280px,1fr) 190px minmax(230px,auto); align-items: center; gap: 18px; padding: 16px; background: #0a1221; border: 1px solid #283955; border-left: 3px solid #40506c; }
.status-row-published { border-left-color: var(--green); }
.status-row-withdrawn { border-left-color: var(--red); }
.status-row-uploaded { border-left-color: var(--yellow); }
.release-version span { display: block; color: #73829d; font-size: 9px; font-weight: 800; }
.release-version strong { color: var(--accent); font-size: 22px; }
.release-main { min-width: 0; }
.release-main strong, .release-main span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.release-main span, .release-main p, .release-state small { color: var(--muted); font-size: 11px; }
.release-main p { margin: 7px 0 0; white-space: normal; }
.release-state { display: grid; gap: 7px; }
.release-actions { display: flex; justify-content: flex-end; align-items: center; gap: 7px; }
.release-actions form { margin: 0; }
.publish-form { display: flex; align-items: center; gap: 7px; }
.publish-form input { min-width: 170px; padding: 9px; }
.empty-state { min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); gap: 8px; }
.empty-state img { width: 90px; height: 90px; object-fit: contain; opacity: .75; }
.empty-state strong { color: var(--text); }

.modal { position: fixed; z-index: 100; inset: 0; background: rgba(1,3,8,.82); display: grid; place-items: center; padding: 24px; backdrop-filter: blur(8px); }
.modal-card { width: min(760px, 100%); max-height: calc(100vh - 48px); overflow: auto; padding: 28px; border-top: 2px solid var(--accent); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; }
.modal-head h2 { margin: 0; }
.icon-button { width: 38px; height: 38px; border: 1px solid #8c294a; background: #1b0a13; color: var(--accent); font-size: 22px; cursor: pointer; }
.input-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.check-row { display: flex !important; gap: 9px; align-items: center; }
.check-row input { width: 16px; accent-color: var(--accent); }
.check-row span { margin: 0 !important; }
.folder-browser { border: 1px solid #30415e; background: #070d18; padding: 12px; }
.folder-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.folder-toolbar code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9fb0cd; }
.folder-list { max-height: 260px; overflow: auto; display: grid; gap: 3px; margin-bottom: 10px; }
.folder-item { width: 100%; text-align: left; padding: 10px 12px; border: 0; background: #101a2d; color: #d8dfed; cursor: pointer; }
.folder-item:hover { background: #192540; color: var(--accent); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #050913; }
::-webkit-scrollbar-thumb { background: var(--accent); border: 3px solid #050913; }

@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .release-row { grid-template-columns: 90px 1fr 170px; }
  .release-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .hero { grid-template-columns: 1fr; }
  .latest-card { margin-top: 20px; }
}
@media (max-width: 760px) {
  .login-layout { display: block; padding: 24px 0; }
  .login-art { position: fixed; inset: 0; min-height: 0; opacity: .28; }
  .login-card { position: relative; width: calc(100% - 30px); padding: 28px; }
  .topbar { height: auto; padding: 12px; flex-wrap: wrap; gap: 10px; }
  .topbar-actions { width: 100%; overflow-x: auto; }
  .dashboard { width: calc(100% - 20px); margin-top: 12px; }
  .hero { padding: 25px; }
  .upload-panel, .api-panel, .releases-panel { padding: 16px; }
  .release-row { grid-template-columns: 1fr; }
  .release-actions, .publish-form { align-items: stretch; flex-direction: column; }
  .release-actions .button, .release-actions form, .publish-form input { width: 100%; }
  .section-heading { flex-direction: column; }
  .path-badge { max-width: 100%; }
}
