/* ===== EMPLOYEE TASK SYSTEM - MODERN CSS (v2) ===== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #64748b;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-dark: #60a5fa;
  --primary-light: #1e293b;
  --secondary: #94a3b8;
  --bg: #0f172a;
  --card: #1e293b;
  --text: #e2e8f0;
  --text-light: #94a3b8;
  --border: #334155;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -4px rgba(0,0,0,0.5);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

/* ===== NAVBAR ===== */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  flex-wrap: wrap;
  gap: 8px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-light);
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s;
  font-size: 14px;
}

.nav-links a:hover, .nav-links a.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.theme-toggle:hover { border-color: var(--primary); }

/* ===== CONTAINER ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
}

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.blue { background: #dbeafe; }
.stat-icon.green { background: #dcfce7; }
.stat-icon.orange { background: #fef3c7; }
.stat-icon.purple { background: #f3e8ff; }
.stat-icon.red { background: #fee2e2; }
[data-theme="dark"] .stat-icon.blue { background: #1e3a8a; }
[data-theme="dark"] .stat-icon.green { background: #14532d; }
[data-theme="dark"] .stat-icon.orange { background: #78350f; }
[data-theme="dark"] .stat-icon.purple { background: #581c87; }
[data-theme="dark"] .stat-icon.red { background: #7f1d1d; }

.stat-info h3 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

.stat-info p {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }

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

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

label .required { color: var(--danger); }

input[type="text"],
input[type="email"],
input[type="date"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

textarea { min-height: 100px; resize: vertical; }

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* file upload */
.upload-box {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}
.upload-box:hover { border-color: var(--primary); }
.upload-box img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 10px;
  display: block;
  border: 3px solid var(--card);
  box-shadow: var(--shadow);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #16a34a; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; }

.btn-secondary { background: var(--secondary); color: white; }

.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

thead th {
  background: var(--bg);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:hover { background: var(--bg); }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-green { background: #dcfce7; color: #166534; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-orange { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .badge-green { background: #14532d; color: #86efac; }
[data-theme="dark"] .badge-blue { background: #1e3a8a; color: #93c5fd; }
[data-theme="dark"] .badge-orange { background: #78350f; color: #fcd34d; }
[data-theme="dark"] .badge-red { background: #7f1d1d; color: #fca5a5; }

/* ===== SEARCH & FILTER ===== */
.search-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.search-bar input, .search-bar select { max-width: 250px; }

/* ===== LOGIN PAGE ===== */
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }

.login-card {
  background: var(--card);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.login-card h2 { text-align: center; margin-bottom: 8px; font-size: 24px; }
.login-card p { text-align: center; color: var(--text-light); margin-bottom: 28px; font-size: 14px; }

/* ===== LANDING PAGE ===== */
.hero { text-align: center; padding: 80px 24px; }

.hero h1 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p { font-size: 18px; color: var(--text-light); max-width: 560px; margin: 0 auto 36px; }
.hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== FORM STEPS ===== */
.step-indicator { display: flex; justify-content: center; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }

.step { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-light); }
.step.active { color: var(--primary); }

.step .num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

.step.active .num { background: var(--primary); color: white; }
.step.completed .num { background: var(--success); color: white; }

.form-section { display: none; }
.form-section.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== SUCCESS PAGE ===== */
.success-box { text-align: center; padding: 48px 24px; }
.success-box .icon { font-size: 64px; margin-bottom: 16px; }
.success-box h2 { font-size: 28px; margin-bottom: 12px; }
.success-box p { color: var(--text-light); margin-bottom: 24px; }

.id-display {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 14px 28px;
  border-radius: 12px;
  margin: 12px 0 24px;
  border: 2px dashed var(--primary);
}

/* ===== EXPORT BUTTONS ===== */
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

.export-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: block;
}

.export-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.export-card .icon { font-size: 36px; margin-bottom: 12px; }
.export-card h4 { font-size: 16px; margin-bottom: 4px; }
.export-card p { font-size: 12px; color: var(--text-light); }

/* ===== DETAIL VIEW ===== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-item { background: var(--bg); padding: 14px 16px; border-radius: 10px; }
.detail-item.full { grid-column: 1 / -1; }
.detail-item label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-light); margin-bottom: 4px; }
.detail-item p { font-size: 14px; font-weight: 600; color: var(--text); }

/* ===== PAGINATION ===== */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 20px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; border: 1px solid var(--border); }
.pagination a { color: var(--text); background: var(--card); }
.pagination a:hover { background: var(--primary); color: white; border-color: var(--primary); }
.pagination .current { background: var(--primary); color: white; border-color: var(--primary); }

/* ===== TIMELINE (approval workflow) ===== */
.timeline { border-left: 2px solid var(--border); padding-left: 20px; margin-left: 6px; }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -26px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--card);
}

/* ===== CHART CARD ===== */
.chart-card canvas { max-height: 280px; }

/* ===== EMPLOYEE PORTAL CARD ===== */
.portal-photo {
  width: 80px; height: 80px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--border);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .form-row, .detail-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 28px; }
  .hero { padding: 48px 20px; }
  .navbar-inner { flex-wrap: wrap; height: auto; padding: 12px 0; }
  .nav-links { width: 100%; justify-content: center; margin-top: 8px; }
  .search-bar input, .search-bar select { max-width: 100%; width: 100%; }
}

/* ===== UTILS ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mt-20 { margin-top: 20px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.hidden { display: none; }
.text-light { color: var(--text-light); }
