* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #0f172a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  box-shadow: 8px 0 24px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  overflow-x: hidden;
  transition: width 180ms ease, padding 180ms ease;
  width: 260px;
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
  padding: 4px 6px 22px;
}

.brand-mark {
  align-items: center;
  background: #2563eb;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
  color: #ffffff;
  display: flex;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  flex: 0 0 42px;
  width: 42px;
}

.brand-copy {
  overflow: hidden;
  white-space: nowrap;
}

.brand strong {
  display: block;
  font-size: 17px;
  letter-spacing: 0;
}

.brand span,
.sidebar-note span,
.eyebrow {
  color: #94a3b8;
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group + .nav-group {
  margin-top: 8px;
}

.nav-group-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  color: #334155;
  display: flex;
  font-size: 13px;
  gap: 10px;
  justify-content: flex-start;
  min-height: 40px;
  padding: 7px 10px;
  text-align: left;
  width: 100%;
}

.nav-group-toggle:hover {
  background: #f1f5f9;
}

.nav-group-icon {
  align-items: center;
  background: #eef2f7;
  border-radius: 7px;
  color: #475569;
  display: inline-flex;
  flex: 0 0 28px;
  font-size: 12px;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.nav-group.group-active .nav-group-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.nav-label {
  overflow: hidden;
  white-space: nowrap;
}

.nav-group-toggle .nav-label {
  flex: 1;
  font-weight: 800;
}

.nav-chevron {
  color: #94a3b8;
  font-size: 15px;
  transition: transform 160ms ease;
}

.nav-group.collapsed .nav-chevron {
  transform: rotate(-90deg);
}

.nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-group.collapsed .nav-group-items {
  display: none;
}

.nav-section-title {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 10px 4px;
}

.nav-section-spaced {
  margin-top: 14px;
}

.nav a {
  align-items: center;
  border-radius: 12px;
  color: #475569;
  display: flex;
  font-size: 14px;
  font-weight: 700;
  gap: 10px;
  padding: 10px 14px 10px 20px;
  text-decoration: none;
}

.nav a.active {
  background: #2563eb;
  color: #ffffff;
}

.nav-icon {
  flex: 0 0 18px;
  font-size: 15px;
  text-align: center;
}

.sidebar-note {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  margin-top: auto;
  padding: 14px;
}

.sidebar-note strong {
  display: block;
  margin-top: 4px;
}

.sidebar-note p {
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
  margin: 8px 0 0;
}

.sidebar-account {
  align-items: center;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 14px 4px 0;
}

.account-avatar {
  align-items: center;
  background: #e2e8f0;
  border-radius: 7px;
  color: #334155;
  display: flex;
  flex: 0 0 32px;
  font-size: 13px;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.account-copy {
  flex: 1;
  min-width: 0;
}

.account-copy strong,
.account-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  font-size: 13px;
}

.account-copy span {
  color: #94a3b8;
  font-size: 11px;
  margin-top: 2px;
}

.logout-button {
  background: transparent;
  box-shadow: none;
  color: #64748b;
  font-size: 12px;
  padding: 6px;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 28px;
}

.operation-empty {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  padding: 48px 24px;
  text-align: center;
}

.login-body {
  background: #f3f6fa;
  min-height: 100vh;
}

.login-shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-panel {
  background: #ffffff;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  padding: 32px;
  width: min(100%, 420px);
}

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

.login-brand strong,
.login-brand span {
  display: block;
}

.login-brand span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  margin-top: 2px;
  text-transform: uppercase;
}

.login-heading {
  margin: 30px 0 22px;
}

.login-heading h1 {
  font-size: 24px;
  margin: 0;
}

.login-heading p {
  color: #64748b;
  font-size: 14px;
  margin: 8px 0 0;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form label span {
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font: inherit;
  height: 44px;
  padding: 0 12px;
}

.login-form input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: 0;
}

.login-form button {
  height: 44px;
  margin-top: 4px;
}

.page-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 26px;
  margin: 4px 0 0;
}

.metrics {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.metric {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
  padding: 18px;
}

.metric span {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  font-size: 30px;
  margin-top: 8px;
}

.toolbar,
.actions {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.page-toolbar {
  margin-bottom: 14px;
}

.filters {
  align-items: end;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1.5fr) repeat(5, minmax(130px, 1fr)) auto;
  margin-bottom: 14px;
  padding: 14px;
}

.feedback-filters {
  grid-template-columns: minmax(280px, 2fr) repeat(3, minmax(150px, 1fr)) auto;
}

.filters label {
  display: grid;
  gap: 6px;
}

.filters label span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.filters input,
.filters select {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
  font: inherit;
  height: 40px;
  min-width: 0;
  padding: 0 10px;
  width: 100%;
}

.filters input:focus,
.filters select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: 0;
}

