/* ============================================================
   IALE Institute - Intern Task Manager Styles
   MICT SETA TVET Placement Programme
   ============================================================ */

:root {
  --primary: #1a56db;
  --primary-dark: #1442a8;
  --primary-light: #e8effc;
  --accent: #0ea5e9;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --purple: #7c3aed;
  --purple-light: #ede9fe;
  --teal: #0d9488;
  --teal-light: #ccfbf1;
  --orange: #ea580c;
  --orange-light: #fff7ed;

  --bg: #f0f2f5;
  --bg-card: #ffffff;
  --bg-sidebar: #111827;
  --bg-sidebar-hover: #1f2937;
  --bg-sidebar-active: #1a56db;

  --text: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-sidebar: #d1d5db;
  --text-sidebar-active: #ffffff;

  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --transition: 0.2s ease;

  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --topbar-height: 64px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* ---- SCREENS ---- */
.screen { min-height: 100vh; }
.screen.active { display: flex; }

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-container {
  margin: auto;
  width: 100%;
  max-width: 420px;
  padding: 2rem;
}
.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--primary);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  letter-spacing: 2px;
}
.logo-mark.small { width: 40px; height: 40px; font-size: 1rem; border-radius: var(--radius); }
.login-brand h1 { font-size: 1.75rem; font-weight: 700; color: var(--text); }
.login-brand .tagline { font-size: 1rem; color: var(--text-secondary); margin-top: 0.25rem; }
.login-brand .programme { font-size: 0.85rem; color: var(--primary); font-weight: 500; margin-top: 0.5rem; }
.login-brand .sla-ref { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

.login-form { background: var(--bg-card); padding: 2rem; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.4rem; color: var(--text); font-size: 0.9rem; }
.form-group input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: border-color var(--transition);
  background: #fff;
}
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

.error-message { background: var(--danger-light); color: var(--danger); padding: 0.6rem 0.9rem; border-radius: var(--radius); font-size: 0.85rem; margin-bottom: 1rem; }

.login-note { text-align: center; font-size: 0.75rem; color: var(--text-muted); margin-top: 1.25rem; line-height: 1.6; }

.default-creds {
  margin-top: 1.25rem;
  padding: 0.85rem;
  background: var(--primary-light);
  border-radius: var(--radius);
  border: 1px solid rgba(26, 86, 219, 0.15);
}
.default-creds-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  text-align: center;
}
.default-creds-table { width: 100%; border-collapse: collapse; font-size: 0.72rem; }
.default-creds-table th, .default-creds-table td { padding: 0.3rem 0.4rem; text-align: left; border-bottom: 1px solid rgba(26, 86, 219, 0.1); }
.default-creds-table th { font-weight: 600; color: var(--primary-dark); font-size: 0.7rem; }
.default-creds-table tr:last-child td { border-bottom: none; }
.default-creds-table code { font-family: 'Courier New', monospace; background: rgba(255,255,255,0.7); padding: 1px 5px; border-radius: 3px; font-size: 0.7rem; color: var(--text); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn .material-icons-outlined { font-size: 1.15rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border-light); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 1.5rem; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--transition);
  overflow-x: hidden;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-title h2 { color: #fff; font-size: 1.1rem; font-weight: 700; white-space: nowrap; }
.sidebar-toggle { display: none; background: none; border: none; color: var(--text-sidebar); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.user-info { overflow: hidden; }
.user-name { display: block; color: #fff; font-weight: 500; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { display: block; color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.role-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--primary-light);
  color: var(--primary);
}

.nav-menu {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.25rem;
  color: var(--text-sidebar);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}
.nav-item.active {
  background: rgba(26, 86, 219, 0.15);
  color: #fff;
  border-left-color: var(--primary);
  font-weight: 500;
}
.nav-item .material-icons-outlined { font-size: 1.25rem; flex-shrink: 0; }
.nav-label { white-space: nowrap; }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-footer .btn { color: var(--text-sidebar); border-color: rgba(255,255,255,0.15); width: 100%; justify-content: center; }
.sidebar-footer .btn:hover { background: var(--bg-sidebar-hover); color: #fff; }
.footer-text { font-size: 0.65rem; color: var(--text-muted); text-align: center; margin-top: 0.75rem; line-height: 1.5; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
#app-screen { display: none; }
#app-screen.active { display: flex; }

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-height);
  padding: 0 1.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 0.75rem; }
.topbar-left h1 { font-size: 1.25rem; font-weight: 600; }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text); padding: 0.25rem; }

