:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --ink: #111827;
  --text: #1f2937;
  --muted: #6b7280;
  --soft: #f8fafc;
  --line: #e5eaf1;
  --primary: #4f46e5;
  --primary-2: #2563eb;
  --primary-soft: #eef2ff;
  --green: #10b981;
  --green-soft: #ecfdf5;
  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --red: #ef4444;
  --red-soft: #fef2f2;
  --shadow: 0 18px 45px rgba(17, 24, 39, 0.08);
  --shadow-soft: 0 10px 24px rgba(17, 24, 39, 0.05);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

b {
  color: var(--red);
}

.public-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(229, 234, 241, 0.8);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
}

.nav-inner {
  width: min(1180px, calc(100% - 36px));
  height: 66px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  color: var(--ink);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.22);
}

.nav-admin,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 9px 14px;
  font-weight: 750;
}

.public-wrap {
  width: min(1180px, calc(100% - 36px));
  margin: 28px auto 56px;
}

.public-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
  gap: 24px;
  align-items: start;
}

.hero-panel {
  position: sticky;
  top: 92px;
  min-height: 620px;
  border-radius: 30px;
  padding: 30px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.28), transparent 190px),
    radial-gradient(circle at 88% 25%, rgba(16, 185, 129, 0.45), transparent 220px),
    linear-gradient(145deg, #172554, #4338ca 58%, #2563eb);
  box-shadow: var(--shadow);
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-badge {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-panel h1 {
  margin: 26px 0 14px;
  max-width: 430px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.07em;
}

.hero-panel p {
  max-width: 430px;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.78);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 28px 0;
}

.hero-metrics article,
.process-card {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(8px);
}

.hero-metrics article {
  padding: 16px;
}

.hero-metrics strong {
  display: block;
  font-size: 22px;
  color: #fff;
  letter-spacing: -0.04em;
}

.hero-metrics span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 750;
}

.process-card {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  padding: 18px;
}

.process-card h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 16px;
}

.process-card ol {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.process-card li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 750;
}

.process-card li span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: #172554;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
}

.review-card,
.login-card,
.panel-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.review-card {
  padding: 22px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: -0.04em;
}

.status-pill {
  display: inline-flex;
  white-space: nowrap;
  border-radius: 999px;
  background: var(--green-soft);
  color: #047857;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 850;
}

form {
  display: grid;
  gap: 16px;
}

.form-block {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
  padding: 16px;
}

.highlight-block {
  background: linear-gradient(180deg, #ffffff, #f7f9ff);
}

.block-title,
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.block-title {
  justify-content: flex-start;
}

.block-title span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.block-title h3,
.panel-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

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

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

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

.service-grid {
  grid-template-columns: 1.15fr 0.9fr 0.95fr;
}

.rating-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  align-items: start;
}

label,
fieldset {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 13px;
  font-weight: 800;
}

legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 13px;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 10px 12px;
  transition: border 0.15s, box-shadow 0.15s, background 0.15s;
}

textarea {
  resize: vertical;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #9bb7ff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}

.rating-box {
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.stars {
  display: flex;
  gap: 4px;
}

.stars button {
  border: 0;
  background: transparent;
  color: #c8d0dc;
  font-size: 31px;
  line-height: 1;
  padding: 0;
}

.stars button.active,
.stars button:hover {
  color: var(--amber);
}

.choice-group,
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.choice-group label,
.tag-group label {
  display: inline-flex;
  align-items: center;
  width: auto;
  gap: 7px;
  border: 1px solid #e1e8f2;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 8px 11px;
  transition: border 0.15s, background 0.15s, color 0.15s;
}

.choice-group label:hover,
.tag-group label:hover {
  border-color: #aabfff;
  background: #f7f9ff;
  color: var(--primary);
}

.choice-group input,
.tag-group input,
.check-filter input {
  width: auto;
  accent-color: var(--primary);
}

.attach-grid {
  align-items: stretch;
  margin: 14px 0;
}

.file-box {
  border: 1px dashed #c7d2e5;
  border-radius: 16px;
  background: #fff;
  padding: 14px;
}

.help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.preview,
.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview {
  min-height: 96px;
  align-items: center;
  border: 1px dashed #c7d2e5;
  border-radius: 16px;
  background: #fff;
  padding: 12px;
}

.empty-preview span {
  color: #9ca3af;
  font-size: 13px;
  font-weight: 750;
}

.preview img,
.thumbs img {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.thumbs img {
  width: 48px;
  height: 48px;
  cursor: pointer;
}

.submit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.message {
  min-height: 1.4em;
  margin: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.message.error {
  color: var(--red);
}

.message.success {
  color: var(--green);
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-weight: 900;
  transition: transform 0.15s, background 0.15s, border 0.15s, box-shadow 0.15s;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 10px 18px rgba(79, 70, 229, 0.18);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(79, 70, 229, 0.22);
}

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

.secondary-btn:hover {
  border-color: #c9d4e4;
}

.full {
  width: 100%;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 10% 15%, rgba(79, 70, 229, 0.15), transparent 300px),
    radial-gradient(circle at 90% 70%, rgba(16, 185, 129, 0.13), transparent 320px),
    var(--bg);
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
}

.login-top {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-weight: 850;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: -0.05em;
}

.login-card form {
  margin-top: 22px;
}

/* Admin */
.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  background:
    radial-gradient(circle at top right, rgba(79, 70, 229, 0.08), transparent 420px),
    var(--bg);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-brand {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

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

.admin-nav a {
  display: grid;
  gap: 2px;
  border-radius: 16px;
  padding: 13px 14px;
  color: var(--muted);
  font-weight: 800;
}

.admin-nav a:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.admin-nav small {
  color: #9ca3af;
  font-size: 11px;
}

.sidebar-footer {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.admin-main {
  padding: 26px;
}

.admin-section {
  margin-bottom: 32px;
}

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

.page-title.compact {
  margin-bottom: 14px;
}

.page-title h1 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 30px;
  letter-spacing: -0.05em;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  padding: 17px;
  box-shadow: var(--shadow-soft);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background: var(--primary-soft);
}

.main-stat::after {
  background: #dbeafe;
}

.warn-stat::after {
  background: var(--amber-soft);
}

.stat-card span,
.stat-card em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: -0.05em;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.panel-box {
  padding: 18px;
}

.review-panel {
  padding: 16px;
}

.bar-list,
.ranking-list,
.list {
  display: grid;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 30px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

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

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #4f46e5);
}

.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
  padding: 12px;
}

.item strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
}

.item p {
  margin: 0;
  font-size: 12px;
}

.agent-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.agent-message {
  margin: 10px 0;
}

.agent-list {
  margin-top: 10px;
}

.status,
.score {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.status {
  color: #047857;
  background: var(--green-soft);
}

.status.inactive {
  color: #b91c1c;
  background: var(--red-soft);
}

.score {
  color: #7c4a00;
  background: var(--amber-soft);
}

.small-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 800;
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 150px 116px 130px 94px;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.check-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  padding: 0 11px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  color: var(--muted);
  background: var(--soft);
  font-weight: 900;
}

tbody tr:hover td {
  background: #fbfdff;
}

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

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

.empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--soft);
  color: var(--muted);
  padding: 18px;
  text-align: center;
  font-weight: 800;
}

