:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-dark: #10181f;
  --line: #e4e9ee;
  --line-strong: #d6dde5;
  --text: #1f2937;
  --muted: #7a8699;
  --primary: #12715b;
  --primary-dark: #0f5b49;
  --primary-soft: rgba(18, 113, 91, 0.1);
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger-soft: rgba(220, 38, 38, 0.1);
  --shadow: 0 10px 28px rgba(16, 24, 31, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
}

body.drawer-open {
  overflow: hidden;
}

.hidden { display: none !important; }

.shell {
  max-width: none;
  margin: 0;
  padding: 0;
}

.auth-grid,
.layout,
.stats-grid,
.auth-stack {
  display: grid;
  gap: 20px;
}

.auth-grid {
  grid-template-columns: 1.1fr 0.9fr;
  min-height: calc(100vh - 72px);
  align-items: center;
}

.auth-stack { grid-template-columns: 1fr; }

.auth-hero,
.panel,
.stat-card,
.workspace-sidebar {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.auth-hero,
.panel,
.workspace-sidebar {
  padding: 20px;
}

.brand-pill,
.user-chip,
.badge,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

.brand-pill,
.user-chip,
.section-kicker {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(18, 113, 91, 0.14);
}

.auth-hero h1,
.topbar h1,
.section-head h2 {
  margin: 12px 0;
}

.auth-hero h1,
.topbar h1 {
  font-size: clamp(1.45rem, 2.6vw, 2rem);
}

.auth-hero p,
.section-head p,
.sidebar-label,
.meta,
.message {
  color: var(--muted);
}

.stack { display: grid; gap: 12px; }

input,
select,
button,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  font: inherit;
}

input,
select,
textarea {
  background: var(--surface-soft);
}

button {
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

button:hover { background: var(--primary-dark); }

button.ghost {
  background: transparent;
  color: var(--text);
}

button.small {
  width: auto;
  padding: 10px 14px;
}

.message { min-height: 20px; margin-top: 10px; }

.app-topbar { margin-bottom: 22px; }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  background: #f8f7f5;
  border-bottom: 1px solid var(--line);
  padding: 12px 24px;
  box-shadow: 0 1px 0 rgba(16, 24, 31, 0.03);
}

.page-heading h1 {
  margin: 2px 0 0;
  font-size: 1.15rem;
}

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

.profile-menu-shell {
  position: relative;
}

.header-meta {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.upgrade-button {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-weight: 700;
}

.header-link {
  color: var(--muted);
}

.profile-menu-button {
  cursor: pointer;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  display: grid;
  gap: 2px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(16, 24, 31, 0.16);
  z-index: 30;
}

.profile-menu-link {
  justify-content: flex-start;
  border-radius: 10px;
  padding: 12px 14px;
}

.profile-menu-link:hover {
  background: #f5f7f9;
}

.profile-menu-danger {
  color: #b42318;
}

.workspace-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 84px);
}

.workspace-sidebar {
  align-self: stretch;
  position: sticky;
  top: 0;
  border-radius: 0;
  border-top: 0;
  border-left: 0;
  border-bottom: 0;
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: none;
  min-height: calc(100vh - 84px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f3faf6;
  color: var(--primary);
  font-weight: 800;
}

.sidebar-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.sidebar-block + .sidebar-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sidebar-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  color: var(--muted);
}

.nav-link {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: #748090;
  border: 1px solid transparent;
  padding: 13px 16px;
  border-radius: 12px;
  font-weight: 600;
}

.nav-link + .nav-link {
  margin-top: 6px;
}

.nav-link.active {
  background: #ede7e1;
  color: #2d3743;
  border-color: transparent;
}

.nav-link:hover {
  background: #f7f9fb;
  color: #314150;
}

.workspace-main {
  min-width: 0;
  padding: 24px 28px;
}

.module-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
}

.module-sidebar {
  background: #f8f7f5;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 14px 16px 0;
  box-shadow: none;
  align-self: start;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.module-content {
  min-width: 0;
  padding-left: 24px;
}

.plain-page {
  min-height: 720px;
}

.module-search {
  margin-bottom: 14px;
}

.module-search input {
  background: #f4f6f8;
}

.module-add-button {
  margin-bottom: 18px;
  background: #3b7b63;
  border-radius: 12px;
  font-weight: 700;
}

.module-group + .module-group {
  margin-top: 16px;
}

.module-group-label {
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 10px;
}

.module-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  margin: 0 0 8px;
  border-radius: 12px;
  color: #384250;
  background: transparent;
  border: 1px solid transparent;
  padding: 13px 14px;
  font-weight: 600;
}

