:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --sidebar: #fbfcfd;
  --border: #e6e9ef;
  --border-strong: #dce1e8;
  --text: #111827;
  --muted: #667085;
  --muted-2: #98a2b3;
  --primary: #2563eb;
  --primary-soft: #eff6ff;
  --surface-muted: #f2f4f7;
  --input-bg: rgba(255,255,255,.9);
  --card-bg: rgba(255,255,255,.94);
  --key-bg: #f9fafb;
  --shadow: 0 8px 28px rgba(16, 24, 40, 0.055);
  --shadow-hover: 0 14px 36px rgba(16, 24, 40, 0.09);
  --radius: 16px;
}

:root[data-theme="dark"] {
  --bg: #111827;
  --panel: #182231;
  --sidebar: #151f2d;
  --border: #2b3a4e;
  --border-strong: #35465c;
  --text: #f3f6fb;
  --muted: #a8b5c8;
  --muted-2: #8190a5;
  --primary: #79a9ff;
  --primary-soft: #1c355b;
  --surface-muted: #223145;
  --input-bg: rgba(24,34,49,.94);
  --card-bg: rgba(24,34,49,.94);
  --key-bg: #223145;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 14px 36px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 72% 6%, rgba(37, 99, 235, 0.035), transparent 24rem),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 258px;
  padding: 26px 18px;
  background: color-mix(in srgb, var(--sidebar) 96%, transparent);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 14px 28px;
}

.brand-mark {
  position: relative;
  width: 31px;
  height: 31px;
}

.brand-mark span {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--text);
}

.brand-mark span:nth-child(1) { left: 0; top: 9px; }
.brand-mark span:nth-child(2) { left: 10px; top: 0; }
.brand-mark span:nth-child(3) { left: 10px; top: 18px; }
.brand-mark span:nth-child(4) { left: 20px; top: 9px; }

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.02;
  letter-spacing: 0.12em;
}

.brand-text strong {
  font-size: 16px;
  font-weight: 700;
}

.brand-text span {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-item,
.workspace-title,
.workspace-subnav button {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border-radius: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: .18s ease;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item:hover {
  background: var(--surface-muted);
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.sidebar-label {
  margin: 28px 14px 13px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .045em;
}

.workspace {
  margin-bottom: 3px;
}

.workspace-title {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: .18s ease;
}

.workspace-title:hover {
  background: var(--surface-muted);
}

.workspace-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
}

.workspace-left svg,
.chevron {
  width: 18px;
  height: 18px;
}

.workspace-left svg {
  color: #7b8799;
}

.workspace-subnav {
  display: grid;
  gap: 1px;
  padding: 2px 0 8px 39px;
}

.workspace-subnav button {
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.workspace-subnav button:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.nav-item.muted {
  color: var(--muted);
}

.sidebar-footer {
  margin: 28px 13px 0;
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.8;
}

.main {
  margin-left: 258px;
  min-height: 100vh;
  padding: 34px 42px 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  max-width: 1320px;
  margin: 0 auto;
}

.topbar h1 {
  margin: 0;
  font-size: 29px;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: .18s ease;
}

.theme-toggle:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  color: var(--primary);
}

.version-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  vertical-align: 1px;
}

.mobile-menu-btn {
  display: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
}

.search-wrap {
  position: relative;
  max-width: 1320px;
  height: 52px;
  margin: 28px auto 0;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--input-bg);
  box-shadow: 0 3px 13px rgba(16,24,40,.035);
  display: flex;
  align-items: center;
}

.search-wrap > svg {
  width: 20px;
  height: 20px;
  color: #475467;
  margin-left: 17px;
}

.search-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 14px;
  outline: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.search-wrap input::placeholder {
  color: #98a2b3;
}

.shortcut {
  display: flex;
  gap: 4px;
  margin-right: 13px;
}

