body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 40px auto;
  background: #ffffff;
  padding: 20px 24px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-radius: 6px;
}

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

header h1 {
  margin: 0;
}

header .meta span {
  margin-right: 12px;
}

header .meta a {
  text-decoration: none;
  color: #007acc;
}

.status-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.chart-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-block {
  width: 100%;
}

.chart-block canvas {
  width: 100%;
  display: block;
}

.status-card {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: #fafafa;
  min-width: 120px;
}

.status-card .label {
  font-size: 12px;
  color: #555;
  margin-bottom: 4px;
}

.status-card .count {
  font-size: 18px;
  font-weight: 600;
}

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

.jobs-table th,
.jobs-table td {
  border: 1px solid #ddd;
  padding: 6px 8px;
}

.jobs-table th {
  background: #fafafa;
  text-align: left;
}

.jobs-table tr:nth-child(even) {
  background: #fcfcfc;
}

.run-now-button {
  white-space: nowrap;
  padding: 4px 8px;
  border: 1px solid #9ca3af;
  border-radius: 4px;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
}

.run-now-button:hover:not(:disabled) {
  background: #eef2ff;
  border-color: #6366f1;
}

.run-now-button:disabled {
  color: #6b7280;
  cursor: wait;
}

.run-now-status {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.2;
}

.run-now-ok {
  color: #166534;
}

.run-now-error {
  color: #991b1b;
}

.ivt-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #ffffff;
}

.ivt-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #374151;
  font-size: 13px;
}

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

.primary-action {
  padding: 6px 10px;
  border: 1px solid #2563eb;
  border-radius: 4px;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
}

.primary-action:hover:not(:disabled) {
  background: #1d4ed8;
}

.primary-action:disabled {
  background: #9ca3af;
  border-color: #9ca3af;
  cursor: wait;
}

.ivt-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ivt-filters input,
.ivt-threshold-input,
.ivt-advertiser-mode {
  padding: 5px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  box-sizing: border-box;
}

.ivt-filters input {
  width: 190px;
}

.ivt-threshold-input {
  width: 90px;
}

.ivt-percent-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ivt-percent-field span {
  color: #4b5563;
  font-size: 13px;
}

.ivt-config-table td {
  vertical-align: middle;
}

.ivt-advertiser-row {
  background: #eef2ff;
}

.ivt-channel-row {
  background: #eef2ff;
}

.ivt-campaign-row,
.ivt-source-row {
  display: none;
}

.ivt-campaign-name,
.ivt-source-name {
  padding-left: 38px !important;
}

.ivt-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ivt-toggle {
  width: 24px;
  height: 24px;
  margin-right: 6px;
  border: 1px solid #9ca3af;
  border-radius: 4px;
  background: #ffffff;
  cursor: pointer;
}

.ivt-count {
  margin-left: 8px;
  color: #6b7280;
  font-size: 12px;
}

.status-success {
  background-color: #e6ffed;
}

.status-failed {
  background-color: #ffe6e6;
}

.status-missing {
  background-color: #fff9e6;
}

.status-unknown {
  background-color: #f0f0f0;
}

.login-form {
  max-width: 300px;
}

.login-form label {
  display: block;
  margin-top: 10px;
}

.login-form input {
  width: 100%;
  padding: 6px;
  margin-top: 4px;
  box-sizing: border-box;
}

.login-form button {
  margin-top: 16px;
  padding: 8px 12px;
}

.error {
  background: #ffe6e6;
  border: 1px solid #ffb3b3;
  color: #990000;
  padding: 8px;
  margin-bottom: 10px;
}

.success {
  background: #e6ffed;
  border: 1px solid #9ae6b4;
  color: #166534;
  padding: 8px;
  margin-bottom: 10px;
}

.user-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.user-form label,
.inline-user-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #374151;
}

.user-form input,
.user-form select,
.inline-user-form input,
.inline-user-form select {
  padding: 5px 7px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #ffffff;
  box-sizing: border-box;
}

.checkbox-label {
  align-items: center !important;
  flex-direction: row !important;
  gap: 6px !important;
  white-space: nowrap;
}

.inline-user-form,
.inline-delete-form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 0;
}

.page-permissions {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f8fafc;
}

.page-permissions-title {
  grid-column: 1 / -1;
  font-weight: 600;
  color: #111827;
}

.inline-page-permissions {
  margin-top: 8px;
}

.danger-button {
  border: 1px solid #991b1b;
  background: #ffffff;
  color: #991b1b;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
}

.danger-button:hover {
  background: #fee2e2;
}

.pill {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  line-height: 1.2;
  margin: 1px 2px;
  white-space: nowrap;
}

.layout {
  display: flex;
}

.sidebar {
  width: 180px;
  background: #1f2933;
  color: #ffffff;
  padding: 16px 12px;
  border-radius: 6px 0 0 6px;
}

.sidebar h2 {
  font-size: 16px;
  margin: 0 0 12px 0;
}

.sidebar a {
  display: block;
  color: #ffffff;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 14px;
}

.sidebar a:hover {
  background: #000000;
}

.sidebar .sidebar-section {
  margin-top: 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
}

.main-content {
  flex: 1;
  margin-left: 16px;
}


body {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 200px;
  background: #000000;
  color: #ffffff;
  padding: 20px 12px;
  box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.page-wrapper {
  flex: 1;
  padding: 24px;
}

.sidebar h2 {
  font-size: 16px;
  margin: 0 0 16px 8px;
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-nav > li {
  margin-bottom: 4px;
}

.sidebar-link {
  display: block;
  color: #ffffff;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 14px;
}

.sidebar-link.active {
  border-left: 3px solid #ffffff;
  font-weight: 600;
  background: #333333;
  color: #ffffff;
}

.sidebar-link:hover {
  border-left: 3px solid rgba(255,255,255,0.4);
  background: #444444;
}

.sidebar-subnav {
  list-style: none;
  padding-left: 16px;
  margin: 4px 0 6px 0;
}

.sidebar-subnav li {
  margin-bottom: 2px;
}

.sidebar-subnav .sidebar-link {
  font-size: 13px;
  padding: 5px 10px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}


body {
  display: flex;
  min-height: 100vh;
  margin: 0;
}

.sidebar {
  width: 220px;
  background: #000000;
  color: #ffffff;
  padding: 20px 12px;
  box-shadow: 2px 0 4px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
}

.page-wrapper {
  flex: 1;
  padding: 24px;
}

.sidebar-toggle {
  position: fixed;
  top: 12px;
  left: 230px;
  z-index: 1000;
  background: #000000;
  color: #ffffff;
  border: 1px solid #444444;
  border-radius: 3px;
  padding: 2px 6px;
  cursor: pointer;
}

body.sidebar-collapsed .sidebar {
  width: 0;
  padding: 0;
  overflow: hidden;
}

body.sidebar-collapsed .sidebar-toggle {
  left: 10px;
}
