:root {
  --primary: #1a365d;
  --primary-light: #2b6cb0;
  --accent: #dd6b20;
  --accent-light: #ed8936;
  --success: #38a169;
  --warning: #d69e2e;
  --danger: #e53e3e;
  --bg: #f7fafc;
  --card: #ffffff;
  --text: #2d3748;
  --text-light: #718096;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 18px;
  font-weight: 700;
  color: white;
  text-decoration: none;
}
.header nav { display: flex; gap: 20px; }
.header nav a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.header nav a:hover { color: white; }

/* Main container */
.main { padding: 32px 24px; }
.container { max-width: 960px; margin: 0 auto; }

/* Hero */
.hero {
  margin-bottom: 24px;
}
.hero h1 {
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 8px;
}
.hero p {
  color: var(--text-light);
  font-size: 15px;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.form-group input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  transition: border-color .2s;
  outline: none;
}
.form-group input:focus {
  border-color: var(--primary-light);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .2s;
}
.btn:hover { opacity: .9; }
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-secondary {
  background: var(--border);
  color: var(--text);
}
.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-error {
  background: #fed7d7;
  color: #9b2c2c;
  border: 1px solid #feb2b2;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-pending { background: #e2e8f0; color: #4a5568; }
.badge-running { background: #bee3f8; color: #2a4365; }
.badge-completed { background: #c6f6d5; color: #22543d; }
.badge-failed { background: #fed7d7; color: #9b2c2c; }

/* Status page */
.status-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.status-header h1 { font-size: 22px; color: var(--primary); }
.status-meta {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.status-meta a { color: var(--primary-light); }

/* Spinner */
.spinner-area {
  text-align: center;
  padding: 40px 0;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-text {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 8px;
}
.elapsed {
  font-size: 14px;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

/* Success / Error areas */
.success-area, .error-area {
  text-align: center;
  padding: 40px 0;
}
.success-icon {
  width: 64px;
  height: 64px;
  line-height: 64px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 32px;
  margin: 0 auto 16px;
}
.error-icon {
  width: 64px;
  height: 64px;
  line-height: 64px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-size: 32px;
  margin: 0 auto 16px;
}
.error-detail {
  background: #fff5f5;
  border: 1px solid #feb2b2;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: #9b2c2c;
  text-align: left;
  margin: 16px 0;
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-light);
  border-bottom: 2px solid var(--border);
}
td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f7fafc; }
.url-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-cell a { color: var(--primary-light); text-decoration: none; }
.text-muted { color: var(--text-light); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-light);
}
.empty-state p { margin-bottom: 16px; }

/* Login page */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}
.login-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(0,0,0,.15);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.login-logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  margin-bottom: 4px;
}
.login-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 24px;
}

/* Audit form */
.audit-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.audit-form .form-group { flex: 1; margin-bottom: 0; }

/* Responsive */
@media (max-width: 640px) {
  .audit-form { flex-direction: column; align-items: stretch; }
  .header nav { gap: 12px; }
  .header nav a { font-size: 13px; }
  table { font-size: 13px; }
  th, td { padding: 8px 10px; }
}
