:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --line: #dde4ef;
  --line-strong: #c8d2e1;
  --text: #142033;
  --muted: #627089;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --teal: #0f766e;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --shadow: 0 12px 34px rgba(20, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  overflow-x: hidden;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

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

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--blue);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

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

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.topbar-meta strong {
  padding: 6px 10px;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 999px;
  font-size: 12px;
}

.sidebar {
  position: fixed;
  z-index: 10;
  top: 68px;
  bottom: 0;
  left: 0;
  width: 264px;
  padding: 18px 14px 24px;
  background: #101827;
  border-right: 1px solid #0f172a;
  overflow: auto;
}

.mobile-menu-toggle,
.mobile-menu-button {
  display: none;
}

.sidebar-nav {
  display: grid;
  gap: 2px;
}

.sidebar-section {
  margin: 18px 10px 8px;
  color: #8fa1bd;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.sidebar-section:first-child {
  margin-top: 4px;
}

.sidebar a {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: #d7e0ee;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  position: relative;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.sidebar a:hover,
.sidebar a:focus-visible {
  color: #ffffff;
  background: #1b2940;
  border-color: #3b82f6;
  transform: translateX(3px);
  box-shadow: inset 3px 0 0 #60a5fa;
  outline: none;
}

.page-dashboard .sidebar a[data-menu="dashboard"],
.page-projects .sidebar a[data-menu="projects"],
.page-keywords .sidebar a[data-menu="keywords"],
.page-rankings .sidebar a[data-menu="rankings"],
.page-tasks .sidebar a[data-menu="tasks"],
.page-audits .sidebar a[data-menu="audits"],
.page-articles .sidebar a[data-menu="articles"],
.page-indexing .sidebar a[data-menu="indexing"],
.page-backlinks .sidebar a[data-menu="backlinks"],
.page-competitors .sidebar a[data-menu="competitors"],
.page-users .sidebar a[data-menu="users"],
.page-settings .sidebar a[data-menu="settings"] {
  color: #ffffff;
  background: #1d4ed8;
  border-color: #3b82f6;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.sidebar a span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #cfe0ff;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 900;
  transition: background 160ms ease, color 160ms ease;
}

.sidebar a:hover span,
.sidebar a:focus-visible span,
.page-dashboard .sidebar a[data-menu="dashboard"] span,
.page-projects .sidebar a[data-menu="projects"] span,
.page-keywords .sidebar a[data-menu="keywords"] span,
.page-rankings .sidebar a[data-menu="rankings"] span,
.page-tasks .sidebar a[data-menu="tasks"] span,
.page-audits .sidebar a[data-menu="audits"] span,
.page-articles .sidebar a[data-menu="articles"] span,
.page-indexing .sidebar a[data-menu="indexing"] span,
.page-backlinks .sidebar a[data-menu="backlinks"] span,
.page-competitors .sidebar a[data-menu="competitors"] span,
.page-users .sidebar a[data-menu="users"] span,
.page-settings .sidebar a[data-menu="settings"] span {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
}

.module-page {
  display: grid;
  gap: 18px;
}

main {
  margin-left: 264px;
  padding: 96px 34px 42px;
  max-width: 100%;
}

.alert {
  margin-bottom: 18px;
  padding: 13px 15px;
  border-radius: 8px;
  font-weight: 800;
}

.alert.success {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
}

.alert.error {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

footer {
  display: none;
}

.dashboard h1,
.module-page h1,
.page-header h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}

.dashboard p,
.module-page p,
.page-header p {
  max-width: 760px;
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

.dashboard-page {
  display: grid;
  gap: 18px;
  max-width: 100%;
}

.dashboard-hero {
  padding: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f6ff 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  min-width: 0;
}

.dashboard-layout .chart-panel-wide {
  grid-column: 1 / -1;
}

.activity-list {
  display: grid;
  gap: 10px;
  max-height: 250px;
  overflow: auto;
  padding-right: 4px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.activity-item > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: var(--blue);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 900;
}

.activity-item strong,
.activity-item em {
  display: block;
}

.activity-item strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.activity-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.quick-actions a {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 18px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-decoration: none;
}

.quick-actions a:hover {
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

.quick-actions strong,
.quick-actions span {
  display: block;
}

.quick-actions strong {
  font-size: 15px;
}

.quick-actions span {
  color: var(--muted);
  line-height: 1.45;
}

.status-card {
  min-height: auto;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: #f8fbff;
  border-color: #d7e5f7;
  box-shadow: none;
}

.status-card::before {
  content: "OK";
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 900;
}

.status-card strong {
  margin: 0 0 4px;
}

.status-card span {
  color: #475569;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.report-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.report-action,
.report-actions button,
.export-form select {
  flex: 0 0 auto;
  padding: 11px 15px;
  border: 1px solid #1d4ed8;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}

.report-action,
.report-actions button {
  color: #ffffff;
  background: var(--blue);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
  text-decoration: none;
  cursor: pointer;
}

.export-form {
  display: flex;
  gap: 8px;
  margin: 0;
}

.export-form select {
  color: var(--text);
  background: #ffffff;
  border-color: var(--line-strong);
}

.report-action:hover,
.report-actions button:hover {
  background: #1d4ed8;
}

.report-action.secondary {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #bfdbfe;
  box-shadow: none;
}

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

.metric-grid {
  margin-top: 18px;
}

article,
.form-panel,
.records-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

article {
  min-height: 120px;
  padding: 20px;
}

article strong,
article span {
  display: block;
}

article strong {
  margin-bottom: 10px;
  font-size: 15px;
}

article span {
  color: var(--muted);
  line-height: 1.5;
}

.metric-card {
  min-height: 118px;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--blue);
}

.metric-card:nth-child(2)::before {
  background: var(--teal);
}

.metric-card:nth-child(3)::before {
  background: var(--green);
}

.metric-card:nth-child(4)::before {
  background: var(--amber);
}

.metric-card span,
.metric-card em {
  color: var(--muted);
  font-style: normal;
}

.metric-card strong {
  margin: 10px 0 6px;
  font-size: 30px;
  line-height: 1;
}

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

.chart-panel {
  min-height: 300px;
}

.chart-panel-wide {
  grid-column: 1 / -1;
}

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

.panel-title strong {
  margin: 0;
  font-size: 15px;
}

.panel-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.line-chart {
  padding: 8px 0 0;
  max-width: 100%;
}

.line-chart svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.line-chart line {
  stroke: var(--line);
  stroke-width: 2;
}

.line-chart polyline {
  fill: none;
  stroke: var(--blue);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart circle {
  fill: #ffffff;
  stroke: var(--blue);
  stroke-width: 4;
}

.line-chart text {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.bar-chart {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 14px;
  padding-top: 10px;
}

.bar-chart div {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
}

.bar-chart span {
  display: block;
  min-height: 18px;
  background: var(--teal);
  border-radius: 7px 7px 0 0;
}

.bar-chart em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

.donut-wrap {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.donut {
  width: 156px;
  height: 156px;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 62%, var(--amber) 62% 87%, var(--red) 87% 100%);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(20, 32, 51, 0.08);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 34px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line);
}

.legend {
  display: grid;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
}

.legend .good {
  background: var(--green);
}

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

.legend .bad {
  background: var(--red);
}

.form-panel,
.records-panel {
  margin-top: 18px;
  padding: 20px;
}

.module-page .form-panel,
.module-page .records-panel {
  margin-top: 0;
}

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

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

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

.field span {
  color: #34415a;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field textarea {
  min-height: 108px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(37, 99, 235, 0.14);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

.form-actions button {
  min-height: 42px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--blue);
  border: 1px solid #1d4ed8;
  border-radius: 7px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
  font-weight: 800;
  cursor: pointer;
}

.form-actions button:hover {
  background: #1d4ed8;
}

.form-actions .secondary {
  color: #34415a;
  background: #eef2f7;
  border-color: #d6deea;
  box-shadow: none;
}

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

.records-header strong,
.records-header span {
  display: block;
}

.records-header strong {
  font-size: 18px;
}

.records-header span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.records-header a {
  flex: 0 0 auto;
  padding: 8px 11px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

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

.data-table-wrap {
  margin-top: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: var(--surface-muted);
}

.data-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.data-table tbody tr:nth-child(even):hover {
  background: #f1f5fb;
}

.data-table th {
  color: #34415a;
  background: #eef4fb;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

.data-table td {
  color: #334155;
}

.project-name {
  color: var(--text);
  font-size: 14px;
}

.domain-link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 800;
}

.domain-link:hover {
  text-decoration: underline;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: #166534;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: #1e40af;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 30px;
  padding: 0 10px;
  color: #0f766e;
  background: #ccfbf1;
  border: 1px solid #5eead4;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.date-chip {
  display: inline-flex;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

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

.row-actions form {
  margin: 0;
}

.edit-action,
.delete-action {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.edit-action {
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #bfdbfe;
}

.delete-action {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

.empty-state {
  margin-top: 14px;
  padding: 14px;
  color: var(--muted);
  background: var(--surface-muted);
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .topbar {
    position: sticky;
    height: auto;
    min-height: 64px;
    padding: 12px 16px;
  }

  .topbar-meta {
    display: none;
  }

  .sidebar {
    position: sticky;
    top: 64px;
    z-index: 15;
    width: 100%;
    bottom: auto;
    display: block;
    padding: 10px 12px;
    border-right: 0;
    overflow: visible;
  }

  .mobile-menu-button {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 0 14px;
    color: #ffffff;
    background: #1d4ed8;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  }

  .mobile-menu-button:hover,
  .mobile-menu-button:focus-visible,
  .mobile-menu-toggle:checked + .mobile-menu-button {
    background: #1e40af;
    border-color: #60a5fa;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
  }

  .mobile-menu-button strong {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: #dbeafe;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    font-size: 16px;
    line-height: 1;
  }

  .sidebar-nav {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #25344f;
  }

  .mobile-menu-toggle:checked ~ .sidebar-nav {
    display: grid;
  }

  .sidebar-section {
    display: none;
  }

  .sidebar a {
    min-height: 40px;
    padding: 8px 10px;
    white-space: normal;
  }

  .sidebar a:hover,
  .sidebar a:focus-visible {
    transform: translateY(-1px);
    box-shadow: inset 0 0 0 1px #60a5fa;
  }

  .sidebar a span {
    width: 26px;
    height: 26px;
  }

  main {
    margin-left: 0;
    padding: 20px 16px 34px;
    width: 100%;
  }

  .page-header,
  .donut-wrap {
    display: block;
  }

  .report-action {
    display: inline-block;
    margin-top: 14px;
  }

  .report-layout {
    grid-template-columns: 1fr;
  }

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

  .dashboard-hero {
    display: grid;
    gap: 16px;
  }

  .dashboard-hero .report-actions {
    justify-content: stretch;
  }

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

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

  .form-actions button {
    flex: 1;
  }

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

  .donut {
    margin: 20px auto;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 15px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

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

  .brand small {
    font-size: 11px;
  }

  .sidebar {
    top: 60px;
  }

  main {
    padding: 16px 12px 28px;
  }

  .dashboard-page {
    gap: 14px;
  }

  .dashboard h1,
  .module-page h1,
  .page-header h1 {
    font-size: 24px;
  }

  .dashboard-hero,
  .form-panel,
  .records-panel {
    padding: 16px;
  }

  .dashboard-hero {
    margin: 0;
  }

  .dashboard-hero .page-header,
  .dashboard-hero {
    width: 100%;
  }

  .metric-grid,
  .grid,
  .quick-actions {
    grid-template-columns: 1fr;
  }

  article {
    min-height: auto;
    padding: 16px;
  }

  .chart-panel {
    min-height: auto;
    padding: 16px;
  }

  .panel-title {
    display: grid;
    gap: 4px;
  }

  .line-chart {
    overflow: hidden;
  }

  .line-chart svg {
    min-width: 0;
    width: 100%;
  }

  .bar-chart {
    height: 190px;
    gap: 10px;
  }

  .bar-chart em {
    font-size: 11px;
  }

  .report-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    width: 100%;
  }

  .export-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .report-action,
  .report-actions button,
  .export-form select {
    width: 100%;
    min-height: 44px;
    text-align: center;
  }

  .activity-list {
    max-height: none;
    padding-right: 0;
  }

  .activity-item {
    align-items: flex-start;
  }

  .quick-actions a {
    min-height: auto;
  }

  .records-header {
    display: grid;
    gap: 12px;
  }

  .records-header a {
    width: fit-content;
  }

  .data-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .data-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    padding: 4px 0;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(20, 32, 51, 0.06);
    overflow: hidden;
  }

  .data-table tbody tr:nth-child(even),
  .data-table tbody tr:hover,
  .data-table tbody tr:nth-child(even):hover {
    background: #ffffff;
  }

  .data-table td {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    word-break: break-word;
  }

  .data-table td:last-child {
    border-bottom: 0;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .domain-link {
    word-break: break-all;
  }

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

  .edit-action,
  .delete-action {
    justify-content: center;
    min-height: 36px;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .topbar {
    padding: 10px 12px;
  }

  .sidebar {
    top: 56px;
    padding: 8px 10px;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .sidebar a {
    font-size: 13px;
  }

  main {
    padding: 14px 10px 24px;
  }

  .dashboard-hero,
  .form-panel,
  .records-panel,
  article {
    border-radius: 8px;
  }

  .dashboard h1,
  .module-page h1,
  .page-header h1 {
    font-size: 22px;
  }

  .module-form {
    gap: 12px;
  }

  .metric-card strong {
    font-size: 26px;
  }

  .activity-item {
    padding: 10px;
  }

  .activity-item > span {
    width: 30px;
    height: 30px;
  }

  .field input,
  .field select,
  .field textarea {
    min-height: 46px;
  }

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

  .records-header a,
  .report-action,
  .report-actions button {
    width: 100%;
  }
}