.filter-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  height: 40px;
}

.filter-actions a {
  color: #64748b;
  font-size: 13px;
  text-decoration: none;
}

.send-bar {
  align-items: center;
  background: #ffffff;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 10px 12px;
  position: sticky;
  top: 10px;
  z-index: 5;
}

.send-bar div {
  align-items: baseline;
  display: flex;
  gap: 10px;
}

.send-bar span {
  color: #64748b;
  font-size: 13px;
}

.send-actions {
  display: flex;
  gap: 8px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.send-dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
  padding: 0;
  width: min(420px, calc(100vw - 32px));
}

.send-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.send-dialog form {
  display: grid;
  gap: 20px;
  padding: 22px;
}

.send-dialog header,
.send-dialog footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.send-dialog h3 {
  font-size: 18px;
  margin: 0;
}

.dialog-close {
  background: transparent;
  box-shadow: none;
  color: #64748b;
  font-size: 22px;
  line-height: 1;
  padding: 4px;
}

.send-dialog label {
  display: grid;
  gap: 7px;
}

.send-dialog label span {
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

.send-dialog input[type="email"] {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font: inherit;
  height: 42px;
  padding: 0 11px;
}

.send-dialog footer {
  gap: 8px;
  justify-content: flex-end;
}

.toolbar h2 {
  font-size: 18px;
  margin: 0;
}

.toolbar p {
  color: #64748b;
  margin: 4px 0 0;
}

button {
  background: #1f6feb;
  border: 0;
  border-radius: 10px;
  box-shadow: 0 10px 18px rgba(31, 111, 235, 0.16);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 15px;
}

button.secondary {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: none;
  color: #1e293b;
}

.count-pill {
  background: #eef4ff;
  border: 1px solid #c7d7fe;
  border-radius: 999px;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 10px;
}

.table-wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  overflow-x: scroll;
  overscroll-behavior-inline: contain;
  scrollbar-color: #94a3b8 #eef2f7;
  scrollbar-gutter: stable;
  touch-action: pan-x pan-y;
}

.table-wrap::-webkit-scrollbar {
  height: 12px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #eef2f7;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border: 3px solid #eef2f7;
  border-radius: 6px;
}

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

.leads-table .col-check {
  width: 52px;
}

.leads-table .col-name {
  width: 210px;
}

.leads-table .col-email {
  width: 280px;
}

.leads-table .col-owner {
  width: 140px;
}

.leads-table .col-article {
  width: 560px;
}

.leads-table .col-sample {
  width: 130px;
}

.leads-table .col-status {
  width: 130px;
}

.leads-table .col-time {
  width: 158px;
}

