*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  background: #050816;
  color: #e5e7eb;
}

body {
  display: flex;
}

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

.sidebar {
  width: 260px;
  padding: 24px 20px;
  background: radial-gradient(circle at top left, #1e293b, #020617);
  border-right: 1px solid rgba(148, 163, 184, 0.3);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.logo {
  margin: 0 0 16px 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #f9fafb;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav .nav-item {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-nav .nav-item:hover {
  background: rgba(59, 130, 246, 0.15);
  color: #e5e7eb;
}

.sidebar-nav .nav-item.active {
  background: rgba(59, 130, 246, 0.25);
  color: #f9fafb;
}

.hidden {
  display: none !important;
}

.view-all-data-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.view-all-data-panel {
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.2));
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.view-all-data-title {
  margin: 0 0 14px 0;
  font-size: 16px;
  color: #e5e7eb;
}

.view-all-data-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.view-all-data-panel .table-wrapper {
  max-height: 70vh;
  overflow: auto;
}

.primary-btn {
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #22c55e, #4ade80);
  color: #022c22;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.1s ease;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.35);
}

.primary-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
}

.ghost-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: transparent;
  color: #e5e7eb;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ghost-btn:hover {
  background: rgba(30, 64, 175, 0.4);
  border-color: #3b82f6;
}

.sidebar-note {
  margin-top: 8px;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.4;
}

code {
  background: rgba(15, 23, 42, 0.9);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.main {
  flex: 1;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.5));
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.7);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

.field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.field input,
.field select {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.8);
  color: #e5e7eb;
  font-size: 13px;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

/* Futures backfill panel */
.backfill-panel {
  padding: 14px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 64, 175, 0.2));
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.backfill-title {
  margin: 0 0 12px 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.backfill-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
}

.backfill-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-right: 4px;
}

.backfill-radio-group {
  display: flex;
  gap: 16px;
  align-items: center;
}

.backfill-radio-group .radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #e5e7eb;
}

.backfill-radio-group input[type="radio"] {
  accent-color: #3b82f6;
}

.backfill-date-wrap,
.backfill-expiry-wrap,
.backfill-secret-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.backfill-date-wrap input,
.backfill-secret-wrap input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.8);
  color: #e5e7eb;
  font-size: 13px;
}

.backfill-secret-wrap input {
  min-width: 140px;
}

.conditions-panel {
  padding: 16px 18px;
  border-radius: 18px;
  background: radial-gradient(circle at top right, rgba(30, 64, 175, 0.5), rgba(15, 23, 42, 0.95));
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.9);
}

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

.conditions-header h2 {
  margin: 0;
  font-size: 16px;
}

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

.conditions-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.condition-row {
  display: flex;
  gap: 8px;
}

.condition-row input[type="text"] {
  flex: 1;
  padding: 8px 11px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.75);
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  font-size: 13px;
}

.condition-row button {
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  background: rgba(248, 113, 113, 0.16);
  color: #fecaca;
  cursor: pointer;
  font-size: 12px;
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: #cbd5f5;
}

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

.table-card {
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
  padding: 14px 16px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.table-card.highlighted {
  border: 1px solid rgba(34, 197, 94, 0.5);
  box-shadow: 0 20px 45px rgba(34, 197, 94, 0.15);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-header h2 {
  margin: 0;
  font-size: 15px;
}

.table-wrapper {
  max-height: 320px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(51, 65, 85, 0.8);
}

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

thead {
  background: rgba(15, 23, 42, 0.95);
  position: sticky;
  top: 0;
  z-index: 1;
}

th,
td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid rgba(30, 41, 59, 0.9);
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.7);
}

tbody tr:hover {
  background: rgba(30, 64, 175, 0.35);
}

.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.7);
  color: #e5e7eb;
  font-size: 13px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast.hidden {
  opacity: 0;
}

@media (max-width: 960px) {
  .sidebar {
    display: none;
  }

  .main {
    padding: 16px;
  }

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

