:root {
  --hub-bg: #f4f6f9;
  --hub-card: #fff;
  --hub-ink: #1a2b3c;
  --hub-muted: #5c6b7a;
  --hub-line: #dde4ec;
  --hub-accent: #58bf25;
  --hub-accent-dark: #3d8f18;
  --hub-sidebar-w: 220px;
  --hub-topbar-h: 56px;
}

* { box-sizing: border-box; }
body.hub-body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--hub-bg); color: var(--hub-ink); }
.hub-app { display: flex; min-height: 100vh; }
.hub-sidebar { width: var(--hub-sidebar-w); background: #1a2b3c; color: #fff; flex-shrink: 0; display: flex; flex-direction: column; }
.hub-brand { padding: 1rem; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,.1); }
.hub-brand a { color: #fff; text-decoration: none; }
.hub-nav { padding: .5rem 0; flex: 1; overflow-y: auto; }
.hub-nav-link { display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem; color: rgba(255,255,255,.85); text-decoration: none; font-size: .9rem; }
.hub-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.hub-nav-link.is-active { background: var(--hub-accent); color: #fff; }
.hub-nav-icon { opacity: .8; width: 1.2rem; text-align: center; }
.hub-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hub-topbar { height: var(--hub-topbar-h); background: var(--hub-card); border-bottom: 1px solid var(--hub-line); display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem; position: sticky; top: 0; z-index: 10; }
.hub-menu-btn { display: none; background: none; border: 1px solid var(--hub-line); border-radius: 6px; padding: .35rem .6rem; cursor: pointer; }
.hub-page-title { font-size: 1.1rem; margin: 0; flex: 1; }
.hub-topbar-actions { display: flex; align-items: center; gap: .75rem; font-size: .875rem; }
.hub-badge { background: var(--hub-accent); color: #fff; font-size: .65rem; padding: 2px 6px; border-radius: 4px; margin-left: 4px; }
.hub-link-btn { background: none; border: none; color: var(--hub-muted); cursor: pointer; text-decoration: underline; font-size: inherit; }
.hub-content { padding: 1.25rem; flex: 1; }
.hub-card { background: var(--hub-card); border: 1px solid var(--hub-line); border-radius: 10px; padding: 1.25rem; margin-bottom: 1rem; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.hub-tile { background: var(--hub-card); border: 1px solid var(--hub-line); border-radius: 10px; padding: 1.25rem; text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
.hub-tile:hover { border-color: var(--hub-accent); box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.hub-tile h3 { margin: 0 0 .35rem; font-size: 1rem; }
.hub-tile p { margin: 0; color: var(--hub-muted); font-size: .85rem; }
.hub-section-tabs { display: flex; gap: .25rem; overflow-x: auto; margin-bottom: 1rem; border-bottom: 1px solid var(--hub-line); padding-bottom: 0; }
.hub-section-tab { padding: .5rem 1rem; text-decoration: none; color: var(--hub-muted); font-size: .875rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.hub-section-tab.is-active { color: var(--hub-accent-dark); border-bottom-color: var(--hub-accent); font-weight: 600; }
.hub-notify-btn { position: relative; background: none; border: none; font-size: 1.1rem; cursor: pointer; }
.hub-notify-badge { position: absolute; top: -4px; right: -6px; background: #e53e3e; color: #fff; font-size: .65rem; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.hub-notify-panel { position: absolute; right: 1rem; top: calc(var(--hub-topbar-h) + 4px); width: 320px; max-height: 400px; overflow-y: auto; background: var(--hub-card); border: 1px solid var(--hub-line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 20; padding: .5rem; }
.hub-notify-item { padding: .6rem; border-bottom: 1px solid var(--hub-line); font-size: .85rem; }
.hub-notify-item a { color: var(--hub-ink); text-decoration: none; }
.hub-notify-item.unread { background: #f0f9eb; }
.hub-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.hub-login-box { background: var(--hub-card); border: 1px solid var(--hub-line); border-radius: 12px; padding: 2rem; width: 100%; max-width: 400px; }
.hub-login-box h1 { margin: 0 0 1.5rem; font-size: 1.35rem; }
.hub-field { margin-bottom: 1rem; }
.hub-field label { display: block; font-size: .85rem; margin-bottom: .35rem; color: var(--hub-muted); }
.hub-field input, .hub-field select, .hub-field textarea { width: 100%; padding: .55rem .75rem; border: 1px solid var(--hub-line); border-radius: 6px; font-size: 1rem; }
.hub-btn { display: inline-block; padding: .55rem 1.1rem; background: var(--hub-accent); color: #fff; border: none; border-radius: 6px; font-size: .9rem; cursor: pointer; text-decoration: none; }
.hub-btn:hover { background: var(--hub-accent-dark); }
.hub-btn-secondary { background: #e8edf2; color: var(--hub-ink); }
.hub-alert-error { background: #fde8e8; color: #9b1c1c; padding: .75rem; border-radius: 6px; margin-bottom: 1rem; font-size: .875rem; }
.hub-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.hub-table th, .hub-table td { padding: .5rem .75rem; border-bottom: 1px solid var(--hub-line); text-align: left; }
.hub-chat-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; min-height: 60vh; }
.hub-chat-threads { border: 1px solid var(--hub-line); border-radius: 8px; overflow-y: auto; background: var(--hub-card); }
.hub-chat-main { display: flex; flex-direction: column; border: 1px solid var(--hub-line); border-radius: 8px; background: var(--hub-card); min-height: 60vh; }
.hub-chat-messages { flex: 1; overflow-y: auto; padding: 1rem; }
.hub-chat-msg { margin-bottom: 1rem; max-width: 85%; }
.hub-chat-msg.user { margin-left: auto; background: #e8f1fc; padding: .75rem; border-radius: 10px; }
.hub-chat-msg.assistant { background: #f4f6f9; padding: .75rem; border-radius: 10px; }
.hub-chat-input-row { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--hub-line); }
.hub-chat-input-row textarea { flex: 1; min-height: 44px; resize: vertical; }
.hub-split { display: grid; grid-template-columns: 1fr 340px; gap: 1rem; }
@media (max-width: 900px) {
  .hub-sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; transform: translateX(-100%); transition: transform .2s; }
  .hub-sidebar.is-open { transform: translateX(0); }
  .hub-menu-btn { display: block; }
  .hub-chat-layout, .hub-split { grid-template-columns: 1fr; }
}