th,
td {
  border-bottom: 1px solid #edf2f7;
  font-size: 14px;
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

td p {
  margin: 4px 0 0;
  max-width: 460px;
  white-space: normal;
}

.truncate {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  max-width: 520px;
  overflow: hidden;
}

.article-cell {
  min-width: 520px;
}

.article-url {
  color: #64748b;
  display: block;
  font-size: 12px;
  margin-top: 7px;
  max-width: 500px;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-full {
  color: #2563eb;
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  margin-top: 5px;
  text-decoration: none;
}

.link-stack {
  white-space: nowrap;
}

.link-stack a {
  color: #2563eb;
  display: block;
  font-weight: 700;
  margin-bottom: 5px;
  text-decoration: none;
}

.row-hint {
  color: #b45309;
  display: block;
  font-size: 11px;
  margin-top: 4px;
}

input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.pagination {
  align-items: center;
  color: #64748b;
  display: flex;
  font-size: 13px;
  justify-content: space-between;
  margin-top: 14px;
}

.pagination-links {
  align-items: center;
  display: flex;
  gap: 6px;
}

.pagination-links a {
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #334155;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  min-width: 34px;
  padding: 0 10px;
  text-decoration: none;
}

.pagination-links a.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

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

.feedback-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 18px;
}

.feedback-item header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.feedback-identity strong,
.feedback-identity span {
  display: block;
}

.feedback-identity span {
  color: #64748b;
  font-size: 13px;
  margin-top: 3px;
}

.feedback-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.feedback-meta time {
  color: #64748b;
  font-size: 12px;
}

.feedback-type {
  background: #eef4ff;
  color: #1d4ed8;
}

.feedback-status.pending {
  background: #fff7df;
  color: #8a5a00;
}

.feedback-status.in_progress {
  background: #e0f2fe;
  color: #075985;
}

.feedback-status.resolved,
.feedback-status.closed {
  background: #e8f5ee;
  color: #17603a;
}

.feedback-description {
  color: #1e293b;
  line-height: 1.7;
  margin-top: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

.feedback-attachments {
  border-top: 1px solid #edf2f7;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
}

.feedback-attachments a,
.feedback-attachments span {
  color: #2563eb;
  font-size: 13px;
  text-decoration: none;
}

.feedback-response {
  background: #f8fafc;
  border-left: 3px solid #2563eb;
  margin-top: 14px;
  padding: 10px 12px;
}

.feedback-response strong {
  font-size: 12px;
}

.feedback-response p {
  line-height: 1.6;
  margin: 5px 0 0;
  white-space: pre-wrap;
}

.feedback-empty {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.empty {
  color: #687385;
  padding: 28px;
  text-align: center;
}

.flash-list {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.flash {
  border-radius: 10px;
  padding: 10px 12px;
}

.flash.success {
  background: #e8f5ee;
  color: #17603a;
}

.flash.error {
  background: #fdeceb;
  color: #9f1d20;
}

.badge {
  border-radius: 999px;
  display: inline-block;
  font-size: 12px;
  padding: 3px 8px;
}

@media (max-width: 820px) {
  .shell {
    display: block;
  }

  .sidebar {
    border-bottom: 1px solid #e2e8f0;
    border-right: 0;
    width: 100%;
  }

  .sidebar-note {
    display: none;
  }

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

  .content {
    padding: 18px;
  }

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

  .filter-wide,
  .filter-actions {
    grid-column: 1 / -1;
  }

  .pagination {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .feedback-item header {
    display: block;
  }

  .feedback-meta {
    justify-content: flex-start;
    margin-top: 10px;
  }
}

@media (min-width: 821px) {
  .sidebar {
    flex: 0 0 76px;
    padding-left: 10px;
    padding-right: 10px;
    width: 76px;
  }

  .sidebar:hover {
    flex-basis: 260px;
    padding-left: 16px;
    padding-right: 16px;
    width: 260px;
  }

  .sidebar:not(:hover) .brand-copy,
  .sidebar:not(:hover) .nav-label,
  .sidebar:not(:hover) .nav-chevron,
  .sidebar:not(:hover) .sidebar-note,
  .sidebar:not(:hover) .account-copy,
  .sidebar:not(:hover) .sidebar-account form {
    display: none;
  }

  .sidebar:not(:hover) .sidebar-account {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .sidebar:not(:hover) .brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .sidebar:not(:hover) .nav-group-toggle {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .sidebar:not(:hover) .nav-group-items {
    display: none;
  }
}

@media (min-width: 821px) and (max-width: 1400px) {
  .filters {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .feedback-filters {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }
}

.badge.sent {
  background: #e8f5ee;
  color: #17603a;
}

.badge.failed {
  background: #fdeceb;
  color: #9f1d20;
}

.badge.skipped {
  background: #fff7df;
  color: #8a5a00;
}
.video-status {
  display: inline-block;
  color: #526174;
  font-size: 12px;
  line-height: 1.4;
}

.status-processing,
.status-pending {
  color: #1769e0;
}

.status-completed {
  color: #16845b;
}

.status-failed {
  color: #c33b32;
}

.video-batches {
  margin-bottom: 18px;
  border: 1px solid #d7e2f2;
  background: #fff;
}

.video-batches-heading,
.video-batch-item {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
}

.video-batches-heading {
  justify-content: space-between;
  border-bottom: 1px solid #e7edf4;
}

.video-batches-heading span,
.video-batch-item { color: #526174; }
.video-batch-item + .video-batch-item { border-top: 1px solid #edf1f6; }
.video-batch-item span:first-child { margin-right: auto; }
.batch-success { color: #16845b; }
.batch-failed { color: #c33b32; }

.inline-notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #d7e2f2;
  background: #f5f8fc;
  color: #46566d;
}

.article-list {
  border: 1px solid #dce4ee;
  background: #fff;
}

.article-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px auto;
  gap: 20px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid #e7edf4;
}

.article-row:last-child { border-bottom: 0; }
.article-main { min-width: 0; }
.article-main strong { display: block; margin-bottom: 6px; }
.article-main p { margin: 0 0 8px; color: #526174; line-height: 1.5; }
.article-main small { color: #7b8798; overflow-wrap: anywhere; }
.article-actions { display: flex; gap: 8px; }
.article-actions form { margin: 0; }
.health-ok { color: #16845b; }
.health-error { color: #c33b32; }

@media (max-width: 800px) {
  .article-row { grid-template-columns: 1fr; gap: 12px; }
  .article-actions { flex-wrap: wrap; }
}
