:root {
  color-scheme: dark;
  --bg: #07100f;
  --panel: rgba(14, 28, 25, .84);
  --panel-solid: #0e1c19;
  --panel-soft: #142521;
  --line: rgba(185, 219, 207, .14);
  --line-strong: rgba(185, 219, 207, .25);
  --text: #f3f7f5;
  --muted: #9fb2ac;
  --accent: #c9f26b;
  --accent-deep: #97bf38;
  --blue: #83b8ff;
  --danger: #ff8e89;
  --shadow: 0 28px 80px rgba(0, 0, 0, .34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe 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 17% 5%, #18372e 0, transparent 28%), radial-gradient(circle at 87% 84%, #192b43 0, transparent 30%), var(--bg); overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.ambient { position: fixed; border-radius: 50%; filter: blur(90px); opacity: .18; pointer-events: none; }
.ambient-a { width: 360px; height: 360px; background: var(--accent); top: -210px; right: 8%; }
.ambient-b { width: 460px; height: 460px; background: #3e82ff; bottom: -300px; left: -180px; }
.shell { position: relative; width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0 70px; }
.brandbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 42px; }
.brand { display: inline-flex; align-items: center; gap: 13px; color: var(--text); text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: -.02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(201, 242, 107, .45); border-radius: 13px; background: rgba(201, 242, 107, .08); transform: rotate(45deg); }
.brand-mark span { width: 13px; height: 13px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 24px rgba(201, 242, 107, .55); }
.security-pill { display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; background: rgba(7, 16, 15, .62); }
.security-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.center-card { width: min(540px, 100%); margin: 8vh auto 0; padding: clamp(30px, 6vw, 52px); border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(145deg, rgba(19, 37, 33, .96), rgba(10, 22, 20, .94)); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.loading-card { text-align: center; }
.spinner { width: 34px; height: 34px; margin: 0 auto 24px; border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--accent); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.eyebrow { display: inline-block; margin-bottom: 12px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(34px, 6vw, 64px); line-height: 1.02; letter-spacing: -.055em; }
.auth-card h1 { font-size: clamp(36px, 7vw, 52px); }
.intro, .workspace-head p { color: var(--muted); line-height: 1.65; }
.form-stack { display: grid; gap: 18px; margin-top: 30px; }
label { display: grid; gap: 8px; color: #dfe8e4; font-size: 13px; font-weight: 700; }
label small { color: var(--muted); font-size: 11px; font-weight: 500; }
input { width: 100%; min-height: 48px; padding: 0 14px; color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; outline: none; background: rgba(5, 14, 12, .62); transition: border-color .15s, box-shadow .15s; }
input:focus { border-color: rgba(201, 242, 107, .68); box-shadow: 0 0 0 3px rgba(201, 242, 107, .08); }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.button { min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 750; font-size: 13px; transition: transform .15s, background .15s, border-color .15s, opacity .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.button.primary { color: #132008; background: var(--accent); box-shadow: 0 12px 32px rgba(201, 242, 107, .12); }
.button.primary:hover { background: #d7fa85; }
.button.ghost { border-color: var(--line-strong); background: rgba(255,255,255,.035); }
.button.quiet { color: var(--muted); border-color: transparent; background: transparent; }
.button.danger { color: var(--danger); border-color: rgba(255, 142, 137, .24); background: rgba(255, 142, 137, .06); }
.button.wide { width: 100%; min-height: 50px; }
.form-error { min-height: 20px; margin: 14px 0 0; color: var(--danger); font-size: 13px; }
.workspace { display: grid; gap: 26px; }
.workspace-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; padding: 30px 0 12px; }
.workspace-head > div:first-child { max-width: 720px; }
.workspace-head h1 { margin-bottom: 12px; }
.workspace-head p { margin-bottom: 0; }
.account-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.stats { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 14px; }
.stats article { min-height: 124px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 12px 30px rgba(0,0,0,.12); }
.stats span, .stats small { display: block; color: var(--muted); font-size: 12px; }
.stats strong { display: block; margin: 13px 0 12px; font-size: 23px; letter-spacing: -.025em; }
.meter { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.meter i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); transition: width .3s; }
.drop-section { padding: 10px; border: 1px solid var(--line); border-radius: 26px; background: rgba(9, 20, 18, .72); box-shadow: var(--shadow); }
.drop-zone { display: grid; place-items: center; min-height: 330px; padding: 42px 20px; border: 1px dashed rgba(201, 242, 107, .3); border-radius: 19px; text-align: center; background: linear-gradient(180deg, rgba(201,242,107,.035), transparent); transition: border-color .18s, background .18s, transform .18s; }
.drop-zone.dragging { border-color: var(--accent); background: rgba(201,242,107,.08); transform: scale(.997); }
.drop-zone h2 { margin: 22px 0 8px; font-size: clamp(24px, 4vw, 34px); letter-spacing: -.035em; }
.drop-zone p { margin-bottom: 24px; color: var(--muted); }
.drop-zone small { margin-top: 17px; color: #758b84; }
.upload-icon { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid rgba(201,242,107,.28); border-radius: 20px; background: rgba(201,242,107,.08); }
.upload-icon span { color: var(--accent); font-size: 31px; line-height: 1; }
.upload-queue { display: grid; gap: 9px; padding: 12px 2px 2px; }
.queue-item { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-solid); }
.queue-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; color: var(--accent); font-size: 11px; font-weight: 900; background: rgba(201,242,107,.08); }
.queue-main { min-width: 0; }
.queue-name { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 13px; }
.queue-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-name span { color: var(--muted); white-space: nowrap; }
.progress { height: 4px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.progress i { display: block; width: 0; height: 100%; background: var(--accent); transition: width .15s; }
.queue-state { color: var(--muted); font-size: 12px; }
.files-panel { padding: clamp(20px, 4vw, 32px); border: 1px solid var(--line); border-radius: 24px; background: var(--panel); box-shadow: var(--shadow); }
.section-title, .subhead { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-title h2 { margin-bottom: 0; font-size: 26px; letter-spacing: -.035em; }
.file-list { display: grid; margin-top: 24px; }
.file-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(110px, .55fr) minmax(110px, .7fr) auto; align-items: center; gap: 18px; min-height: 76px; border-top: 1px solid var(--line); }
.file-row:first-child { border-top: 0; }
.file-name { display: flex; align-items: center; gap: 13px; min-width: 0; }
.file-badge { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--accent); font-size: 10px; font-weight: 900; background: rgba(201,242,107,.08); }
.file-name-text { min-width: 0; }
.file-name-text strong, .file-name-text small { display: block; }
.file-name-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.file-name-text small, .file-meta { margin-top: 5px; color: var(--muted); font-size: 11px; }
.status { justify-self: start; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.status.ready { color: var(--accent); background: rgba(201,242,107,.1); }
.status.uploading { color: var(--blue); background: rgba(131,184,255,.1); }
.status.rejected { color: var(--danger); background: rgba(255,142,137,.1); }
.file-actions { display: flex; gap: 6px; justify-self: end; }
.empty-state { padding: 54px 20px 34px; text-align: center; color: var(--muted); }
.empty-state span { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 16px; color: var(--accent); font-size: 11px; font-weight: 900; background: rgba(201,242,107,.08); }
.empty-state h3 { margin-bottom: 8px; color: var(--text); }
.admin-dialog { width: min(1040px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; color: var(--text); border: 1px solid var(--line-strong); border-radius: 24px; background: #0d1917; box-shadow: 0 40px 120px rgba(0,0,0,.7); }
.admin-dialog::backdrop { background: rgba(1,8,7,.78); backdrop-filter: blur(9px); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 24px 28px; border-bottom: 1px solid var(--line); background: rgba(13,25,23,.95); }
.dialog-head h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); cursor: pointer; background: transparent; font-size: 26px; }
.admin-layout { display: grid; grid-template-columns: 350px 1fr; min-height: 560px; }
.user-form { padding: 28px; border-right: 1px solid var(--line); background: rgba(255,255,255,.015); }
.user-form h3 { margin-bottom: 22px; }
.user-form > label, .user-form > .split-fields, .user-form fieldset { margin-bottom: 15px; }
fieldset { display: flex; flex-wrap: wrap; gap: 10px 16px; padding: 12px 0 4px; border: 0; }
legend { margin-bottom: 8px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.check { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.check input { width: 15px; min-height: 15px; accent-color: var(--accent-deep); }
.generated-secret { margin-top: 14px; padding: 16px; border: 1px solid rgba(201,242,107,.32); border-radius: 13px; color: #e8f6c5; background: rgba(201,242,107,.08); font-size: 12px; overflow-wrap: anywhere; }
.generated-secret > strong { display: block; margin-bottom: 5px; font-size: 15px; }
.generated-secret p { margin: 0 0 12px; color: var(--muted); line-height: 1.45; }
.generated-secret label { color: var(--muted); }
.generated-secret input { margin-top: 6px; color: #fff; border-color: rgba(201,242,107,.35); background: rgba(0,0,0,.3); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 15px; letter-spacing: .03em; }
.generated-secret small { display: block; margin-top: 12px; color: var(--muted); line-height: 1.45; }
.secret-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.form-hint { margin: 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.password-dialog { width: min(520px, calc(100% - 28px)); padding: 0; color: var(--text); border: 1px solid var(--line-strong); border-radius: 24px; background: #0d1917; box-shadow: 0 40px 120px rgba(0,0,0,.7); }
.password-dialog::backdrop { background: rgba(1,8,7,.84); backdrop-filter: blur(9px); }
.password-form { padding: 0 28px 28px; }
.user-list-wrap { padding: 28px; overflow: auto; }
.subhead h3 { margin: 0; }
.subhead span { color: var(--muted); font-size: 12px; }
.user-list { display: grid; gap: 10px; margin-top: 22px; }
.user-card { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.018); }
.user-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.user-card-head strong, .user-card-head small { display: block; }
.user-card-head small { margin-top: 4px; color: var(--muted); }
.user-card-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.tag { padding: 5px 8px; border-radius: 7px; color: var(--muted); background: rgba(255,255,255,.045); font-size: 10px; }
.tag.active { color: var(--accent); }
.user-card-actions { display: flex; gap: 6px; margin-top: 14px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: min(380px, calc(100% - 48px)); padding: 14px 17px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: #172824; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(255,142,137,.38); color: #ffd4d2; }

@media (max-width: 880px) {
  .workspace-head { align-items: flex-start; flex-direction: column; }
  .account-actions { justify-content: flex-start; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats article:first-child { grid-column: 1 / -1; }
  .file-row { grid-template-columns: minmax(0, 1fr) auto; padding: 15px 0; }
  .file-meta { display: none; }
  .file-actions { grid-column: 1 / -1; justify-self: start; padding-left: 55px; }
  .admin-layout { grid-template-columns: 1fr; }
  .user-form { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1240px); padding-top: 18px; }
  .security-pill { display: none; }
  .brandbar { margin-bottom: 22px; }
  .center-card { margin-top: 4vh; padding: 27px 21px; border-radius: 22px; }
  .split-fields { grid-template-columns: 1fr; }
  .workspace-head { padding-top: 16px; }
  .workspace-head h1 { font-size: 42px; }
  .account-actions { width: 100%; }
  .account-actions .button { flex: 1 1 auto; }
  .stats { grid-template-columns: 1fr; }
  .stats article:first-child { grid-column: auto; }
  .drop-zone { min-height: 300px; padding: 35px 16px; }
  .queue-item { grid-template-columns: 38px minmax(0,1fr); }
  .queue-state { grid-column: 2; }
  .section-title { align-items: flex-start; }
  .file-row { gap: 10px; }
  .dialog-head, .user-form, .user-list-wrap { padding: 20px; }
}
