:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-soft: #f8f9fc;
    --text: #172033;
    --muted: #70798d;
    --border: #e5e9f2;
    --primary: #4263eb;
    --primary-dark: #3150d8;
    --primary-soft: #eef2ff;
    --nav: #121a2d;
    --nav-soft: #1d2942;
    --success: #14865c;
    --success-soft: #e9f8f1;
    --danger: #d03b4f;
    --danger-soft: #fff0f2;
    --warning: #ad7414;
    --warning-soft: #fff6df;
    --shadow: 0 18px 48px rgba(24, 36, 67, .08);
    --radius: 18px;
    --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font: 14px/1.6 var(--font);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: 26px;
    line-height: 1.25;
    letter-spacing: -.03em;
}

h2 {
    margin-bottom: 0;
    font-size: 20px;
    line-height: 1.35;
    letter-spacing: -.02em;
}

.muted,
.form-hint {
    color: var(--muted);
}

.eyebrow {
    margin-bottom: 5px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.eyebrow.light {
    color: #aebfff;
}

.brand-mark {
    display: inline-grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, #5374f4, #7454df);
    box-shadow: 0 12px 32px rgba(66, 99, 235, .32);
    font-size: 19px;
    font-weight: 900;
    letter-spacing: -.04em;
}

.brand-mark.small {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    box-shadow: none;
    font-size: 14px;
}

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 700;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:disabled,
.action-button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.button.primary {
    color: #fff;
    background: var(--primary);
    box-shadow: 0 8px 20px rgba(66, 99, 235, .18);
}

.button.primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.button.secondary {
    color: var(--text);
    border-color: var(--border);
    background: var(--surface);
}

.button.light {
    color: var(--nav);
    background: #fff;
}

.button.wide {
    width: 100%;
}

.small-button {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    font-size: 12px;
}

.button-row,
.row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button,
.link-button,
.menu-button {
    display: inline-grid;
    border: 0;
    cursor: pointer;
    place-items: center;
    color: var(--muted);
    background: transparent;
}

.icon-button {
    width: 34px;
    height: 34px;
    border-radius: 9px;
}

.icon-button:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.link-button {
    padding: 0;
}

.text-link,
.back-link {
    color: var(--primary);
    font-weight: 700;
}

.danger-text {
    color: var(--danger);
}

.alert {
    margin-bottom: 16px;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.alert.success {
    color: var(--success);
    border-color: #c8eddd;
    background: var(--success-soft);
}

.alert.danger {
    color: var(--danger);
    border-color: #f1c9cf;
    background: var(--danger-soft);
}

.alert.warning {
    color: var(--warning);
    border-color: #eddcb3;
    background: var(--warning-soft);
}

.status-pill {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    white-space: nowrap;
    padding: 2px 10px;
    border-radius: 999px;
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 12px;
    font-weight: 750;
}

.status-pill.success {
    color: var(--success);
    background: var(--success-soft);
}

.status-pill.danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.status-pill.warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.stack-form {
    display: grid;
    gap: 18px;
}

.stack-form.compact {
    gap: 14px;
}

.stack-form label,
.field-label {
    display: grid;
    gap: 7px;
    color: #3a4355;
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    outline: none;
    border-radius: 11px;
    color: var(--text);
    background: #fff;
    padding: 10px 12px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #879bf3;
    box-shadow: 0 0 0 4px rgba(66, 99, 235, .1);
}

input[readonly] {
    color: var(--muted);
    background: var(--surface-soft);
}

.form-hint,
.stack-form label .form-hint {
    font-size: 12px;
    font-weight: 400;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

fieldset {
    min-width: 0;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
}

legend {
    padding: 0 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.input-with-action {
    display: flex;
    gap: 8px;
}

.divider {
    height: 1px;
    background: var(--border);
}

.switch-row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.switch-row span {
    display: grid;
}

.switch-row small {
    color: var(--muted);
    font-weight: 400;
}

.switch-row input,
.check-row input {
    width: 20px;
    min-height: 20px;
    accent-color: var(--primary);
}

.check-row {
    display: flex !important;
    grid-template-columns: none;
    align-items: center;
}

.panel {
    min-width: 0;
    padding: 24px;
    border: 1px solid rgba(222, 227, 239, .9);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 26px rgba(25, 36, 69, .035);
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.top-gap {
    margin-top: 20px;
}

.content-grid {
    display: grid;
    gap: 20px;
}

.content-grid.two-thirds {
    grid-template-columns: minmax(0, 1.55fr) minmax(310px, .75fr);
}

.content-grid.form-layout {
    grid-template-columns: minmax(0, 1fr) minmax(360px, .85fr);
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.page-actions p {
    margin: 0;
    color: var(--muted);
}

.empty-state {
    display: grid;
    min-height: 250px;
    place-items: center;
    align-content: center;
    text-align: center;
    color: var(--muted);
}

.empty-state strong {
    color: var(--text);
    font-size: 18px;
}

.empty-state p {
    max-width: 360px;
    margin: 6px auto 16px;
}

.empty-state.small {
    min-height: 100px;
}

.empty-state.wide {
    grid-column: 1 / -1;
}

.empty-icon {
    display: grid;
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    place-items: center;
    border-radius: 15px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 900;
}

/* Installation */
.install-page {
    display: grid;
    place-items: center;
    padding: 40px 20px;
    background:
        radial-gradient(circle at 15% 20%, rgba(80, 111, 241, .12), transparent 30%),
        radial-gradient(circle at 88% 75%, rgba(116, 84, 223, .1), transparent 32%),
        #f6f7fb;
}

.install-shell {
    display: grid;
    width: min(1120px, 100%);
    grid-template-columns: .82fr 1.3fr;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.install-intro {
    position: relative;
    overflow: hidden;
    padding: 60px 48px;
    color: #fff;
    background: linear-gradient(160deg, #17223d, #263a75);
}

.install-intro::after {
    position: absolute;
    right: -90px;
    bottom: -90px;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    box-shadow: 0 0 0 45px rgba(255, 255, 255, .03), 0 0 0 90px rgba(255, 255, 255, .025);
    content: "";
}

.install-intro .eyebrow {
    margin-top: 44px;
    color: #aebfff;
}

.install-intro h1 {
    margin: 0 0 16px;
    font-size: 38px;
}

.install-intro > p:last-of-type {
    color: #bfc9e4;
}

.install-steps {
    display: grid;
    gap: 12px;
    margin-top: 48px;
}

.install-steps span {
    padding: 10px 14px;
    border-left: 2px solid rgba(255, 255, 255, .14);
    color: #8995b5;
}

.install-steps span.active {
    border-color: #8fa7ff;
    color: #fff;
}

.install-card {
    padding: 42px;
}

.requirements-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 24px;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--muted);
    background: var(--surface-soft);
}

.requirement span {
    font-weight: 900;
}

.requirement.ok span {
    color: var(--success);
}

.requirement.bad {
    color: var(--danger);
    background: var(--danger-soft);
}

/* Login */
.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 12%, rgba(66, 99, 235, .12), transparent 28%),
        #f3f5fa;
}

.login-shell {
    display: grid;
    width: min(1040px, 100%);
    min-height: 600px;
    grid-template-columns: 1.15fr .85fr;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: #fff;
    box-shadow: var(--shadow);
}

.login-brand {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    justify-content: center;
    padding: 64px;
    color: #fff;
    background:
        radial-gradient(circle at 80% 15%, rgba(127, 150, 255, .3), transparent 27%),
        linear-gradient(145deg, #141d33, #23376c);
}

.login-brand::after {
    position: absolute;
    right: -100px;
    bottom: -130px;
    width: 380px;
    height: 380px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50%;
    box-shadow: 0 0 0 58px rgba(255, 255, 255, .025), 0 0 0 116px rgba(255, 255, 255, .02);
    content: "";
}

.login-brand .eyebrow {
    margin-top: 44px;
    color: #9eb3ff;
}

.login-brand h1 {
    margin-bottom: 20px;
    font-size: 45px;
}

.login-brand > p {
    max-width: 460px;
    color: #bfc8df;
    font-size: 16px;
}

.login-feature-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 32px;
}

.login-feature-row span {
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 999px;
    color: #d9e0f3;
    background: rgba(255, 255, 255, .05);
    font-size: 12px;
}

.login-card {
    display: grid;
    align-content: center;
    padding: 56px;
}

.login-card h2 {
    font-size: 30px;
}

/* Admin shell */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    z-index: 20;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: 244px;
    flex-direction: column;
    padding: 20px 14px;
    color: #c5cee3;
    background: var(--nav);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 8px 24px;
    color: #fff;
}

.sidebar-brand span:last-child,
.sidebar-footer div {
    display: grid;
}

.sidebar-brand small,
.sidebar-footer small {
    color: #7d8aa8;
    font-size: 10px;
}

.sidebar nav {
    display: grid;
    gap: 5px;
}

.sidebar nav a {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 11px;
    padding: 0 12px;
    border-radius: 11px;
    transition: color .15s ease, background .15s ease;
}

.sidebar nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .045);
}

.sidebar nav a.active {
    color: #fff;
    background: var(--nav-soft);
    box-shadow: inset 3px 0 #6f8bff;
}

.nav-icon {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 7px;
    color: #9dacd2;
    background: rgba(255, 255, 255, .055);
    font-size: 12px;
    font-weight: 900;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding: 14px 8px 3px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-footer form {
    margin-left: auto;
}

.sidebar-footer .icon-button {
    color: #8f9bb5;
}

.admin-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 10px;
    color: #d9e2ff;
    background: #2a3a5c;
    font-weight: 900;
}

.main-content {
    width: calc(100% - 244px);
    min-width: 0;
    margin-left: 244px;
    padding: 26px 30px 50px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.topbar .eyebrow {
    margin-bottom: 2px;
}

.secure-chip {
    padding: 8px 12px;
    border: 1px solid #dfe6e2;
    border-radius: 999px;
    color: var(--success);
    background: #fff;
    font-size: 12px;
    font-weight: 700;
}

.secure-chip::first-letter {
    font-size: 9px;
}

.menu-button {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
}

.sidebar-overlay {
    display: none;
}

.hero-panel {
    position: relative;
    display: grid;
    overflow: hidden;
    grid-template-columns: .85fr 1.15fr;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
    padding: 28px 30px;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 85% -20%, rgba(139, 162, 255, .35), transparent 38%),
        linear-gradient(135deg, #182541, #284486);
    box-shadow: 0 14px 36px rgba(25, 48, 104, .16);
}

.hero-panel h2 {
    margin-bottom: 7px;
    font-size: 25px;
}

.hero-panel p:last-child {
    margin-bottom: 0;
    color: #bdc8e2;
}

.copy-field {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    padding: 8px 9px 8px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}

.copy-field code {
    overflow: hidden;
    min-width: 0;
    flex: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--primary);
}

.copy-field.dark {
    border-color: rgba(255, 255, 255, .13);
    background: rgba(8, 15, 35, .34);
}

.copy-field.dark code {
    color: #dce4ff;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 19px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.stat-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 12px;
    font-weight: 900;
}

.stat-icon.blue {
    color: #3862dc;
    background: #eaf0ff;
}

.stat-icon.violet {
    color: #7950c5;
    background: #f1ebff;
}

.stat-icon.green {
    color: var(--success);
    background: var(--success-soft);
}

.stat-icon.amber {
    color: var(--warning);
    background: var(--warning-soft);
}

.stat-card div {
    display: grid;
}

.stat-card small {
    color: var(--muted);
}

.stat-card strong {
    font-size: 25px;
    line-height: 1.2;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

th {
    color: var(--muted);
    background: var(--surface-soft);
    font-size: 11px;
    letter-spacing: .03em;
}

td {
    font-size: 13px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.table-sub {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.empty-cell {
    padding: 42px;
    color: var(--muted);
    text-align: center;
}

.app-quick-list {
    display: grid;
    gap: 7px;
}

.quick-app {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: var(--surface-soft);
}

.quick-app div {
    display: grid;
    min-width: 0;
    flex: 1;
}

.quick-app code {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
}

.app-monogram {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border-radius: 11px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 900;
}

.app-monogram.large {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 14px;
    font-size: 17px;
}

.app-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.application-card {
    display: grid;
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    transition: transform .18s ease, box-shadow .18s ease;
}

.application-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.application-card-top,
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.application-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.application-metrics span {
    display: grid;
    padding: 9px;
    border-radius: 10px;
    background: var(--surface-soft);
}

.application-metrics small,
.card-footer span {
    color: var(--muted);
    font-size: 11px;
}

.version-list {
    display: grid;
    gap: 8px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.version-row {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 11px;
    background: var(--surface-soft);
}

.version-row > div:first-child {
    display: grid;
}

.version-row small {
    color: var(--muted);
}

.preset-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 7px;
}

.preset {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    color: var(--muted);
    background: #fff;
    font-weight: 700;
}

.preset.active,
.preset:hover {
    color: var(--primary);
    border-color: #9eaff3;
    background: var(--primary-soft);
}

.generated-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.generated-list {
    display: grid;
    max-height: 520px;
    overflow-y: auto;
    gap: 6px;
    padding-right: 5px;
}

.generated-list code {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: #274ab7;
    background: #f8faff;
    text-align: center;
    letter-spacing: .06em;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) 180px 140px auto;
    gap: 10px;
    margin-bottom: 18px;
}

.search-box {
    position: relative;
}

.search-box span {
    position: absolute;
    z-index: 1;
    top: 10px;
    left: 13px;
    color: var(--muted);
}

.search-box input {
    padding-left: 36px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 18px;
    color: var(--muted);
}

.pagination div {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.pagination a {
    display: grid;
    min-width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.pagination a.active {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.secret-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 14px;
    border: 1px dashed #aebcf1;
    border-radius: 13px;
    background: #f7f9ff;
}

.secret-box code {
    min-width: 0;
    flex: 1;
    overflow-wrap: anywhere;
    color: #3959c7;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--border);
}

.detail-grid div {
    display: grid;
    gap: 3px;
    padding: 14px;
    background: #fff;
}

.detail-grid dt {
    color: var(--muted);
    font-size: 11px;
}

.detail-grid dd {
    margin: 0;
    font-weight: 700;
}

.detail-grid dd small {
    display: block;
    color: var(--muted);
    font-weight: 400;
}

.action-list {
    display: grid;
    gap: 8px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.action-button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    cursor: pointer;
    color: var(--text);
    background: #fff;
    text-align: left;
}

.action-button:hover:not(:disabled) {
    border-color: #aebcf1;
    background: #f9faff;
}

.action-button > span {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    border-radius: 10px;
    color: var(--primary);
    background: var(--primary-soft);
    font-weight: 900;
}

.action-button div {
    display: grid;
}

.action-button small {
    color: var(--muted);
}

.action-button.danger-action {
    color: var(--danger);
}

.action-button.danger-action > span {
    color: var(--danger);
    background: var(--danger-soft);
}

.settings-list {
    display: grid;
    margin: 0;
}

.settings-list > div {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.settings-list dt {
    color: var(--muted);
}

.settings-list dd {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.settings-list code {
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast {
    position: fixed;
    z-index: 100;
    right: 24px;
    bottom: 24px;
    padding: 12px 18px;
    border-radius: 11px;
    color: #fff;
    background: #172033;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity .18s ease, transform .18s ease;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: var(--danger);
}

@media (max-width: 1120px) {
    .app-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-grid.two-thirds,
    .content-grid.form-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .install-shell,
    .login-shell {
        grid-template-columns: 1fr;
    }

    .install-intro {
        padding: 36px;
    }

    .install-intro .eyebrow {
        margin-top: 20px;
    }

    .install-steps {
        display: none;
    }

    .login-brand {
        min-height: 320px;
        padding: 42px;
    }

    .login-brand h1 {
        font-size: 36px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 20px;
    }

    .menu-button {
        display: grid;
    }

    .topbar > div {
        margin-right: auto;
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-open .sidebar-overlay {
        position: fixed;
        z-index: 15;
        inset: 0;
        display: block;
        background: rgba(11, 17, 30, .48);
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-panel {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .install-page,
    .login-page {
        padding: 0;
        place-items: stretch;
    }

    .install-shell,
    .login-shell {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
    }

    .install-intro {
        padding: 30px 22px;
    }

    .install-intro h1 {
        font-size: 30px;
    }

    .install-card,
    .login-card {
        padding: 28px 20px;
    }

    .login-brand {
        min-height: 270px;
        padding: 30px 24px;
    }

    .login-brand .eyebrow {
        margin-top: 24px;
    }

    .login-brand h1 {
        font-size: 31px;
    }

    .login-feature-row {
        margin-top: 12px;
    }

    .requirements-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 16px 14px 38px;
    }

    .secure-chip {
        display: none;
    }

    .panel {
        padding: 18px;
        border-radius: 15px;
    }

    .hero-panel {
        padding: 23px 20px;
    }

    .hero-panel h2 {
        font-size: 22px;
    }

    .copy-field.dark {
        align-items: stretch;
        flex-direction: column;
    }

    .stat-grid {
        gap: 10px;
    }

    .stat-card {
        align-items: flex-start;
        padding: 14px;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .stat-card strong {
        font-size: 21px;
    }

    .page-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .app-card-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        grid-template-columns: 1fr;
    }

    .preset-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .secret-box {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-list > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .settings-list dd {
        align-items: stretch;
        flex-direction: column;
    }

    .pagination {
        align-items: flex-start;
        flex-direction: column;
    }
}

