/* Product UI polish: shared control rhythm, restrained surfaces, and responsive shells. */
:root {
  --tool-page: #f4f6fa;
  --tool-surface: #ffffff;
  --tool-surface-soft: #f8f9fc;
  --tool-surface-strong: #172238;
  --tool-border: #dfe4ed;
  --tool-border-strong: #cfd7e6;
  --tool-text: #202b42;
  --tool-muted: #718097;
  --tool-blue: #315bfb;
  --tool-blue-soft: #edf2ff;
  --tool-radius: 12px;
  --tool-radius-sm: 9px;
  --tool-shadow: 0 1px 2px rgba(24, 37, 61, .035), 0 8px 26px rgba(24, 37, 61, .035);
}

html[data-theme="dark"] {
  --tool-page: #151515;
  --tool-surface: #1c1c1c;
  --tool-surface-soft: #242424;
  --tool-surface-strong: #2a2a2a;
  --tool-border: #333333;
  --tool-border-strong: #454545;
  --tool-text: #f3f4f6;
  --tool-muted: #a3a3a3;
  --tool-blue: #5f7cf6;
  --tool-blue-soft: #1b2440;
  --tool-shadow: 0 1px 2px rgba(0, 0, 0, .14), 0 12px 30px rgba(0, 0, 0, .12);
}

body { text-rendering: optimizeLegibility; }
button, input, select, textarea { accent-color: var(--tool-blue); }
.button, .secondary-button, .danger-button { min-height: 40px; border-radius: var(--tool-radius-sm); }
input:not([type="checkbox"]):not([type="radio"]), select { min-height: 40px; }

/* Authentication: keep brand, theme, and locale on one shared header baseline. */
.auth-header {
  width: min(1120px, calc(100% - 48px));
  min-height: 48px;
  margin: 22px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.auth-header .auth-brand { margin: 0; flex: 0 0 auto; }
.auth-header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.auth-header-actions .vm-theme-toggle,
.auth-header-actions .vm-language-switcher {
  position: static !important;
  inset: auto !important;
  margin: 0 !important;
}
.auth-header-actions .vm-theme-toggle { order: 1; width: 40px; height: 40px; border-radius: 10px; box-shadow: none; }
.auth-header-actions .vm-language-switcher {
  order: 2;
  min-height: 40px;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--tool-border);
  border-radius: 10px;
  background: var(--tool-surface);
  box-shadow: none;
  backdrop-filter: none;
}
.auth-header-actions .vm-language-icon { width: 30px; height: 30px; padding: 7px; border: 0; background: transparent; }
.auth-header-actions .vm-language-switcher select { width: 108px; min-width: 108px; height: 32px; min-height: 32px; padding: 0 25px 0 9px; border: 0; border-radius: 7px; background: transparent; box-shadow: none; }

/* Landing: application-like controls without wrapping cards in extra decoration. */
.landing-page .header { height: 96px; position: relative; }
.landing-page .header-actions { gap: 10px; }
.landing-page .header-actions .vm-language-switcher { margin: 0; }
.landing-page .header-actions .vm-language-icon,
.landing-page .header-actions .vm-theme-toggle { width: 38px; height: 38px; border-radius: 9px; box-shadow: none; }
.landing-page .header-actions .vm-language-switcher select { min-width: 104px; height: 38px; padding-block: 0; border-radius: 9px; }
.landing-page .login-link { padding: 10px 7px; }
.landing-page .nav-cta { min-height: 40px; padding-block: 0; border-radius: 9px; }
.landing-page .hero-connect .connect-way-card { border-color: var(--tool-border); border-radius: var(--tool-radius); box-shadow: var(--tool-shadow); }
.landing-page .hero-connect .connect-service-button,
.landing-page .hero-connect .connect-skill-button { min-height: 44px; border-radius: 8px; }
.landing-page .hero-connect .connect-service-button:focus-visible,
.landing-page .hero-connect .connect-skill-button:focus-visible { outline-offset: 3px; }
.landing-page .feature,
.landing-page .playground,
.landing-page .start-card,
.landing-page .agent-support-card { border-color: var(--tool-border); box-shadow: var(--tool-shadow); }

/* Console shell. */
.console-page {
  --sidebar-width: 260px;
  --console-border: var(--tool-border);
  --console-shadow: var(--tool-shadow);
  background: var(--tool-page);
}
.sidebar { padding: 20px 14px 15px; border-color: var(--tool-border); background: var(--tool-surface); box-shadow: none; }
.sidebar-brand-row { min-height: 38px; padding: 0 7px 18px; }
.sidebar .brand { font-size: 20px; }
.plan-badge { border-color: var(--tool-border); background: var(--tool-surface-soft); }
.workspace { min-height: 58px; margin-bottom: 22px; border-color: var(--tool-border); border-radius: 10px; background: var(--tool-surface-soft); box-shadow: none; }
.sidebar nav { gap: 3px; }
.sidebar-label { margin-bottom: 7px; }
.sidebar-label-spaced { margin-top: 19px; }
.sidebar nav button { height: 42px; border-radius: 8px; }
.sidebar nav button[aria-current="page"] { box-shadow: none; }
.sidebar-help-card { border-color: var(--tool-border); border-radius: 10px; background: var(--tool-surface-soft); }
.account-popover { border-color: var(--tool-border); background: var(--tool-surface); box-shadow: 0 18px 48px rgba(24, 37, 61, .14); }