.module-tab::before {
  content: attr(data-icon);
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #f4f7f5;
  color: #5a8a76;
  font-size: 0.9rem;
  font-weight: 800;
}

.module-tab.active {
  background: #eee8e3;
  color: #2a323d;
  border-color: transparent;
}

.module-tab.active::before {
  background: #ffffff;
  color: var(--primary);
}

.module-page-title {
  font-size: 1rem;
  font-weight: 700;
  color: #303844;
  margin-bottom: 12px;
}

.tools-shell {
  grid-template-columns: 280px minmax(0, 1fr);
}

.account-manager-actions {
  display: grid;
  gap: 10px;
}

.module-outline-button {
  background: #fff;
  color: #384250;
  border: 1px dashed var(--line-strong);
  text-align: left;
}

.module-outline-button:hover {
  background: #f8fafc;
}

.compact-form input,
.compact-form select,
.compact-form button {
  padding-top: 10px;
  padding-bottom: 10px;
}

.module-divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0 12px;
}

.small-note {
  font-size: 0.86rem;
}

.account-manager-stack {
  display: grid;
  gap: 18px;
}

.account-collection-card {
  min-height: 420px;
}

.account-collection-tools {
  display: grid;
  grid-template-columns: 1fr 54px 54px;
  gap: 0;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 10px;
}

.account-collection-tools input {
  border-radius: 10px 0 0 10px;
  margin: 0;
}

.account-tool-button {
  border-radius: 0;
  background: #f1f4f6;
  color: #73808f;
  border-color: var(--line);
}

.account-tool-button-add {
  background: #e6f0eb;
  color: #2c745a;
}

.account-tool-button-delete {
  background: #f8eeec;
  color: #d46b5c;
}

.account-table-head {
  display: grid;
  gap: 14px;
  color: #a1a9b6;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 14px 14px;
  border-bottom: 1px solid var(--line);
}

#cloudAccountsPanel .account-table-head {
  grid-template-columns: 1.2fr 1fr 1fr 0.9fr 0.8fr 1fr;
}

#webAccountsPanel .account-table-head {
  grid-template-columns: 1.2fr 1fr 1fr 0.95fr 0.9fr 0.8fr 1.1fr;
}

.account-card-list {
  max-height: 420px;
}

.account-table-list {
  gap: 0;
}

.account-table-row {
  display: grid;
  gap: 14px;
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 14px;
  cursor: pointer;
}

#cloudAccountsPanel .account-table-row {
  grid-template-columns: 1.2fr 1fr 1fr 0.9fr 0.8fr 1fr;
}

#webAccountsPanel .account-table-row {
  grid-template-columns: 1.2fr 1fr 1fr 0.95fr 0.9fr 0.8fr 1.1fr;
}

.account-row-cell {
  min-width: 0;
  font-size: 0.92rem;
  color: #546171;
}

.account-row-account .card-title {
  margin-bottom: 4px;
}

.account-row-actions {
  margin-top: 0;
  justify-content: flex-end;
}

.account-table-row.selected {
  background: #f3f8f5;
  box-shadow: inset 3px 0 0 var(--primary);
}

.account-empty-stage {
  min-height: 260px;
}

.link-device-copy {
  margin-bottom: 12px;
}

.link-device-state {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.state-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.state-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.link-step-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.link-step-list .link-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.link-step-list .link-step.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.link-step-index {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f6f9f7;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--primary);
}

.link-step-list .meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.link-device-panel {
  max-width: 720px;
}

.link-session-meta {
  margin-top: 14px;
}

.file-manager-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
}

