:root {
    --ink: #101828;
    --muted: #667085;
    --line: #e4e7ec;
    --panel: #ffffff;
    --canvas: #f5f7fa;
    --nav: #0d1726;
    --nav-soft: #172337;
    --cyan: #20c6b7;
    --cyan-dark: #0e9f95;
    --blue: #2e5bff;
    --red: #d92d20;
    --amber: #b54708;
    --shadow: 0 12px 38px rgba(16, 24, 40, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--canvas); }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; }
code { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
[hidden] { display: none !important; }

svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: #061e1c;
    background: linear-gradient(145deg, #58eadb, #19b8aa);
    font-weight: 900;
    font-size: 20px;
    box-shadow: inset 0 1px rgba(255,255,255,.45), 0 8px 20px rgba(32,198,183,.2);
}

.brand-mark.large {
    width: 58px;
    height: 58px;
    border-radius: 17px;
    font-size: 30px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--cyan-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .16em;
}

.auth-body {
    background:
        radial-gradient(circle at 10% 15%, rgba(32,198,183,.18), transparent 34%),
        radial-gradient(circle at 90% 80%, rgba(46,91,255,.14), transparent 30%),
        #07111f;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(400px, .9fr);
    min-height: 100vh;
}

.auth-brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(48px, 8vw, 120px);
    color: #f8fafc;
    background-image:
        linear-gradient(rgba(19,38,54,.75), rgba(7,17,31,.92)),
        repeating-linear-gradient(90deg, transparent 0 44px, rgba(255,255,255,.035) 45px),
        repeating-linear-gradient(0deg, transparent 0 44px, rgba(255,255,255,.035) 45px);
}

.auth-brand-panel .eyebrow { color: var(--cyan); margin-top: 40px; }
.auth-brand-panel h1 {
    margin: 0;
    font-size: clamp(44px, 6vw, 76px);
    line-height: .98;
    letter-spacing: -.055em;
}
.auth-intro { max-width: 500px; margin: 26px 0 34px; color: #aabbcd; font-size: 16px; line-height: 1.8; }
.auth-feature-row { display: flex; flex-wrap: wrap; gap: 10px; }
.auth-feature-row span {
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 999px;
    color: #c7d4df;
    font-size: 12px;
}

.auth-card-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.auth-card {
    width: min(430px, 100%);
    padding: 42px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 24px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 30px 90px rgba(0,0,0,.28);
}

.auth-card h2 { margin: 0; font-size: 30px; letter-spacing: -.03em; }
.card-intro { margin: 10px 0 28px; color: var(--muted); line-height: 1.7; }
.mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 28px; font-weight: 800; }
.auth-footer { color: #65788c; font-size: 12px; }

.stack-form { display: grid; gap: 18px; }
.stack-form label, .form-grid label { display: grid; gap: 8px; }
.stack-form label > span, .form-grid label > span {
    color: #344054;
    font-size: 13px;
    font-weight: 700;
}
.stack-form small, .form-grid small { color: var(--muted); font-size: 11px; }

.stack-form input,
.form-grid input,
.secret-field input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    color: var(--ink);
    border: 1px solid #d0d5dd;
    border-radius: 11px;
    outline: none;
    background: #fff;
    transition: border-color .16s, box-shadow .16s;
}
.stack-form input:focus,
.form-grid input:focus {
    border-color: var(--cyan-dark);
    box-shadow: 0 0 0 4px rgba(32,198,183,.13);
}
.security-note { margin: 22px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 750;
    font-size: 13px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .15s;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; }