.console-header { height: 64px; padding: 0 30px; border-color: var(--tool-border); background: color-mix(in srgb, var(--tool-surface) 92%, transparent); }
.breadcrumb { min-width: 190px; }
.topbar-search { height: 38px; border-color: var(--tool-border); border-radius: 9px; background: var(--tool-surface-soft); }
.topbar-actions { min-width: 228px; gap: 13px; }
.console-header .vm-language-switcher select { height: 36px; min-height: 36px; border-radius: 8px; }
.console-header .vm-language-icon,
.console-header .vm-theme-toggle,
.topbar-avatar,
.topbar-avatar span { width: 34px; height: 34px; }

#console-main { max-width: 1560px; padding: 32px 36px 64px; }
.console-page-heading { margin-bottom: 25px; }
.console-page-heading h1 { font-size: 28px; }
.console-page-heading .button { min-height: 40px; box-shadow: 0 5px 14px rgba(49, 91, 251, .12); }
.console-panel,
.stat-card,
.security-card,
.security-note { border-color: var(--tool-border); border-radius: var(--tool-radius); background: var(--tool-surface); box-shadow: var(--tool-shadow); }
.stat-card { min-height: 132px; padding: 19px; }
.stat-card:hover { transform: none; border-color: var(--tool-border-strong); box-shadow: var(--tool-shadow); }
.stat-card-icon { border-radius: 9px; background: var(--tool-blue-soft); color: var(--tool-blue); }
.stat-card strong { margin-top: 15px; font-size: 28px; }
.dashboard-grid { gap: 16px; }
.panel-heading { min-height: 68px; padding: 17px 20px; }
.records-table th { padding: 12px 20px; }
.records-table td { padding: 16px 20px; }
.records-table tbody tr:hover { background: var(--tool-surface-soft); }
.record-title { min-height: 32px; padding: 4px 0; }
.row-actions button, .row-actions a { min-height: 34px; display: inline-flex; align-items: center; padding: 0 7px; }
.tag { border-radius: 5px; }

