body { margin: 0; font-family: "Segoe UI", sans-serif; color: #334155; background: #f3f5f9; }
.shell { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 64px; flex: 0 0 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 16px; background: #fff; border-bottom: 1px solid #e8ebf1; box-sizing: border-box; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: #1e293b; text-decoration: none; }
.brand img { height: 32px; width: 156px; display: block; background: #12324d; border-radius: 6px; }
.brand-name { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.top-user { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.who { font-size: 14px; white-space: nowrap; }
.top-user button { background: transparent; border: 0; color: #334155; cursor: pointer; font-size: 14px; padding: 6px 12px; border-radius: 999px; }
.top-user button:hover { background: #f2f4f8; }
.frame { display: flex; flex: 1; min-height: 0; }
aside { width: 220px; flex: 0 0 220px; background: #fff; border-right: 1px solid #e8ebf1; padding: 8px; box-sizing: border-box; overflow: auto; }
aside a { display: block; margin: 2px 0; padding: 10px 12px; border-radius: 8px; color: #334155; text-decoration: none; }
aside a.with-count { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
aside a:hover { background: #f2f4f8; }
aside a.active { background: #e8f3fb; color: #1d6f9a; font-weight: 600; }
.nav-badge { min-width: 18px; padding: 0 6px; border-radius: 999px; background: #9b1c1c; color: #fff; font-size: 12px; font-weight: 600; line-height: 18px; text-align: center; }
.content { flex: 1; min-width: 0; overflow: auto; display: flex; flex-direction: column; }
main { flex: 1; padding: 12px 16px 8px; }
.content footer { padding: 8px 16px 16px; text-align: center; color: #64748b; font-size: 14px; background: transparent; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 0 16px; }
.metric { background: white; border-radius: 8px; padding: 14px 16px; }
.metric b { display: block; font-size: 24px; line-height: 1.2; }
.metric span { color: #627d98; font-size: 13px; }
.login-page { min-height: 100vh; display: flex; flex-direction: column; background: #12324d; color: #d9e2ec; }
.login-page main { flex: 1; max-width: 420px; margin: 48px auto; width: 100%; }
.login-page footer { padding: 16px; text-align: center; color: #d9e2ec; }
.login-logo { height: 32px; width: 156px; background: #12324d; border-radius: 6px; padding: 6px 8px; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; background: white; border: 1px solid #e6e9f0; border-radius: 10px; padding: 12px 16px; margin: 0 0 12px; }
.filters label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 13px; color: #64748b; }
.filters input, .filters select { width: 200px; }
.filters .actions { display: flex; align-items: center; gap: 8px; }
.filters a { color: #1d6f9a; text-decoration: none; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 12px; color: #64748b; font-size: 14px; }
.pager form { margin: 0; }
.pager label { display: flex; align-items: center; gap: 6px; margin: 0; }
.pager select { width: auto; }
.pager a { color: #1d6f9a; text-decoration: none; }
.pager .current { min-width: 1.5em; font-weight: 600; color: #1e293b; text-align: center; }
.pager .disabled { color: #9fb3c8; }
.empty { text-align: center; color: #627d98; }
table { width: 100%; border-collapse: collapse; background: white; }
.matrix select { width: auto; }
th, td { border-bottom: 1px solid #d9e2ec; padding: 8px; text-align: left; vertical-align: top; }
form.card, .card { background: white; padding: 16px; border-radius: 8px; }
label { display: block; margin: 10px 0 4px; }
input, select, textarea { width: 100%; box-sizing: border-box; padding: 8px; }
button.primary { background: #1d6f9a; color: white; border: 0; padding: 8px 14px; border-radius: 4px; cursor: pointer; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-head h1 { margin: 0 0 16px; }
dialog { border: 0; border-radius: 8px; padding: 0; width: min(420px, calc(100% - 32px)); }
dialog#connections { width: min(760px, calc(100% - 32px)); }
.conn-tree, .conn-tree ul { list-style: none; margin: 0; padding-left: 18px; }
.conn-tree { padding-left: 0; max-height: 420px; overflow: auto; }
.conn-tree li { margin: 2px 0; }
.conn-group.collapsed > ul { display: none; }
.conn-group.conn-hidden, .conn-source.conn-hidden { display: none; }
.conn-toggle { display: flex; align-items: center; gap: 6px; width: auto; background: transparent; border: 0; padding: 4px 0; cursor: pointer; font: inherit; font-weight: 600; color: inherit; text-align: left; }
.conn-caret { width: 1em; color: #64748b; }
.conn-group .conn-caret::before { content: "▾"; }
.conn-group.collapsed .conn-caret::before { content: "▸"; }
.conn-count { color: #64748b; font-weight: 400; font-size: 12px; }
.conn-source > span:first-child::before { content: "• "; color: #94a3b8; }
.conn-meta { margin-left: 8px; color: #64748b; font-size: 13px; font-weight: 400; }
.conn-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.conn-tools input { width: 200px; }
.conn-tools button { width: auto; background: white; border: 1px solid #9fb3c8; padding: 6px 10px; border-radius: 4px; cursor: pointer; }
dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
dialog h2 { margin: 0 0 8px; font-size: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.dialog-actions button { width: auto; background: white; border: 1px solid #9fb3c8; padding: 8px 14px; border-radius: 4px; cursor: pointer; }
.dialog-actions button.primary { background: #1d6f9a; color: white; border-color: #1d6f9a; }
button.link { background: transparent; border: 0; color: #1d6f9a; cursor: pointer; padding: 0; }
.danger { color: #9b1c1c; }
.notice { margin: 0 0 12px; }
.pick { width: 36px; }
.pick input { width: auto; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.bulk input { width: 240px; }
.bulk button { width: auto; background: white; border: 1px solid #9fb3c8; padding: 8px 14px; border-radius: 4px; cursor: pointer; }
.bulk button.primary { background: #1d6f9a; color: white; border-color: #1d6f9a; }
.pending { color: #64748b; }
pre { white-space: pre-wrap; background: #102a43; color: #f0f4f8; padding: 12px; }
