:root {
    --bg: #f5f7fa;
    --surface: #fff;
    --ink: #17202a;
    --muted: #697386;
    --line: #dfe4ea;
    --brand: #136f63;
    --brand-dark: #0d5048;
    --nav: #18242d;
    --nav-soft: #243640;
    --danger: #b42318;
    --warning: #a15c00;
    --success: #157347;
    font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 14px; line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
.app-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; color: #e8edf0; background: var(--nav); }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; }
.brand:hover { color: inherit; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 6px; color: white; font-weight: 800; background: #168c7c; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 1px; color: #9eb0ba; font-size: 11px; }
.sidebar nav { display: grid; gap: 4px; margin-top: 30px; }
.sidebar nav a { padding: 10px 12px; border-radius: 5px; color: #becbd1; font-weight: 600; }
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: var(--nav-soft); }
.sidebar-foot { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid #33454e; }
.sidebar-foot span, .sidebar-foot small { display: block; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot small { color: #9eb0ba; }
.link-button { padding: 8px 0 0; border: 0; color: #a9cfc9; background: transparent; cursor: pointer; }
.main { min-width: 0; padding: 28px 34px 48px; }
.topbar { display: flex; gap: 18px; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: 0; }
.topbar p { margin: 4px 0 0; color: var(--muted); }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 8px 14px; border: 1px solid transparent; border-radius: 5px; font: inherit; font-weight: 700; cursor: pointer; }
.button.primary { color: #fff; background: var(--brand); }
.button.primary:hover { color: #fff; background: var(--brand-dark); }
.button.secondary { color: #293640; border-color: #cbd3da; background: #fff; }
.button.danger { color: #fff; background: var(--danger); }
.panel, .metric, .secret-box { margin-bottom: 18px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: 0 1px 2px rgba(20, 32, 44, .04); }
.panel { padding: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin: -2px 0 14px; }
.panel-head h2 { margin: 0; font-size: 16px; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 14px; }
.metric { padding: 18px; border-left: 4px solid var(--brand); }
.metric.warn { border-left-color: #c67a12; }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 5px; font-size: 27px; }
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 10px; border-bottom: 1px solid #e8ebef; text-align: left; vertical-align: top; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; }
tbody tr:hover { background: #f8fafb; }
.actions { display: flex; gap: 10px; }
.empty { padding: 34px; color: var(--muted); text-align: center; }
.badge { display: inline-flex; padding: 2px 8px; border-radius: 999px; color: #38444d; font-size: 12px; font-weight: 700; background: #e9edf0; }
.badge.active, .badge.success, .badge.succeeded, .badge.published { color: #0b6b3e; background: #dff4e8; }
.badge.suspended, .badge.grace, .badge.started, .badge.installing, .badge.draft { color: #855200; background: #fff0cd; }
.badge.revoked, .badge.failed, .badge.denied, .badge.rollback_failed { color: #9b1c1c; background: #fee2e2; }
.badge.beta, .badge.neutral { color: #3e4c59; background: #e8edf2; }
.filter-bar, .compact-form form { display: flex; gap: 10px; align-items: end; margin-bottom: 16px; }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #cbd3da; border-radius: 5px; color: var(--ink); background: #fff; font: inherit; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(19, 111, 99, .16); border-color: var(--brand); }
.filter-bar input { max-width: 360px; }
.filter-bar select { max-width: 210px; }
.form-panel { max-width: 980px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
label { display: grid; gap: 6px; color: #3d4952; font-weight: 650; }
.span-2 { grid-column: 1 / -1; }
.check-group { display: flex; gap: 24px; align-items: center; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: 17px; min-height: 17px; accent-color: var(--brand); }
fieldset { padding: 14px; border: 1px solid var(--line); border-radius: 5px; }
legend { padding: 0 6px; font-weight: 700; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.module-option { padding: 10px; border: 1px solid var(--line); border-radius: 5px; }
.module-option span, .module-option strong, .module-option small { display: block; }
.module-option small { color: var(--muted); font-weight: 400; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; padding: 0; overflow: hidden; }
.detail-grid > div { min-width: 0; padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-grid span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.detail-grid strong { display: block; }
.compact-form { padding: 14px 20px; }
.compact-form form { margin: 0; }
.compact-form label { min-width: 220px; }
.secret-box { display: flex; gap: 20px; justify-content: space-between; align-items: center; padding: 18px 20px; border-color: #ddb66b; background: #fff8e7; }
.secret-box p { margin: 3px 0 0; color: #705321; }
.secret-box code { padding: 10px 14px; border-radius: 4px; font-size: 16px; background: #fff; user-select: all; }
.alert { margin-bottom: 18px; padding: 13px 16px; border: 1px solid; border-radius: 6px; }
.alert ul { margin: 6px 0 0; }
.alert.success { color: #0c5936; border-color: #a8d8bd; background: #ebf8f0; }
.alert.danger { color: #8d1c16; border-color: #efb1ad; background: #fff0ef; }
.mono, code, pre { font-family: "Cascadia Mono", Consolas, monospace; }
.break { overflow-wrap: anywhere; word-break: break-all; }
pre { max-height: 520px; overflow: auto; padding: 14px; border-radius: 5px; color: #dfe8ec; background: #1f2b33; white-space: pre-wrap; }
.prose { white-space: pre-wrap; }
.muted { color: var(--muted); }
.file-field small { color: var(--muted); font-weight: 400; }
nav[role="navigation"] { margin-top: 16px; }
nav[role="navigation"] > div:first-child { display: none; }
nav[role="navigation"] > div:last-child { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); }
nav[role="navigation"] svg { width: 18px; }
nav[role="navigation"] span[aria-current="page"] span, nav[role="navigation"] a { display: inline-flex; padding: 6px 10px; border: 1px solid var(--line); background: #fff; }
.login-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: #eef2f4; }
.login-panel { width: min(420px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 18px 55px rgba(23, 32, 42, .1); }
.login-brand { color: var(--ink); }
.login-panel h1 { margin: 30px 0 2px; font-size: 23px; }
.form-stack { display: grid; gap: 16px; margin-top: 22px; }
@media (max-width: 1000px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
    .split-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; width: 100%; height: auto; }
    .sidebar nav { grid-template-columns: repeat(3, 1fr); margin-top: 18px; }
    .sidebar-foot { display: none; }
    .main { padding: 22px 16px 40px; }
    .topbar, .secret-box { align-items: stretch; flex-direction: column; }
    .form-grid, .detail-grid, .module-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