.dashboard-guide { min-height: 56px; margin-bottom: 16px; padding: 10px 14px; border-color: #2e3c54; border-radius: 10px; background: #172238; box-shadow: none; }
.dashboard-guide-copy { gap: 11px; }
.dashboard-guide-actions { flex-wrap: nowrap; }
.dashboard-guide-actions button { min-height: 34px; border-radius: 7px; white-space: nowrap; }
.storage-usage-card { min-height: 98px; margin-bottom: 16px; padding: 17px 20px; border-color: #2d3b54; border-radius: 11px; box-shadow: none; }
.storage-usage-icon { width: 42px; height: 42px; border-radius: 10px; }
.storage-usage-main strong { font-size: 25px; }

.install-prompt-card,
.mcp-connect-card { border-color: color-mix(in srgb, var(--tool-blue) 28%, var(--tool-border)); border-radius: var(--tool-radius); background: var(--tool-surface); box-shadow: var(--tool-shadow); }
.install-prompt-card>.button,
.mcp-connect-actions .button { min-height: 42px; border-radius: 8px; }
.mcp-connect-actions .button.primary { color: #fff; }
.mcp-connect-actions .button:not(.primary) { border: 1px solid var(--tool-border); background: var(--tool-surface-soft); color: var(--tool-text); box-shadow: none; }
.mcp-connect-actions .button:not(.primary):hover { border-color: var(--tool-border-strong); background: var(--tool-surface-strong); color: var(--tool-text); transform: none; }
.agent-catalog > span { border-color: var(--tool-border); border-radius: 9px; background: var(--tool-surface); box-shadow: none; }
.security-details > div,
.request-detail-section,
.request-detail-result { border-color: var(--tool-border); background: var(--tool-surface-soft); }

.ui-modal { border-color: var(--tool-border); border-radius: 14px; background: var(--tool-surface); box-shadow: 0 30px 90px rgba(18, 29, 50, .26); }
.ui-modal > form, .ui-modal > .ui-modal-shell { padding: 27px 28px; }
.ui-icon-button { border-radius: 9px; }
.dialog-actions .button,
.dialog-actions .secondary-button { min-height: 38px; padding: 0 14px; }

#console-main.is-graph-view { height: calc(100dvh - 64px); }
.relationship-graph-meta { bottom: 14px; left: 14px; min-height: 38px; border-color: var(--tool-border); border-radius: 9px; background: color-mix(in srgb, var(--tool-surface) 90%, transparent); font-size: 10px; }
.relationship-graph-controls { right: 14px; bottom: 14px; border-color: var(--tool-border); border-radius: 9px; background: color-mix(in srgb, var(--tool-surface) 94%, transparent); }
.relationship-graph-controls button { width: 40px; height: 38px; color: var(--tool-muted); }

/* Admin: the same shell and control system as the user console. */
.admin-page { min-width: 0; background: var(--tool-page); color: var(--tool-text); }
.admin-header { height: 64px; padding: 0 clamp(20px, 3vw, 48px); border-color: var(--tool-border); background: var(--tool-surface); }
.admin-header nav { gap: 6px; }
.admin-header nav a,
.admin-header nav button { min-height: 36px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 8px; }
.admin-header .vm-language-switcher select { height: 36px; min-height: 36px; border-radius: 8px; }
.admin-main { max-width: 1520px; padding: 34px clamp(20px, 3vw, 48px) 70px; }
.admin-heading { margin-bottom: 24px; }
.admin-identity,
.admin-panel,
.admin-stats button { border-color: var(--tool-border); background: var(--tool-surface); box-shadow: var(--tool-shadow); }
.admin-identity { border-radius: 10px; }
.admin-stats { gap: 10px; }
.admin-stats button { min-height: 104px; border-radius: 10px; }
.admin-stats button:hover,
.admin-stats button.selected { box-shadow: var(--tool-shadow); }
.admin-panel { border-radius: var(--tool-radius); }
.admin-toolbar { min-height: 78px; padding: 18px 20px; border-color: var(--tool-border); }
.admin-filters select,
.admin-filters input,
.admin-filters > button,
.admin-operators-panel > .admin-toolbar > button { height: 38px; min-height: 38px; border-color: var(--tool-border); border-radius: 8px; background: var(--tool-surface-soft); }
.admin-table th { padding: 12px 15px; background: var(--tool-surface-soft); }
.admin-table td { padding: 15px; }
.admin-edit,
.admin-pager button { min-height: 34px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 7px; }
.admin-operator-list { gap: 10px; padding: 16px 20px 20px; }
.admin-operator-card { border-color: var(--tool-border); border-radius: 10px; background: var(--tool-surface-soft); }
.admin-operator-card > button { min-height: 36px; padding: 0 11px; }

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .console-header,
html[data-theme="dark"] .console-panel,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .security-card,
html[data-theme="dark"] .security-note,
html[data-theme="dark"] .install-prompt-card,
html[data-theme="dark"] .mcp-connect-card,
html[data-theme="dark"] .agent-catalog > span,
html[data-theme="dark"] .admin-header,
html[data-theme="dark"] .admin-panel,
html[data-theme="dark"] .admin-identity,
html[data-theme="dark"] .admin-stats button { background: var(--tool-surface); border-color: var(--tool-border); }
html[data-theme="dark"] .workspace,
html[data-theme="dark"] .sidebar-help-card,
html[data-theme="dark"] .topbar-search,
html[data-theme="dark"] .admin-filters select,
html[data-theme="dark"] .admin-filters input,
html[data-theme="dark"] .admin-filters > button,
html[data-theme="dark"] .admin-operator-card { background: var(--tool-surface-soft); border-color: var(--tool-border); }
html[data-theme="dark"] .dashboard-guide { background: var(--tool-blue-soft); border-color: color-mix(in srgb,var(--tool-blue) 30%,var(--tool-border)); }
html[data-theme="dark"] .storage-usage-card { background: var(--tool-surface); }
html[data-theme="dark"] .console-status-list > div,
html[data-theme="dark"] .dashboard-status-agents { border-color: var(--tool-border); }
html[data-theme="dark"] .console-status-list span { color: var(--tool-muted); }
html[data-theme="dark"] .console-status-list strong { color: var(--tool-text); }

@media (max-width: 900px) {
  .landing-page .header nav { display: none; }
  .landing-page .header-actions .vm-language-switcher,
  .landing-page .header-actions .vm-theme-toggle { position: static; inset: auto; margin: 0; box-shadow: none; }
  .landing-page .header-actions .vm-language-switcher { padding: 0; border: 0; background: transparent; backdrop-filter: none; }
}

@media (max-width: 820px) {
  .console-page { --sidebar-width: 268px; }
  .console-header { height: 60px; padding-inline: 16px; }
  .breadcrumb { min-width: 0; flex: 1; }
  .topbar-actions { min-width: 0; }
  #console-main { padding: 27px 20px 54px; }
  #console-main.is-graph-view { height: calc(100dvh - 60px); padding: 0; }
  .dashboard-guide { align-items: center; flex-direction: row; }
  .dashboard-guide-actions { justify-content: flex-end; overflow-x: auto; scrollbar-width: none; }
  .dashboard-guide-actions::-webkit-scrollbar { display: none; }
}

@media (max-width: 640px) {
  .admin-header { height: auto; min-height: 108px; align-content: center; flex-wrap: wrap; gap: 8px; padding: 11px 15px; }
  .admin-header .brand { min-height: 36px; }
  .admin-header nav { width: 100%; display: flex; gap: 5px; }
  .admin-header nav .vm-language-switcher { flex: 1; }
  .admin-header nav .vm-language-icon { display: none; }
  .admin-header nav .vm-language-switcher select { width: 100%; }
  .admin-header nav a,
  .admin-header nav button { justify-content: center; min-height: 36px; padding-inline: 9px; white-space: nowrap; }
  .admin-header nav a:nth-of-type(2) { display: none; }
  .admin-main { width: 100%; padding: 24px 15px 48px; overflow: hidden; }
  .admin-heading { gap: 19px; }
  .admin-heading h1 { font-size: 27px; }
  .admin-stats { gap: 9px; }
  .admin-toolbar { min-height: 0; padding: 17px; }
  .admin-operator-list { padding: 13px; }
}

@media (max-width: 520px) {
  .auth-header { width: calc(100% - 40px); min-height: 40px; margin-top: 18px; gap: 10px; }
  .auth-header .auth-brand { gap: 8px; font-size: 20px; }
  .auth-header .auth-brand img { width: 30px; height: 30px; }
  .auth-header-actions { gap: 6px; }
  .auth-header-actions .vm-theme-toggle { width: 36px; height: 36px; border-radius: 9px; }
  .auth-header-actions .vm-language-switcher { min-height: 36px; padding: 3px; }
  .auth-header-actions .vm-language-icon { display: none; }
  .auth-header-actions .vm-language-switcher select { width: 92px; min-width: 92px; height: 30px; min-height: 30px; padding-left: 8px; }
  .auth-page .auth-layout { margin-top: 28px; }

  .landing-page .header { gap: 8px; }
  .landing-page .brand { gap: 7px; font-size: 18px; }
  .landing-page .brand svg { width: 24px; }
  .landing-page .header-actions { gap: 5px; margin-left: auto; }
  .landing-page .header-actions .login-link { display: none; }
  .landing-page .header-actions .vm-language-icon { display: none; }
  .landing-page .header-actions .vm-language-switcher select { width: 70px; min-width: 70px; height: 36px; min-height: 36px; padding: 0 20px 0 7px; }
  .landing-page .header-actions .vm-theme-toggle { width: 34px; height: 36px; }
  .landing-page .header-actions .nav-cta { min-height: 36px; padding: 0 9px; }
  .landing-page .hero { padding-top: 36px; }

  .console-header { gap: 8px; padding-inline: 12px; }
  .breadcrumb { flex: 1; }
  .topbar-search { width: 40px; max-width: 40px; height: 38px; flex-basis: 40px; }
  .topbar-actions { gap: 3px; }
  .console-header .vm-language-switcher select { width: 82px; min-width: 82px; max-width: 82px; }
  .console-header .vm-theme-toggle,
  .topbar-avatar,
  .topbar-avatar span { width: 32px; height: 32px; }
  .console-page-heading { margin-bottom: 24px; }
  .console-page-heading .button { width: auto; margin-top: 14px; }
  .dashboard-guide { position: relative; display: block; padding: 13px; }
  .dashboard-guide-copy { justify-content: flex-start; padding-right: 94px; }
  .dashboard-guide-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 11px; overflow: visible; }
  .dashboard-guide-actions button { width: 100%; min-width: 0; padding-inline: 7px; font-size: 10px; }
  .dashboard-guide-actions .dashboard-guide-dismiss { position: absolute; top: 7px; right: 7px; width: 30px; height: 30px; margin: 0; padding: 0; border-color: transparent; background: transparent; font-size: 0; }
  .dashboard-guide-actions .dashboard-guide-dismiss svg { width: 14px; height: 14px; }
  .stats-grid { gap: 10px; }
  .stat-card { min-height: 124px; padding: 16px; }
  .storage-usage-card { padding: 17px; }
  .records-table th,
  .records-table td { padding-inline: 14px; }
  .ui-modal > form,
  .ui-modal > .ui-modal-shell { padding: 22px 20px; }
}

@media (max-width: 380px) {
  .auth-header { width: calc(100% - 32px); gap: 7px; }
  .auth-header .auth-brand { font-size: 18px; }
  .auth-header .auth-brand img { width: 28px; height: 28px; }
  .auth-header-actions .vm-language-switcher select { width: 80px; min-width: 80px; }
  .auth-header-actions .vm-theme-toggle { width: 34px; }

  .landing-page .brand { font-size: 17px; }
  .landing-page .brand svg { width: 22px; }
  .landing-page .header-actions .vm-language-switcher select { width: 56px; min-width: 56px; }
  .landing-page .header-actions .vm-theme-toggle { width: 32px; }
  .landing-page .header-actions .nav-cta { padding-inline: 7px; font-size: 9px; }
  .console-header .topbar-avatar { display: none; }
}

/* Tablet and mobile admin tables become readable cards instead of clipped canvases. */
.admin-page { font-family: var(--sans); }
@media (max-width: 820px) {
  .admin-table-scroll { overflow: visible; }
  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td { display: block; width: 100%; min-width: 0; }
  .admin-table thead { display: none; }
  .admin-table tbody { padding: 10px; }
  .admin-table tr { margin-bottom: 10px; padding: 4px 13px; border: 1px solid var(--tool-border); border-radius: 11px; background: var(--tool-surface); box-shadow: var(--tool-shadow); }
  .admin-table tr:last-child { margin-bottom: 0; }
  .admin-table td,
  .admin-table td:first-child,
  .admin-table td:nth-child(5) { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: start; gap: 10px; width: auto; padding: 10px 0; border-bottom: 1px solid var(--tool-border); overflow-wrap: anywhere; }
  .admin-table td:last-child { border-bottom: 0; }
  .admin-table td::before { grid-column: 1; grid-row: 1 / span 4; color: var(--tool-muted); font: 8px var(--admin-mono); letter-spacing: .35px; }
  .admin-table td > * { grid-column: 2; min-width: 0; }
  .admin-table td:first-child > span,
  .admin-table td:nth-child(2) small { max-width: none; white-space: normal; }
  .admin-request-title,
  .admin-result { max-width: none; }
  .admin-table:not(.admin-users-table) td:nth-child(1)::before { content: "요청"; }
  .admin-table:not(.admin-users-table) td:nth-child(2)::before { content: "요청자"; }
  .admin-table:not(.admin-users-table) td:nth-child(3)::before { content: "우선순위"; }
  .admin-table:not(.admin-users-table) td:nth-child(4)::before { content: "상태"; }
  .admin-table:not(.admin-users-table) td:nth-child(5)::before { content: "처리 결과"; }
  .admin-table:not(.admin-users-table) td:nth-child(6)::before { content: "최종 갱신"; }
  .admin-table:not(.admin-users-table) td:nth-child(7)::before { content: "작업"; }
  .admin-users-table td:nth-child(1)::before { content: "사용자"; }
  .admin-users-table td:nth-child(2)::before { content: "권한"; }
  .admin-users-table td:nth-child(3)::before { content: "보안"; }
  .admin-users-table td:nth-child(4)::before { content: "가입 시각"; }
  .admin-users-table td:nth-child(5)::before { content: "연결"; }
  .admin-users-table td:nth-child(6)::before { content: "기록"; }
  .admin-users-table td:nth-child(7)::before { content: "저장 용량"; }
}

@media (min-width: 641px) and (max-width: 820px) {
  .admin-table tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .admin-table tr { margin-bottom: 0; }
}

/* SaaS workspace refresh: one restrained shell, dense data, and consistent controls. */
:root {
  --tool-page: #f7f8fb;
  --tool-surface: #ffffff;
  --tool-surface-soft: #f8fafc;
  --tool-border: #e4e7ec;
  --tool-border-strong: #d0d5dd;
  --tool-text: #182230;
  --tool-muted: #667085;
  --tool-blue: #3563e9;
  --tool-blue-soft: #eef3ff;
  --tool-radius: 10px;
  --tool-radius-sm: 8px;
  --tool-shadow: 0 1px 2px rgba(16, 24, 40, .035);
}
html[data-theme="dark"] {
  --tool-page: #151515;
  --tool-surface: #1c1c1c;
  --tool-surface-soft: #242424;
  --tool-border: #333333;
  --tool-border-strong: #454545;
  --tool-text: #f2f4f7;
  --tool-muted: #a3a3a3;
  --tool-blue: #5f7cf6;
  --tool-blue-soft: #1b2440;
  --tool-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

.console-page { --sidebar-width: 252px; background: var(--tool-page); color: var(--tool-text); }
.sidebar {
  padding: 16px 12px 14px;
  border-right: 1px solid var(--tool-border);
  background: var(--tool-surface);
  box-shadow: none;
}
.sidebar-brand-row { min-height: 42px; padding: 0 8px 14px; }
.sidebar .brand { gap: 9px; color: var(--tool-text); font-size: 19px; letter-spacing: -.65px; }
.sidebar .brand img { width: 27px; height: 27px; }
.plan-badge { padding: 4px 7px; border: 0; border-radius: 6px; background: #172238; color: #dce5f7; font-size: 8px; letter-spacing: .8px; }
.workspace { min-height: 62px; margin-bottom: 20px; padding: 10px; border-color: var(--tool-border); border-radius: 9px; background: var(--tool-surface-soft); box-shadow: none; }
.workspace-icon { width: 34px; height: 34px; border-radius: 8px; box-shadow: none; }
.workspace-copy strong { color: var(--tool-text); font-size: 12px; }
.workspace-copy small { display: flex; align-items: center; gap: 5px; color: var(--tool-muted); font-size: 9px; }
.workspace-live { width: 6px; height: 6px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, .1); }
.sidebar nav { gap: 2px; }
.sidebar-label { margin: 0 10px 6px; color: #98a2b3; font-size: 8px; letter-spacing: 1.15px; }
.sidebar-label-spaced { margin-top: 15px; }
.sidebar nav button { position: relative; height: 39px; gap: 10px; padding: 0 10px; border-radius: 7px; color: var(--tool-muted); font-size: 12px; }
.sidebar nav button svg { width: 18px; height: 18px; }
.sidebar nav button:hover { background: var(--tool-surface-soft); color: var(--tool-text); }
.sidebar nav button[aria-current="page"] { background: var(--tool-blue-soft); color: var(--tool-blue); font-weight: 650; box-shadow: none; }
.sidebar-help-card { margin-bottom: 10px; padding: 11px; border-color: var(--tool-border); border-radius: 8px; background: var(--tool-surface-soft); }
.sidebar-help-card strong { color: var(--tool-text); font-size: 10px; }
.sidebar-help-card a { color: var(--tool-muted); font-size: 9px; }
.account-line { padding: 11px 7px 2px; border-top-color: var(--tool-border); }
.account-line > span { width: 32px; height: 32px; }
.account-line strong { color: var(--tool-text); font-size: 11px; }
.account-line small { color: var(--tool-muted); font-size: 9px; }
.account-popover { border-color: var(--tool-border); border-radius: 10px; background: var(--tool-surface); box-shadow: 0 18px 48px rgba(16, 24, 40, .14); }

.console-header {
  position: sticky;
  top: 0;
  z-index: 15;
  height: 60px;
  padding: 0 24px;
  gap: 18px;
  border-bottom: 1px solid var(--tool-border);
  background: color-mix(in srgb, var(--tool-surface) 95%, transparent);
  box-shadow: none;
  backdrop-filter: blur(16px);
}
.breadcrumb { min-width: 190px; color: var(--tool-muted); font-size: 11px; }
.breadcrumb strong { color: var(--tool-text); font-size: 11px; font-weight: 650; }
.topbar-search { width: min(440px, 38vw); height: 36px; margin-left: auto; padding: 0 11px; border-color: var(--tool-border); border-radius: 8px; background: var(--tool-surface-soft); color: var(--tool-muted); font-size: 11px; }
.topbar-search:hover { border-color: var(--tool-border-strong); background: var(--tool-surface); }
.topbar-search kbd { border-color: var(--tool-border); background: var(--tool-surface); color: var(--tool-muted); }
.topbar-actions { min-width: 0; gap: 10px; margin-left: auto; }
.topbar-actions > a { color: var(--tool-muted); font-size: 11px; }
.service-status { color: var(--tool-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .45px; }
.service-status i { background: #12b76a; }
.topbar-create { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid #2f5bdd; border-radius: 8px; background: #3563e9; color: #fff; font-size: 10px; font-weight: 650; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.topbar-create:hover { background: #2f58d7; }
.topbar-create svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.topbar-avatar,.topbar-avatar span { width: 32px; height: 32px; }

#console-main { width: 100%; max-width: 1500px; padding: 28px 32px 64px; }
.console-page-heading { align-items: flex-start; margin-bottom: 22px; }
.console-page-heading .eyebrow { margin-bottom: 7px; color: #7f8ba0; font-size: 9px; letter-spacing: 1px; }
.console-page-heading h1 { margin-bottom: 6px; color: var(--tool-text); font-size: 26px; letter-spacing: -.9px; }
.console-page-heading > div > p:last-of-type { color: var(--tool-muted); font-size: 12px; }
.page-context { display: flex; align-items: center; gap: 7px; margin-top: 12px; }
.page-context span { display: inline-flex; min-height: 24px; align-items: center; gap: 6px; padding: 0 8px; border: 1px solid var(--tool-border); border-radius: 6px; background: var(--tool-surface); color: var(--tool-muted); font: 8px var(--mono); white-space: nowrap; }
.page-context span:first-child i { width: 6px; height: 6px; border-radius: 50%; background: #12b76a; }
.console-page-heading .button { min-height: 36px; padding: 0 12px; border-radius: 8px; box-shadow: none; font-size: 10px; }

.console-panel,.stat-card,.security-card,.security-note { border-color: var(--tool-border); border-radius: 10px; background: var(--tool-surface); box-shadow: var(--tool-shadow); }
.stats-grid { gap: 12px; margin-bottom: 16px; }
.stat-card { min-height: 128px; padding: 16px; }
.stat-card:hover { transform: none; border-color: var(--tool-border-strong); box-shadow: 0 4px 12px rgba(16, 24, 40, .05); }
.stat-card-top > span:first-child { display: grid; gap: 3px; }
.stat-card-code { color: #98a2b3; font: 8px var(--mono); letter-spacing: .7px; }
.stat-card-label { color: var(--tool-muted); font-size: 11px; }
.stat-card-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--tool-blue-soft); color: var(--tool-blue); }
.stat-card-icon svg { width: 16px; height: 16px; }
.stat-card strong { margin: 14px 0 5px; color: var(--tool-text); font-size: 27px; letter-spacing: -1px; }
.stat-card > small { color: var(--tool-muted); font-size: 10px; }

.dashboard-guide { margin-bottom: 16px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--tool-blue) 20%, var(--tool-border)); border-radius: 9px; background: var(--tool-blue-soft); color: var(--tool-text); box-shadow: none; }
.dashboard-guide-copy span { color: var(--tool-blue); }
.dashboard-guide-copy strong { color: var(--tool-text); font-size: 11px; }
.dashboard-guide-actions button { min-height: 31px; border-color: color-mix(in srgb, var(--tool-blue) 18%, var(--tool-border)); border-radius: 7px; background: var(--tool-surface); color: var(--tool-muted); font-size: 10px; }
.dashboard-guide-actions button:hover { border-color: var(--tool-blue); background: var(--tool-surface); color: var(--tool-blue); }
.dashboard-guide-actions .dashboard-guide-dismiss { color: var(--tool-muted); }

.storage-usage-card { position: relative; display: grid; min-height: 104px; grid-template-columns: minmax(250px, 1fr) auto; gap: 16px 28px; margin-bottom: 16px; padding: 18px 20px 15px; border: 1px solid var(--tool-border); border-radius: 10px; background: var(--tool-surface); color: var(--tool-text); box-shadow: var(--tool-shadow); overflow: hidden; }
.storage-usage-main { gap: 13px; }
.storage-usage-icon { width: 40px; height: 40px; border-color: var(--tool-border); border-radius: 9px; background: var(--tool-blue-soft); color: var(--tool-blue); }
.storage-usage-icon svg { width: 20px; height: 20px; }
.storage-usage-label { margin-bottom: 5px; color: var(--tool-muted); font-size: 10px; }
.storage-usage-main strong { color: var(--tool-text); font-size: 24px; }
.storage-usage-main small { margin-top: 5px; color: var(--tool-muted); font-size: 9px; }
.storage-usage-breakdown { gap: 22px; }
.storage-usage-breakdown > div { min-width: 96px; padding-left: 16px; border-left-color: var(--tool-border); }
.storage-usage-breakdown span { margin-bottom: 5px; color: var(--tool-muted); font-size: 9px; }
.storage-usage-breakdown strong { color: var(--tool-text); font-size: 12px; }
.storage-usage-breakdown p { border-color: var(--tool-border); background: var(--tool-surface-soft); color: var(--tool-muted); font-size: 8px; }
.storage-composition { display: flex; height: 4px; grid-column: 1 / -1; border-radius: 99px; background: var(--tool-surface-soft); overflow: hidden; }
.storage-composition span { display: block; background: var(--tool-blue); }
.storage-composition i { display: block; background: #8b9fca; }

.dashboard-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .72fr); gap: 16px; }
.console-panel { margin-bottom: 16px; }
.panel-heading { min-height: 64px; padding: 15px 18px; border-bottom-color: var(--tool-border); }
.panel-heading-copy h2,.panel-heading h2 { color: var(--tool-text); font-size: 13px; }
.panel-heading-copy p { margin-top: 4px; color: var(--tool-muted); font-size: 10px; }
.panel-heading button { color: var(--tool-muted); font-size: 10px; }
.records-table thead { position: sticky; top: 0; z-index: 1; }
.records-table th { padding: 10px 18px; border-color: var(--tool-border); background: var(--tool-surface-soft); color: #8a94a6; font-size: 9px; }
.records-table td { padding: 14px 18px; border-color: var(--tool-border); color: var(--tool-muted); font-size: 11px; }
.records-table tbody tr:hover { background: var(--tool-surface-soft); }
.record-title { color: var(--tool-text); font-size: 12px; }
.record-subtitle { color: var(--tool-muted); font-size: 9px; }
.console-status-list { padding: 1px 16px; }
.console-status-list > div { padding: 11px 2px; border-bottom-color: var(--tool-border); }
.console-status-list span { color: var(--tool-muted); font-size: 10px; }
.console-status-list strong { color: var(--tool-text); font-size: 10px; }
.dashboard-status-agents { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 13px 16px 16px; border-top-color: var(--tool-border); }
.dashboard-status-agents span { padding: 8px 3px; border-color: var(--tool-border); border-radius: 7px; background: var(--tool-surface-soft); }
.dashboard-status-agents img { width: 22px; height: 22px; }
.activity-list article { padding: 12px 18px; border-color: var(--tool-border); }
.activity-icon { border-radius: 7px; background: var(--tool-blue-soft); color: var(--tool-blue); }
.activity-list article strong { color: var(--tool-text); }
.activity-list article small,.activity-list article code { color: var(--tool-muted); }
.tag { border-color: var(--tool-border); background: var(--tool-surface-soft); color: var(--tool-muted); }
.list-toolbar { gap: 8px; padding: 13px 16px; border-bottom-color: var(--tool-border); }
.list-toolbar input,.list-toolbar select { border-color: var(--tool-border); background: var(--tool-surface); color: var(--tool-text); }
.secondary-button,.row-actions button,.row-actions a,.pager button { border-color: var(--tool-border); background: var(--tool-surface); color: var(--tool-muted); box-shadow: none; }
.secondary-button:hover,.row-actions button:hover,.row-actions a:hover,.pager button:hover { border-color: var(--tool-border-strong); background: var(--tool-surface-soft); color: var(--tool-text); }
.console-footer { padding: 15px 32px; border-top-color: var(--tool-border); background: var(--tool-surface); color: var(--tool-muted); }

/* Admin inherits the same SaaS application shell. */
.admin-page { --admin-sidebar-width: 244px; background: var(--tool-page); }
.admin-sidebar { width: var(--admin-sidebar-width); padding: 16px 12px 14px; border-right-color: var(--tool-border); background: var(--tool-surface); box-shadow: none; }
.admin-sidebar-brand { min-height: 42px; padding: 0 8px; color: var(--tool-text); font-size: 18px; }
.admin-sidebar-brand em { border-radius: 6px; background: #172238; font-size: 8px; }
.admin-sidebar nav { margin-top: 22px; gap: 2px; }
.admin-sidebar nav > p { margin: 0 10px 7px; color: #98a2b3; font-size: 8px; }
.admin-sidebar nav > p.admin-sidebar-group { margin-top: 18px; }
.admin-sidebar nav > a,.admin-sidebar-bottom > button { min-height: 39px; gap: 10px; padding: 0 10px; border-radius: 7px; color: var(--tool-muted); font-size: 11px; }
.admin-sidebar nav > a:hover,.admin-sidebar-bottom > button:hover { background: var(--tool-surface-soft); color: var(--tool-text); }
.admin-sidebar nav > a[aria-current="page"] { background: var(--tool-blue-soft); color: var(--tool-blue); }
.admin-sidebar-bottom { border-top-color: var(--tool-border); }
.admin-sidebar .admin-identity { padding: 10px; border-color: var(--tool-border); border-radius: 8px; background: var(--tool-surface-soft); }
.admin-body { margin-left: var(--admin-sidebar-width); }
.admin-header { height: 60px; padding: 0 24px; border-color: var(--tool-border); background: color-mix(in srgb, var(--tool-surface) 95%, transparent); backdrop-filter: blur(16px); }
.admin-breadcrumb { color: var(--tool-muted); }
.admin-breadcrumb strong { color: var(--tool-text); }
.admin-main { max-width: 1500px; padding: 28px 32px 64px; }
.admin-heading { margin-bottom: 22px; }
.admin-heading p { margin-bottom: 7px; color: #7f8ba0; font-size: 9px; }
.admin-heading h1 { margin-bottom: 6px; color: var(--tool-text); font-size: 26px; }
.admin-heading > div > span { color: var(--tool-muted); font-size: 12px; }
.admin-stats { gap: 12px; margin-bottom: 16px; }
.admin-stats button { min-height: 98px; padding: 15px; border-color: var(--tool-border); border-radius: 9px; background: var(--tool-surface); box-shadow: var(--tool-shadow); }
.admin-stats button:hover,.admin-stats button.selected { border-color: var(--tool-border-strong); box-shadow: var(--tool-shadow); }
.admin-stats strong { margin: 10px 0 5px; color: var(--tool-text); font-size: 23px; }
.admin-panel { border-color: var(--tool-border); border-radius: 10px; background: var(--tool-surface); box-shadow: var(--tool-shadow); }
.admin-toolbar { min-height: 68px; padding: 15px 18px; border-color: var(--tool-border); }
.admin-toolbar h2 { color: var(--tool-text); font-size: 13px; }
.admin-toolbar p { color: var(--tool-muted); font-size: 10px; }
.admin-table th { padding: 10px 14px; border-color: var(--tool-border); background: var(--tool-surface-soft); }
.admin-table td { padding: 14px; border-color: var(--tool-border); }
.admin-pager { border-color: var(--tool-border); }
.admin-overview-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .72fr); gap: 16px; }
.admin-overview-grid .admin-panel { margin: 0; }
.admin-overview-grid .admin-toolbar { align-items: center; }
.admin-overview-grid .admin-toolbar > a { display: inline-flex; align-items: center; gap: 6px; color: var(--tool-muted); font-size: 10px; font-weight: 600; white-space: nowrap; }
.admin-overview-grid .admin-toolbar > a:hover { color: var(--tool-blue); }
.admin-overview-request-list { min-height: 272px; }
.admin-overview-request { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 54px; padding: 11px 18px; border-bottom: 1px solid var(--tool-border); color: var(--tool-text); }
.admin-overview-request:last-child { border-bottom: 0; }
.admin-overview-request:hover { background: var(--tool-surface-soft); }
.admin-overview-request-mark { width: 7px; height: 7px; border-radius: 50%; background: #8b95a7; box-shadow: 0 0 0 3px color-mix(in srgb, #8b95a7 12%, transparent); }
.admin-overview-request-mark.in-progress { background: #d09a37; }
.admin-overview-request-mark.completed { background: #12b76a; }
.admin-overview-request-mark.reviewing,.admin-overview-request-mark.planned { background: var(--tool-blue); }
.admin-overview-request strong { display: block; overflow: hidden; color: var(--tool-text); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.admin-overview-request small { display: block; margin-top: 4px; overflow: hidden; color: var(--tool-muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.admin-overview-tools nav { display: grid; padding: 7px 14px; }
.admin-overview-tools nav > a { display: grid; grid-template-columns: 34px minmax(0, 1fr) 16px; align-items: center; gap: 11px; min-height: 66px; padding: 9px 3px; border-bottom: 1px solid var(--tool-border); color: var(--tool-text); }
.admin-overview-tools nav > a:last-child { border-bottom: 0; }
.admin-overview-tools nav > a:hover strong { color: var(--tool-blue); }
.admin-overview-tool-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 8px; background: var(--tool-blue-soft); color: var(--tool-blue); }
.admin-overview-tool-icon svg { width: 17px; height: 17px; }
.admin-overview-tools strong { display: block; font-size: 11px; }
.admin-overview-tools small { display: block; margin-top: 4px; color: var(--tool-muted); font-size: 8px; }
.admin-overview-tools nav > a > svg { color: var(--tool-muted); }
.admin-overview-tools footer { display: flex; align-items: center; justify-content: space-between; min-height: 45px; padding: 0 17px; border-top: 1px solid var(--tool-border); background: var(--tool-surface-soft); color: var(--tool-muted); font: 8px var(--admin-mono); }
.admin-overview-tools footer span:first-child { display: flex; align-items: center; gap: 7px; }
.admin-overview-tools footer i { width: 6px; height: 6px; border-radius: 50%; background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, .1); }

html[data-theme="dark"] .plan-badge,
html[data-theme="dark"] .admin-sidebar-brand em { background: var(--tool-surface-soft); color: var(--tool-muted); }
html[data-theme="dark"] .dashboard-guide { background: var(--tool-blue-soft); border-color: color-mix(in srgb,var(--tool-blue) 32%,var(--tool-border)); color: var(--tool-text); }
html[data-theme="dark"] .dashboard-guide-actions button,
html[data-theme="dark"] .storage-usage-card { background: var(--tool-surface); border-color: var(--tool-border); color: var(--tool-text); }
html[data-theme="dark"] .storage-composition { background: var(--tool-surface-soft); }
html[data-theme="dark"] .topbar-create { background: #5677e8; border-color: #6f8af0; color: #fff; }

@media (max-width: 1120px) {
  .console-page { --sidebar-width: 236px; }
  .topbar-search { width: min(320px, 31vw); }
  #console-main { padding-inline: 26px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.3fr) minmax(280px, .8fr); }
}
@media (max-width: 900px) {
  .admin-body { margin-left: 0; }
  .admin-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .console-header { height: 60px; padding-inline: 16px; }
  .topbar-create span { display: none; }
  .topbar-create { width: 34px; justify-content: center; padding: 0; }
  #console-main { padding: 24px 20px 52px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .storage-usage-card { grid-template-columns: 1fr; }
  .storage-usage-breakdown { width: 100%; }
}
@media (max-width: 520px) {
  .console-header { gap: 7px; padding-inline: 11px; }
  .breadcrumb { min-width: 0; flex: 1 1 auto; }
  .topbar-search { width: 36px; max-width: 36px; height: 34px; margin: 0; flex: 0 0 36px; }
  .topbar-actions { min-width: 0; flex: 0 0 auto; }
  .topbar-create { width: 34px; min-height: 34px; }
  .topbar-actions > a,.service-status { display: none; }
  .console-page-heading { display: flex; gap: 12px; }
  .console-page-heading h1 { font-size: 23px; }
  .console-page-heading .button { width: 38px; min-width: 38px; height: 38px; justify-content: center; padding: 0; font-size: 0; }
  .console-page-heading .button svg { width: 16px; height: 16px; margin: 0; }
  .page-context { max-width: calc(100vw - 40px); overflow-x: auto; scrollbar-width: none; }
  .page-context::-webkit-scrollbar { display: none; }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 120px; padding: 14px; }
  .stat-card strong { font-size: 24px; }
  .dashboard-guide { padding: 12px; }
  .storage-usage-card { padding: 16px; }
  .storage-usage-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .storage-usage-breakdown p { grid-column: 1 / -1; }
  .admin-main { padding: 23px 14px 48px; }
  .admin-heading h1 { font-size: 23px; }
  .admin-overview-grid .admin-toolbar { align-items: flex-start; }
  .admin-overview-request { grid-template-columns: 7px minmax(0, 1fr); padding-inline: 14px; }
  .admin-overview-request .admin-status { grid-column: 2; justify-self: start; }
}