kbd {
  min-width: 24px;
  height: 25px;
  padding: 0 6px;
  border: 1px solid #d8dde5;
  border-bottom-color: #c5cad3;
  border-radius: 6px;
  background: var(--key-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  box-shadow: inset 0 -1px 0 rgba(16,24,40,.04);
}

.search-summary {
  max-width: 1320px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-section {
  max-width: 1320px;
  margin: 34px auto 0;
}

.section-header {
  margin-bottom: 17px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.section-header h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.section-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

.text-button svg {
  width: 16px;
  height: 16px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.app-card {
  min-height: 204px;
  padding: 20px 20px 17px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-icon {
  width: 46px;
  height: 46px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-icon svg {
  width: 24px;
  height: 24px;
}

.app-icon.orange { background: #fff0df; color: #f97316; }
.app-icon.violet { background: #f3e8ff; color: #8b5cf6; }
.app-icon.blue   { background: #e7f0ff; color: #3b82f6; }
.app-icon.green  { background: #eafaf0; color: #22a35a; }
.app-icon.yellow { background: #fff7dc; color: #e6a700; }
.app-icon.purple { background: #f1ebff; color: #7c3aed; }
.app-icon.red    { background: #ffecef; color: #e11d48; }

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  text-transform: uppercase;
}

.status.active {
  color: #f97316;
  background: #fff2e5;
}

.status.beta {
  color: #1677ff;
  background: #eaf4ff;
}

.favorite-indicator {
  color: #f4b000;
  display: inline-flex;
}

.favorite-indicator svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.app-card h3 {
  margin: 19px 0 7px;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.app-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.card-footer {
  margin-top: auto;
  padding-top: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.meta {
  color: var(--muted);
  font-size: 11px;
}

.category {
  font-weight: 500;
}

.category.orange { color: #f97316; }
.category.violet { color: #8b5cf6; }
.category.blue { color: #3b82f6; }
.category.green { color: #22a35a; }
.category.yellow { color: #e6a700; }
.category.purple { color: #7c3aed; }
.category.red { color: #e11d48; }

.card-arrow {
  width: 18px;
  height: 18px;
}

#paeseSection,
#otherSection {
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.workspace-card {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(16,24,40,.03);
  transition: .18s ease;
}

.workspace-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16,24,40,.06);
}

.workspace-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.workspace-icon svg {
  width: 20px;
  height: 20px;
}

.workspace-icon.green { background: #ebf9ef; color: #26a65b; }
.workspace-icon.yellow { background: #fff6d9; color: #eba900; }
.workspace-icon.purple { background: #f2eaff; color: #7c3aed; }
.workspace-icon.red { background: #ffedf0; color: #e11d48; }

.workspace-card span:last-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.workspace-card strong {
  font-size: 13px;
}

.workspace-card small {
  color: var(--muted);
  font-size: 11px;
}

.empty-state {
  padding: 60px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--card-bg);
  text-align: center;
}

.empty-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.empty-state h3 {
  margin: 0;
  font-size: 16px;
}

.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.page-footer {
  max-width: 1320px;
  margin: 44px auto 8px;
  color: #98a2b3;
  font-size: 11px;
  text-align: center;
}

.page-footer kbd {
  height: 21px;
  min-width: 21px;
  padding: 0 5px;
  margin: 0 2px;
  font-size: 10px;
}

.hidden {
  display: none !important;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 1180px) {
  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 20px 0 50px rgba(16,24,40,.14);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(15, 23, 42, .28);
  }

  .sidebar-overlay.visible {
    display: block;
  }

  .main {
    margin-left: 0;
    padding: 24px 20px;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .topbar h1 {
    font-size: 24px;
  }

  .theme-toggle-label {
    display: none;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 20px 14px;
  }

  .topbar p {
    font-size: 12px;
  }

  .search-wrap {
    margin-top: 22px;
  }

  .shortcut {
    display: none;
  }

  .dashboard-section {
    margin-top: 28px;
  }

  .section-header {
    align-items: center;
  }

  .app-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .app-card {
    min-height: 190px;
  }

  .text-button {
    font-size: 11px;
  }
}