.topbar-right { display: flex; align-items: center; gap: 1.25rem; }
.topbar-clock { font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.topbar-date { font-size: 0.85rem; color: var(--text-secondary); }
.work-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
}
.work-status.working { background: var(--success-light); color: var(--success); }
.work-status.off-hours { background: var(--warning-light); color: var(--warning); }
.work-status.holiday { background: var(--danger-light); color: var(--danger); }
.work-status.weekend { background: var(--purple-light); color: var(--purple); }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.topbar-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger-light);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.topbar-logout:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.topbar-logout .material-icons-outlined { font-size: 1.1rem; }
@media (max-width: 600px) {
  .topbar-logout-text { display: none; }
  .topbar-logout { padding: 0.45rem 0.55rem; }
}

.content-area { padding: 1.5rem; flex: 1; }

/* ---- VIEWS ---- */
.view { display: none; animation: fadeIn 0.3s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---- INTERN QUICK ACTIONS ---- */
.intern-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.quick-action-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
}
.quick-action-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quick-action-card.check-in { border-left-color: var(--success); }
.quick-action-card.check-out { border-left-color: var(--accent); }
.quick-action-card.submit-work { border-left-color: var(--purple); }
.quick-action-card.my-tasks { border-left-color: var(--orange); }
.qa-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
}
.quick-action-card.check-in .qa-icon { background: var(--success-light); color: var(--success); }
.quick-action-card.check-out .qa-icon { background: rgba(14, 165, 233, 0.15); color: var(--accent); }
.quick-action-card.submit-work .qa-icon { background: var(--purple-light); color: var(--purple); }
.quick-action-card.my-tasks .qa-icon { background: var(--orange-light); color: var(--orange); }
.qa-icon .material-icons-outlined { font-size: 1.4rem; }
.qa-text { display: flex; flex-direction: column; }
.qa-text strong { font-size: 0.95rem; color: var(--text); }
.qa-text span { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }

.link-small { font-size: 0.8rem; color: var(--primary); font-weight: 500; }

/* Week hours grid (Mon-Fri) */
.week-hours-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; }
.week-day-cell {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.5rem 0.25rem;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
}
.week-day-cell.today { border-color: var(--primary); background: var(--primary-light); }
.week-day-cell.full { background: var(--success-light); border-color: var(--success); }
.week-day-cell.partial { background: var(--warning-light); border-color: var(--warning); }
.week-day-cell.absent { background: var(--danger-light); border-color: var(--danger); }
.week-day-cell .wd-day { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; }
.week-day-cell .wd-hours { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-top: 2px; }