.file-manager-canvas {
  min-height: 720px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.file-empty-canvas {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #a3adb9;
}

.file-empty-illustration {
  font-size: 6rem;
  line-height: 1;
  opacity: 0.32;
  filter: grayscale(1);
}

.file-canvas-list {
  position: relative;
  z-index: 1;
  max-height: none;
}

.file-manager-rail {
  background: transparent;
}

.file-manager-actions-top {
  display: grid;
  grid-template-columns: 1fr 86px;
  gap: 8px;
  margin-bottom: 12px;
}

.small-icon-button {
  font-size: 1rem;
}

.danger {
  background: #dc6258;
  color: #fff;
}

.danger:hover {
  background: #c94d44;
}

.file-new-folder {
  margin-bottom: 16px;
  background: #edf5f1;
  color: #3f7d66;
}

.rail-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.rail-section h3 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.upload-dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 22px 16px;
  text-align: center;
  background: #fafcfd;
}

.upload-drop-icon {
  font-size: 2.4rem;
  color: #7ca290;
  margin-bottom: 8px;
}

.browser-files-button {
  margin-top: 10px;
  background: #3b7b63;
}

.rail-button {
  margin-bottom: 12px;
}

.rail-label {
  display: block;
  margin: 10px 0 8px;
  font-size: 0.86rem;
  color: var(--muted);
}

.wa-page-select {
  margin-top: 14px;
}

.wa-page-select select {
  background: #fff;
}

.utility-hidden {
  display: none !important;
}

.editor-drawer {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.table-tools {
  display: grid;
  grid-template-columns: 220px 54px;
  gap: 0;
  overflow: hidden;
  border-radius: 10px;
}

.table-tools input {
  border-radius: 10px 0 0 10px;
  margin: 0;
}

.export-inline-form {
  max-width: 560px;
  margin-bottom: 18px;
}

.wa-empty-stage {
  min-height: 420px;
  display: grid;
  place-items: center;
  gap: 14px;
  color: #a3adb9;
  text-align: center;
  padding: 24px;
}

.wa-empty-stage h3 {
  margin: 0;
  color: #344152;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.wa-empty-stage p {
  margin: 0;
  max-width: 38ch;
  color: var(--muted);
  line-height: 1.6;
}

.centered-button {
  width: auto;
  min-width: 220px;
  border-radius: 999px;
  background: #57c266;
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

.centered-button:hover {
  background: #46b356;
}

.file-type-tabs {
  display: grid;
  grid-template-columns: 1fr;
}

.file-type-tabs .account-tab {
  text-align: left;
}

.workspace-view + .workspace-view {
  margin-top: 0;
}

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

.section-head h2 {
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.section-head p {
  margin: 0;
}

.send-help {
  margin-bottom: 12px;
}

.dashboard-layout {
  grid-template-columns: 0.72fr 1.28fr;
  margin-top: 18px;
}

.dashboard-report-grid {
  margin-bottom: 18px;
}

.layout {
  grid-template-columns: 0.82fr 1.18fr;
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 1.9rem;
  letter-spacing: -0.02em;
}

.panel.wide {
  min-height: 720px;
}

.list {
  display: grid;
  gap: 12px;
  max-height: 580px;
  overflow: auto;
}

.compact-list { max-height: 360px; }

.card-item {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 12px;
  padding: 14px;
}

.wa-list-row {
  background: #fff;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr) auto;
  gap: 14px;
  align-items: center;
}

.wa-list-row .panel-head {
  margin-bottom: 0;
}

.wa-list-row .card-title {
  font-size: 1rem;
}

.wa-row-main {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.wa-row-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #f1f6f3;
  color: var(--primary);
  font-weight: 800;
}

.wa-row-copy {
  min-width: 0;
}

.wa-row-copy .card-title {
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-row-meta {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-row-badgebar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wa-row-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.plain-page .card-item {
  background: #fff;
}

.report-grid,
.report-sections,
.integrations-grid {
  display: grid;
  gap: 18px;
}

.report-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

.report-filmstrip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.report-filmstrip .report-section {
  min-height: 140px;
}

.integrations-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 18px;
}

.integration-card {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.integration-card-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #f4f7f5;
  font-size: 1.8rem;
}

.integration-card h3 {
  margin: 4px 0 12px;
  font-size: 1.6rem;
}

.integration-card-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.report-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 22px;
  min-height: 180px;
}

.report-section h3 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.report-section strong {
  display: block;
  margin-top: 18px;
  font-size: 2.4rem;
  color: var(--primary);
}

.report-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.report-mini-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.report-mini-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.report-mini-card strong {
  display: block;
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 6px;
}

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

.api-doc-card {
  min-height: 210px;
  padding: 26px;
}

.api-doc-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eef6f2;
  font-size: 1.5rem;
  margin-bottom: 18px;
}

.docs-drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.docs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.docs-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(760px, 100vw);
  height: 100%;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -16px 0 40px rgba(16, 24, 31, 0.14);
  padding: 24px;
  overflow: auto;
}

.docs-meta {
  color: var(--muted);
  margin-bottom: 18px;
}

.docs-grid {
  display: grid;
  gap: 16px;
}

.docs-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.docs-card h3 {
  margin: 0 0 8px;
}

.docs-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.docs-list-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface-soft);
}

