/* ── Reset & Base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f6fa;
  color: #1a1a2e;
  line-height: 1.6;
}

a { color: #4361ee; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ─────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1a1a2e;
  padding: 0 2rem;
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
}
.brand-logo {
  height: 200px;
  width: 200px;
  display: block;
}
.navbar .nav-links a {
  color: #c9d1e9;
  margin-left: 1.5rem;
  font-size: .95rem;
}
.navbar .nav-links a:hover { color: #fff; text-decoration: none; }
.nav-sep   { color: #4a5568; margin: 0 .5rem; }
.nav-user  { color: #a0aec0; font-size: .85rem; }
.nav-logout{ color: #fc8181 !important; margin-left: .5rem; font-size: .85rem; }

/* ── Login page ─────────────────────────────────── */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f5f6fa; }
.login-card { background: #fff; border-radius: 16px; overflow: hidden; width: 100%; max-width: 380px; box-shadow: 0 4px 24px rgba(0,0,0,.1); }
.login-logo-wrap { background: #1a1a2e; padding: 2rem; display: flex; justify-content: center; align-items: center; }
.login-logo { display: block; max-width: 180px; height: auto; }
.login-body { padding: 2rem; }
.login-title{ font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: .25rem; }
.login-sub  { text-align: center; color: #6b7280; font-size: .9rem; margin-bottom: 1.5rem; }

/* ── Alert success ──────────────────────────────── */
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

/* ── Checkboxes ─────────────────────────────────── */
.checkbox-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.checkbox-label { display: flex; flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; font-size: .9rem; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ── Layout ─────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

h1 { font-size: 1.75rem; margin-bottom: 1.25rem; color: #1a1a2e; }
h2 { font-size: 1.15rem; margin-bottom: 1rem; color: #16213e; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* ── Card ───────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  text-align: center;
}
.stat-number { font-size: 2rem; font-weight: 700; color: #4361ee; }
.stat-label  { font-size: .85rem; color: #6b7280; margin-bottom: .5rem; }

/* ── Forms ──────────────────────────────────────── */
label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-size: .9rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 1rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
  padding: .55rem .75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: .95rem;
  background: #fafafa;
  transition: border-color .15s;
}
input:focus, select:focus { outline: none; border-color: #4361ee; background: #fff; }

.hint { font-size: .8rem; color: #9ca3af; font-weight: 400; }

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}
.filter-form label { min-width: 160px; margin-bottom: 0; }

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: .55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #f3f4f6; text-decoration: none; }

.btn-primary { background: #4361ee; color: #fff; border-color: #4361ee; }
.btn-primary:hover { background: #3451d1; }

.btn-danger  { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-danger:hover { background: #dc2626; }

.btn-warning { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.btn-warning:hover { background: #d97706; }

.btn-sm { padding: .3rem .7rem; font-size: .8rem; }

.btn-row { display: flex; gap: .75rem; margin-top: .5rem; }

/* ── Badges ─────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .3px;
}
.badge-valid    { background: #d1fae5; color: #065f46; }
.badge-invalid  { background: #fee2e2; color: #991b1b; }
.badge-greylist { background: #fef3c7; color: #92400e; }
.badge-pending  { background: #e0e7ff; color: #3730a3; }
.badge-processing { background: #dbeafe; color: #1e40af; }
.badge-done     { background: #d1fae5; color: #065f46; }
.badge-error    { background: #fee2e2; color: #991b1b; }

/* ── Tables ─────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.data-table th {
  background: #f9fafb;
  padding: .6rem .85rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #e5e7eb;
  white-space: nowrap;
}
.data-table td {
  padding: .55rem .85rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.data-table tr:hover td { background: #f9fafb; }

.table-wrap { overflow-x: auto; }

.result-table { width: 100%; border-collapse: collapse; }
.result-table th, .result-table td { padding: .5rem .75rem; border-bottom: 1px solid #e5e7eb; font-size: .9rem; }
.result-table th { width: 160px; font-weight: 600; color: #6b7280; }

/* ── Progress bar ───────────────────────────────── */
.progress-bar-wrap {
  background: #e5e7eb;
  border-radius: 999px;
  height: 14px;
  overflow: hidden;
  margin-bottom: .75rem;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4361ee, #7209b7);
  border-radius: 999px;
  transition: width .4s ease;
  min-width: 4px;
}

/* ── Alerts ─────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .9rem;
}
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── Key code ───────────────────────────────────── */
.key-code {
  font-family: monospace;
  font-size: .8rem;
  background: #f3f4f6;
  padding: .2rem .45rem;
  border-radius: 4px;
  word-break: break-all;
}

/* ── Pagination ─────────────────────────────────── */
.pagination { margin-top: 1rem; text-align: right; }

/* ── Job count boxes ────────────────────────────── */
.counts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.count-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}
.count-box-cached   { border-color: #93c5fd; background: #eff6ff; }
.count-box-cleaned  { border-color: #6ee7b7; background: #ecfdf5; }
.count-box-valid    { border-color: #6ee7b7; background: #ecfdf5; }
.count-box-invalid  { border-color: #fca5a5; background: #fef2f2; }
.count-box-greylist { border-color: #fcd34d; background: #fffbeb; }
.section-label { font-size: 1rem; font-weight: 600; color: #6b7280; margin: 1.25rem 0 .5rem; text-transform: uppercase; letter-spacing: .5px; }
.section-sub   { font-size: .8rem; font-weight: 400; text-transform: none; color: #9ca3af; }
.count-number { font-size: 1.9rem; font-weight: 700; color: #1a1a2e; }
.count-label  { font-size: .85rem; font-weight: 600; color: #374151; margin: .2rem 0; }
.count-hint   { font-size: .75rem; color: #9ca3af; }

/* ── Result card accent ─────────────────────────── */
.result-card.status-valid   { border-left: 5px solid #10b981; }
.result-card.status-invalid { border-left: 5px solid #ef4444; }
.result-card.status-greylist{ border-left: 5px solid #f59e0b; }