.button.primary {
    color: #04201d;
    background: linear-gradient(135deg, #52e4d5, #1cbcaf);
    box-shadow: 0 8px 20px rgba(14,159,149,.18);
}
.button.primary:hover:not(:disabled) { box-shadow: 0 11px 24px rgba(14,159,149,.28); }
.button.secondary { color: #344054; background: #fff; border-color: #d0d5dd; }
.button.small { min-height: 38px; padding: 0 12px; }
.button.full { width: 100%; min-height: 50px; margin-top: 4px; }
.button.danger-ghost { color: var(--red); border-color: #f1b8b3; background: #fff; }

.alert {
    margin-bottom: 18px;
    padding: 12px 15px;
    border: 1px solid;
    border-radius: 11px;
    font-size: 13px;
    line-height: 1.6;
}
.alert-success { color: #05603a; border-color: #a6f4c5; background: #ecfdf3; }
.alert-error { color: #912018; border-color: #fecdca; background: #fef3f2; }
.alert-info { color: #1849a9; border-color: #b2ddff; background: #eff8ff; }
.auth-card .alert { margin: 0 0 20px; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 24px 16px 16px;
    color: #cbd5e1;
    background:
        radial-gradient(circle at 0 0, rgba(32,198,183,.12), transparent 34%),
        var(--nav);
    overflow-y: auto;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 8px 24px;
    color: #fff;
    text-decoration: none;
}
.sidebar-brand strong { display: block; font-size: 14px; letter-spacing: .08em; }
.sidebar-brand small { display: block; margin-top: 2px; color: #7990a5; font-size: 10px; letter-spacing: .06em; }
.sidebar-nav { display: grid; gap: 5px; margin-top: 8px; }
.bottom-nav { margin-top: 24px; }
.nav-label {
    margin: 0 10px 7px;
    color: #60778e;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    height: 43px;
    padding: 0 12px;
    border-radius: 9px;
    color: #9fb0c1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color .15s, background .15s;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.045); }
.nav-item.active { color: #eafffc; background: rgba(32,198,183,.14); }
.nav-item.active .nav-icon { color: var(--cyan); }
.nav-icon { display: inline-grid; place-items: center; width: 24px; color: #71869a; }
.nav-icon svg { width: 19px; height: 19px; }
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 15px 9px 3px;
    border-top: 1px solid rgba(255,255,255,.08);
}
.user-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: #061e1c;
    background: #4ed8ca;
    font-weight: 900;
}
.user-meta { display: grid; flex: 1; min-width: 0; }
.user-meta strong { overflow: hidden; color: #f1f5f9; font-size: 12px; text-overflow: ellipsis; }
.user-meta small { margin-top: 2px; color: #71869a; font-size: 10px; }
.icon-button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 8px;
    color: #8ba0b4;
    background: transparent;
    cursor: pointer;
}
.icon-button:hover { color: #fff; background: rgba(255,255,255,.06); }

.main-content { min-width: 0; padding: 0 clamp(22px, 4vw, 54px); }
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 92px;
    border-bottom: 1px solid var(--line);
}
.topbar-kicker { margin: 0 0 5px; color: #98a2b3; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.topbar h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.system-state {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid #d1fadf;
    border-radius: 999px;
    color: #067647;
    background: #ecfdf3;
    font-size: 11px;
    font-weight: 700;
}
.system-state span { width: 7px; height: 7px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px rgba(18,183,106,.12); }
.main-content > .alert { margin-top: 20px; }
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 26px;
    padding: 38px 0 26px;
}
.page-heading h1 { margin: 0; font-size: clamp(29px, 3vw, 38px); letter-spacing: -.045em; }
.page-heading p:not(.eyebrow) { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.heading-stat {
    min-width: 100px;
    padding: 13px 18px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255,255,255,.7);
    text-align: right;
}
.heading-stat strong { display: block; font-size: 26px; line-height: 1; }
.heading-stat span { color: var(--muted); font-size: 10px; }

.upload-card,
.data-panel,
.narrow-card,
.settings-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 1px 2px rgba(16,24,40,.02);
}
.upload-card {
    display: grid;
    grid-template-columns: minmax(220px, .7fr) minmax(420px, 1.3fr);
    gap: 34px;
    padding: 30px;
    background:
        linear-gradient(120deg, rgba(32,198,183,.055), transparent 45%),
        #fff;
}
.upload-copy h2 { margin: 0 0 10px; font-size: 23px; letter-spacing: -.03em; }
.upload-copy > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
.release-upload-form { display: grid; gap: 16px; }
.form-grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid input { height: 44px; }
.file-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 128px;
    padding: 18px;
    border: 1.5px dashed #b8c3cf;
    border-radius: 14px;
    background: #f9fbfc;
    text-align: center;
    cursor: pointer;
    transition: border-color .16s, background .16s;
}
.file-drop:hover { border-color: var(--cyan-dark); background: #f1fcfb; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop-icon {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    margin-bottom: 10px;
    border-radius: 10px;
    color: var(--cyan-dark);
    background: #dff9f6;
}
.file-drop-title { color: #344054; font-size: 13px; font-weight: 700; }
.file-drop-hint { margin-top: 5px; color: #98a2b3; font-size: 10px; }
.upload-progress-panel {
    padding: 14px;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    background: #fbfcfe;
}
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 11px; }
.progress-meta span { color: var(--cyan-dark); font-weight: 800; }
.upload-progress-panel progress {
    width: 100%;
    height: 8px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    appearance: none;
}
.upload-progress-panel progress::-webkit-progress-bar { background: #eaecf0; border-radius: 999px; }
.upload-progress-panel progress::-webkit-progress-value { background: linear-gradient(90deg, var(--cyan-dark), #52e4d5); border-radius: 999px; }
.upload-progress-panel progress::-moz-progress-bar { background: linear-gradient(90deg, var(--cyan-dark), #52e4d5); border-radius: 999px; }
.upload-progress-panel p { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.form-actions { display: flex; align-items: center; gap: 14px; }
.form-actions.centered { justify-content: center; }
.form-hint { color: #98a2b3; font-size: 10px; line-height: 1.5; }

.data-panel { margin-top: 22px; overflow: hidden; }
.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 25px;
    border-bottom: 1px solid var(--line);
}
.panel-heading h2 { margin: 0; font-size: 17px; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.count-badge {
    padding: 5px 9px;
    border-radius: 999px;
    color: #475467;
    background: #f2f4f7;
    font-size: 10px;
    font-weight: 700;
}
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; white-space: nowrap; }
th {
    padding: 12px 16px;
    color: #667085;
    background: #fcfcfd;
    text-align: left;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
td { padding: 15px 16px; border-top: 1px solid #f0f2f5; vertical-align: middle; }
tbody tr:hover { background: #fbfcfd; }
th:first-child, td:first-child { padding-left: 25px; }
th:last-child, td:last-child { padding-right: 25px; }
.align-right { text-align: right; }
.identity-cell { display: flex; align-items: center; gap: 10px; }
.identity-avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: #0d736b;
    background: #e9fbf8;
    font-size: 9px;
    font-weight: 900;
}
.identity-cell strong { color: #344054; font-size: 11px; }
.version-tag {
    display: inline-block;
    padding: 5px 8px;
    border: 1px solid #dbe7ff;
    border-radius: 6px;
    color: #2454d6;
    background: #f2f6ff;
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 10px;
    font-weight: 700;
}
.hash { color: #667085; font-size: 9px; }
.table-sub { display: block; margin-top: 3px; color: #98a2b3; font-size: 9px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; }
.status i { width: 6px; height: 6px; border-radius: 50%; }
.status.online { color: #067647; }
.status.online i { background: #12b76a; }
.status.offline { color: #667085; }
.status.offline i { background: #98a2b3; }
.row-actions { display: inline-flex; align-items: center; gap: 6px; }
.row-actions form { display: inline; }
.action-link {
    border: 0;
    padding: 4px 6px;
    color: #155eef;
    background: transparent;
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}
.action-link.subtle { color: #667085; }
.action-link:hover { text-decoration: underline; }
.empty-state { padding: 58px 20px; text-align: center; }
.empty-icon {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px dashed #b8c3cf;
    border-radius: 14px;
    color: #98a2b3;
    font-size: 22px;
}
.empty-state h3 { margin: 13px 0 5px; font-size: 14px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 11px; }

.spec-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 22px;
}
.spec-strip > div { padding: 6px 4px; }
.spec-strip span { color: #98a2b3; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.spec-strip strong { display: block; margin: 7px 0 3px; font-size: 12px; }
.spec-strip p { margin: 0; color: var(--muted); font-size: 10px; }

.narrow-card { max-width: 620px; padding: 30px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-card { padding: 25px; }
.full-span { grid-column: 1 / -1; }
.settings-heading > div { display: flex; align-items: flex-start; gap: 13px; }
.settings-heading h2 { margin: 0; font-size: 18px; }
.settings-heading p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.settings-icon {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    height: 42px;
    border-radius: 11px;
    color: #0d736b;
    background: #e9fbf8;
    font-size: 9px;
    font-weight: 900;
}
.secret-field { display: flex; gap: 8px; margin-top: 24px; }
.secret-field input { min-width: 0; height: 43px; font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; }
.settings-warning {
    margin: 18px 0;
    padding: 13px 15px;
    border: 1px solid #fedf89;
    border-radius: 10px;
    background: #fffaeb;
}
.settings-warning strong { color: #93370d; font-size: 11px; }
.settings-warning p { margin: 5px 0 0; color: #b54708; font-size: 10px; }
.endpoint-list { display: grid; gap: 8px; margin-top: 23px; }
.endpoint-list > div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 7px 10px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid #eaecf0;
    border-radius: 9px;
    background: #fcfcfd;
}
.endpoint-list code { color: #344054; font-size: 10px; overflow-wrap: anywhere; }
.endpoint-list small { grid-column: 2; color: #98a2b3; font-size: 9px; }
.method { padding: 3px 5px; border-radius: 4px; font-size: 8px; font-weight: 900; }
.method.get { color: #067647; background: #dcfae6; }
.security-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 23px; }
.security-grid div { padding: 16px; border: 1px solid #eaecf0; border-radius: 10px; }
.security-grid strong { display: block; font-size: 11px; }
.security-grid span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }

.error-state { max-width: 620px; margin: 12vh auto; text-align: center; }
.error-code { margin: 0; color: #d0d5dd; font-size: 78px; font-weight: 900; letter-spacing: -.08em; }
.error-state h1 { margin: 0 0 12px; font-size: 30px; }
.error-state > p:not(.error-code) { color: var(--muted); line-height: 1.7; }
.page-footer { padding: 34px 0 22px; color: #98a2b3; font-size: 9px; text-align: center; }

@media (max-width: 1050px) {
    .upload-card { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .full-span { grid-column: auto; }
    .security-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 800px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand-panel { display: none; }
    .auth-card-panel { min-height: 100vh; padding: 20px; }
    .auth-card { padding: 28px; }
    .mobile-brand { display: flex; }
    .app-shell { display: block; }
    .sidebar {
        position: static;
        display: block;
        width: 100%;
        height: auto;
        padding: 14px;
    }
    .sidebar-brand { padding-bottom: 12px; }
    .sidebar-nav { display: flex; overflow-x: auto; margin: 8px 0 0; }
    .bottom-nav { margin-top: 4px; }
    .nav-label { display: none; }
    .nav-item { flex: 0 0 auto; }
    .sidebar-user { margin-top: 10px; padding-top: 12px; }
    .main-content { padding: 0 16px; }
    .topbar { min-height: 76px; }
    .topbar-kicker { display: none; }
    .page-heading { align-items: flex-start; }
    .heading-stat { display: none; }
    .upload-card { padding: 21px; }
    .form-grid.two { grid-template-columns: 1fr; }
    .form-actions { align-items: flex-start; flex-direction: column; }
    .spec-strip { grid-template-columns: 1fr; }
    .security-grid { grid-template-columns: 1fr; }
}