/* Performance dimension bars */
.perf-dim {
  display: grid;
  grid-template-columns: 60px 1fr 50px;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.perf-dim-label { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.perf-dim-bar { height: 8px; background: var(--border-light); border-radius: 4px; overflow: hidden; }
.perf-dim-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.perf-dim-score { text-align: right; font-size: 0.85rem; font-weight: 600; }

/* Deadline rows */
.deadline-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-light);
}
.deadline-row:last-child { border-bottom: none; }
.deadline-days { font-size: 0.75rem; padding: 2px 8px; border-radius: 100px; font-weight: 600; }
.deadline-overdue { background: var(--danger-light); color: var(--danger); }
.deadline-soon { background: var(--warning-light); color: #92400e; }
.deadline-future { background: var(--primary-light); color: var(--primary); }
.link-small:hover { text-decoration: underline; }

/* Mini task / submission list rows on dashboard */
.mini-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border-light);
}
.mini-row:last-child { border-bottom: none; }
.mini-row-main { flex: 1; min-width: 0; }
.mini-row-title { font-size: 0.85rem; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row-meta { font-size: 0.72rem; color: var(--text-muted); }
.mini-row-action { margin-left: 0.5rem; }

/* ---- STATS GRID ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon .material-icons-outlined { font-size: 1.5rem; color: #fff; }
.bg-blue { background: var(--primary); }
.bg-green { background: var(--success); }
.bg-orange { background: var(--warning); }
.bg-purple { background: var(--purple); }
.bg-teal { background: var(--teal); }
.bg-red { background: var(--danger); }
.stat-value { display: block; font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat-label { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.15rem; }

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
}
.card-header h3 { font-size: 1rem; font-weight: 600; }
.card-body { padding: 1.25rem; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1rem;
}

/* ---- BADGE ---- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-info { background: var(--primary-light); color: var(--primary); }

/* ---- TOOLBAR ---- */
.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* ---- FORM INPUTS ---- */
.input-text, .input-date, .input-time, .input-select, .input-textarea {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: #fff;
  color: var(--text);
  transition: border-color var(--transition);
}
.input-text:focus, .input-date:focus, .input-time:focus, .input-select:focus, .input-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.input-textarea { width: 100%; min-height: 100px; resize: vertical; }

/* ---- DATA TABLE ---- */
.table-responsive { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.data-table th {
  text-align: left;
  padding: 0.7rem 0.9rem;
  background: var(--bg);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.data-table td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(0,0,0,0.015); }

/* ---- TASKS BOARD ---- */
.tasks-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.tasks-column { min-height: 300px; }
.column-header {
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.column-header.pending { background: var(--warning-light); color: #92400e; }
.column-header.in-progress { background: var(--primary-light); color: var(--primary-dark); }
.column-header.completed { background: var(--success-light); color: #166534; }
.column-header .count {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 0.6rem;
  cursor: pointer;
  transition: all var(--transition);
}
.task-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); }
.task-card-title { font-weight: 500; font-size: 0.9rem; margin-bottom: 0.35rem; }
.task-card-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; gap: 0.75rem; }
.task-card-category {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--primary-light);
  color: var(--primary);
  margin-bottom: 0.4rem;
}

/* ---- SUBMISSIONS GRID ---- */
.submissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.submission-type {
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
}
.submission-type:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sub-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}
.sub-icon .material-icons-outlined { font-size: 1.75rem; color: #fff; }
.submission-type h4 { font-size: 0.95rem; margin-bottom: 0.35rem; }
.submission-type p { font-size: 0.8rem; color: var(--text-secondary); }

/* ---- REPORTS GRID ---- */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.report-card {
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
}
.report-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.report-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}
.report-icon .material-icons-outlined { font-size: 1.5rem; color: #fff; }
.report-card h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.report-card p { font-size: 0.8rem; color: var(--text-secondary); }

/* ---- ROSTER GRID ---- */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}
.intern-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  transition: all var(--transition);
}
.intern-card:hover { box-shadow: var(--shadow-md); }
.intern-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  font-size: 1rem;
}
.intern-details { flex: 1; min-width: 0; }
.intern-details h4 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.intern-details p { font-size: 0.8rem; color: var(--text-secondary); }
.intern-stats { display: flex; gap: 1rem; margin-top: 0.5rem; }
.intern-stat { text-align: center; }
.intern-stat-value { display: block; font-weight: 600; font-size: 1rem; }
.intern-stat-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; }

/* ---- PERFORMANCE GRID ---- */
.performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.perf-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.perf-card-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.perf-score {
  font-size: 1.5rem;
  font-weight: 700;
}
.perf-score.excellent { color: var(--success); }
.perf-score.good { color: var(--primary); }
.perf-score.needs-improvement { color: var(--warning); }
.perf-score.at-risk { color: var(--danger); }
.perf-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.perf-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }

/* ---- PROJECTS GRID ---- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}
.project-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1rem;
  border-left: 4px solid var(--teal);
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.project-card.border-teal { border-left-color: var(--teal); }
.project-card.border-blue { border-left-color: var(--primary); }
.project-card.border-orange { border-left-color: var(--orange); }
.project-card h5 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text); }
.project-card p { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 0.4rem; }
.project-progress-bar { height: 5px; background: var(--border-light); border-radius: 3px; overflow: hidden; }
.project-progress-fill { height: 100%; background: var(--teal); border-radius: 3px; transition: width 0.5s ease; }
.project-card.border-blue .project-progress-fill { background: var(--primary); }
.project-card.border-orange .project-progress-fill { background: var(--orange); }

/* ---- PROGRAMME REPORTS ---- */
.programme-reports-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 768px) { .programme-reports-grid { grid-template-columns: 1fr; } }

.prog-metric { margin-bottom: 1rem; }
.prog-metric-label { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.35rem; }
.prog-metric-bar { height: 10px; background: var(--border-light); border-radius: 5px; overflow: hidden; }
.prog-metric-fill { height: 100%; border-radius: 5px; transition: width 0.6s ease; }

.sla-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  line-height: 1.8;
}
.sla-box strong { color: var(--text); }
.classification-green { display: inline-block; padding: 0.15rem 0.5rem; background: var(--success-light); color: var(--success); border-radius: 4px; font-weight: 600; font-size: 0.8rem; }

.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.demo-box {
  text-align: center;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius);
}
.demo-box-value { display: block; font-size: 2rem; font-weight: 700; color: var(--primary); }
.demo-box-label { font-size: 0.8rem; color: var(--text-secondary); }

/* ---- ADMIN ---- */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}
.setting-group { margin-bottom: 0.85rem; }
.setting-group label { display: block; font-weight: 500; font-size: 0.85rem; margin-bottom: 0.3rem; color: var(--text-secondary); }
.setting-group input { width: 100%; }

