:root {
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --bg: #f0fdfa;
  --card: #ffffff;
  --text: #134e4a;
  --muted: #5eead4;
  --danger: #dc2626;
  --border: #99f6e4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.app-header {
  background: var(--card);
  border-bottom: 2px solid var(--border);
  padding: 0.75rem 1rem;
}

.env-banner {
  background: #fef3c7;
  color: #92400e;
  padding: 0.5rem 1rem;
  font-weight: 600;
  text-align: center;
}

.halt-banner {
  background: #fef3c7;
  color: #92400e;
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
  border-radius: 4px;
  font-weight: 600;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.export-actions a.secondary {
  display: inline-block;
  padding: 0.4rem 0.75rem;
}


.header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--teal-dark);
}

.brand p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.8;
}

#nav { display: flex; gap: 0.5rem; flex-wrap: wrap; }

#nav a {
  color: var(--teal-dark);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
}

#nav a.active { background: var(--muted); font-weight: 600; }

.halt-banner {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid #fecaca;
}

.halt-banner ul { margin: 0.35rem 0 0 1.2rem; padding: 0; }

.export-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }

.export-actions a, .export-actions button {
  font-size: 0.85rem;
}

.user-bar { margin-left: auto; font-size: 0.9rem; }

.conn-status {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #e2e8f0;
}

.conn-ok { background: #bbf7d0; }
.conn-fail { background: #fecaca; }

main {
  max-width: 960px;
  margin: 1.5rem auto;
  padding: 0 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(13, 148, 136, 0.08);
}

.loading { text-align: center; opacity: 0.7; }

.hidden { display: none !important; }

.login-hint {
  font-size: 0.9rem;
  color: #0f766e;
  margin: 0.5rem 0 0;
  line-height: 1.4;
}

.form-group { margin-bottom: 1rem; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

input, select, button {
  font: inherit;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

button {
  background: var(--teal);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

button:hover { background: var(--teal-dark); }

button.secondary {
  background: transparent;
  color: var(--teal-dark);
  border: 1px solid var(--teal);
}

.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--teal-dark);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  z-index: 100;
}

@media (max-width: 640px) {
  .header-row { flex-direction: column; align-items: flex-start; }
  .user-bar { margin-left: 0; }
}

.staff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.staff-header .header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

.staff-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.staff-form-grid .full-width { grid-column: 1 / -1; }

.import-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.import-row a.secondary {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.file-label {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  background: var(--teal);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.muted { opacity: 0.75; font-size: 0.9rem; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  border: 1px solid var(--border);
  padding: 0.5rem;
  text-align: left;
}

.data-table th {
  background: #ccfbf1;
  font-weight: 600;
}

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  background: #e2e8f0;
}

.status-computed { background: #dbeafe; }
.status-approved { background: #bbf7d0; }
.status-locked { background: #fde68a; }

.payslip-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.payslip-sheet .total-row { font-weight: 700; }

.net-pay {
  font-size: 1.15rem;
  border-top: 2px solid var(--border);
  padding-top: 0.75rem;
}

.payslip-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }

@media print {
  .app-header, .toast, .no-print, #nav, .user-bar, .conn-status { display: none !important; }
  main { margin: 0; max-width: none; }
  .card { box-shadow: none; border: none; }
  body { background: white; }
}
