.accounts-layout,
.commands-layout,
.plugins-layout,
.macros-layout { gap: 14px !important; }
.account-table-head { color: var(--text-1, #cdd7e6) !important; background: #131d33 !important; border-color: var(--mm-border, #2b3a56) !important; }
.account-row,
.plugin-item,
.macro-item,
.proxy-row,
.schedule-item,
.team-item { color: var(--mm-text, #f2f6fd) !important; background: #101828 !important; border-color: var(--mm-border, #2b3a56) !important; }
.account-row:hover,
.plugin-item:hover,
.macro-item:hover,
.proxy-row:hover,
.schedule-item:hover,
.team-item:hover { background: #16213a !important; }
.actions-bar,
.accounts-bulk-actions { background: #101828 !important; border-color: var(--mm-border, #2b3a56) !important; box-shadow: none !important; }
.status-pill,
.dashboard-pill,
.proxy-badge { border-radius: 999px !important; }
.terminal-log,
.logs-console,
.chat-box { color: #e5e7eb !important; background: linear-gradient(150deg, #262a31, #181b20) !important; border-color: rgba(148, 163, 184, .28) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important; }

.builder { background: linear-gradient(145deg, #24272e, #16191e) !important; }
.builder-topbar,
.builder-left,
.builder-right { background: rgba(31, 34, 40, .97) !important; border-color: rgba(148, 163, 184, .18) !important; }
.builder-canvas { background-color: #1b1e24 !important; background-image: radial-gradient(circle, rgba(148, 163, 184, .2) 1px, transparent 1px) !important; background-size: 22px 22px !important; }
.builder .btn-light { color: #dbe6ff !important; background: rgba(255,255,255,.06) !important; border-color: rgba(164,184,229,.2) !important; }

@media (max-width: 1450px) {
  .dashboard-cockpit { grid-template-columns: minmax(280px, .75fr) minmax(360px, 1.25fr); }
  .stat-icon { width: 40px !important; height: 40px !important; }
  .stat-value { font-size: 22px; }
}
@media (max-width: 1600px) {
  .kc-stats-bar { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .dashboard-grid { grid-template-columns: 320px minmax(0, 1fr) !important; }
  .bot-selected-card { min-height: 230px; }
  .bot-window-card { min-height: 420px; }
  .dashboard-support-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .account-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

@media (max-width: 980px), (orientation: portrait) {
  .shell,
  html[data-ui-mode="portrait"] .shell,
  html[data-ui-mode="tall"] .shell { grid-template-columns: 1fr !important; }
  .sidebar {
    position: fixed !important;
    z-index: 140 !important;
    width: min(86vw, 320px) !important;
    max-width: 320px !important;
    transform: translateX(0);
    transition: transform 180ms ease, opacity 180ms ease;
  }
  .sidebar-header-row {
    grid-template-columns: minmax(0, 1fr) 40px;
    gap: 8px;
  }
  .sidebar-close-btn { display: grid; }
  .sidebar.collapsed { transform: translateX(calc(-100% - 10px)) !important; opacity: 0; pointer-events: none; }
  .sidebar .nav-block {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 3px !important;
    width: 100%;
    overflow: visible !important;
    padding: 0 !important;
  }
  .sidebar .nav-item {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: flex-start !important;
    white-space: normal !important;
  }
  .sidebar-toggle-btn { display: grid; }
  .topbar { align-items: center !important; min-height: 68px !important; }
  .topbar-actions { width: auto !important; display: flex !important; flex-wrap: nowrap !important; }
  .topbar-actions .actions-divider,
  .topbar-actions .current-user,
  #themeToggleBtn { display: none !important; }
  .status-chip { display: none !important; }
  .page-host { padding: 12px !important; }
  .dashboard-grid { grid-template-columns: 1fr !important; }
  .account-grid-card { min-height: 360px; }
  .account-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)) !important; }
  .dashboard-cockpit { display: flex !important; }
  .dashboard-support-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 620px) {
  .topbar h1 { font-size: 16px !important; }
  .topbar p { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-actions { gap: 5px !important; }
  .topbar-actions .btn { min-width: 36px; padding-inline: 9px !important; font-size: 0 !important; }
  .topbar-actions .btn svg { width: 15px; height: 15px; }
  #logoutBtn { font-size: 10px !important; }
  .workspace-subnav { align-items: stretch; gap: 8px; padding: 9px; overflow: hidden; }
  .workspace-subnav-context { display: none; }
  .workspace-subnav-items { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .workspace-subnav-items::-webkit-scrollbar { display: none; }
  .workspace-subnav-button { flex: 1 0 auto; min-height: 38px; }
  .kc-stats-bar { grid-template-columns: 1fr !important; gap: 9px !important; }
  .stat-card { min-height: 90px; }
  .dashboard-support-grid { grid-template-rows: auto; }
  .fleet-action-buttons { grid-template-columns: 1fr; }
  .window-tabs { align-self: stretch; }
  .dashboard-tab { flex: 1; min-width: 0; padding-inline: 8px !important; font-size: 11px; }
  .server-card .row.split { grid-template-columns: 1fr !important; }
  .card { border-radius: 15px !important; }
}