.docs-list-item strong {
  display: block;
  margin-bottom: 8px;
}

.docs-list-item code {
  display: inline-block;
  padding: 6px 8px;
  border-radius: 8px;
  background: #eaf3ef;
  color: var(--primary-dark);
  font-size: 0.86rem;
}

.history-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.history-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  text-align: center;
}

.history-stat strong {
  display: block;
  font-size: 1.6rem;
  color: var(--primary);
  margin-top: 4px;
}

.history-table-head {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  color: #a1a9b6;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 14px 14px;
  border-bottom: 1px solid var(--line);
}

.history-table-list {
  display: flex;
  flex-direction: column;
}

.history-table-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: center;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.history-row-cell {
  min-width: 0;
  font-size: 0.92rem;
  color: #546171;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.meta {
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.actions button { width: auto; }

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: auto;
  margin: 0;
}

.quick-links {
  display: grid;
  gap: 10px;
}

.quick-link {
  text-align: left;
  background: var(--surface-soft);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 600;
}

.quick-link:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.user-chip {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  justify-content: center;
  padding: 0;
  background: var(--primary);
  color: #fff;
  border: 0;
}

.manager-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.file-type-tabs {
  flex-wrap: wrap;
}

.storage-bar {
  width: 100%;
  height: 10px;
  background: #e2ebe7;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.storage-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #12715b 0%, #22a07f 100%);
  border-radius: inherit;
}

.tools-shell .module-tab {
  padding-left: 12px;
}

.tools-shell .module-tab.active {
  background: #f2ebe6;
}

.profile-section {
  margin-bottom: 18px;
}

.badge {
  padding: 6px 10px;
  text-transform: uppercase;
}

.badge.ok { background: var(--primary-soft); color: var(--primary); }
.badge.warn { background: var(--warning-soft); color: #a16207; }
.badge.error { background: var(--danger-soft); color: #a93d3d; }

.account-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.account-tab {
  width: auto;
  background: #fff;
  color: var(--muted);
  border-color: var(--line);
}

.account-tab.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(18, 113, 91, 0.14);
}

.meta-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.pairing-account {
  font-weight: 700;
}

.qr-stage {
  min-height: 320px;
  border: 1px dashed var(--line-strong);
  background: var(--surface-soft);
  border-radius: 20px;
  display: grid;
  place-items: center;
  padding: 20px;
}

.qr-empty {
  color: var(--muted);
  text-align: center;
  max-width: 28ch;
}

.qr-image {
  width: min(100%, 320px);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 18px;
  background: #fff;
  padding: 10px;
  border: 1px solid var(--line);
}

.runtime-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.runtime-meta .meta-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}

.doc-card + .doc-card {
  margin-top: 14px;
}

.small-activity {
  min-height: 120px;
}

.activity {
  margin: 0;
  min-height: 260px;
  max-height: 620px;
  overflow: auto;
  background: #111827;
  color: #d8eee8;
  border-radius: 12px;
  padding: 18px;
}

.inline-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  margin-bottom: 12px;
}

.inline-form button { width: auto; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.toggle-row input { width: auto; }

.top-gap { margin-top: 12px; }

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

  .module-shell {
    grid-template-columns: 1fr;
  }

  .account-manager-grid {
    grid-template-columns: 1fr;
  }

  .file-manager-shell {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar {
    position: static;
  }

  .module-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 980px) {
  .auth-grid,
  .layout,
  .dashboard-layout,
  .stats-grid,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .docs-panel {
    width: 100%;
  }

  .account-tabs {
    overflow: auto;
    padding-bottom: 4px;
  }
}