.review-cards {
  display: none;
}

@media (max-width: 1180px) {
  .public-layout,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    position: static;
    min-height: auto;
  }

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

  .service-grid,
  .grid.two,
  .rating-layout,
  .agent-form {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .nav-inner,
  .public-wrap {
    width: min(100% - 24px, 1180px);
  }

  .hero-panel {
    padding: 24px;
    border-radius: 24px;
  }

  .hero-panel h1 {
    font-size: 34px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .review-card {
    padding: 16px;
  }

  .review-head,
  .submit-row,
  .page-title {
    flex-direction: column;
    align-items: stretch;
  }

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

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-main {
    padding: 16px;
  }

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

  .table-wrap {
    display: none;
  }

  .review-cards {
    display: grid;
    gap: 10px;
  }

  .review-card {
    border: 1px solid var(--line);
    background: var(--card);
    border-radius: 16px;
    padding: 14px;
  }

  .review-card h3 {
    margin: 0 0 5px;
    font-size: 16px;
  }

  .review-card p {
    margin-bottom: 8px;
    font-size: 13px;
  }
}



/* v10 front-end simplification */
.front-body {
  background:
    radial-gradient(circle at top left, rgba(79, 70, 229, 0.08), transparent 320px),
    #f5f7fb;
}

.front-page {
  width: min(920px, calc(100% - 28px));
  margin: 26px auto 48px;
}

.simple-form-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  padding: 22px;
}

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

.simple-title h1 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: -0.04em;
}

.simple-title p {
  margin: 0;
}

.soft-block {
  background: linear-gradient(180deg, #ffffff, #f8faff);
}

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


/* v11 compact vertical structure */
.narrow-page {
  width: min(760px, calc(100% - 24px));
  margin: 18px auto 36px;
}

.simple-form-card {
  padding: 16px;
  border-radius: 18px;
}

.simple-title {
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.simple-title h1 {
  font-size: 24px;
}

.form-block {
  padding: 12px;
  border-radius: 14px;
}

.block-title {
  margin-bottom: 10px;
}

.block-title span {
  width: 24px;
  height: 24px;
}

.grid.two,
.service-grid,
.rating-layout,
.compact-rating {
  grid-template-columns: 1fr;
}

.rating-box {
  padding: 10px;
}

.stars button {
  font-size: 28px;
}

.attach-grid {
  margin: 10px 0;
}

.preview {
  min-height: 74px;
}

.submit-row {
  padding-top: 0;
}

.admin-top-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(79, 70, 229, 0.06), transparent 380px),
    var(--bg);
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.admin-topbar-inner {
  width: min(1120px, calc(100% - 28px));
  height: 62px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.top-nav a {
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-weight: 850;
}

.top-nav a:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

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

.compact-admin-main {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.compact-title-row {
  margin-bottom: 12px;
}

.compact-title-row h1,
.page-title.compact h1 {
  font-size: 26px;
}

.compact-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.compact-stats .stat-card {
  padding: 12px;
}

.compact-stats .stat-card strong {
  font-size: 23px;
}

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

.panel-box {
  padding: 14px;
}

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

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

.danger-small:hover {
  background: var(--red-soft);
}

.filters {
  grid-template-columns: minmax(220px, 1fr) 150px 116px 130px 94px;
}

table {
  min-width: 820px;
}

@media (max-width: 980px) {
  .admin-topbar-inner {
    grid-template-columns: 1fr;
    height: auto;
    padding: 12px 0;
  }

  .top-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .top-actions {
    justify-content: flex-start;
  }

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

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

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

@media (max-width: 620px) {
  .compact-stats,
  .filters {
    grid-template-columns: 1fr;
  }

  .admin-topbar-inner,
  .compact-admin-main,
  .narrow-page {
    width: min(100% - 18px, 1120px);
  }

  .simple-form-card {
    padding: 12px;
  }
}


/* v12: auth lock, compact tab admin, image lightbox */
#adminApp[hidden],
#loginView[hidden] {
  display: none !important;
}

body:not(.is-authed) #adminApp {
  display: none !important;
}

body.is-authed #loginView {
  display: none !important;
}

.admin-page {
  background: var(--bg);
}

.admin-compact-app {
  min-height: 100vh;
}

.admin-head {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.admin-head-inner {
  width: min(1080px, calc(100% - 24px));
  min-height: 58px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}

.tab-switch {
  position: relative;
  justify-self: center;
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  padding: 4px;
  overflow-x: auto;
  max-width: 100%;
}

.tab-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  font-weight: 900;
  white-space: nowrap;
}

.tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.18);
}

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

.admin-stage {
  width: min(1080px, calc(100% - 24px));
  margin: 0 auto;
  overflow: hidden;
  padding: 16px 0 34px;
}

.tab-track {
  display: flex;
  width: 300%;
  transition: transform 0.28s ease;
}

.tab-panel {
  width: 100%;
  flex: 0 0 100%;
  padding: 0 2px;
}

.tab-panel:not(.active) {
  pointer-events: none;
}

.compact-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.compact-stats .stat-card {
  padding: 11px 12px;
}

.compact-stats .stat-card strong {
  font-size: 22px;
}

.compact-title-row,
.page-title.compact {
  margin-bottom: 12px;
}

