* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  background: linear-gradient(180deg, #f5f7fb 0%, #edf2f7 100%);
  color: #1f2937;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  gap: 16px;
}

.panel {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

h1,
h2 {
  margin: 0 0 12px;
}

.muted {
  margin: 0;
  color: #64748b;
}

.status {
  margin-top: 12px;
  min-height: 22px;
  font-size: 0.95rem;
}

.panel-nav {
  display: grid;
  gap: 10px;
}

.nav-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.top-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.top-nav-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.top-nav-link:hover {
  background: #e2e8f0;
  text-decoration: none;
}

.top-nav-link.is-active {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.top-nav-link:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

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

h3 {
  margin: 0;
  font-size: 1.02rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

label.full {
  grid-column: 1 / -1;
}

.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

button:hover {
  background: #1d4ed8;
}

.btn-secondary {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.settings-stack {
  display: grid;
  gap: 14px;
}

.settings-source-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.settings-block {
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.settings-block-source {
  border-left-width: 5px;
}

.settings-block-sparwelt {
  border-left-color: #16a34a;
}

.settings-block-mydealz {
  border-left-color: #f59e0b;
}

.settings-grid {
  gap: 10px;
}

.settings-actions {
  margin-top: 14px;
}

.action-source {
  min-width: 260px;
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.actions input {
  min-width: 260px;
  flex: 1 1 260px;
}

.deal-filters {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.deal-filters-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: end;
}

.deal-filters-row label {
  min-width: 180px;
}

.deal-filters-row .checkbox {
  min-height: 40px;
}

.deal-filters-row input[type="text"] {
  min-width: 340px;
  flex: 1 1 340px;
}

.deal-pagination {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.deal-pagination-info {
  color: #334155;
  font-size: 0.92rem;
}

.deal-pagination-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.deal-pagination-actions button {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  padding: 8px 12px;
}

.deal-pagination-actions button:hover:not(:disabled) {
  background: #e2e8f0;
}

.deal-pagination-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  border-bottom: 1px solid #e2e8f0;
  padding: 8px;
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}

th {
  background: #f8fafc;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

  .settings-source-row {
    grid-template-columns: 1fr;
  }
}
