/* ============================================================
   Payroll Portal — bảng token thiết kế
   Màu:    --ink (nền tối chủ đạo), --paper (nền sáng),
           --gold (đường viền thẻ NV / điểm nhấn),
           --line (viền mảnh), --danger, --ok
   Chữ:    Fraunces (tiêu đề, dùng tiết chế) / Inter (nội dung)
           / IBM Plex Mono (số tiền — cảm giác sổ sách)
   Dấu ấn: "Thẻ nhân viên" — khối bo góc có dải vàng bên trái,
           lặp lại ở trang đăng nhập và đầu trang phiếu lương.
   ============================================================ */

:root {
  --ink: #182338;
  --ink-soft: #2b3a56;
  --paper: #eef1f6;
  --card: #ffffff;
  --gold: #b98b2e;
  --gold-soft: #e7d3a1;
  --line: #d9deea;
  --text: #1c2536;
  --text-muted: #5b6b85;
  --danger: #b3261e;
  --ok: #21714f;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--text);
  font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(185,139,46,0.10), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(24,35,56,0.06), transparent 40%);
}

h1, h2, h3, .display {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}

.mono, .amount, .qty {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

a { color: var(--ink-soft); }

/* ---------- Layout ---------- */
.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.page.payslip-page {
  align-items: flex-start;
  padding-top: 40px;
}

.container-narrow { width: 100%; max-width: 420px; }
.container-wide { width: 100%; max-width: 720px; }

/* ---------- Thẻ nhân viên (signature element) ---------- */
.badge-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left: 6px solid var(--gold);
  box-shadow: 0 20px 40px -20px rgba(24,35,56,0.35);
  overflow: hidden;
}

.badge-card__strip {
  background: var(--ink);
  color: #f1eee2;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.badge-card__strip .id-dot {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Fraunces", serif;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.badge-card__strip .eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin: 0 0 2px;
}

.badge-card__strip .title {
  font-family: "Fraunces", serif;
  font-size: 19px;
  margin: 0;
}

.badge-card__body { padding: 28px; }

/* ---------- Form ---------- */
.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field input {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  font-family: "IBM Plex Mono", monospace;
  background: #fbfcfe;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(185,139,46,0.18);
}

.field .hint {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 18px;
  border-radius: 10px;
  border: none;
  background: var(--ink);
  color: #f1eee2;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn:hover { background: var(--ink-soft); }
.btn:active { transform: translateY(1px); }

.btn-gold {
  background: var(--gold);
  color: var(--ink);
}
.btn-gold:hover { background: #a67c26; }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--text);
}

.alert {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13.5px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.alert-error {
  background: #fbeceb;
  border-color: #f0c6c2;
  color: var(--danger);
}

.footnote {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 18px;
  line-height: 1.6;
}

/* ---------- Payslip page ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.topbar .company {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.topbar a.logout {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 8px;
}
.topbar a.logout:hover { border-color: var(--gold); color: var(--ink); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 22px 0;
}
@media (max-width: 560px) {
  .summary-grid { grid-template-columns: 1fr; }
}
.summary-cell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
.summary-cell .label {
  font-size: 11.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.summary-cell .value {
  font-family: "IBM Plex Mono", monospace;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 4px;
}
.summary-cell.net {
  background: var(--ink);
  border-color: var(--ink);
}
.summary-cell.net .label { color: var(--gold-soft); }
.summary-cell.net .value { color: #f7f5ee; }

.ledger {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 22px;
}
.ledger table { width: 100%; border-collapse: collapse; }
.ledger th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}
.ledger td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.ledger tr:last-child td { border-bottom: none; }
.ledger td.amount, .ledger th.amount { text-align: right; }
.ledger td.qty, .ledger th.qty { text-align: right; color: var(--text-muted); width: 90px; }

.actions { display: flex; gap: 12px; margin-top: 22px; }
.actions .btn { width: auto; flex: 1; }

.confidential {
  margin-top: 26px;
  font-size: 12px;
  color: var(--text-muted);
  border-left: 3px solid var(--gold);
  padding-left: 12px;
}