body {
  margin: 0;
  font-family: "Segoe UI", "Hiragino Sans", sans-serif;
  background: linear-gradient(180deg, #f5efe5 0%, #f4f7fb 100%);
  color: #1f2937;
}

.topbar, .panel, .login-card {
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding: 24px 32px;
  background: #fffaf4;
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  padding: 20px 32px 0;
}

.panel {
  background: white;
  border-radius: 18px;
  padding: 24px;
  margin: 20px 32px;
}

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

.stats div, .history-item {
  background: #f7f9fc;
  border-radius: 14px;
  padding: 14px;
}

.stats strong {
  display: block;
  font-size: 28px;
  color: #0f4c5c;
}

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

form {
  margin: 0;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  background: #0f4c5c;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 12px;
  padding: 12px 16px;
  background: #0f4c5c;
  color: white;
  font-weight: 600;
}

button.secondary {
  background: #d97706;
}

.secondary-link {
  background: #d97706;
}

.settings-form {
  display: grid;
  gap: 10px;
}

.section-title {
  margin-top: 16px;
  font-weight: 700;
  font-size: 18px;
  color: #7c2d12;
}

label {
  font-weight: 600;
}

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

input, textarea, select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

textarea {
  resize: vertical;
}

.flash {
  margin: 20px 32px;
  background: #fff3cd;
  color: #7c2d12;
  border-radius: 12px;
  padding: 14px 16px;
}

.flash.error {
  margin: 16px 0;
  background: #fee2e2;
}

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

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.filter-form input {
  max-width: 180px;
}

.job-list {
  display: grid;
  gap: 16px;
}

.job-card {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 18px;
  background: #fbfdff;
}

.job-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.application-preview,
.long-text {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7f9fc;
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.detail-meta div {
  background: #f7f9fc;
  border-radius: 12px;
  padding: 12px;
}

.detail-meta strong,
.detail-meta span {
  display: block;
}

.copy-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.copy-area {
  min-height: 360px;
  font-family: "Segoe UI", "Hiragino Sans", sans-serif;
}

.muted {
  color: #64748b;
}

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.history-item.success {
  border-left: 4px solid #16a34a;
}

.history-item.error {
  border-left: 4px solid #dc2626;
}

.history-item.warning,
.history-item.alert {
  border-left: 4px solid #d97706;
}

.history-item.stopped {
  border-left: 4px solid #991b1b;
}

.history-item.ok {
  border-left: 4px solid #16a34a;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.pricing-card {
  background: #f7f9fc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
}

.history pre {
  white-space: pre-wrap;
  word-break: break-word;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: white;
  border-radius: 20px;
  padding: 28px;
}

@media (max-width: 720px) {
  .topbar, .panel, .grid, .flash {
    margin-left: 16px;
    margin-right: 16px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .grid {
    padding-top: 16px;
  }

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

  .job-card-head,
  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
