:root {
  --bg: #f4f5f8;
  --panel: #ffffff;
  --ink: #171923;
  --muted: #667085;
  --line: #e5e7eb;
  --soft: #f8fafc;
  --violet: #6941c6;
  --violet-2: #7f56d9;
  --teal: #0f9f8f;
  --amber: #f59e0b;
  --red: #ef4444;
  --blue: #2563eb;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  font-family: Inter, "Segoe UI", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at top left, #eef2ff 0, transparent 26rem), var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 460px) 1fr;
  gap: 24px;
  padding: 24px;
}

.login-panel,
.preview-panel,
.sidebar,
.workspace-card,
.module-card,
.settings-panel,
.stat-card,
.mobile-nav {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: var(--shadow);
}

.login-panel {
  min-height: calc(100vh - 48px);
  border-radius: 8px;
  padding: 34px;
  display: flex;
  flex-direction: column;
}

.brand-row,
.topbar,
.row,
.toolbar,
.module-head,
.task-line,
.card-footer,
.version-bar {
  display: flex;
  align-items: center;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--teal));
  font-weight: 800;
}

.brand-title {
  margin-left: 12px;
}

.brand-title strong {
  display: block;
  font-size: 15px;
}

.brand-title span,
.subtle,
.task-meta,
.small {
  color: var(--muted);
  font-size: 12px;
}

.login-copy {
  margin: auto 0;
}

.eyebrow {
  color: var(--violet);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: 0;
}

.login-copy p {
  color: var(--muted);
  line-height: 1.65;
}

.login-actions {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.primary-btn,
.ghost-btn,
.icon-btn,
.tab,
.chip {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.primary-btn {
  border: 0;
  color: #fff;
  background: var(--violet);
  padding: 13px 16px;
  font-weight: 700;
}

.ghost-btn {
  padding: 12px 14px;
  font-weight: 650;
}

.version-bar {
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.preview-panel {
  border-radius: 8px;
  padding: 18px;
  overflow: hidden;
}

.mini-app {
  height: 100%;
  min-height: calc(100vh - 84px);
  border-radius: 8px;
  background: #fbfcfe;
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 230px 1fr;
}

.sidebar {
  box-shadow: none;
  border-width: 0 1px 0 0;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-link,
.project-link {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #344054;
  font-size: 13px;
}

.side-link.active,
.project-link.active {
  color: var(--violet);
  background: #f1ecff;
  font-weight: 700;
}

.side-group {
  display: grid;
  gap: 4px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 58px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}

.search {
  flex: 1;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f3f6;
  padding: 10px 14px 10px 36px;
}

.search span {
  position: absolute;
  left: 13px;
  top: 9px;
  color: var(--muted);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #101828, #667085);
  color: white;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}

.content {
  padding: 22px;
  overflow: auto;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.page-head h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

.toolbar {
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 18px;
}

.tab,
.chip,
.icon-btn {
  min-height: 34px;
  padding: 8px 11px;
  font-size: 13px;
}

.tab.active {
  color: var(--violet);
  border-color: #d6bbfb;
  background: #f4f0ff;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  box-shadow: none;
  border-radius: 8px;
  padding: 14px;
}

.stat-card strong {
  display: block;
  font-size: 24px;
  margin: 5px 0;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
}

.workspace-card,
.settings-panel {
  box-shadow: none;
  border-radius: 8px;
  padding: 14px;
}

.module-list {
  display: grid;
  gap: 12px;
}

.module-card {
  box-shadow: none;
  border-radius: 8px;
  padding: 14px;
}

.module-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.module-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.module-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--violet);
}

.module-icon.teal {
  background: var(--teal);
}

.module-icon.amber {
  background: var(--amber);
}

.module-icon.blue {
  background: var(--blue);
}

.module-icon.red {
  background: var(--red);
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--violet));
}

.card-footer {
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.task-table {
  display: grid;
  gap: 8px;
}

.task-line {
  min-height: 44px;
  border-top: 1px solid var(--line);
  gap: 12px;
  font-size: 13px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  flex: 0 0 auto;
}

.dot.warn {
  background: var(--amber);
}

.dot.danger {
  background: var(--red);
}

.task-title {
  flex: 1;
  min-width: 160px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #067647;
  font-size: 12px;
  font-weight: 700;
}

.pill.warn {
  background: #fffaeb;
  color: #b54708;
}

.pill.danger {
  background: #fef3f2;
  color: #b42318;
}

.settings-panel h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.setting-row {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

.setting-row label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.setting-row select,
.setting-row input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
}

.bilingual {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.bilingual button {
  border: 0;
  padding: 8px 10px;
  background: #fff;
  color: var(--muted);
}

.bilingual button.active {
  background: var(--ink);
  color: #fff;
}

.bottom-version {
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1100px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-panel {
    min-height: auto;
  }

  .mini-app {
    min-height: 760px;
  }
}

@media (max-width: 860px) {
  .mini-app,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: flex;
    gap: 8px;
    overflow: auto;
    border-radius: 0;
    border-width: 0 0 1px;
    box-shadow: none;
    padding: 10px;
  }

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

  .topbar {
    flex-wrap: wrap;
    height: auto;
  }

  .search {
    order: 3;
    max-width: none;
    flex-basis: 100%;
  }
}

@media (max-width: 560px) {
  .login-shell,
  .content {
    padding: 14px;
  }

  .login-panel,
  .preview-panel {
    padding: 18px;
  }

  .page-head,
  .task-line,
  .card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .primary-btn,
  .ghost-btn {
    width: 100%;
  }
}
