:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #162033;
  --muted: #697586;
  --faint: #98a2b3;
  --line: #e5e9f0;
  --primary: #2563eb;
  --primary-soft: #eaf1ff;
  --teal: #0f766e;
  --teal-soft: #e8f7f3;
  --amber: #b45309;
  --amber-soft: #fff4dd;
  --red: #c2413b;
  --red-soft: #fcebea;
  --shadow: 0 10px 26px rgba(17, 24, 39, 0.06);
  --radius: 8px;
  --radius-lg: 12px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-panel {
  display: grid;
  width: min(380px, 100%);
  gap: 12px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel .brand-mark {
  margin-bottom: 4px;
}

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

.login-panel p {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.name-link {
  color: inherit;
  text-decoration: none;
}

.name-link:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: 238px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: #172033;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.brand-copy strong {
  font-size: 14px;
  letter-spacing: 0;
}

.brand-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.nav-section {
  padding: 22px 14px 8px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav {
  display: grid;
  gap: 4px;
  padding: 0 10px;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: background 160ms ease, color 160ms ease;
}

.nav-button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-button.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.nav-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
}

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

.demo-note {
  padding: 12px;
  border: 1px solid #dbe6ff;
  border-radius: 8px;
  background: #f5f8ff;
  color: #31518c;
  font-size: 12px;
  line-height: 1.55;
}

.main {
  width: calc(100% - 238px);
  min-width: 0;
  margin-left: 238px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.topbar-title strong,
.topbar-title span {
  display: block;
}

.topbar-title strong {
  font-size: 17px;
}

.topbar-title span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.identity-select {
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.avatar {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #eaf1ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 34px;
}

.api-health-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #f0b4ad;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
}

.api-health-alert strong,
.api-health-alert span {
  display: block;
}

.api-health-alert span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #8f2f2a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  font-size: 28px;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
}

h3 {
  font-size: 14px;
}

.page-heading p,
.section-heading p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

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

.button.primary:hover {
  background: #1d4ed8;
}

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

.button.secondary:hover {
  border-color: #cbd5e1;
  background: var(--surface-soft);
}

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

.button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

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

.metric-card {
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.metric-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.metric-value {
  margin-top: 16px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
}

.metric-caption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-status-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dashboard-status-bar > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.dashboard-status-bar > div:last-child {
  border-right: 0;
}

.dashboard-status-bar span:first-child {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-status-bar strong {
  font-size: 13px;
  white-space: nowrap;
}

.dashboard-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 10px;
}

.dashboard-section-heading h2 {
  font-size: 16px;
}

.dashboard-section-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-daily-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dashboard-daily-grid .metric-card {
  min-height: 116px;
  padding: 16px;
}

.dashboard-daily-grid .metric-value {
  margin-top: 12px;
  font-size: 23px;
}

.dashboard-panel {
  margin-bottom: 18px;
}

.dashboard-table {
  min-width: 900px;
}

.dashboard-table th:not(:first-child),
.dashboard-table td.number {
  text-align: right;
}

.dashboard-entity-link {
  display: grid;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.dashboard-entity-link strong,
.dashboard-entity-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-entity-link:hover strong {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dashboard-entity-link span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-employee-table th:first-child,
.dashboard-employee-table td:first-child,
.dashboard-channel-table th:first-child,
.dashboard-channel-table td:first-child {
  width: 230px;
}

.dashboard-issues-table {
  min-width: 760px;
}

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

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 18px;
}

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

.panel-header,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-body {
  padding: 20px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading .right-actions {
  display: flex;
  gap: 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  padding: 12px 16px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}

tr:hover td {
  background: #fbfcfe;
}

.channel-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-cell strong,
.channel-cell span {
  display: block;
}

.channel-cell span {
  max-width: 220px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
}

.channel-avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
}

.channel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.status.pending {
  background: var(--amber-soft);
  color: var(--amber);
}

.status.monitoring,
.status.active {
  background: var(--teal-soft);
  color: var(--teal);
}

.status.abnormal,
.status.resigned {
  background: var(--red-soft);
  color: var(--red);
}

.status.disabled {
  background: #eef1f5;
  color: #64748b;
}

.status.unassigned {
  background: var(--amber-soft);
  color: var(--amber);
}

.content-title-with-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.content-title-with-status strong {
  min-width: 0;
}

.content-status {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 2px 7px;
}

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

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

.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.employee-report-toolbar {
  margin-bottom: 18px;
}

.my-submissions-panel {
  margin-bottom: 18px;
}

.submission-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.employee-report-toolbar .panel-body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
}

.report-toolbar-group {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.report-toolbar-primary {
  min-width: 0;
}

.report-toolbar-group label,
.report-toolbar-group > div {
  min-width: 0;
}

.report-toolbar-group label > span,
.report-control-label,
.report-employee > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.report-employee strong {
  display: block;
  min-width: 150px;
  height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 13px;
}

.employee-report-toolbar .select {
  width: 220px;
}

.employee-channel-select {
  width: min(320px, 100%);
  max-width: 320px;
}

.report-summary-grid,
.employee-channel-summary,
.employee-content-summary {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}

.report-summary-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.employee-channel-summary {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-width: 0 0 1px;
}

.employee-content-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-width: 0 0 1px;
}

.report-summary-item {
  min-width: 0;
  padding: 15px 14px;
  border-right: 1px solid var(--line);
}

.report-summary-item:last-child {
  border-right: 0;
}

.report-summary-item span,
.report-summary-item strong,
.report-summary-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-summary-item span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.report-summary-item strong {
  margin-top: 7px;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.report-summary-item small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
}

.employee-report-panel {
  margin-top: 0;
}

.employee-sheet table {
  min-width: 1120px;
}

.employee-content-table table {
  min-width: 1180px;
}

.employee-content-table th:first-child,
.employee-content-table td:first-child {
  width: 280px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.employee-content-table th:nth-child(2),
.employee-content-table td:nth-child(2) {
  width: 150px;
}

.employee-content-table th:nth-child(3),
.employee-content-table td:nth-child(3) {
  width: 160px;
}

.employee-content-table th:nth-child(n + 4),
.employee-content-table td:nth-child(n + 4) {
  width: 98px;
  text-align: right;
}

.employee-sheet th,
.employee-sheet td {
  border-right: 1px solid var(--line);
}

.employee-sheet th:last-child,
.employee-sheet td:last-child {
  border-right: 0;
}

.employee-sheet tbody tr:nth-child(even) td {
  background: #fcfdff;
}

.sync-message {
  max-width: 280px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
}

.sync-alert {
  border-bottom: 1px solid var(--line);
  background: var(--red-soft);
  color: var(--red);
  font-weight: 700;
}

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

.channel-batch-panel {
  margin-bottom: 18px;
}

.channel-batch-panel form {
  padding: 0 16px 16px;
  display: grid;
  gap: 12px;
}

.channel-batch-owner-static {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.input.channel-batch-textarea {
  min-height: 152px;
  height: auto;
  padding: 12px;
  line-height: 1.5;
  resize: vertical;
}

.channel-batch-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.input,
.select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input:focus,
.select:focus {
  border-color: #9ab7ff;
  box-shadow: 0 0 0 3px #eaf1ff;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.empty-state {
  padding: 38px 20px;
  color: var(--muted);
  text-align: center;
}

.list {
  display: grid;
  gap: 0;
}

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.list-item:first-child {
  padding-top: 0;
}

.list-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.list-main {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.list-copy {
  min-width: 0;
}

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

.list-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.list-value {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.tab {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.09);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
}

.filter-bar .select {
  width: auto;
  min-width: 142px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid #dbe6ff;
  border-radius: 8px;
  background: #f5f8ff;
  color: #31518c;
  font-size: 12px;
  line-height: 1.55;
}

.notice strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.api-health-panel {
  margin-bottom: 18px;
}

.api-health-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 20px 0;
}

.api-scheduler-grid {
  padding-top: 0;
  padding-bottom: 18px;
}

.data-unavailable {
  color: var(--muted);
  cursor: help;
}

.api-health-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.api-health-card span,
.api-health-card strong,
.api-health-card small {
  display: block;
}

.api-health-card span {
  color: var(--muted);
  font-size: 12px;
}

.api-health-card strong {
  margin-top: 7px;
  overflow: hidden;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-health-card small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.api-health-card.ok strong {
  color: var(--teal);
}

.api-health-card.warn strong {
  color: var(--amber);
}

.api-health-card.bad strong {
  color: var(--red);
}

.api-health-steps {
  padding-top: 14px;
}

.api-step-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.api-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 9px;
  align-items: flex-start;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.api-step > span {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: #eef1f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.api-step.success > span {
  background: var(--teal-soft);
  color: var(--teal);
}

.api-step.failed > span {
  background: var(--red-soft);
  color: var(--red);
}

.api-step.checking > span {
  background: var(--amber-soft);
  color: var(--amber);
}

.api-step strong,
.api-step small {
  display: block;
}

.api-step small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.api-recovery-row.active td {
  background: var(--amber-soft);
}

.switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 24px;
  flex: 0 0 auto;
}

.switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 160ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  content: "";
  transition: transform 160ms ease;
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(20px);
}

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

.setting-row:first-child {
  padding-top: 0;
}

.setting-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.setting-copy strong,
.setting-copy span {
  display: block;
}

.setting-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.public-settings-layout {
  display: grid;
  gap: 18px;
}

.public-channel-settings-panel .panel-header {
  align-items: center;
}

.public-channel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.public-channel-filters,
.public-channel-batch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.public-channel-filters {
  flex: 1;
  min-width: 0;
}

.public-channel-search {
  max-width: 280px;
}

.public-channel-owner-filter {
  width: 180px;
}

.public-channel-batch-actions {
  flex: 0 0 auto;
}

.public-channel-selection-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.public-channel-settings-wrap {
  max-height: 560px;
  overflow: auto;
}

.public-channel-settings-table {
  min-width: 720px;
}

.public-channel-settings-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.public-channel-settings-table th:first-child,
.public-channel-settings-table td:first-child {
  width: 48%;
}

.public-channel-settings-table td {
  padding: 12px 16px;
}

.public-channel-settings-table tbody tr:last-child td {
  border-bottom: 0;
}

.public-channel-toggle-column {
  width: 88px;
  text-align: center;
}

.public-channel-toggle-column .switch {
  margin: 0 auto;
}

.public-channel-filter-empty {
  border-top: 1px solid var(--line);
}

.public-shell {
  min-height: 100vh;
  background: #f8fafc;
}

.public-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 28px;
}

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

.public-brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: #172033;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

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

.public-brand span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.public-link {
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.public-link:hover {
  color: var(--primary);
}

.public-content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 28px 60px;
}

.public-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.public-hero h1 {
  max-width: 660px;
  font-size: 36px;
  line-height: 1.1;
}

.public-hero p {
  max-width: 650px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.update-label {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

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

.public-metric {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.public-metric span,
.public-metric strong {
  display: block;
}

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

.public-metric strong {
  margin-top: 10px;
  font-size: 25px;
}

.public-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.public-main-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
}

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

.public-delta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 20px;
}

.public-delta {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.public-delta span,
.public-delta strong {
  display: block;
}

.public-delta span {
  color: var(--muted);
  font-size: 12px;
}

.public-delta strong {
  margin-top: 8px;
  font-size: 22px;
}

.public-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.public-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-width: 0;
}

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

.public-panel-header > div:first-child {
  min-width: 0;
}

.public-panel-header h2 {
  font-size: 18px;
}

.public-panel-header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.public-panel-body {
  padding: 20px;
}

.public-report-actions,
.public-range-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 9px;
}

.public-report-actions > .select,
.public-sort-select {
  width: auto;
  min-width: 170px;
}

.public-range-controls label {
  display: grid;
  gap: 5px;
}

.public-range-controls label span {
  color: var(--muted);
  font-size: 11px;
}

.public-range-controls .input {
  width: 142px;
  min-height: 34px;
}

.public-range-error {
  align-self: center;
  color: var(--red);
  font-size: 12px;
  white-space: nowrap;
}

.public-channel-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.public-summary-item {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid var(--line);
}

.public-summary-item:last-child {
  border-right: 0;
}

.public-summary-item span,
.public-summary-item strong,
.public-summary-item small {
  display: block;
}

.public-summary-item span,
.public-summary-item small {
  color: var(--muted);
  font-size: 11px;
}

.public-summary-item strong {
  margin-top: 7px;
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-summary-item small {
  margin-top: 5px;
}

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

.public-data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.public-trend-table {
  min-width: 760px;
}

.public-channel-table {
  min-width: 720px;
}

.public-content-table {
  min-width: 1080px;
}

.public-content-data-table {
  min-width: 1180px;
}

.public-channel-rank-table {
  min-width: 940px;
}

.public-data-table th,
.public-data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.public-data-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

.public-data-table .numeric {
  text-align: right;
}

.public-data-table .rank-column {
  width: 64px;
  text-align: center;
}

.public-data-table .operator-column {
  width: 92px;
  text-align: left;
  white-space: nowrap;
}

.public-content-rank-table th:nth-last-child(-n + 4),
.public-content-rank-table td:nth-last-child(-n + 4) {
  width: 120px;
}

.public-content-data-table th.numeric,
.public-content-data-table td.numeric {
  width: 96px;
}

.public-content-table .date-time-column {
  width: 160px;
  padding-right: 8px;
  padding-left: 8px;
  font-size: 12px;
}

.public-content-table .content-title-cell {
  width: 260px;
}

.public-content-table .content-title-cell .name-link {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.public-pagination > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.public-page-button {
  width: 32px;
  min-width: 32px;
  padding: 0;
  font-size: 18px;
}

.employee-stats-panel {
  margin-bottom: 18px;
}

.employee-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 20px 20px;
}

.employee-stat-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.employee-stat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

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

.employee-stat-header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-stat-header span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

.employee-stat-totals div {
  min-width: 0;
}

.employee-stat-totals span,
.employee-stat-totals strong {
  display: block;
}

.employee-stat-totals span {
  color: var(--muted);
  font-size: 11px;
}

.employee-stat-totals strong {
  margin-top: 4px;
  font-size: 18px;
}

.employee-stat-today {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.employee-stat-today span {
  padding: 5px 8px;
  border: 1px solid #dbe6ff;
  border-radius: 999px;
  background: #fff;
  color: #31518c;
  font-size: 12px;
}

.rank-list {
  display: grid;
  gap: 12px;
}

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

.rank-item:first-child {
  padding-top: 0;
}

.rank-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.rank-number {
  color: var(--faint);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.rank-number.top {
  color: var(--primary);
}

.rank-copy {
  min-width: 0;
}

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

.rank-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.rank-value {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.rank-value span,
.rank-value strong {
  display: block;
}

.rank-value span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.rank-value strong {
  margin-top: 3px;
  font-size: 15px;
}

.video-thumb {
  display: inline-grid;
  width: 58px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.public-empty,
.public-offline {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 30px;
  text-align: center;
}

.offline-box {
  max-width: 420px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.offline-box h1 {
  font-size: 25px;
}

.offline-box p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: 340px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172033;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.45;
  animation: toast-in 180ms ease;
}

.toast.error {
  background: #8e2d2b;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .metrics-grid,
  .public-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .report-summary-grid,
  .employee-channel-summary,
  .public-channel-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .report-summary-item:nth-child(4n) {
    border-right: 0;
  }

  .public-overview-grid {
    grid-template-columns: 1fr;
  }

  .grid-two,
  .public-layout {
    grid-template-columns: 1fr;
  }

  .api-health-grid,
  .api-step-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-shell {
    display: block;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-bottom: 12px;
  }

  .nav-section,
  .sidebar-footer {
    display: none;
  }

  .main {
    width: 100%;
    margin-left: 0;
  }

  .topbar {
    padding: 16px 18px;
  }

  .topbar-title span,
  .user-chip {
    display: none;
  }

  .content {
    padding: 24px 18px 40px;
  }

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

  .dashboard-status-bar > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dashboard-status-bar > div:last-child {
    border-bottom: 0;
  }

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

  .employee-report-toolbar .panel-body,
  .report-toolbar-group {
    align-items: stretch;
    flex-direction: column;
  }

  .employee-report-toolbar .select,
  .employee-channel-select {
    width: 100%;
    max-width: none;
  }

  .employee-report-panel .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .report-toolbar-group .tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .report-summary-grid,
  .employee-channel-summary,
  .employee-content-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-summary-item:nth-child(2n) {
    border-right: 0;
  }

  .page-heading,
  .public-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 25px;
  }

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

  .channel-batch-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .public-topbar,
  .public-content {
    padding-right: 18px;
    padding-left: 18px;
  }

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

  .public-panel-header,
  .public-report-actions,
  .public-range-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .public-report-actions,
  .public-range-controls {
    justify-content: flex-start;
    width: 100%;
  }

  .public-report-actions > .select,
  .public-sort-select,
  .public-range-controls .input {
    width: 100%;
  }

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

  .public-summary-item:nth-child(2n) {
    border-right: 0;
  }

  .public-delta-grid {
    grid-template-columns: 1fr;
  }

  .api-health-alert {
    align-items: flex-start;
    flex-direction: column;
  }

  .api-health-alert span {
    white-space: normal;
  }

  .public-channel-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .public-channel-filters {
    flex-wrap: wrap;
  }

  .public-channel-search {
    flex: 1 1 240px;
    max-width: none;
  }

  .public-channel-batch-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 500px) {
  .metrics-grid,
  .public-metrics,
  .employee-stats-grid,
  .api-health-grid,
  .api-step-list {
    grid-template-columns: 1fr;
  }

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

  .public-channel-filters {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .public-channel-search,
  .public-channel-owner-filter {
    width: 100%;
    max-width: none;
  }

  .public-channel-visibility-filter,
  .public-channel-batch-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .public-channel-visibility-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .public-channel-selection-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions .button {
    display: none;
  }

  .public-panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-hero h1 {
    font-size: 28px;
  }

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

  .rank-item {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
  }
}