.dashboard-grid {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.panel-box {
  padding: 13px;
}

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

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

.danger-small:hover {
  background: var(--red-soft);
}

.filters {
  grid-template-columns: minmax(220px, 1fr) 150px 116px 130px 94px;
}

table {
  min-width: 780px;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 54px 76px;
  background: rgba(15, 23, 42, 0.82);
}

.image-lightbox.open {
  display: flex;
}

.lightbox-open {
  overflow: hidden;
}

.image-lightbox img {
  max-width: min(100%, 1080px);
  max-height: calc(100vh - 130px);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  object-fit: contain;
}

.lightbox-bar {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 8px 10px 8px 14px;
  font-weight: 900;
}

.lightbox-close {
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  padding: 7px 12px;
  font-weight: 900;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 70px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 44px;
  line-height: 1;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

@media (max-width: 980px) {
  .admin-head-inner {
    grid-template-columns: 1fr;
    padding: 10px 0;
  }

  .tab-switch {
    justify-self: start;
  }

  .head-actions {
    justify-content: flex-start;
  }

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

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

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

@media (max-width: 620px) {
  .admin-stage,
  .admin-head-inner {
    width: min(100% - 18px, 1080px);
  }

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

  .image-lightbox {
    padding: 58px 16px;
  }

  .lightbox-nav {
    width: 38px;
    height: 58px;
    font-size: 36px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }
}


/* v13: stable resolved buttons + adaptive supplemental content */
.stable-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.stable-choice label {
  min-height: 42px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #e1e8f2;
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  padding: 0 10px;
  line-height: 1;
  transform: none !important;
  box-shadow: none;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
  white-space: nowrap;
}

.stable-choice label:hover {
  transform: none !important;
}

.stable-choice label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.stable-choice label.selected {
  color: var(--primary);
  border-color: #b8c7ff;
  background: #f5f7ff;
}

.adaptive-block {
  transition: background 0.18s, border-color 0.18s;
}

.adaptive-title {
  align-items: flex-start;
}

.adaptive-title p {
  margin: 3px 0 0;
  font-size: 12.5px;
}

.adaptive-block[data-rating-state="low"] {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff, #fff7f7);
}

.adaptive-block[data-rating-state="mid"] {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fff, #fffaf0);
}

.adaptive-block[data-rating-state="high"] {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #fff, #f4fff8);
}

.adaptive-block[data-rating-state="low"] .block-title span {
  color: #b91c1c;
  background: #fee2e2;
}

.adaptive-block[data-rating-state="mid"] .block-title span {
  color: #92400e;
  background: #fef3c7;
}

.adaptive-block[data-rating-state="high"] .block-title span {
  color: #047857;
  background: #d1fae5;
}

.soft-hidden {
  opacity: 0.52;
}

.soft-hidden .file-box,
.soft-hidden .preview {
  background: #f8fafc;
}

@media (max-width: 620px) {
  .stable-choice {
    grid-template-columns: 1fr;
  }
}


/* v14 mobile responsive fixes */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
canvas {
  max-width: 100%;
}

.narrow-page {
  width: min(760px, calc(100% - 24px));
}

.simple-form-card {
  max-width: 100%;
}

.simple-title {
  align-items: flex-start;
}

.form-block {
  max-width: 100%;
}

.choice-group,
.tag-group {
  min-width: 0;
}

.choice-group label,
.tag-group label {
  min-width: 0;
}

/* Fix admin tab sliding: track must be viewport width, not 300% */
.tab-track {
  width: 100% !important;
  display: flex;
  transition: transform 0.28s ease;
  will-change: transform;
}

.tab-panel {
  min-width: 100%;
  flex: 0 0 100% !important;
  max-width: 100%;
}

/* Compact admin table/card behavior */
.review-cards {
  display: none;
}

/* More comfortable tablet layout */
@media (max-width: 900px) {
  .narrow-page {
    width: min(100% - 20px, 760px);
    margin-top: 12px;
    margin-bottom: 26px;
  }

  .simple-form-card {
    padding: 14px;
    border-radius: 18px;
  }

  .simple-title {
    display: block;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .simple-title h1 {
    font-size: 24px;
  }

  .simple-title p {
    font-size: 13px;
  }

  .form-block {
    padding: 12px;
    border-radius: 14px;
  }

  .block-title {
    margin-bottom: 10px;
  }

  .grid,
  .grid.two,
  .service-grid,
  .rating-layout,
  .compact-rating,
  .attach-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  input,
  select,
  textarea {
    min-height: 42px;
    font-size: 14px;
  }

  .stars {
    justify-content: space-between;
    max-width: 250px;
  }

  .stars button {
    font-size: 30px;
  }

  .stable-choice {
    grid-template-columns: 1fr !important;
  }

  .stable-choice label {
    justify-content: flex-start;
    min-height: 42px;
  }

  .choice-group,
  .tag-group {
    gap: 7px;
  }

  .choice-group label,
  .tag-group label {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
    min-height: 38px;
    text-align: center;
  }

  .preview {
    min-height: 82px;
  }

  .preview img {
    width: 54px;
    height: 54px;
    border-radius: 10px;
  }

  .submit-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .submit-row .primary-btn {
    width: 100%;
    min-height: 44px;
  }

  /* Admin top header mobile */
  .admin-head {
    position: sticky;
  }

  .admin-head-inner {
    width: min(100% - 18px, 1080px);
    min-height: auto;
    padding: 10px 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-head-inner .brand {
    justify-content: space-between;
  }

  .tab-switch {
    width: 100%;
    justify-self: stretch;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .tab-switch::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex: 1 0 auto;
    min-width: 92px;
    padding: 9px 12px;
  }

  .head-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .head-actions .ghost-link,
  .head-actions .secondary-btn {
    width: 100%;
    min-height: 40px;
  }

  .admin-stage {
    width: min(100% - 18px, 1080px);
    padding: 12px 0 28px;
    overflow: hidden;
  }

  .page-title,
  .page-title.compact,
  .compact-title-row {
    display: block;
    margin-bottom: 10px;
  }

  .page-title h1,
  .page-title.compact h1,
  .compact-title-row h1 {
    font-size: 22px;
  }

  .page-title p {
    font-size: 13px;
  }

  .compact-stats,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }

  .stat-card {
    padding: 11px !important;
    border-radius: 14px;
  }

  .stat-card span {
    font-size: 11px;
  }

  .stat-card strong {
    font-size: 22px !important;
  }

  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .panel-box {
    padding: 12px;
    border-radius: 16px;
  }

  .agent-form {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .agent-form .primary-btn {
    width: 100%;
  }

  .item {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .agent-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .filters {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  .filters input,
  .filters select,
  .check-filter {
    width: 100%;
    min-height: 42px;
  }

  .table-wrap {
    display: none !important;
  }

  .review-cards {
    display: grid !important;
    gap: 10px;
  }

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

  .review-card h3 {
    margin: 0 0 5px;
    font-size: 15px;
  }

  .review-card p {
    margin-bottom: 8px;
    font-size: 13px;
  }

  .thumbs img {
    width: 52px;
    height: 52px;
    border-radius: 10px;
  }
}

/* Phone-specific tightening */
@media (max-width: 520px) {
  body {
    font-size: 13px;
  }

  .narrow-page {
    width: min(100% - 14px, 760px);
    margin-top: 8px;
  }

  .simple-form-card {
    padding: 10px;
    border-radius: 14px;
  }

  .simple-title h1 {
    font-size: 22px;
  }

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

  .block-title span {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .block-title h3 {
    font-size: 15px;
  }

  label,
  fieldset,
  legend {
    font-size: 13px;
  }

  .choice-group label,
  .tag-group label {
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .rating-box {
    padding: 10px;
  }

  .stars {
    max-width: none;
  }

  .stars button {
    font-size: 28px;
  }

  .file-box {
    padding: 11px;
  }

  .preview {
    min-height: 72px;
  }

  .message {
    font-size: 12px;
    word-break: break-word;
  }

  .admin-head-inner,
  .admin-stage {
    width: min(100% - 12px, 1080px);
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }

  .tab-btn {
    min-width: 84px;
    padding: 8px 10px;
    font-size: 13px;
  }

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

  .compact-stats,
  .stat-grid {
    grid-template-columns: 1fr !important;
  }

  .panel-title {
    display: block;
  }

  .bar-row {
    grid-template-columns: 38px minmax(0, 1fr) 28px;
  }

  .lightbox-bar {
    top: 10px;
    width: calc(100% - 24px);
    justify-content: space-between;
    transform: translateX(-50%);
  }

  .image-lightbox {
    padding: 54px 10px 22px;
  }

  .image-lightbox img {
    max-height: calc(100vh - 110px);
    border-radius: 10px;
  }

  .lightbox-nav {
    width: 34px;
    height: 52px;
    font-size: 32px;
  }

  .lightbox-prev {
    left: 6px;
  }

  .lightbox-next {
    right: 6px;
  }
}

/* v15: compact UI, stable tag selection, rating feedback, admin button alignment */
:root {
  --radius: 18px;
}

body {
  font-size: 13px;
}

p {
  line-height: 1.45;
}

form {
  gap: 10px;
}

.narrow-page {
  width: min(700px, calc(100% - 20px));
  margin: 12px auto 28px;
}

.simple-form-card {
  padding: 12px;
  border-radius: 16px;
}

.simple-title {
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.simple-title h1 {
  font-size: 22px;
}

.simple-title p,
.adaptive-title p {
  font-size: 12px;
}

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

.block-title,
.panel-title {
  gap: 8px;
  margin-bottom: 8px;
}

.block-title span {
  width: 22px;
  height: 22px;
  font-size: 11px;
}

.block-title h3,
.panel-title h2 {
  font-size: 15px;
}

.grid,
.choice-group,
.tag-group {
  gap: 8px;
}

label,
fieldset {
  gap: 5px;
  font-size: 13px;
}

legend {
  margin-bottom: 6px;
  font-size: 13px;
}

input,
select,
textarea {
  min-height: 36px;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}

textarea {
  line-height: 1.45;
}

.rating-layout,
.compact-rating,
.attach-grid {
  gap: 8px;
}

.rating-box {
  padding: 9px;
  border-radius: 12px;
}

.rating-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.stars {
  display: inline-flex;
  gap: 2px;
}

.stars button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 25px;
  line-height: 1;
  transition: transform 0.12s ease, color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.stars button:hover,
.stars button:focus-visible {
  background: #fffbeb;
  color: var(--amber);
  transform: translateY(-1px);
  outline: none;
}

.stars button:focus-visible {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.stars button.active {
  color: var(--amber);
  text-shadow: 0 2px 7px rgba(245, 158, 11, 0.24);
}

.stars button.picked {
  animation: star-pop 0.18s ease-out;
}

.rating-text {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: #fffbeb;
  color: #92400e;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.rating-text.empty {
  background: #f1f5f9;
  color: #64748b;
}

@keyframes star-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.stable-choice {
  gap: 6px;
}

.stable-choice label {
  min-height: 34px;
  border-radius: 10px;
  padding: 0 8px;
}

.tag-group {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(106px, 1fr));
  gap: 6px;
  align-items: stretch;
}

.tag-group label {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  overflow: hidden;
  border-radius: 10px;
  padding: 0 9px;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  transform: none !important;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.tag-group label input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.tag-group label:hover {
  transform: none !important;
}

.tag-group label.selected {
  border-color: #b8c7ff;
  background: #f5f7ff;
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.05);
}

.tag-group label.selected::after {
  content: "✓";
  margin-left: 5px;
  font-size: 11px;
  font-weight: 900;
}

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

.attach-grid {
  margin: 8px 0;
}

.preview {
  min-height: 62px;
  border-radius: 12px;
  padding: 9px;
}

.preview img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
}

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

.submit-row {
  gap: 8px;
}

.primary-btn,
.secondary-btn,
.ghost-link {
  min-height: 34px;
  border-radius: 10px;
  padding: 8px 12px;
}

.small-btn {
  min-height: 30px;
  border-radius: 9px;
  padding: 6px 9px;
}

.admin-head-inner {
  width: min(1040px, calc(100% - 20px));
  min-height: 52px;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 11px;
}

.tab-switch {
  gap: 3px;
  padding: 3px;
}

.tab-btn {
  padding: 7px 12px;
}

.head-actions {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px;
}

.admin-stage {
  width: min(1040px, calc(100% - 20px));
  padding: 12px 0 28px;
}

.page-title,
.page-title.compact,
.compact-title-row {
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.page-title h1,
.page-title.compact h1,
.compact-title-row h1 {
  font-size: 23px;
}

.page-title p {
  margin-bottom: 0;
}

.page-title .primary-btn,
.page-title .secondary-btn {
  align-self: center;
  white-space: nowrap;
}

.compact-stats,
.stat-grid {
  gap: 8px;
  margin-bottom: 12px;
}

.stat-card,
.compact-stats .stat-card {
  padding: 10px 11px;
  border-radius: 14px;
}

.stat-card strong,
.compact-stats .stat-card strong {
  margin: 5px 0 2px;
  font-size: 21px;
}

.dashboard-grid {
  gap: 10px;
}

.panel-box,
.review-panel {
  padding: 11px;
  border-radius: 14px;
}

.bar-list,
.ranking-list,
.list {
  gap: 7px;
}

.item {
  border-radius: 12px;
  padding: 9px;
}

.agent-form {
  grid-template-columns: minmax(120px, 1fr) minmax(110px, 0.85fr) minmax(110px, 0.85fr) auto;
  gap: 8px;
}

.agent-message,
.agent-list {
  margin-top: 8px;
}

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

.agent-main {
  min-width: 0;
}

.agent-main strong,
.agent-main p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-actions {
  display: grid;
  grid-template-columns: 50px 52px 52px;
  align-items: center;
  justify-content: end;
  gap: 6px;
  flex-wrap: nowrap;
}

.agent-actions .status,
.agent-actions .small-btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.status,
.score {
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
}

.filters {
  grid-template-columns: minmax(190px, 1fr) 136px 104px 116px 84px;
  gap: 8px;
  margin-bottom: 10px;
}

.check-filter {
  height: 36px;
  border-radius: 10px;
  padding: 0 9px;
}

.table-wrap {
  border-radius: 12px;
}

table {
  min-width: 760px;
}

th,
td {
  padding: 9px 10px;
  line-height: 1.4;
}

.empty {
  border-radius: 12px;
  padding: 14px;
}

@media (max-width: 900px) {
  .narrow-page {
    width: min(100% - 16px, 700px);
    margin-top: 8px;
  }

  .tag-group {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .tag-group label {
    flex: none !important;
    min-height: 34px;
    justify-content: center !important;
  }

  .admin-head-inner,
  .admin-stage {
    width: min(100% - 16px, 1040px);
  }

  .page-title,
  .page-title.compact,
  .compact-title-row {
    display: flex;
    align-items: center;
  }

  .agent-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

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

@media (max-width: 620px) {
  .front-page,
  .narrow-page {
    width: min(100% - 12px, 700px);
  }

  .simple-form-card,
  .form-block,
  .panel-box,
  .review-panel {
    padding: 9px;
  }

  .rating-line {
    align-items: flex-start;
  }

  .stars {
    width: auto;
    max-width: none;
    justify-content: flex-start;
  }

  .stars button {
    width: 28px;
    height: 28px;
    font-size: 23px;
  }

  .stable-choice {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .stable-choice label {
    min-height: 32px;
    justify-content: center;
    padding: 0 5px;
    font-size: 12px;
  }

  .tag-group label {
    min-height: 32px !important;
    padding: 0 7px !important;
    font-size: 12px;
  }

  .head-actions {
    grid-template-columns: 1fr 1fr !important;
  }

  .head-actions .ghost-link,
  .head-actions .secondary-btn {
    min-height: 36px;
  }

  .page-title,
  .page-title.compact,
  .compact-title-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .page-title .primary-btn,
  .page-title .secondary-btn {
    width: 100%;
  }

  .compact-stats,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 420px) {
  .tag-group {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .compact-stats,
  .stat-grid {
    grid-template-columns: 1fr !important;
  }

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

/* v16: image delete before submit, focused agent rating distribution */
.preview-item {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
}

.preview .preview-item img {
  display: block;
  width: 100%;
  height: 100%;
}

.image-remove-btn {
  position: absolute;
  top: -7px;
  right: -7px;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  min-height: 20px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff;
  color: var(--red);
  padding: 0;
  font-size: 15px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

.image-remove-btn:hover,
.image-remove-btn:focus-visible {
  background: var(--red-soft);
  outline: none;
  transform: translateY(-1px);
}

.rating-panel-title {
  align-items: flex-start;
}

.rating-panel-title > div {
  min-width: 0;
}

.compact-select {
  width: min(180px, 44vw);
  min-height: 32px;
  border-radius: 10px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 620px) {
  .rating-panel-title {
    display: grid;
    grid-template-columns: 1fr;
  }

  .compact-select {
    width: 100%;
  }
}

/* v17: agent identity labels, yesterday 24h stats, feedback link copy */
.field-hint {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.45;
}

.field-hint.active {
  color: #1d4ed8;
}

.field-hint.warning {
  color: var(--red);
}

.agent-form {
  grid-template-columns: minmax(110px, 1fr) minmax(100px, 0.75fr) minmax(105px, 0.8fr) minmax(140px, 1fr) auto;
}

.agent-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.agent-name-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.agent-name-line strong {
  margin-bottom: 0;
}

.agent-identity-badge,
.inline-label {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 3px 7px;
  font-size: 11px;
  line-height: 1;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.agent-identity-badge.empty {
  border-color: var(--line);
  background: #f8fafc;
  color: var(--muted);
}

.table-badge {
  margin-top: 4px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-label-editor {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 72px;
  gap: 6px;
  margin-top: 7px;
  max-width: 360px;
}

.agent-label-input {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 12px;
}

.copy-small {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.copy-small:hover,
.copy-small:focus-visible {
  background: #dbeafe;
  outline: none;
}

.agent-actions {
  grid-template-columns: 50px 76px 52px 52px;
}

.yesterday-panel {
  margin-bottom: 10px;
}

.yesterday-title {
  align-items: flex-start;
}

.yesterday-title > div:first-child {
  min-width: 0;
}

.mini-stat-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-stat-row span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 850;
}

.mini-stat-row b {
  color: var(--ink);
  font-size: 12px;
}

.hour-grid {
  display: grid;
  grid-template-columns: repeat(24, minmax(24px, 1fr));
  gap: 5px;
  align-items: end;
  min-height: 112px;
  padding-top: 4px;
}

.hour-cell {
  display: grid;
  grid-template-rows: 72px auto auto;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.hour-bar {
  position: relative;
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 26px;
  height: 72px;
  overflow: hidden;
  border-radius: 8px;
  background: #eef2f7;
}

.hour-bar i {
  display: block;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, #93c5fd, #4f46e5);
}

.hour-cell b {
  color: var(--ink);
  font-size: 10px;
}

.hour-cell:not(.has-data) .hour-bar i {
  display: none;
}

@media (max-width: 900px) {
  .agent-form {
    grid-template-columns: 1fr 1fr !important;
  }

  .agent-form .primary-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .agent-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .agent-label-editor {
    max-width: none;
  }

  .hour-grid {
    grid-template-columns: repeat(12, minmax(24px, 1fr));
    row-gap: 8px;
  }
}

@media (max-width: 620px) {
  .agent-form {
    grid-template-columns: 1fr !important;
  }

  .agent-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .agent-label-editor {
    grid-template-columns: 1fr;
  }

  .agent-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .yesterday-title {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mini-stat-row {
    justify-content: flex-start;
  }

  .hour-grid {
    grid-template-columns: repeat(6, minmax(28px, 1fr));
  }
}

@media (max-width: 900px) {
  .agent-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* v18: review record button/filter stability + whole-day yesterday panel */
.tab-panel[data-panel="reviews"] .page-title {
  align-items: center;
}

.tab-panel[data-panel="reviews"] #exportBtn {
  flex: 0 0 auto;
  width: auto;
  min-width: 88px;
  max-width: 120px;
  white-space: nowrap;
}

.review-panel .filters {
  grid-template-columns: minmax(170px, 1fr) minmax(126px, 0.74fr) 96px 108px auto 76px;
  align-items: center;
  gap: 7px;
}

.review-panel .filters > input,
.review-panel .filters > select {
  min-height: 34px;
  height: 34px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.time-filter-group {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  align-items: center;
  justify-content: start;
  gap: 6px;
  min-width: 0;
}

.review-panel .check-filter,
.time-filter-group .check-filter {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  gap: 5px;
  padding: 0 8px;
  overflow: hidden;
  line-height: 1;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: none;
}

.review-panel .check-filter input,
.time-filter-group .check-filter input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0;
  box-shadow: none;
}

.review-panel .check-filter:has(input:checked) {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.yesterday-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.yesterday-summary article {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--soft);
  padding: 10px 11px;
}

.yesterday-summary span,
.yesterday-summary em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.yesterday-summary strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.yesterday-summary.is-empty article {
  background: #fff;
}

@media (max-width: 1040px) {
  .review-panel .filters {
    grid-template-columns: minmax(190px, 1fr) minmax(126px, 0.7fr) 96px 108px 76px;
  }

  .time-filter-group {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .time-filter-group .check-filter {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .tab-panel[data-panel="reviews"] #exportBtn {
    width: 100%;
    max-width: none;
  }

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

  .review-panel .filters > input[type="search"],
  .time-filter-group {
    grid-column: 1 / -1;
  }

  .review-panel .image-chip {
    width: 100%;
  }

  .yesterday-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .review-panel .filters {
    grid-template-columns: 1fr;
  }

  .review-panel .filters > input[type="search"],
  .time-filter-group {
    grid-column: auto;
  }

  .time-filter-group {
    grid-template-columns: 1fr;
  }
}

/* v19: short feedback links, delayed problem details, colored identity labels, yesterday quick filter, 48h cleanup */
[hidden] {
  display: none !important;
}

.field-hint .agent-identity-badge {
  margin-left: 4px;
  vertical-align: middle;
}

.agent-identity-badge.identity-green,
.inline-label.identity-green {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

.agent-identity-badge.identity-red,
.inline-label.identity-red {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.agent-identity-badge.identity-gold,
.inline-label.identity-gold {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.agent-identity-badge.identity-blue,
.inline-label.identity-blue {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.agent-identity-badge.identity-gray,
.inline-label.identity-gray {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.agent-form {
  grid-template-columns: minmax(100px, 1fr) minmax(96px, 0.72fr) minmax(100px, 0.76fr) minmax(130px, 1fr) minmax(92px, 0.62fr) auto;
}

.agent-label-editor {
  grid-template-columns: minmax(130px, 1fr) 86px 72px;
  max-width: 470px;
}

.agent-label-color {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 12px;
}

.review-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.danger-action {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff;
  white-space: nowrap;
}

.danger-action:hover,
.danger-action:focus-visible {
  background: #fef2f2;
  outline: none;
}

.time-filter-group {
  grid-template-columns: repeat(4, max-content);
}

.review-panel .filters {
  grid-template-columns: minmax(160px, 1fr) minmax(118px, 0.74fr) 92px 104px auto 72px;
}

.time-chip:has(input[value="yesterday"]:checked) {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.tab-panel[data-panel="reviews"] #exportBtn,
.tab-panel[data-panel="reviews"] #deleteOldReviewsBtn {
  width: auto;
  min-width: 94px;
  max-width: none;
}

@media (max-width: 1040px) {
  .agent-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .agent-form .primary-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .time-filter-group {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .review-title-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tab-panel[data-panel="reviews"] #exportBtn,
  .tab-panel[data-panel="reviews"] #deleteOldReviewsBtn {
    width: 100%;
  }

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

  .agent-label-editor {
    grid-template-columns: 1fr 86px 72px;
  }
}

@media (max-width: 480px) {
  .review-title-actions,
  .time-filter-group,
  .agent-label-editor {
    grid-template-columns: 1fr;
  }
}

/* v20: daily complaint quota, required complaint evidence, duplicate IP filters */
.simple-title {
  align-items: flex-start;
}

.quota-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.quota-badge.is-low {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.quota-badge.is-empty {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.quota-notice {
  margin: -6px 0 12px;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: #fef2f2;
  color: #991b1b;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

button:disabled,
.primary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  box-shadow: none;
}

.required-evidence .file-box {
  border-color: #fecaca;
  background: #fffafa;
}

.required-evidence .help {
  color: #b91c1c;
  font-weight: 850;
}

.stats-filter-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.stats-repeat-chip,
.repeat-ip-chip {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.stats-repeat-chip:has(input:checked),
.repeat-ip-chip:has(input:checked) {
  border-color: #fb923c;
  background: #ffedd5;
  color: #9a3412;
}

.review-panel .filters {
  grid-template-columns: minmax(150px, 1fr) minmax(112px, 0.72fr) 86px 98px auto 112px 72px;
}

.review-panel .repeat-ip-chip {
  width: 100%;
}

@media (max-width: 1180px) {
  .review-panel .filters {
    grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.8fr) 90px 100px 112px 72px;
  }

  .time-filter-group {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .simple-title {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .quota-badge {
    justify-self: start;
  }

  .stats-filter-row {
    width: 100%;
    justify-content: stretch;
  }

  .stats-filter-row .compact-select,
  .stats-filter-row .stats-repeat-chip {
    width: 100%;
  }

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

  .review-panel .filters > input[type="search"],
  .time-filter-group {
    grid-column: 1 / -1;
  }

  .review-panel .repeat-ip-chip,
  .review-panel .image-chip {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .review-panel .filters,
  .time-filter-group,
  .stats-filter-row {
    grid-template-columns: 1fr;
  }

  .review-panel .filters > input[type="search"],
  .time-filter-group {
    grid-column: auto;
  }
}

/* v21: review detail modal, gentle submit confirmation, praise tag quick select */
.tag-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 8px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.soft-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.soft-action-btn:hover,
.soft-action-btn:focus-visible {
  border-color: #86efac;
  background: #dcfce7;
  outline: none;
  transform: translateY(-1px);
}

.success-modal,
.review-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.46);
  padding: 18px;
}

.success-modal.open,
.review-detail-modal.open {
  display: flex;
}

.success-modal-open,
.review-detail-open {
  overflow: hidden;
}

.success-modal-card {
  width: min(430px, 100%);
  border: 1px solid #fed7aa;
  border-radius: 24px;
  background: linear-gradient(180deg, #fffaf5 0%, #ffffff 72%);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  padding: 26px 24px 22px;
  text-align: center;
  animation: calm-pop 0.18s ease-out;
}

.success-modal-icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: #fff7ed;
  color: #ea580c;
  font-size: 25px;
  box-shadow: inset 0 0 0 1px #fed7aa;
}

.success-modal-card h2 {
  margin: 0 0 9px;
  color: #7c2d12;
  font-size: 21px;
  letter-spacing: -0.02em;
}

.success-modal-text {
  margin: 0;
  color: #334155;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.75;
}

.success-modal-subtext {
  margin: 10px 0 18px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.65;
}

.success-modal-ok {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #fb923c, #f59e0b);
  color: #fff;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.26);
}

.success-modal-ok:hover,
.success-modal-ok:focus-visible {
  outline: none;
  filter: brightness(1.02);
  box-shadow: 0 14px 30px rgba(245, 158, 11, 0.34);
}

@keyframes calm-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.review-panel .filters {
  grid-template-columns: minmax(150px, 1fr) minmax(112px, 0.72fr) 86px 102px 98px auto 112px 72px;
}

.positive-chip {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.positive-chip:has(input:checked) {
  border-color: #22c55e;
  background: #dcfce7;
  color: #166534;
}

.review-action-cell {
  min-width: 86px;
  text-align: right;
}

.detail-btn {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 900;
  white-space: nowrap;
}

.review-detail-card {
  width: min(760px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  animation: calm-pop 0.16s ease-out;
}

.review-detail-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  padding: 16px 18px;
}

.review-detail-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
}

.review-detail-close {
  min-height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.review-detail-close:hover,
.review-detail-close:focus-visible {
  border-color: #94a3b8;
  background: #f8fafc;
  outline: none;
}

.review-detail-body {
  display: grid;
  gap: 12px;
  padding: 14px 18px 18px;
}

.detail-section {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  padding: 13px;
}

.detail-section.primary-detail {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

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

.detail-section h3,
.detail-section-title h3 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 15px;
}

.detail-section-title h3 {
  margin-bottom: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

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

.detail-field {
  min-width: 0;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  background: #f8fafc;
  padding: 9px 10px;
}

.detail-field span,
.detail-user-agent span {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 11px;
  font-weight: 850;
}

.detail-value {
  display: block;
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.45;
}

.detail-value.mono,
.detail-user-agent code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

.detail-comment {
  min-height: 46px;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px;
  color: #334155;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-tags {
  margin-top: 8px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.detail-images {
  margin-top: 10px;
}

.detail-user-agent {
  margin-top: 8px;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  background: #f8fafc;
  padding: 9px 10px;
}

.detail-user-agent code {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #334155;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .review-panel .filters {
    grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.8fr) 90px 102px 100px 112px 72px;
  }

  .time-filter-group {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .success-modal-card {
    padding: 22px 18px 18px;
  }

  .success-modal-card h2 {
    font-size: 19px;
  }

  .success-modal-text {
    font-size: 15px;
  }

  .review-detail-card {
    max-height: 88vh;
    border-radius: 18px;
  }

  .review-detail-head {
    align-items: flex-start;
    padding: 14px;
  }

  .review-detail-body {
    padding: 12px;
  }

  .detail-grid,
  .user-detail-grid {
    grid-template-columns: 1fr;
  }

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

  .review-panel .filters > input[type="search"],
  .time-filter-group {
    grid-column: 1 / -1;
  }

  .review-panel .positive-chip,
  .review-panel .repeat-ip-chip,
  .review-panel .image-chip {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .tag-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .soft-action-btn {
    width: 100%;
  }

  .review-panel .filters,
  .time-filter-group {
    grid-template-columns: 1fr;
  }

  .review-panel .filters > input[type="search"],
  .time-filter-group {
    grid-column: auto;
  }
}

/* v22: account login/settings, work-time field, de-duplicate IP filters, recent-repeat prompt */
.login-card form {
  display: grid;
  gap: 12px;
}

.account-panel {
  max-width: 780px;
}

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

.credential-form label:first-child {
  grid-column: 1 / -1;
}

.credential-form .primary-btn {
  min-height: 42px;
}

#currentUsername[readonly] {
  color: #475569;
  background: #f8fafc;
  cursor: default;
}

.agent-form {
  grid-template-columns: minmax(130px, 1fr) minmax(142px, 1fr) minmax(160px, 1fr) minmax(94px, 0.7fr) auto !important;
}

.agent-config-editor {
  grid-template-columns: minmax(138px, 1fr) minmax(138px, 1fr) 86px 76px !important;
  max-width: 680px !important;
}

.agent-worktime-input {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 12px;
}

.stats-unique-chip,
.unique-ip-chip {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.stats-unique-chip:has(input:checked),
.unique-ip-chip:has(input:checked) {
  border-color: #60a5fa;
  background: #dbeafe;
  color: #1e40af;
}

.review-panel .filters {
  grid-template-columns: minmax(150px, 1fr) minmax(112px, 0.72fr) 86px 102px 98px auto 112px 112px 72px !important;
}

.review-panel .unique-ip-chip,
.review-panel .repeat-ip-chip {
  width: 100%;
}

.recent-review-card {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 78%);
}

.recent-icon {
  background: #dbeafe;
  color: #2563eb;
  box-shadow: inset 0 0 0 1px #bfdbfe;
  font-weight: 950;
}

.recent-review-text {
  color: #1e3a8a;
  font-size: 15.5px;
  line-height: 1.8;
}

.recent-review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.recent-review-continue,
.recent-review-cancel {
  min-height: 46px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 950;
  cursor: pointer;
}

.recent-review-continue {
  border: 1px solid #bfdbfe;
  background: #fff;
  color: #1d4ed8;
}

.recent-review-continue:hover,
.recent-review-continue:focus-visible {
  outline: none;
  border-color: #60a5fa;
  background: #eff6ff;
}

.recent-review-cancel {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

@media (max-width: 1180px) {
  .review-panel .filters {
    grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.8fr) 90px 102px 100px 112px 112px 72px !important;
  }

  .time-filter-group {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .agent-form,
  .credential-form {
    grid-template-columns: 1fr 1fr !important;
  }

  .agent-form .primary-btn,
  .credential-form .primary-btn {
    grid-column: 1 / -1;
  }

  .agent-config-editor {
    grid-template-columns: 1fr 1fr !important;
    max-width: none !important;
  }
}

@media (max-width: 760px) {
  .review-panel .filters {
    grid-template-columns: 1fr 1fr !important;
  }

  .review-panel .filters > input[type="search"],
  .time-filter-group {
    grid-column: 1 / -1;
  }

  .review-panel .positive-chip,
  .review-panel .repeat-ip-chip,
  .review-panel .unique-ip-chip,
  .review-panel .image-chip {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .agent-form,
  .credential-form,
  .agent-config-editor,
  .recent-review-actions,
  .review-panel .filters,
  .time-filter-group {
    grid-template-columns: 1fr !important;
  }

  .credential-form label:first-child,
  .review-panel .filters > input[type="search"],
  .time-filter-group {
    grid-column: auto;
  }
}

/* v23: video evidence upload, upload progress, stronger quota reminder */
.quota-widget {
  margin-left: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  min-width: 132px;
  text-align: right;
}

.quota-badge.is-very-low {
  border-color: #fb923c;
  background: #fff7ed;
  color: #9a3412;
  box-shadow: 0 8px 18px rgba(251, 146, 60, 0.16);
}

.quota-notice-inline {
  max-width: 230px;
  color: #92400e;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
}

.quota-notice-inline.is-empty {
  color: #b91c1c;
}

.upload-progress {
  grid-column: 1 / -1;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
  padding: 10px 12px;
  margin: -4px 0 12px;
}

.upload-progress[hidden] {
  display: none !important;
}

.upload-progress-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
}

.upload-progress-top b {
  font-weight: 900;
}

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

.upload-progress-bar {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  transition: width 0.18s ease;
}

.video-preview-item {
  width: 136px;
  height: 92px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0f172a;
  overflow: hidden;
}

.preview .video-preview-item video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0f172a;
}

.video-preview-meta {
  position: absolute;
  left: 6px;
  bottom: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.74);
  color: #fff;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 900;
}

.evidence-thumbs {
  align-items: center;
}

.video-thumb {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 1px solid #c7d2fe;
  border-radius: 14px;
  background: #eef2ff;
  color: #3730a3;
  text-decoration: none;
  font-weight: 900;
  line-height: 1;
}

.video-thumb span {
  font-size: 16px;
  margin-bottom: 4px;
}

.video-thumb small {
  font-size: 11px;
  font-weight: 900;
}

@media (max-width: 700px) {
  .quota-widget {
    align-items: flex-start;
    text-align: left;
    min-width: 0;
  }

  .quota-notice-inline {
    max-width: 100%;
  }

  .video-preview-item {
    width: 118px;
    height: 82px;
  }
}

/* v24: tighter quota display, polished upload button, guided missing-field modal */
.simple-title {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between;
  gap: 12px;
}

.simple-title > div:first-child {
  min-width: 0;
}

.simple-title h1 {
  line-height: 1.12;
}

.simple-title p {
  margin-right: 4px;
}

.quota-widget {
  flex: 0 0 auto;
  width: auto;
  min-width: 100px;
  margin-left: 8px;
  align-items: flex-end !important;
  text-align: right !important;
  gap: 4px;
}

.quota-badge {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 5px;
  min-width: 96px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
}

.quota-badge .quota-label {
  color: currentColor;
  opacity: 0.72;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.02em;
}

.quota-badge strong {
  color: currentColor;
  font-size: 15px;
  font-weight: 950;
  letter-spacing: -0.01em;
}

.quota-notice-inline {
  max-width: 168px;
  text-align: right;
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1.45;
}

.evidence-uploader {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 9px 11px;
  align-items: center;
  min-height: 126px;
  padding: 15px;
  cursor: pointer;
  border: 1.5px dashed #c7d2fe;
  background: linear-gradient(180deg, #ffffff, #f8faff);
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.evidence-uploader:hover,
.evidence-uploader:focus-within {
  border-color: #818cf8;
  background: #f5f7ff;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.09);
  transform: translateY(-1px);
}

.evidence-uploader input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  opacity: 0;
}

.file-box-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 22px;
  font-weight: 950;
  box-shadow: inset 0 0 0 1px #c7d2fe;
}

.file-box-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.file-box-copy strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.file-box-copy .help {
  display: block;
  line-height: 1.45;
}

.file-action {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
}

.required-evidence .evidence-uploader {
  border-color: #fca5a5;
  background: linear-gradient(180deg, #fffafa, #ffffff);
}

.field-missing {
  outline: 2px solid rgba(239, 68, 68, 0.45) !important;
  outline-offset: 3px;
  border-color: #fca5a5 !important;
  box-shadow: 0 0 0 5px rgba(254, 226, 226, 0.64) !important;
}

select.field-missing,
textarea.field-missing,
input.field-missing {
  background-color: #fffafa;
}

.missing-fields-card {
  width: min(460px, 100%);
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 76%);
}

.missing-fields-icon {
  background: #eff6ff;
  color: #2563eb;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.missing-fields-card h2 {
  color: #1e3a8a;
}

.missing-fields-text {
  color: #334155;
  font-size: 15px;
}

.missing-fields-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 16px;
}

.missing-field-item {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  border: 1px solid #dbeafe;
  border-radius: 15px;
  background: #ffffff;
  padding: 10px 12px;
  color: #1e3a8a;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.missing-field-item:hover,
.missing-field-item:focus-visible {
  outline: none;
  border-color: #93c5fd;
  background: #eff6ff;
  transform: translateY(-1px);
}

.missing-field-item span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 950;
}

.missing-field-item strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 950;
}

.missing-field-item small {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.missing-fields-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.missing-fields-go {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
}

.missing-fields-close {
  min-height: 46px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: #fff;
  color: #475569;
  padding: 0 16px;
  font-weight: 900;
}

.missing-fields-close:hover,
.missing-fields-close:focus-visible {
  outline: none;
  background: #f8fafc;
  border-color: #bfdbfe;
}

@media (max-width: 700px) {
  .simple-title {
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px;
  }

  .simple-title h1 {
    font-size: 23px;
  }

  .simple-title p {
    font-size: 13px;
    line-height: 1.45;
  }

  .quota-widget {
    min-width: 88px;
    margin-left: 4px;
    align-items: flex-end !important;
    text-align: right !important;
  }

  .quota-badge {
    min-width: 86px;
    min-height: 31px;
    padding: 5px 8px;
    gap: 4px;
  }

  .quota-badge .quota-label {
    font-size: 9px;
  }

  .quota-badge strong {
    font-size: 14px;
  }

  .quota-notice-inline {
    max-width: 128px;
    font-size: 10px;
    line-height: 1.38;
  }

  .evidence-uploader {
    min-height: 116px;
    padding: 13px;
  }

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

  .missing-fields-close {
    width: 100%;
  }
}

/* v25: admin video preview and balanced review status controls */
.review-panel .filters {
  grid-template-columns: minmax(220px, 1.35fr) minmax(150px, 0.85fr) minmax(112px, 0.55fr) minmax(132px, 0.65fr);
  align-items: stretch;
  gap: 10px;
}

.native-status-select {
  display: none !important;
}

.resolved-filter-group,
.time-filter-group {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.resolved-filter-btn,
.review-panel .check-filter {
  width: 100%;
  min-width: 0;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

.resolved-filter-btn {
  min-height: 36px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #f8fafc;
  color: #64748b;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.resolved-filter-btn:hover,
.resolved-filter-btn:focus-visible {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  outline: none;
  transform: translateY(-1px);
}

.resolved-filter-btn.active {
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.review-status-cell {
  min-width: 190px;
}

.review-status-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.review-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  padding: 4px 7px;
  font-size: 11.5px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
}

.review-status-badge.status-solved {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.review-status-badge.status-partial {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.review-status-badge.status-unsolved {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.review-status-badge.status-rating {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.review-status-badge.status-evidence {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}

.review-status-badge.status-muted {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #94a3b8;
}

.review-card-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 8px 0;
}

.review-card-meta-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.detail-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  align-items: start;
}

.detail-media-grid img {
  width: 100%;
  height: 156px;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  cursor: zoom-in;
}

.detail-video-card {
  overflow: hidden;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  padding: 10px;
}

.detail-video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.detail-video-meta strong {
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 950;
}

.detail-video-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.detail-video-player {
  display: block;
  width: 100%;
  max-height: 360px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: #020617;
  outline: 1px solid #dbeafe;
}

.detail-video-open {
  width: 100%;
  min-height: 34px;
  margin-top: 9px;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.detail-video-open:hover,
.detail-video-open:focus-visible {
  background: #e0e7ff;
  outline: none;
}

.video-thumb {
  cursor: pointer;
}

.video-thumb:hover,
.video-thumb:focus-visible {
  border-color: #818cf8;
  background: #e0e7ff;
  outline: none;
}

.video-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.62);
  padding: 18px;
}

.video-preview-modal.open {
  display: flex;
}

.video-preview-open {
  overflow: hidden;
}

.video-preview-card {
  width: min(900px, 100%);
  overflow: hidden;
  border: 1px solid #1e293b;
  border-radius: 22px;
  background: #0f172a;
  box-shadow: 0 28px 80px rgba(2, 6, 23, 0.48);
  animation: calm-pop 0.16s ease-out;
}

.video-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.16);
  background: #111827;
  padding: 14px 16px;
}

.video-preview-head h2 {
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
  font-size: 17px;
}

.video-preview-close {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.video-preview-player {
  display: block;
  width: 100%;
  max-height: 72vh;
  background: #000;
}

.video-preview-footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px 14px;
  background: #0f172a;
}

.video-preview-footer a {
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.video-preview-footer a:hover,
.video-preview-footer a:focus-visible {
  color: #fff;
  text-decoration: underline;
  outline: none;
}

@media (max-width: 1180px) {
  .review-panel .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resolved-filter-group,
  .time-filter-group {
    grid-column: span 1;
  }
}

@media (max-width: 760px) {
  .review-panel .filters {
    grid-template-columns: 1fr;
  }

  .resolved-filter-group,
  .time-filter-group {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-status-list,
  .review-card-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-card-meta-grid span:last-child,
  .review-status-list .review-status-badge:last-child {
    grid-column: 1 / -1;
  }

  .detail-media-grid {
    grid-template-columns: 1fr;
  }

  .detail-media-grid img {
    height: 190px;
  }

  .video-preview-card {
    border-radius: 18px;
  }
}
