:root {
  --primary: #1d4ed8;
  --primary-dark: #1e3a8a;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --bg: #f4f6f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #1f2937;
  --text-muted: #6b7280;
  --radius: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.navbar {
  background: var(--primary-dark);
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.navbar .brand { font-weight: 700; font-size: 1.1rem; color: #fff; }
.navbar nav a { color: #dbeafe; margin-right: 1rem; font-size: 0.92rem; }
.navbar nav a:hover { color: #fff; text-decoration: none; }
.navbar .user-info { color: #cbd5e1; font-size: 0.85rem; }

.container {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card h2, .card h3 { margin-top: 0; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.stat-box {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}
.stat-box .number { font-size: 1.8rem; font-weight: 700; color: var(--primary-dark); }
.stat-box .label { font-size: 0.85rem; color: var(--text-muted); }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; }
th { background: #f8fafc; font-weight: 600; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; }
tr:hover { background: #fafbfc; }

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  text-decoration: none;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn-success { background: var(--success); }
.btn-danger { background: var(--danger); }
.btn-warning { background: var(--warning); }
.btn-secondary { background: #64748b; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-pending, .badge-applied, .badge-requested, .badge-draft { background: #fef3c7; color: #92400e; }
.badge-active, .badge-placed, .badge-completed, .badge-approved, .badge-paid, .badge-open { background: #dcfce7; color: #166534; }
.badge-suspended, .badge-rejected, .badge-failed, .badge-cancelled, .badge-disputed { background: #fee2e2; color: #991b1b; }
.badge-interview, .badge-offered, .badge-in_progress, .badge-ended, .badge-closed, .badge-expired, .badge-adjusted { background: #dbeafe; color: #1e40af; }

form .field { margin-bottom: 1rem; }
label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 0.3rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=datetime-local], select, textarea {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 80px; }
.help-text { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.2rem; }

.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.auth-wrapper {
  max-width: 420px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.muted { color: var(--text-muted); font-size: 0.85rem; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }

.receipt {
  max-width: 600px;
  margin: 2rem auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.receipt h1 { font-size: 1.3rem; }
.receipt table td { border: none; padding: 0.3rem 0; }
.receipt .total-row td { font-weight: 700; border-top: 2px solid var(--text); padding-top: 0.5rem; }

.certificate {
  max-width: 800px;
  margin: 2rem auto;
  background: #fffdf7;
  border: 10px solid var(--primary-dark);
  border-radius: 4px;
  padding: 3rem;
  text-align: center;
}
.certificate h1 { font-family: Georgia, serif; color: var(--primary-dark); }

@media print {
  .navbar, .no-print { display: none !important; }
  body { background: #fff; }
}
