:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --line: #dce3e8;
  --line-strong: #cbd5dc;
  --text: #263238;
  --muted: #718096;
  --accent: #3498db;
  --accent-hover: #2980b9;
  --green: #27ae60;
  --red: #e74c3c;
  --radius: 7px;
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 238px; padding: 25px 16px 18px; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 5; }
.brand, .login-brand { display: flex; align-items: center; gap: 11px; padding: 0 9px 30px; }
.brand strong, .login-brand strong { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.3px; }
.brand small, .login-brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: #3498db; border-radius: 6px; }
.brand-mark svg { width: 22px; fill: none; stroke: white; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.side-label, .eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 1.3px; color: #82909c; }
.side-label { padding: 0 11px 10px; }
.navigation { display: grid; gap: 4px; }
.nav-item { border: 0; background: transparent; color: #58666f; display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 11px; border-radius: 5px; text-align: left; font-size: 13px; }
.nav-item:hover { background: #f1f5f7; color: var(--text); }
.nav-item.active { background: #e8f4fb; color: #2476a8; font-weight: 600; box-shadow: inset 3px 0 #3498db; }
.nav-icon { font-size: 16px; width: 18px; text-align: center; color: #81909a; }
.nav-count { margin-left: auto; color: #63717a; background: #e9eef1; border-radius: 4px; padding: 1px 7px; font-size: 10px; }
.sidebar-bottom { margin-top: auto; }
.server-state { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-soft); }
.server-state b, .server-state small { display: block; }
.server-state b { font-size: 12px; font-weight: 600; }
.server-state small { font-size: 10px; color: var(--muted); margin-top: 2px; }
.status-dot, .live-dot { display: inline-block; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--green); }
.logout-button { width: 100%; margin-top: 9px; padding: 10px 12px; border: 0; background: transparent; color: #6e7c85; text-align: left; border-radius: 5px; font-size: 12px; }
.logout-button:hover { background: #f1f5f7; color: var(--text); }
.logout-button span { float: right; }
.main-area { margin-left: 238px; min-height: 100vh; padding: 0 38px 24px; max-width: 1800px; }
.topbar { min-height: 70px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #8997a0; font-size: 12px; }
.breadcrumb b { color: var(--text); font-weight: 600; }
.crumb-sep { color: #b3bec5; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.source-shortcut { font-size: 12px; color: #60717b; }
.source-shortcut:hover { color: var(--accent-hover); }
.source-shortcut span { color: var(--accent); margin-right: 5px; }
.primary-button, .secondary-button { border: 1px solid transparent; border-radius: 5px; padding: 9px 14px; color: #fff; background: var(--accent); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .12s ease; }
.primary-button:hover { background: var(--accent-hover); }
.primary-button:disabled { opacity: .6; cursor: wait; }
.primary-button span { font-size: 16px; line-height: 10px; }
.secondary-button { background: #ecf0f1; border-color: #d7dfe4; color: #40515b; }
.secondary-button:hover { background: #e2e8ec; }
.text-button, .subtle-link { border: 0; background: none; color: #2980b9; font-weight: 600; font-size: 11px; }
.text-button span { margin-left: 5px; }
.view { display: none; padding-top: 30px; }
.view.active { display: block; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 22px; }
.page-heading h1 { font-size: 28px; line-height: 1.2; margin: 7px 0 6px; letter-spacing: -.8px; font-weight: 700; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.date-chip { border: 1px solid #cfe8d8; background: #effaf3; color: #27834d; border-radius: 4px; padding: 6px 10px; font-size: 11px; display: flex; align-items: center; gap: 8px; margin-bottom: 3px; white-space: nowrap; }
.live-dot { width: 6px; height: 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat-card { padding: 17px 19px 15px; min-height: 124px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: #687781; font-size: 12px; }
.stat-icon { width: 29px; height: 29px; border-radius: 4px; display: grid; place-items: center; font-size: 16px; }
.stat-icon.purple { color: #7452a6; background: #efe8f7; }
.stat-icon.blue { color: #2476a8; background: #e6f3fa; }
.stat-icon.green { color: #23834d; background: #e6f5eb; }
.stat-number { font-size: 26px; font-weight: 700; letter-spacing: -.7px; margin-top: 8px; }
.stat-foot { font-size: 10px; color: #89969e; margin-top: 1px; }
.content-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(320px,1fr); gap: 14px; }
.panel { padding: 19px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 15px; }
.panel-heading h2, .settings-section-heading h2 { font-size: 15px; margin: 0 0 4px; font-weight: 700; }
.panel-heading p, .settings-section-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.recent-list { display: grid; }
.recent-item { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-top: 1px solid #edf0f2; }
.recent-item:first-child { border-top: 0; padding-top: 1px; }
.app-icon { width: 41px; height: 41px; border-radius: 7px; background: #e7edf1; border: 1px solid #dce3e8; display: grid; place-items: center; overflow: hidden; flex: none; color: #52636e; font-size: 12px; font-weight: 700; }
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.recent-info { min-width: 0; flex: 1; }
.recent-info strong, .recent-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-info strong { font-size: 12px; font-weight: 600; }
.recent-info small { font-size: 10px; color: var(--muted); margin-top: 3px; }
.version-pill { font-size: 10px; color: #237b49; background: #e8f6ed; border: 1px solid #d2ebdc; padding: 3px 7px; border-radius: 4px; white-space: nowrap; }
.empty-state, .loading-line { padding: 28px 5px; text-align: center; color: #82909a; font-size: 12px; }
.source-icon { width: 31px; height: 31px; border-radius: 5px; background: #e7f3fa; color: #287dad; display: grid; place-items: center; font-size: 16px; }
.source-preview { display: flex; align-items: center; gap: 11px; padding: 12px; background: #f6f8f9; border: 1px solid var(--line); border-radius: 5px; margin-bottom: 16px; }
.source-preview-icon { width: 41px; height: 41px; background: #3498db; border-radius: 5px; display: grid; place-items: center; color: white; font-size: 12px; font-weight: 700; }
.source-preview strong, .source-preview small { display: block; }
.source-preview strong { font-size: 12px; }
.source-preview small { font-size: 10px; color: var(--muted); margin-top: 3px; }
.field-label { display: block; font-size: 9px; letter-spacing: 1px; font-weight: 700; color: #82909a; margin-bottom: 6px; }
.copy-field { display: flex; gap: 6px; min-width: 0; }
.copy-field input { min-width: 0; flex: 1; background: #fff; border: 1px solid var(--line-strong); color: #40515b; padding: 9px 10px; border-radius: 4px; font-size: 10px; outline: 0; }
.copy-field input:focus { border-color: var(--accent); }
.icon-button { width: 36px; border: 1px solid var(--line-strong); background: #f4f6f8; color: #52636e; border-radius: 4px; }
.icon-button:hover { background: #e8eef2; }
.source-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.source-actions .secondary-button { padding: 8px 10px; font-size: 10px; }
.subtle-link { color: #667a86; }
.public-changelog-shortcut { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 13px; padding-top: 12px; border-top: 1px solid #edf0f2; font-size: 10px; }
.public-changelog-shortcut span { color: #82909a; }
.public-changelog-shortcut a { color: #2980b9; font-weight: 600; }
.source-note { display: flex; gap: 8px; margin-top: 15px; padding-top: 12px; border-top: 1px solid #edf0f2; color: #73828b; }
.source-note > span { width: 16px; height: 16px; border: 1px solid #bac6ce; border-radius: 50%; display: grid; place-items: center; font-size: 10px; flex: none; }
.source-note p { font-size: 10px; line-height: 1.5; margin: 0; }
.quick-panel { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 15px 18px; }
.quick-symbol { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 1px solid #d0e4f0; border-radius: 5px; background: #eaf5fb; color: #2980b9; font-size: 21px; }
.quick-panel > div:nth-child(2) { flex: 1; }
.quick-panel h3 { font-size: 12px; margin: 0 0 4px; }
.quick-panel p { font-size: 10px; color: #71818b; margin: 0; }
.quick-panel .secondary-button { font-size: 10px; padding: 8px 11px; }
.footer { display: flex; justify-content: space-between; gap: 15px; color: #8b979e; font-size: 10px; padding: 25px 2px 0; }
.footer b { color: #60717b; font-weight: 600; margin-left: 4px; }
.apps-table-panel { padding: 0; overflow: hidden; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.search-wrap { display: flex; align-items: center; gap: 9px; color: #82909a; width: min(320px,70%); }
.search-wrap span { font-size: 19px; }
.search-wrap input { width: 100%; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 12px; }
.muted { color: var(--muted); font-size: 10px; }
.apps-list { padding: 0 17px; }
.app-entry { border-bottom: 1px solid #edf0f2; }
.app-entry:last-child { border-bottom: 0; }
.app-row { display: grid; grid-template-columns: minmax(180px,1.1fr) minmax(130px,.7fr) auto; align-items: center; gap: 14px; padding: 14px 0; }
.app-identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.app-identity-text { min-width: 0; }
.app-identity strong, .app-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-identity strong { font-size: 12px; }
.app-identity small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.app-meta strong, .app-meta small { display: block; }
.app-meta strong { font-size: 11px; font-weight: 600; }
.app-meta small { font-size: 10px; color: var(--muted); margin-top: 3px; }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.small-button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--line-strong); background: #f4f6f8; color: #52636e; padding: 6px 9px; border-radius: 4px; font-size: 10px; white-space: nowrap; }
.small-button:hover { background: #e9eef2; color: #263238; }
.small-button.danger { color: #c0392b; border-color: #efcfcb; background: #fff8f7; }
.small-button.danger:hover { background: #fcecea; }
.version-history { padding: 0 0 9px 52px; }
.version-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 11px; margin-bottom: 6px; background: #f8fafb; border: 1px solid #e4e9ed; border-radius: 5px; }
.version-row-main { min-width: 0; }
.version-row strong, .version-row small { display: block; }
.version-row strong { font-size: 10px; }
.version-row small { font-size: 9px; color: #7c8991; margin-top: 3px; }
.version-row .version-notes { color: #4e6572; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; max-width: 850px; }
.version-row .empty-notes { color: #a1aab0; font-style: italic; }
.build-tag { font-size: 9px; font-weight: 400; color: #7c8991; margin-left: 5px; }
.version-row.empty-version { color: #82909a; font-size: 10px; }
.settings-panel, .api-panel { padding: 21px 23px; }
.settings-section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.settings-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 5px; background: #eaf5fb; color: #2980b9; font-size: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: #53636c; font-size: 11px; font-weight: 600; }
.form-field.full { grid-column: 1 / -1; }
.form-field > span small { color: #8b979e; font-weight: 400; margin-left: 3px; }
.form-field > small { color: #82909a; font-size: 9px; font-weight: 400; }
.form-field input, .form-field textarea, .form-field select { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line-strong); background: #fff; border-radius: 4px; color: var(--text); outline: none; font-size: 12px; font-weight: 400; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px #3498db18; }
.form-field textarea { resize: vertical; line-height: 1.55; }
.color-input { display: flex; align-items: center; gap: 9px; min-height: 36px; }
.color-input input { width: 42px; height: 32px; padding: 3px; }
.color-input span { color: #71818b; font-size: 10px; font-weight: 400; }
.settings-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #edf0f2; }
.api-panel { margin-top: 14px; }
.api-detail { display: flex; align-items: center; gap: 13px; padding: 10px 0; border-top: 1px solid #edf0f2; }
.api-detail code, .api-hint code { color: #2476a8; background: #eaf5fb; border-radius: 3px; padding: 4px 6px; font-size: 10px; }
.api-detail span, .api-hint { color: #7a8991; font-size: 10px; }
.api-hint { margin: 12px 0 0; }
.modal-dialog { width: min(760px,calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--text); }
.modal-dialog::backdrop { background: #1d2a33aa; }
.modal-card { padding: 22px; overflow-y: auto; }
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.modal-heading h2 { font-size: 19px; margin: 5px 0 3px; }
.modal-heading p { color: var(--muted); font-size: 11px; margin: 0; }
.close-button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 4px; background: #f5f7f8; color: #61717a; font-size: 20px; line-height: 1; }
.drop-zone { min-height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 18px; border: 1px dashed #aebec8; border-radius: 5px; background: #f8fafb; color: #4c5d67; text-align: center; cursor: pointer; margin-bottom: 18px; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: #f0f8fc; }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-symbol { width: 30px; height: 30px; display: grid; place-items: center; background: #e5f2f9; color: #2980b9; border-radius: 5px; font-size: 19px; }
.drop-zone strong { font-size: 12px; }
.drop-zone .muted { font-size: 10px; }
.file-selected { font-size: 10px; color: #2980b9; overflow-wrap: anywhere; }
.upload-fields { margin-bottom: 16px; }
.upload-progress { padding: 12px; border: 1px solid var(--line); background: #f8fafb; border-radius: 5px; margin-bottom: 14px; }
.progress-top { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; color: #687781; margin-bottom: 7px; }
.progress-track { height: 7px; border-radius: 3px; background: #e4eaee; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .12s; }
.modal-error { padding: 9px 10px; background: #fff1ef; border: 1px solid #f1d0cb; border-radius: 4px; color: #b33b30; font-size: 11px; margin: 12px 0; }
.modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #edf0f2; padding-top: 16px; margin-top: 16px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.danger-ghost { border: 1px solid #efcfcb; background: #fff8f7; color: #c0392b; border-radius: 4px; padding: 9px 12px; font-size: 11px; }
.toast-container { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 20; }
.toast { max-width: min(420px,calc(100vw - 40px)); padding: 11px 14px; background: #2c3e50; color: white; border-radius: 5px; font-size: 11px; }
.toast.error { background: #c0392b; }
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-wrap { width: min(420px,100%); }
.login-brand { padding: 0 4px 20px; }
.login-card { padding: 27px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.login-card h1 { font-size: 25px; margin: 8px 0 7px; letter-spacing: -.7px; }
.login-card > p { margin: 0 0 21px; color: var(--muted); font-size: 12px; }
.login-card form { display: grid; gap: 15px; }
.block-button { width: 100%; }
.login-error { padding: 9px; background: #fff1ef; border: 1px solid #f1d0cb; border-radius: 4px; color: #b33b30; font-size: 11px; }
.login-foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 15px; border-top: 1px solid #edf0f2; color: #74828b; font-size: 10px; }
@media (max-width: 1100px) {
  .main-area { padding-left: 25px; padding-right: 25px; }
  .content-grid { grid-template-columns: 1fr; }
  .app-row { grid-template-columns: minmax(160px,1fr) minmax(120px,.7fr); }
  .row-actions { grid-column: 1 / -1; justify-content: flex-start; padding-left: 52px; }
}
@media (max-width: 760px) {
  .sidebar { position: static; width: auto; padding: 13px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 5px 12px; }
  .side-label, .sidebar-bottom { display: none; }
  .navigation { display: flex; gap: 4px; overflow-x: auto; }
  .nav-item { width: auto; white-space: nowrap; padding: 8px 10px; }
  .main-area { margin-left: 0; padding: 0 14px 20px; }
  .topbar { align-items: flex-start; flex-direction: column; justify-content: center; padding: 12px 0; gap: 10px; }
  .top-actions { width: 100%; gap: 11px; flex-wrap: wrap; }
  .top-actions .source-shortcut { font-size: 10px; }
  .top-actions .primary-button { margin-left: auto; }
  .view { padding-top: 22px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 25px; }
  .stats-grid { grid-template-columns: 1fr; gap: 9px; }
  .stat-card { min-height: 0; padding: 13px 15px; }
  .stat-number { margin-top: 4px; }
  .quick-panel { align-items: flex-start; flex-wrap: wrap; }
  .quick-panel > div:nth-child(2) { min-width: calc(100% - 55px); }
  .quick-panel .secondary-button { margin-left: 50px; }
  .app-row { grid-template-columns: minmax(0,1fr); gap: 9px; }
  .row-actions { padding-left: 0; }
  .version-history { padding-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .settings-footer, .modal-footer { align-items: stretch; flex-direction: column; }
  .settings-footer .primary-button, .modal-footer .primary-button { width: 100%; }
  .modal-card { padding: 16px; }
  .modal-dialog { width: calc(100vw - 16px); }
}
