:root {
  --primary-navy: #0f172a;
  --accent-gold: #f59e0b;
  --accent-blue: #2563eb;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #eab308;
  --bg-glass: rgba(255, 255, 255, 0.94);
  --border-color: #cbd5e1;
  --text-dark: #1e293b;
  --text-muted: #64748b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  color: var(--text-dark);
  min-height: 100vh;
  position: relative;
  background-color: #0f172a;
}

/* Background image & gradient overlay */
.bg-image {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('https://images.unsplash.com/photo-1509440159596-0249088772ff?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
  z-index: -2;
}

.bg-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(30, 41, 59, 0.82));
  z-index: -1;
}

.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.main-header {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 16px 24px;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-circle {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.header-left h1 {
  font-size: 24px;
  letter-spacing: 1px;
  font-weight: 700;
  color: #fbbf24;
}

.header-left .subtitle {
  font-size: 13px;
  color: #94a3b8;
}

.header-controls {
  display: flex;
  gap: 16px;
  align-items: center;
}

.period-selector {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.period-selector select {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.period-selector select option {
  background: #1e293b;
  color: #fff;
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: #475569;
  color: #fff;
}

.btn-secondary:hover {
  background: #334155;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

/* Navigation Tabs */
.nav-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.nav-btn {
  background: rgba(255, 255, 255, 0.85);
  border: none;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn.active, .nav-btn:hover {
  background: #fbbf24;
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(251, 191, 36, 0.4);
}

/* Main Panel Containers */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.panel {
  background: var(--bg-glass);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 10px;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-glass);
  padding: 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
}

.bg-blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.bg-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.bg-orange { background: linear-gradient(135deg, #f97316, #c2410c); }
.bg-green { background: linear-gradient(135deg, #10b981, #047857); }

.stat-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
}

/* Categories Grid */
.section-title {
  color: #fff;
  font-size: 18px;
  margin: 20px 0 14px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.category-card {
  background: var(--bg-glass);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-left: 6px solid var(--accent-blue);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

/* 10 Individual Category Accent Colors */
.category-card.cat-Simba { border-left-color: #ef4444; }
.category-card.cat-Chui { border-left-color: #f59e0b; }
.category-card.cat-Ndovu { border-left-color: #10b981; }
.category-card.cat-Nyati { border-left-color: #14b8a6; }
.category-card.cat-Tiger { border-left-color: #8b5cf6; }
.category-card.cat-Cheetah { border-left-color: #6366f1; }
.category-card.cat-Cakes { border-left-color: #ec4899; }
.category-card.cat-Oven { border-left-color: #06b6d4; }
.category-card.cat-Others { border-left-color: #64748b; }
.category-card.cat-Sales { border-left-color: #f43f5e; }

.category-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.category-card p {
  color: var(--text-muted);
  font-size: 14px;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.payroll-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 13px;
  background: #fff;
}

.payroll-table th, .payroll-table td {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  text-align: center;
}

.payroll-table th {
  background: #0f172a;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  position: sticky;
  top: 0;
}

/* Attendance Cells */
.att-cell {
  width: 32px;
  height: 32px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: all 0.1s ease;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.code-P { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.code-O { background: #fef9c3; color: #a16207; border: 1px solid #fde047; }
.code-A { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.code-NONE { background: #f8fafc; color: #94a3b8; }

/* Category Pills Filter */
.category-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pill-btn.active {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

/* Inputs in table */
.table-input {
  width: 75px;
  padding: 4px 6px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-align: right;
  font-family: inherit;
  font-size: 13px;
}

.table-input:focus {
  outline: 2px solid var(--accent-blue);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 500px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-dark);
}

.form-group input, .form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
}

.form-group input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Payslip Card */
.payslip-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.payslip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.payslip-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
  font-size: 14px;
}

.payslip-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.payslip-table th, .payslip-table td {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
}

.payslip-table th {
  background: #f1f5f9;
  text-align: left;
}

.payslip-net {
  background: #fef3c7;
  padding: 14px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  color: #92400e;
}

/* Badges */
.badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-period {
  background: #e0e7ff;
  color: #3730a3;
}

.badge-paid {
  background: #dcfce7;
  color: #166534;
  cursor: pointer;
}

.badge-unpaid {
  background: #fee2e2;
  color: #991b1b;
  cursor: pointer;
}

.legend-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  font-size: 13px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-note {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.summary-card {
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

/* Jump arrows (Payroll & Attendance): each takes you to the other end of the tables */
.jump-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 64px;
  border: none;
  background: rgba(15, 23, 42, 0.92);
  color: #fbbf24;
  font-size: 18px;
  cursor: pointer;
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.jump-arrow.show { display: flex; }
.jump-arrow:hover { background: #1e293b; }
.jump-left { left: 0; border-radius: 0 12px 12px 0; }
.jump-right { right: 0; border-radius: 12px 0 0 12px; }