/* Payidi portal styles — Payroll Made Simple */
:root {
  --blue: #1A3DFF;
  --blue-600: #1431d6;
  --blue-50: #eef1ff;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6B7280;
  --line: #E5E7EB;
  --bg: #F3F4F6;
  --white: #FFFFFF;
  --green: #10B981;
  --green-50: #ecfdf5;
  --gold: #FACC15;
  --gold-50: #fefce8;
  --red: #DC2626;
  --red-50: #fef2f2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 4px 16px rgba(17, 24, 39, .06);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }

/* ---------- top bar ---------- */
.topbar { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; }
.topbar .logo img { height: 44px; display: block; }
.topbar nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.topbar nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .9rem; padding: 8px 12px; border-radius: 8px; }
.topbar nav a:hover { background: var(--bg); }
.topbar nav a.active { color: var(--blue); background: var(--blue-50); }
.topbar .who { font-size: .85rem; color: var(--muted); text-align: right; line-height: 1.25; }
.topbar .who strong { color: var(--ink); display: block; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 1.1rem; cursor: pointer; }
@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; }
  .menu-btn { display: block; margin-left: auto; }
  .topbar nav { display: none; order: 3; width: 100%; flex-direction: column; }
  .topbar nav.open { display: flex; }
  .topbar .who { display: none; }
  .topbar .logo img { height: 36px; }
}

/* ---------- layout ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }

.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.stat .value { font-size: 1.5rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .8rem; color: var(--muted); }
.stat.accent { background: var(--blue); border-color: var(--blue); color: #fff; }
.stat.accent .label, .stat.accent .sub { color: rgba(255,255,255,.8); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 8px; padding: 10px 16px; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); }
.btn-outline { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-ghost { background: transparent; color: var(--blue); padding: 6px 8px; }
.btn-danger { background: var(--white); color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: var(--red-50); }
.btn-sm { padding: 6px 10px; font-size: .8rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 5px; color: var(--ink-2); }
.field { margin-bottom: 14px; }
.hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--white); border: 1px solid #d1d5db; border-radius: 8px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 61, 255, .15); }
input[type=checkbox] { width: auto; margin-right: 6px; }
.check { display: flex; align-items: center; font-weight: 500; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 4px; margin: 0 0 16px; }
legend { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--blue); padding: 0 6px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap; background: #fafafa; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 30px 12px; }

/* ---------- badges & alerts ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: capitalize; background: var(--bg); color: var(--ink-2); }
.badge.green { background: var(--green-50); color: #047857; }
.badge.blue { background: var(--blue-50); color: var(--blue); }
.badge.gold { background: var(--gold-50); color: #92400e; }
.badge.red { background: var(--red-50); color: var(--red); }
.alert { border-radius: 10px; padding: 12px 14px; font-size: .9rem; margin-bottom: 14px; border: 1px solid; }
.alert.error { background: var(--red-50); border-color: #fecaca; color: #991b1b; }
.alert.success { background: var(--green-50); border-color: #a7f3d0; color: #065f46; }
.alert.info { background: var(--blue-50); border-color: #c7d2fe; color: #1e3a8a; }
.alert.warn { background: var(--gold-50); border-color: #fde68a; color: #854d0e; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(17, 24, 39, .55); display: none; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto; }
.modal.open { display: flex; }
.modal-box { background: var(--white); border-radius: 14px; width: 100%; max-width: 640px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.x { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; background: radial-gradient(1200px 500px at 50% -10%, #dfe5ff 0%, var(--bg) 60%); }
.auth-card { width: 100%; max-width: 430px; background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 30px 28px; }
.auth-card .logo { display: block; margin: 0 auto 18px; width: 220px; }
.auth-card h1 { text-align: center; font-size: 1.35rem; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 0 0 20px; }
.auth-links { display: flex; justify-content: space-between; font-size: .85rem; margin-top: 14px; flex-wrap: wrap; gap: 8px; }
.portal-switch { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 18px; }
.portal-switch a { margin: 0 6px; white-space: nowrap; }

/* ---------- footer ---------- */
.foot { text-align: center; font-size: .78rem; color: var(--muted); padding: 24px 16px 30px; }
.foot img { height: 26px; vertical-align: middle; opacity: .9; }

/* tax breakdown */
.breakdown { width: 100%; font-size: .9rem; }
.breakdown td { padding: 6px 0; border: 0; }
.breakdown tr.total td { border-top: 2px solid var(--ink); font-weight: 800; padding-top: 10px; }
.breakdown tr.sub td { color: var(--muted); }
.net-box { background: var(--bg); border-left: 5px solid var(--blue); border-radius: 10px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.net-box .v { font-size: 1.5rem; font-weight: 800; }
