:root {
  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-2: #edf3f1;
  --line: #d8e2df;
  --text: #17211f;
  --muted: #63706d;
  --teal: #087b66;
  --blue: #1d64b5;
  --amber: #a56608;
  --red: #c63333;
  --green: #167447;
  --sidebar: #173b34;
  --shadow: 0 8px 24px rgba(20, 49, 43, 0.07);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: var(--sidebar);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f3b61f;
  color: #173b34;
  font-weight: 800;
  letter-spacing: 0;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
}

.brand p,
.server-note span,
.eyebrow {
  margin: 0;
  color: #98a2b3;
  font-size: 13px;
}

.nav-tabs {
  display: grid;
  gap: 8px;
}

.nav-tab {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d5e5e1;
  text-align: left;
}

.nav-tab.active,
.nav-tab:hover {
  background: #ffffff;
  color: #174c40;
  border-color: #ffffff;
}

.server-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid #344054;
  border-radius: 8px;
  display: grid;
  gap: 4px;
}

.workspace {
  min-width: 0;
  padding: 22px 28px 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.topbar h2 {
  margin: 6px 0 0;
  font-size: 28px;
}

.top-actions,
.upload-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.ghost-button,
.danger-button,
.text-button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 14px;
}

.primary-button {
  background: var(--teal);
  color: #fff;
}

.primary-button:hover {
  background: #0b625c;
}

.ghost-button {
  background: #fff;
  color: var(--text);
  border-color: var(--line);
}

.danger-button {
  background: #fff;
  color: var(--red);
  border-color: #fecaca;
}

.text-button {
  background: transparent;
  color: var(--blue);
  padding: 0;
}

.icon-button {
  width: 38px;
  padding: 0;
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
}

.compact {
  min-height: 34px;
}

.hidden {
  display: none !important;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #f6f7f9;
}

