/* css/style.css - Main Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
  --primary: #FDB827;
  --primary-dark: #7e5907;
  --secondary: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --pending: #f59e0b;
  --in-progress: #3b82f6;
  --completed: #10b981;
  --over-due: #ef4444;
  --bg: #F1F1F1;
  --sidebar-bg: black;
  --sidebar-text: #c7d2fe;
  --sidebar-active: #4f46e5;
  --card-bg: black;
  --text: #1e293b;
  --text-muted: white;
  --border: #e2e8f0;
  --shadow: 0 2px 10px rgba(0,0,0,0.08);
  --radius: 12px;
  --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg)
}

.auth-card {
  background:black;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.auth-logo p { 
  color: var(--text-muted); 
  font-size: 14px; 
}

.auth-card h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 24px;
  text-align: center;
  color: white;
}

/* ===== LAYOUT ===== */
.layout { 
  display: flex; 
  min-height: 100vh; 
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  font-size: 20px;
  font-weight: 800;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo span {
  background: var(--primary);
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.sidebar-user {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user img {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}

.sidebar-user .user-info .name {
  font-weight: 700;
  color: white;
  font-size: 14px;
}

.sidebar-user .user-info .role {
  font-size: 11px;
  color: var(--sidebar-text);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav { 
  flex: 1; 
  padding: 16px 12px; 
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  color:white;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 8px 8px 4px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.nav-item.active {
  background: var(--primary);
  color: white;
}

.nav-item i { width: 20px; text-align: center; font-size: 16px; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  color: #fca5a5;
  background: rgba(239,68,68,0.1);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-logout:hover { background: rgba(239,68,68,0.2); }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 0;
  min-height: 100vh;
}

.topbar {
  background: white;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar h2 { 
  font-size: 20px; 
  font-weight: 800; 
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

.page-body { padding: 28px; }

/* ===== CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card .stat-info .value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.stat-card .stat-info .label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

.icon-blue    { background: #eff6ff; color: var(--info); }
.icon-green   { background: #f0fdf4; color: var(--success); }
.icon-yellow  { background: #fffbeb; color: var(--warning); }
.icon-red     { background: #fef2f2; color: var(--danger); }
.icon-purple  { background: #f5f3ff; color: var(--primary); }
.icon-cyan    { background: #ecfeff; color: var(--secondary); }

/* ===== TABLES ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-header h3 { 
  color: white; 
  font-size: 16px; 
  font-weight: 800; 
}

.card-body { padding: 0; }

.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  background: white;
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: black;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

tbody td {
  color: white;
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }


.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-cell img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-pending   { background: #fffbeb; color: #92400e; }
.badge-in_progress { background: #eff6ff; color: #1e40af; }
.badge-completed { background: #f0fdf4; color: #065f46; }
.badge-over_due  { background: #fef2f2; color: #991b1b; }
.badge-admin     { background: #f5f3ff; color: #5b21b6; }
.badge-manager   { background: #ecfeff; color: #155e75; }
.badge-employee  { background: #f0fdf4; color: #065f46; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  margin-top: none;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger  { background: var(--danger);  color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}
.btn-white {
  background: white;
  color: black;
}
.btn-save {
  background: black;
  color: white;
}
.btn-outline:hover { border-color: var(--primary); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; color: white; }
.btn-icon { padding: 7px; border-radius: 8px; }


/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 9px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.2s;
  background: white;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

select.form-control { cursor: pointer; }

/* ===== FILTERS ===== */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: white;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: black;
  transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: #f5f3ff;
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 18px; font-weight: 800; }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: black;
  padding: 4px;
  line-height: 1;
}

/* ===== PROFILE ===== */
.profile-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 600px;
}

.profile-banner {
  height: 120px;
  background: black ;
  border-radius: var(--radius) var(--radius) 0 0;
}

.profile-info { padding: 0 28px 28px; }

.profile-avatar-wrap {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-top: -40px;
  margin-bottom: 16px;
}

.profile-avatar-wrap img {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 4px solid white;
  object-fit: cover;
}

.profile-avatar-placeholder {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 4px solid white;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
}

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
}

.alert.show { display: block; }
.alert-success { background: #f0fdf4; color: #065f46; border: 1px solid #bbf7d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ===== QR MODAL ===== */
.qr-display {
  text-align: center;
  padding: 20px;
}

.qr-display img { max-width: 220px; border: 4px solid var(--border); border-radius: 10px; }

/* ===== PRINT ===== */
@media print {
  .sidebar, .topbar, .btn, .filters, .no-print { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  table { font-size: 12px; }
  body { background: white; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-body { padding: 16px; }
}