:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #091017;
  color: #e9f0f6;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top left, #153047 0, #091017 42%); }
header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 2rem clamp(1rem, 4vw, 4rem); border-bottom: 1px solid #233646; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -0.045em; }
h2 { margin-bottom: 0; font-size: 1.55rem; }
h3 { margin-top: 1.4rem; margin-bottom: .45rem; font-size: .85rem; color: #9fb0bf; text-transform: uppercase; letter-spacing: .08em; }
.eyebrow { color: #5eead4; font-weight: 800; font-size: .72rem; letter-spacing: .22em; margin-bottom: .45rem; }
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem; }
.layout { padding: 2rem clamp(1rem, 4vw, 4rem) 4rem; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(340px, .8fr); gap: 1.4rem; }
.panel, .login-card { background: rgba(13, 25, 35, .92); border: 1px solid #294052; border-radius: 16px; box-shadow: 0 24px 80px rgba(0,0,0,.24); padding: 1.4rem; }
.clients-panel, .recovery-panel, .command-panel { grid-column: 1 / -1; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.status { color: #9fb0bf; min-height: 1.4em; }
.error { color: #fda4af !important; }
.client-tools { display: grid; grid-template-columns: minmax(280px, 2fr) repeat(3, minmax(150px, 1fr)); gap: .75rem; align-items: end; margin-bottom: .75rem; }
.client-tools label { margin-top: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 1420px; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; color: #91a4b4; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
th, td { padding: .8rem .65rem; border-bottom: 1px solid #213443; vertical-align: top; }
tbody tr:hover { background: rgba(39, 63, 80, .18); }
.badge { display: inline-flex; padding: .25rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 750; }
.pending { background: #3f3215; color: #fde68a; }
.approved, .connected { background: #12392f; color: #99f6e4; }
.rejected, .offline { background: #3b1d26; color: #fecdd3; }
.upgrade-state { background: #172f46; color: #bae6fd; }
.tag { background: #233247; color: #c7d2fe; }
.tag-list, .state-badges { display: flex; flex-wrap: wrap; gap: .35rem; }
.client-name, .organization-name { color: #f4f8fb; font-weight: 800; }
.muted { margin-top: .25rem; color: #8fa4b5; font-size: .78rem; line-height: 1.35; }
.monospace { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; overflow-wrap: anywhere; }
.notes-preview { max-width: 16rem; margin-top: .55rem; color: #b9c7d2; font-size: .78rem; line-height: 1.35; white-space: pre-line; }
.fingerprint { max-width: 12rem; }
.inline-error { max-width: 22rem; margin-top: .4rem; color: #fda4af; font-size: .75rem; line-height: 1.3; }
.button-group { display: flex; flex-wrap: wrap; gap: .4rem; min-width: 10rem; }
.button-group button { padding: .5rem .65rem; font-size: .76rem; }
.action-note { flex-basis: 100%; color: #8fa4b5; font-size: .72rem; line-height: 1.3; }
.empty-state { padding: 2rem; color: #9fb0bf; text-align: center; }
label { display: block; margin: .8rem 0 .4rem; color: #b9c7d2; font-size: .82rem; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #365166; background: #08121a; color: #f0f7fb; border-radius: 9px; padding: .72rem .8rem; font: inherit; }
textarea, pre { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
button, a.secondary { border: 0; border-radius: 9px; padding: .7rem 1rem; background: #2dd4bf; color: #05221d; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; }
button.secondary, a.secondary { background: #152a39; color: #dbe8f1; border: 1px solid #345064; }
button.compact { padding: .5rem .7rem; }
button:disabled { opacity: .45; cursor: not-allowed; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-wide { grid-column: 1 / -1; }
.field-help { margin: .35rem 0 0; color: #8297a8; font-size: .75rem; }
.metadata-dialog { width: min(680px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); overflow: auto; border: 1px solid #365166; border-radius: 16px; padding: 0; background: #0d1923; color: #e9f0f6; box-shadow: 0 30px 100px rgba(0, 0, 0, .65); font: inherit; }
.metadata-dialog::backdrop { background: rgba(2, 8, 13, .78); backdrop-filter: blur(3px); }
.metadata-dialog form { padding: 1.4rem; }
.metadata-dialog > .dialog-heading, .metadata-dialog > p, .metadata-dialog > pre, .metadata-dialog > button { margin-left: 1.4rem; margin-right: 1.4rem; }
.metadata-dialog > .dialog-heading { margin-top: 1.4rem; }
.metadata-dialog > button { margin-bottom: 1.4rem; }
.recovery-password { min-height: auto; font-size: 1.1rem; letter-spacing: .06em; user-select: all; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: .5rem; }
#run-command { margin-top: .85rem; }
pre { min-height: 5rem; max-height: 16rem; overflow: auto; white-space: pre-wrap; background: #050b10; border: 1px solid #203543; border-radius: 9px; padding: .85rem; color: #d8f3ea; }
.result-meta { color: #7dd3fc; font-size: .85rem; min-height: 1.3rem; }
.login-page { display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(100%, 440px); }
.login-card button { width: 100%; margin-top: 1rem; }
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } .client-tools { grid-template-columns: 1fr 1fr; } header { align-items: flex-start; flex-direction: column; } .header-actions { justify-content: flex-start; } }
@media (max-width: 600px) { .client-tools, .form-grid { grid-template-columns: 1fr; } .form-wide { grid-column: auto; } }