.user-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-light);
}
.user-list-item:last-child { border-bottom: none; }

/* ---- ATTENDANCE ---- */
.attendance-summary { }
.att-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
}
.att-row:last-child { border-bottom: none; }
.att-name { font-weight: 500; }
.att-status-present { color: var(--success); font-weight: 500; }
.att-status-absent { color: var(--danger); font-weight: 500; }
.att-status-late { color: var(--warning); font-weight: 500; }

.attendance-today {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.att-item { font-size: 0.9rem; }

/* ---- ACTIVITY FEED ---- */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 0.4rem;
  flex-shrink: 0;
}
.activity-text { font-size: 0.85rem; }
.activity-time { font-size: 0.75rem; color: var(--text-muted); }

/* ---- ALERTS ---- */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.7rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}
.alert-item:last-child { margin-bottom: 0; }
.alert-warning { background: var(--warning-light); }
.alert-danger { background: var(--danger-light); }
.alert-info { background: var(--primary-light); }
.alert-item .material-icons-outlined { font-size: 1.25rem; flex-shrink: 0; }
.alert-item p { font-size: 0.85rem; }

/* ---- PROGRESS BAR ---- */
.progress-bar-container {
  height: 12px;
  background: var(--border-light);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 6px;
  transition: width 1s ease;
}
.timeline-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---- TIMESHEET ---- */
.timesheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.timesheet-table th, .timesheet-table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
}
.timesheet-table th { background: var(--bg); font-weight: 600; }
.timesheet-header {
  text-align: center;
  margin-bottom: 1rem;
}
.timesheet-header h2 { font-size: 1.1rem; }
.timesheet-header p { font-size: 0.85rem; color: var(--text-secondary); }
.timesheet-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
}
.signature-line {
  width: 200px;
  border-top: 1px solid var(--text);
  padding-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  line-height: 1;
  padding: 0.25rem;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 1.25rem; }
.modal-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.modal .form-group { margin-bottom: 1rem; }
.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---- TOAST ---- */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  animation: slideIn 0.3s ease;
  min-width: 280px;
  max-width: 400px;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-warning { background: var(--warning); color: #fff; }
.toast-info { background: var(--primary); color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---- REPORT OUTPUT ---- */
.report-output { font-size: 0.9rem; line-height: 1.7; }
.report-output h2 { font-size: 1.15rem; margin: 1.25rem 0 0.5rem; color: var(--primary); }
.report-output h3 { font-size: 1rem; margin: 1rem 0 0.4rem; }
.report-output table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; }
.report-output th, .report-output td { padding: 0.5rem 0.75rem; border: 1px solid var(--border); text-align: left; font-size: 0.85rem; }
.report-output th { background: var(--bg); font-weight: 600; }

/* ---- MOBILE BOTTOM NAV ---- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  z-index: 90;
  padding: 0.4rem 0.25rem calc(0.4rem + env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: stretch;
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0.5rem 0.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all var(--transition);
  min-height: 56px;
}
.bottom-nav-item .material-icons-outlined { font-size: 1.4rem; }
.bottom-nav-item:active { background: var(--border-light); }
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item.active .material-icons-outlined { color: var(--primary); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .tasks-board { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding-bottom: 80px; }
  .mobile-menu-btn { display: flex; }
  .bottom-nav { display: flex; }
  /* Sidebar overlay backdrop when open on mobile */
  .sidebar.open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: -1;
  }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .submissions-grid { grid-template-columns: 1fr 1fr; }
  .reports-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .roster-grid { grid-template-columns: 1fr; }
  .performance-grid { grid-template-columns: 1fr; }

  .topbar-right { gap: 0.75rem; }
  .topbar-date { display: none; }

  .view-toolbar { flex-direction: column; align-items: flex-start; }
  .toolbar-left, .toolbar-right { width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .submissions-grid { grid-template-columns: 1fr; }
  .attendance-today { grid-template-columns: 1fr; }
  .intern-quick-actions { grid-template-columns: 1fr 1fr; }
  .quick-action-card { padding: 0.85rem; }
  .qa-icon { width: 36px; height: 36px; }
  .qa-text strong { font-size: 0.85rem; }
  .qa-text span { font-size: 0.7rem; }
  .week-day-cell { padding: 0.4rem 0.15rem; }
  .week-day-cell .wd-hours { font-size: 0.8rem; }
  .perf-dim { grid-template-columns: 50px 1fr 40px; gap: 0.4rem; }
}

/* ---- PRINT ---- */
@media print {
  .sidebar, .topbar, .view-toolbar, .modal-overlay, .toast-container { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .content-area { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