.auth-card {
  width: min(460px, 100%);
  display: grid;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-brand {
  color: var(--text);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form h2,
.auth-form p {
  margin: 0;
}

.auth-form p {
  color: var(--muted);
  line-height: 1.55;
}

.user-badge {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 104px;
  box-shadow: var(--shadow);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  color: #173b34;
}

.metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.metric-red {
  border-left: 4px solid var(--red);
  background: #fff8f8;
}

.metric-red strong {
  color: var(--red);
}

.metric-yellow {
  border-left: 4px solid #d79a16;
  background: #fffdf5;
}

.metric-yellow strong {
  color: #9a6500;
}

.dashboard-grid,
.document-layout,
.marketing-layout,
.smart-layout,
.meeting-layout,
.analysis-layout,
.user-admin-layout {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 16px;
}

.panel,
.upload-zone {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
}

.section-commandbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid #cddbd7;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #fff;
}

.section-commandbar > div:first-child {
  display: grid;
  gap: 4px;
}

.section-commandbar strong {
  font-size: 17px;
}

.section-commandbar span,
.platform-note,
.post-meta,
.due-line {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.command-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.compact-select {
  width: auto;
  min-width: 170px;
}

.notification-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

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

.panel-head h3,
.upload-zone h3 {
  margin: 0;
  font-size: 18px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 210px 160px 150px;
  gap: 10px;
  margin-bottom: 12px;
}

.customer-toolbar {
  grid-template-columns: minmax(240px, 1fr) 210px 160px 150px auto;
}

.agent-toolbar {
  grid-template-columns: minmax(260px, 1fr) auto;
}

.marketing-toolbar {
  grid-template-columns: minmax(260px, 1fr) 170px 170px 130px;
}

.meeting-toolbar {
  grid-template-columns: minmax(260px, 1fr) 170px 130px;
}

.order-toolbar {
  grid-template-columns: minmax(260px, 1fr) 130px;
}

.inventory-toolbar {
  grid-template-columns: minmax(260px, 1fr) 170px 120px 130px;
}

.task-toolbar {
  grid-template-columns: minmax(260px, 1fr) 170px 150px 130px;
}

.automation-toolbar {
  grid-template-columns: minmax(260px, 1fr) 190px 190px;
}

.automation-layout {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.5fr);
  gap: 16px;
  align-items: start;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-height: 40px;
  padding: 9px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
}

.table-wrap.tall {
  max-height: calc(100vh - 190px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: #344054;
  font-size: 13px;
  z-index: 1;
}

td {
  font-size: 14px;
}

.followup-row-red td {
  background: #fff1f1;
}

.followup-row-yellow td {
  background: #fff9df;
}

.followup-row-red td:first-child {
  border-left: 4px solid var(--red);
}

.followup-row-yellow td:first-child {
  border-left: 4px solid #d79a16;
}

.followup-warning {
  display: block;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;
}

.followup-warning-red {
  background: #fbdcdc;
  color: #9f1d1d;
}

.followup-warning-yellow {
  background: #fce9a9;
  color: #765000;
}

.name-cell strong {
  display: block;
  margin-bottom: 4px;
}

.name-cell small {
  color: var(--muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef2f6;
  color: #344054;
  font-size: 12px;
  white-space: nowrap;
}

.pill.status-hot {
  background: #fef3c7;
  color: #92400e;
}

.pill.status-won {
  background: #dcfce7;
  color: #166534;
}

.pill.status-paused {
  background: #fee2e2;
  color: #991b1b;
}

.priority-high {
  color: var(--red);
  font-weight: 700;
}

.priority-mid {
  color: var(--amber);
  font-weight: 700;
}

.priority-low {
  color: var(--green);
  font-weight: 700;
}

.row-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

a.ghost-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.category-bars {
  display: grid;
  gap: 12px;
}

.analysis-bars {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.analysis-bars h4 {
  margin: 4px 0 0;
  font-size: 14px;
  color: #344054;
}

.bar-item {
  display: grid;
  gap: 7px;
}

.bar-line {
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--blue);
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.stage {
  min-width: 180px;
  background: #eef2f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.stage h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

.lead-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}

.lead-card.followup-card-red {
  border-left: 4px solid var(--red);
  background: #fff7f7;
}

.lead-card.followup-card-yellow {
  border-left: 4px solid #d79a16;
  background: #fffdf3;
}

.lead-card strong {
  display: block;
  margin-bottom: 6px;
}

.lead-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.follow-panel {
  margin-top: 16px;
}

.activity-list,
.document-list,
.campaign-list,
.meeting-list,
.template-list,
.meeting-actions,
.order-list,
.smart-list,
.task-list,
.user-list,
.notification-list,
.marketing-post-list,
.social-connection-list {
  display: grid;
  gap: 10px;
}

.notification-item,
.marketing-post-item {
  padding: 14px 4px 16px;
  border-bottom: 1px solid var(--line);
}

.notification-item:last-child,
.marketing-post-item:last-child {
  border-bottom: 0;
}

.notification-item.is-unread {
  padding-left: 13px;
  border-left: 3px solid var(--blue);
  background: linear-gradient(90deg, #f2f7fb, rgba(242, 247, 251, 0));
}

.notification-item header,
.marketing-post-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.notification-item header > div,
.marketing-post-item header > div {
  display: grid;
  gap: 7px;
}

.notification-item header strong,
.marketing-post-item header strong {
  font-size: 16px;
}

.notification-item small,
.marketing-post-item small,
.marketing-post-item time {
  color: var(--muted);
  font-size: 12px;
}

.notification-item p,
.marketing-post-item p {
  margin: 0 0 12px;
  color: #35413e;
  line-height: 1.65;
}

.notification-item .row-actions,
.marketing-post-item .row-actions {
  margin-top: 12px;
  flex-wrap: wrap;
}

.due-line {
  margin-top: 8px;
  color: var(--red);
}

.status-info {
  background: #dfeefa;
  color: #174f83;
}

.platform-pill {
  background: #e7f3ef;
  color: #145b4d;
}

.social-connection {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.social-connection:last-child {
  border-bottom: 0;
}

.social-logo {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7edf4;
  color: #344054;
  font-weight: 800;
}

.social-logo.facebook {
  background: #e4eefb;
  color: #1d64b5;
}

.social-logo.zalo {
  background: #e3f5f5;
  color: #087b66;
}

.social-logo.tiktok {
  background: #17191d;
  color: #fff;
}

.social-logo.chatgpt {
  background: #e8f4ef;
  color: #176c55;
  font-size: 12px;
}

.social-connection strong,
.social-connection p {
  display: block;
  margin: 0;
}

.social-connection p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.platform-note {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.activity-item,
.document-item,
.campaign-item,
.meeting-item,
.template-card,
.action-item,
.order-item,
.smart-item,
.task-item,
.user-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.activity-item header,
.document-item header,
.campaign-item header,
.meeting-item header,
.template-card header,
.order-item header,
.smart-item header,
.task-item header,
.user-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.activity-item p,
.document-item p,
.campaign-item p,
.meeting-item p,
.template-card p,
.action-item p,
.order-item p,
.smart-item p,
.task-item p,
.user-item p,
.upload-zone p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
  color: #475467;
  font-size: 13px;
}

.item-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.campaign-item header strong,
.meeting-item header strong,
.template-card header strong,
.action-item strong {
  display: block;
  margin-bottom: 5px;
}

.campaign-item .row-actions,
.meeting-item .row-actions {
  margin-top: 12px;
}

.template-card {
  background: #fbfcfd;
}

.smart-item {
  background: #fbfcfd;
}

.task-done {
  opacity: 0.72;
}

.task-done strong {
  text-decoration: line-through;
}

.score-badge {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 36px;
  border-radius: 8px;
  background: #e0f2fe;
  color: #075985;
  font-weight: 800;
}

.compact-metrics {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.template-card button {
  margin-top: 12px;
}

.action-item {
  display: grid;
  gap: 6px;
}

.inline-form {
  display: grid;
  gap: 12px;
}

.user-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.user-item strong {
  display: block;
  margin-bottom: 4px;
}

.user-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.task-progress {
  position: relative;
  height: 22px;
  margin: 10px 0;
  overflow: hidden;
  border: 1px solid #cbd8d3;
  border-radius: 6px;
  background: #f2f6f4;
}

.task-progress div {
  height: 100%;
  background: #2f8a70;
  transition: width 180ms ease;
}

.task-progress span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #17231f;
  font-size: 12px;
  font-weight: 700;
}

.progress-note {
  padding: 8px 10px;
  border-left: 3px solid #2f8a70;
  background: #f4f8f6;
}

#taskOwnerField select[multiple] {
  min-height: 150px;
}

.ai-assist-row {
  display: flex;
  justify-content: flex-end;
}

.inventory-approval-panel {
  margin-top: 16px;
}

.inventory-change-item {
  grid-template-columns: minmax(0, 1fr) auto;
}

.order-line-builder {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(100px, 0.7fr) minmax(120px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.order-line-list {
  display: grid;
  gap: 8px;
}

.order-line-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 36px;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}

.order-line-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.compact-empty {
  padding: 10px;
}

.registration-request {
  grid-template-columns: minmax(0, 1fr);
}

.registration-request header {
  margin-bottom: 0;
}

.registration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.registration-actions select {
  flex: 1 1 220px;
  min-width: 0;
}

.funnel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.funnel-step {
  display: grid;
  gap: 6px;
}

.funnel-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.funnel-bar {
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.funnel-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #2563eb);
}

.insight-list {
  display: grid;
  gap: 10px;
}

.insight-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #fbfcfd;
  color: #344054;
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  border-radius: 8px;
  background: #1f2937;
  color: #fff;
  box-shadow: 0 16px 36px rgba(31, 41, 55, 0.28);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.document-layout {
  align-items: start;
}

.upload-zone {
  padding: 20px;
  display: grid;
  gap: 14px;
  border-style: dashed;
}

.upload-zone.dragging {
  border-color: var(--teal);
  background: #ecfdf5;
}

.upload-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  background: #e0f2fe;
  color: #075985;
  border-radius: 8px;
  font-weight: 800;
}

.upload-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.upload-progress {
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
}

.documents-panel {
  min-height: 520px;
}

dialog {
  width: min(880px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 22px 70px rgba(31, 41, 55, 0.22);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.dialog-form {
  padding: 18px;
}

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

.dialog-head h3 {
  margin: 0;
}

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

.conflict-box {
  margin-top: 14px;
  border: 1px solid #f5b544;
  border-radius: 8px;
  background: #fff7e6;
  color: #7a4d00;
  padding: 12px;
  line-height: 1.5;
}

.conflict-box strong {
  display: block;
  margin-bottom: 6px;
}

.import-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.import-text {
  min-height: 250px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.5;
}

.import-preview,
.license-current {
  margin-top: 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  color: #475467;
}

.license-current a {
  color: #126a52;
  font-weight: 700;
}

.agent-quarter-panel {
  margin-top: 16px;
}

.agent-quarter-panel .panel-head select {
  width: min(220px, 100%);
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
}

label.wide {
  grid-column: 1 / -1;
}

.required-field {
  color: #9a3412;
}

.dialog-actions {
  justify-content: end;
  margin-top: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
}

.order-actions {
  grid-template-columns: auto 1fr auto auto auto;
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fafafa;
  text-align: center;
  padding: 16px;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    padding: 12px;
    gap: 12px;
    overflow: hidden;
  }

  .brand,
  .server-note {
    display: none;
  }

  .nav-tabs {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .nav-tab {
    min-width: 110px;
    text-align: center;
  }

  .workspace {
    padding: 14px;
  }

  .topbar,
  .dashboard-grid,
  .document-layout,
  .marketing-layout,
  .smart-layout,
  .meeting-layout,
  .analysis-layout,
  .user-admin-layout,
  .automation-layout {
    grid-template-columns: 1fr;
    display: grid;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions button {
    flex: 1;
  }

  .section-commandbar {
    align-items: stretch;
    display: grid;
  }

  .command-actions > button {
    flex: 1;
  }

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

  .toolbar {
    grid-template-columns: 1fr;
  }

  .pipeline-board {
    grid-template-columns: repeat(6, 220px);
  }
}

@media (max-width: 620px) {
  .metrics-grid,
  .analysis-grid,
  .form-grid,
  .upload-meta,
  .item-grid,
  .order-line-builder {
    grid-template-columns: 1fr;
  }

  label.wide {
    grid-column: auto;
  }

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

  .workspace {
    padding: 12px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .top-actions .user-badge {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .section-commandbar,
  .panel {
    padding: 13px;
  }

  .command-actions {
    display: grid;
  }

  .compact-select {
    width: 100%;
  }

  .notification-item header,
  .marketing-post-item header {
    display: grid;
  }

  .row-actions {
    flex-wrap: wrap;
  }

  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .dialog-actions span {
    display: none;
  }
}
