/* ===== CSS Variables ===== */
:root {
  --primary: #4F46E5;
  --primary-dark: #1E3A8A;
  --primary-mid: #3730A3;
  --primary-light: #EEF2FF;
  --primary-hover: #4338CA;
  --accent: #6366F1;
  --accent-light: #C7D2FE;

  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;

  --bg: #F1F5FD;
  --bg-card: #FFFFFF;
  --sidebar-bg: #1E3A8A;
  --sidebar-hover: #1D4ED8;
  --sidebar-active: #4F46E5;

  --text: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --text-sidebar: rgba(255,255,255,0.85);
  --text-sidebar-active: #FFFFFF;

  --border: #E2E8F0;
  --border-focus: #4F46E5;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.18s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; overflow-x: hidden; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; overflow-x: hidden; max-width: 100vw; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }
ul { list-style: none; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-light); border-radius: 3px; }

/* ===== ===== LOGIN PAGE ===== ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--accent) 100%);
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
}

.auth-logo-text h1 { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.auth-logo-text p { font-size: 0.75rem; color: var(--text-muted); margin-top: 1px; }

.auth-title { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.auth-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 28px; }

.auth-tabs { display: flex; gap: 4px; background: var(--bg); border-radius: var(--radius); padding: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 8px; text-align: center; font-size: 0.85rem; font-weight: 500; border-radius: 6px; color: var(--text-muted); transition: var(--transition); }
.auth-tab.active { background: var(--bg-card); color: var(--primary); box-shadow: var(--shadow); }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-card);
  transition: var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
.form-input::placeholder { color: var(--text-light); }
select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748B' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-input { resize: vertical; min-height: 90px; }

.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  border: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: var(--radius); }

/* ===== ===== DASHBOARD LAYOUT ===== ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
}
.sidebar-logo-text { color: white; font-weight: 700; font-size: 1.05rem; }
.sidebar-logo-sub { color: rgba(255,255,255,0.5); font-size: 0.7rem; }

.sidebar-nav { flex: 1; padding: 16px 10px; overflow-y: auto; }

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 8px 10px 4px;
  margin-top: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-sidebar);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.nav-item.active { background: var(--sidebar-active); color: white; }
.nav-item .nav-icon { font-size: 1.05rem; width: 20px; text-align: center; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-user {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user-avatar {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { color: white; font-size: 0.85rem; font-weight: 600; truncate: ellipsis; overflow: hidden; white-space: nowrap; }
.sidebar-user-role { color: rgba(255,255,255,0.5); font-size: 0.72rem; text-transform: capitalize; }
.sidebar-logout { color: rgba(255,255,255,0.4); font-size: 1rem; cursor: pointer; transition: var(--transition); padding: 4px; border-radius: 4px; }
.sidebar-logout:hover { color: white; background: rgba(255,255,255,0.1); }

/* Main area */
.main-area {
  flex: 1;
  margin-left: 240px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
}

/* Top header */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.topbar-title { font-size: 1.1rem; font-weight: 700; color: var(--text); flex: 1; }
.topbar-search {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  gap: 8px;
  min-width: 220px;
}
.topbar-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 0.85rem;
  color: var(--text);
  width: 100%;
}
.topbar-search input::placeholder { color: var(--text-light); }
.topbar-search-icon { color: var(--text-muted); font-size: 0.9rem; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.notif-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
}
.notif-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--accent-light); }
.notif-count {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid white;
}
.notif-count.hidden { display: none; }

/* Page content */
.page-content {
  padding: 24px;
  flex: 1;
}

.page { display: none; }
.page.active { display: block; }

/* ===== Section Header ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-title { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.section-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }

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

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card-clickable { cursor: pointer; }
.stat-card-clickable:hover { border-color: var(--accent-light); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.purple { background: #F3E8FF; color: #9333EA; }

.stat-info {}
.stat-value { font-size: 1.7rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.card-body { padding: 20px; }

/* ===== Filters Bar ===== */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-select {
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.filter-select:focus { border-color: var(--border-focus); }

/* ===== Task Grid ===== */
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.task-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}
.task-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.task-card.color-yellow { border-left-color: var(--warning); }
.task-card.color-green { border-left-color: var(--success); }
.task-card.color-red { border-left-color: var(--danger); }

.task-card-body { padding: 16px; }
.task-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.task-card-title { font-size: 0.92rem; font-weight: 700; color: var(--text); line-height: 1.4; }
.task-card-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.task-card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.task-meta-item { display: flex; align-items: center; gap: 5px; font-size: 0.75rem; color: var(--text-muted); }

.task-card-footer { display: flex; align-items: center; justify-content: space-between; }
.task-assignee { display: flex; align-items: center; gap: 7px; }
.task-avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; color: white; font-size: 0.7rem; font-weight: 700; flex-shrink: 0; }
.task-assignee-name { font-size: 0.78rem; color: var(--text-muted); }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-yellow { background: var(--warning-light); color: #92400E; }
.badge-green { background: var(--success-light); color: #065F46; }
.badge-red { background: var(--danger-light); color: #991B1B; }
.badge-blue { background: var(--info-light); color: #1E40AF; }
.badge-purple { background: #F3E8FF; color: #6B21A8; }
.badge-gray { background: #F1F5F9; color: #475569; }
.badge-inprogress { background: var(--primary-light); color: var(--primary); }

/* Priority badges */
.priority-low { background: #F1F5F9; color: #475569; }
.priority-medium { background: var(--info-light); color: #1E40AF; }
.priority-high { background: var(--warning-light); color: #92400E; }
.priority-critical { background: var(--danger-light); color: #991B1B; }

/* ===== Table ===== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 11px 14px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); transition: var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #F8FAFF; }
tbody td { padding: 12px 14px; font-size: 0.85rem; color: var(--text); vertical-align: middle; }
.table-actions { display: flex; align-items: center; gap: 6px; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.18s ease;
}
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
@keyframes modalIn {
  from { transform: scale(0.95) translateY(-10px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);     opacity: 1; }
}
.modal-lg { max-width: 700px; }
.modal-xl { max-width: 860px; }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.modal-close { width: 30px; height: 30px; border-radius: 6px; background: none; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 1.1rem; transition: var(--transition); }
.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }

/* ===== Timeline ===== */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  z-index: 1;
}
.timeline-dot.yellow { background: var(--warning); box-shadow: 0 0 0 2px var(--warning-light); }
.timeline-dot.green { background: var(--success); box-shadow: 0 0 0 2px var(--success-light); }
.timeline-dot.red { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-light); }
.timeline-dot.blue { background: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition);
}
.timeline-content:hover { box-shadow: var(--shadow-md); border-color: var(--accent-light); }
.timeline-date { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 6px; }
.timeline-title { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.timeline-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }

/* ===== Notifications Panel ===== */
.notif-panel {
  position: fixed;
  top: 60px;
  right: 0;
  width: 360px;
  max-height: calc(100vh - 60px);
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 16px rgba(0,0,0,0.08);
  z-index: 150;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.notif-panel.open { transform: translateX(0); }

.notif-panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.notif-panel-title { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.notif-list { flex: 1; overflow-y: auto; }

.notif-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.notif-item:hover { background: #F8FAFF; }
.notif-item.unread { background: var(--primary-light); }
.notif-item.unread:hover { background: #E0E7FF; }

.notif-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.notif-icon.assigned { background: var(--primary-light); color: var(--primary); }
.notif-icon.reminder { background: var(--warning-light); color: var(--warning); }
.notif-icon.deadline_missed { background: var(--danger-light); color: var(--danger); }
.notif-icon.delay { background: var(--warning-light); color: var(--warning); }
.notif-icon.completed { background: var(--success-light); color: var(--success); }
.notif-icon.blocked { background: var(--danger-light); color: var(--danger); }
.notif-icon.unblocked { background: var(--success-light); color: var(--success); }
.notif-icon.max_delays { background: var(--danger-light); color: var(--danger); }
.notif-icon.system { background: var(--primary-light); color: var(--primary); }

.notif-body { flex: 1; min-width: 0; }
.notif-message { font-size: 0.82rem; color: var(--text); line-height: 1.5; }
.notif-time { font-size: 0.72rem; color: var(--text-light); margin-top: 4px; }
.notif-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 6px; }

/* ===== Location Page Layout ===== */
.loc-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (min-width: 769px) {
  .loc-layout {
    flex-direction: row;
    align-items: flex-start;
  }
  .loc-map-card { flex: 1; min-width: 0; }
  .loc-team-panel { width: 272px; flex-shrink: 0; }
}

/* Map card */
.loc-map-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
#map {
  height: 320px;
  width: 100%;
  display: block;
}
@media (min-width: 769px) {
  #map { height: 460px; }
}

/* Team panel */
.loc-team-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.loc-team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.loc-team-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.loc-live-badge {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(16,185,129,0.1);
  border-radius: 20px;
  padding: 2px 10px;
}
.loc-worker-list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
  padding: 10px;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
  .loc-worker-list {
    max-height: 260px;
  }
}

/* Individual worker cards in location panel */
.loc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.loc-card:last-child { margin-bottom: 0; }
.loc-card:hover, .loc-card:active {
  border-color: var(--primary);
  background: var(--primary-light);
}
.loc-card-info { flex: 1; min-width: 0; }
.loc-card-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.loc-card-status {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.loc-card-status.live { color: #10B981; font-weight: 600; }
.loc-card-addr {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.loc-pin-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--primary-light);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: var(--transition);
}
.loc-pin-btn:hover { background: var(--primary); color: white; }

/* Empty state inside location team panel */
.loc-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}
.loc-empty-icon { font-size: 2.4rem; margin-bottom: 10px; opacity: 0.45; }
.loc-empty-title { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.loc-empty-desc { font-size: 0.75rem; line-height: 1.5; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state-title { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state-desc { font-size: 0.85rem; }

/* ===== Dropdown ===== */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 100;
  overflow: hidden;
  display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item { padding: 9px 14px; font-size: 0.85rem; color: var(--text); cursor: pointer; transition: var(--transition); display: flex; align-items: center; gap: 8px; }
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-light); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== File Upload ===== */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.file-upload-area:hover, .file-upload-area.dragover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.file-upload-area input[type="file"] { display: none; }
.file-list { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--primary-light); color: var(--primary); border-radius: 20px; font-size: 0.75rem; }
.file-chip .remove { cursor: pointer; color: var(--primary); }

/* ===== Task Detail ===== */
.task-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.task-detail-field { }
.task-detail-label { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 4px; }
.task-detail-value { font-size: 0.9rem; color: var(--text); }
.task-detail-description { margin-bottom: 16px; }
.task-delay-list { margin-top: 8px; }
.task-delay-item { background: var(--bg); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 8px; border-left: 3px solid var(--danger); }
.task-delay-item p { font-size: 0.82rem; color: var(--text); margin-bottom: 3px; }
.task-delay-item span { font-size: 0.75rem; color: var(--text-muted); }

/* ===== Privileges Panel ===== */
.privilege-toggle { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.privilege-toggle:last-child { border-bottom: none; }
.privilege-label { font-size: 0.85rem; font-weight: 500; color: var(--text); }
.privilege-desc { font-size: 0.75rem; color: var(--text-muted); }

/* Toggle switch */
.toggle { position: relative; width: 42px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #CBD5E1; border-radius: 24px;
  transition: var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: white; border-radius: 50%;
  transition: var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ===== Progress ===== */
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.progress-fill.green { background: var(--success); }
.progress-fill.yellow { background: var(--warning); }
.progress-fill.red { background: var(--danger); }
.progress-fill.blue { background: var(--primary); }

/* ===== Alert ===== */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 0.85rem; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; }
.alert-info { background: var(--info-light); color: #1E40AF; border: 1px solid #BFDBFE; }
.alert-success { background: var(--success-light); color: #065F46; border: 1px solid #A7F3D0; }
.alert-warning { background: var(--warning-light); color: #92400E; border: 1px solid #FDE68A; }
.alert-danger { background: var(--danger-light); color: #991B1B; border: 1px solid #FECACA; }

/* ===== Location Status Dot ===== */
.location-status { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.location-status.online { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,0.2); animation: locPulse 2s infinite; }
.location-status.offline { background: var(--text-light); }
@keyframes locPulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(16,185,129,0.08); }
}
.location-active-icon { animation: locIconPulse 1.8s infinite; }
@keyframes locIconPulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ===== Toast ===== */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 280px;
  max-width: 380px;
  padding: 14px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toastIn 0.3s ease;
  cursor: pointer;
}
.toast-success { background: #065F46; color: white; }
.toast-error { background: #991B1B; color: white; }
.toast-warning { background: #92400E; color: white; }
.toast-info { background: var(--primary-dark); color: white; }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; margin-bottom: 2px; }
.toast-msg { opacity: 0.9; font-size: 0.82rem; line-height: 1.4; }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  to { transform: translateX(110%); opacity: 0; }
}
.toast.removing { animation: toastOut 0.3s ease forwards; }

/* ===== Loading ===== */
.loading { display: flex; align-items: center; justify-content: center; padding: 48px; color: var(--text-muted); gap: 10px; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-loader { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; }

/* ===== Avatar Group ===== */
.avatar-group { display: flex; }
.avatar-group .task-avatar { margin-left: -8px; border: 2px solid white; }
.avatar-group .task-avatar:first-child { margin-left: 0; }

/* ===== Sidebar mobile overlay ===== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.hamburger { display: none; width: 38px; height: 38px; border-radius: var(--radius); background: var(--bg); border: 1.5px solid var(--border); align-items: center; justify-content: center; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main-area { margin-left: 0; }
  .hamburger { display: flex; }
  .topbar-search { display: none; }
  .tasks-grid { grid-template-columns: 1fr; }
  .task-detail-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .notif-panel { width: 100%; }
}
@media (max-width: 500px) {
  .auth-card { padding: 28px 20px; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .modal { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}

/* ===== User Role Chip ===== */
.role-admin { background: #FEF3C7; color: #92400E; }
.role-manager { background: var(--primary-light); color: var(--primary); }
.role-worker { background: #F1F5F9; color: #475569; }
.status-active { background: var(--success-light); color: #065F46; }
.status-blocked { background: var(--danger-light); color: #991B1B; }

/* ===== Section Divider ===== */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ===== Tabs ===== */
.tab-bar { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn { padding: 10px 18px; font-size: 0.875rem; font-weight: 600; color: var(--text-muted); background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer; transition: var(--transition); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover { color: var(--text); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===== Proof image ===== */
.proof-img { width: 100%; max-width: 320px; border-radius: var(--radius); border: 1px solid var(--border); margin-top: 8px; }
.proof-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--primary-light); color: var(--primary); border-radius: var(--radius); font-size: 0.82rem; font-weight: 600; margin-top: 6px; transition: var(--transition); }
.proof-link:hover { background: var(--accent-light); }

/* ===== MOBILE BOTTOM NAV ===== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--bg-card);
  border-top: 1.5px solid var(--border);
  z-index: 110;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -3px 16px rgba(0,0,0,0.07);
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px; border-radius: var(--radius); cursor: pointer;
  color: var(--text-muted); transition: var(--transition); min-width: 0;
  position: relative; flex: 1;
}
.bnav-item.active { color: var(--primary); }
.bnav-item i { font-size: 1.15rem; }
.bnav-item span { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.02em; }
.bnav-badge {
  position: absolute; top: 4px; right: calc(50% - 18px);
  background: var(--danger); color: white; font-size: 0.6rem; font-weight: 700;
  padding: 1px 4px; border-radius: 10px; min-width: 14px; text-align: center;
  border: 1.5px solid white;
}
.bnav-fab {
  width: 50px; height: 50px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.3rem; cursor: pointer;
  box-shadow: 0 4px 14px rgba(79,70,229,0.45);
  transition: transform var(--transition), box-shadow var(--transition);
}
.bnav-fab:active { transform: scale(0.93); box-shadow: 0 2px 8px rgba(79,70,229,0.35); }

/* ===== TIMELINE PROGRESS CARDS ===== */
.timeline-header-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--primary-light); border-radius: var(--radius-lg);
  padding: 14px 20px; margin-bottom: 20px; border: 1px solid var(--accent-light);
}
.timeline-today-pill {
  background: var(--primary); color: white; border-radius: 20px;
  padding: 6px 16px; font-size: 0.82rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.timeline-today-pill .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: #A5F3FC;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.tl-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  margin-bottom: 14px; cursor: pointer; transition: var(--transition);
  box-shadow: var(--shadow);
}
.tl-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.tl-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tl-card-title { font-size: 0.95rem; font-weight: 700; color: var(--text); flex: 1; line-height: 1.4; }
.tl-card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.tl-card-assignee { display: flex; align-items: center; gap: 7px; margin-bottom: 14px; font-size: 0.8rem; color: var(--text-muted); }

.tl-bar-section { margin-bottom: 10px; }
.tl-bar-track {
  position: relative; height: 10px; background: var(--border);
  border-radius: 5px; overflow: visible; margin: 6px 0;
}
.tl-bar-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  border-radius: 5px; transition: width 0.6s ease;
}
.tl-bar-fill.green  { background: linear-gradient(90deg, #6EE7B7, var(--success)); }
.tl-bar-fill.yellow { background: linear-gradient(90deg, #FDE68A, var(--warning)); }
.tl-bar-fill.orange { background: linear-gradient(90deg, #FDBA74, #F97316); }
.tl-bar-fill.red    { background: linear-gradient(90deg, #FCA5A5, var(--danger)); }
.tl-bar-fill.done   { background: linear-gradient(90deg, #6EE7B7, var(--success)); }

.tl-today-pin {
  position: absolute; top: -5px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary-dark); border: 3px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25); transform: translateX(-50%);
  z-index: 2; cursor: default;
}
.tl-today-pin::after {
  content: '▼'; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  font-size: 8px; color: var(--primary-dark); margin-top: 2px;
}

.tl-labels { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }
.tl-labels .tl-label-start { text-align: left; }
.tl-labels .tl-label-end   { text-align: right; }

.tl-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; gap: 6px; }
.tl-footer-left { font-size: 0.78rem; color: var(--text-muted); }
.tl-footer-right { font-size: 0.78rem; font-weight: 600; }
.tl-footer-right.overdue { color: var(--danger); }
.tl-footer-right.urgent  { color: #F97316; }
.tl-footer-right.warning { color: var(--warning); }
.tl-footer-right.ok      { color: var(--success); }
.tl-footer-right.done    { color: var(--success); }

.tl-section-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  padding: 4px 0 10px; margin-top: 8px;
  border-top: 1px solid var(--border);
}
.tl-section-label:first-child { border-top: none; }

/* ===== EMPLOYEE LIST ===== */
.employee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px; padding: 16px;
}
.emp-card {
  background: var(--bg-card); border: 1.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; transition: var(--transition); gap: 10px;
}
.emp-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent-light); }
.emp-avatar-lg {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.3rem; font-weight: 700; flex-shrink: 0;
}
.emp-name { font-size: 0.92rem; font-weight: 700; color: var(--text); }
.emp-email { font-size: 0.75rem; color: var(--text-muted); }
.emp-actions { display: flex; gap: 6px; margin-top: 4px; }

/* Quick employee select UI */
.emp-select-wrap { position: relative; }
.emp-select-custom {
  display: flex; align-items: center; gap: 10px;
}
.emp-select-custom .form-input { flex: 1; }

/* ===== IMPROVED MOBILE (phone-first) ===== */
@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; }
  .main-area { margin-left: 0 !important; padding-bottom: 68px; overflow-x: hidden; }
  .sidebar { display: none; }
  .sidebar.open { display: flex; z-index: 200; }
  .hamburger { display: flex; } /* visible on mobile — opens sidebar */
  .topbar { height: 52px; padding: 0 14px; gap: 10px; width: 100%; }
  .topbar-search { display: none; }
  .topbar-title { font-size: 1rem; }
  .page-content { padding: 14px; overflow-x: hidden; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
  .stat-value { font-size: 1.4rem; }

  .tasks-grid { grid-template-columns: 1fr; }
  .task-card-body { padding: 13px; }

  /* Modal as bottom sheet — shorter to not overflow small screens */
  .modal-overlay { padding: 0 !important; align-items: flex-end !important; }
  .modal {
    max-width: 100% !important;
    max-height: 82vh !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  }
  .modal-footer {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .filters-bar { gap: 6px; flex-wrap: wrap; }
  .filter-select { font-size: 0.78rem; padding: 6px 10px; }

  /* Tables — allow horizontal scroll inside wrapper only, not page */
  .table-wrapper { font-size: 0.8rem; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  thead th { padding: 9px 10px; font-size: 0.7rem; white-space: nowrap; }
  tbody td { padding: 10px; }

  .employee-grid { grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
  .emp-avatar-lg { width: 44px; height: 44px; font-size: 1.1rem; }

  .task-detail-grid { grid-template-columns: 1fr; }

  .tl-card { padding: 14px 16px; }
  .tl-card-top { flex-direction: column; gap: 8px; }
  .notif-panel { width: 100%; right: 0; left: 0; }
  .topbar-actions { gap: 6px; }

  /* Filters bar horizontal scroll on mobile */
  .filters-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .employee-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .bnav-item span { display: none; }
  .bnav-item { padding: 8px 4px; min-width: 0; }
  .bnav-fab { width: 48px; height: 48px; }
}

/* ===== Dashboard Welcome Card ===== */
.dash-welcome-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  color: white;
}
.dash-welcome-left { display: flex; flex-direction: column; gap: 6px; }
.dash-greeting { font-size: 1.05rem; font-weight: 700; }
.dash-role-pill .badge { font-size: 0.72rem; padding: 3px 10px; background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.35); }
.dash-role-pill .role-admin   { background: rgba(255,255,255,0.25); }
.dash-role-pill .role-manager { background: rgba(255,255,255,0.25); }
.dash-role-pill .role-worker  { background: rgba(255,255,255,0.25); }
.dash-welcome-card .btn { background: rgba(255,255,255,0.18); color: white; border: 1.5px solid rgba(255,255,255,0.4); white-space: nowrap; }
.dash-welcome-card .btn:hover { background: rgba(255,255,255,0.3); }

/* ===== Vertical Timeline ===== */
.vtl-header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.vtl-header-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.vtl-header-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; }

.vtl-feed { display: flex; flex-direction: column; }

.vtl-row {
  display: flex;
  gap: 0;
  cursor: pointer;
  position: relative;
}
.vtl-row:hover .vtl-content { background: var(--primary-light); border-color: var(--accent-light); }

.vtl-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 36px;
  flex-shrink: 0;
  padding-top: 14px;
}
.vtl-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  z-index: 1;
}
.vtl-line {
  flex: 1;
  width: 2px;
  background: var(--border);
  margin-top: 4px;
  min-height: 20px;
}
.vtl-row:last-child .vtl-line { display: none; }

.vtl-content {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 6px 0 6px 8px;
  transition: var(--transition);
}
.vtl-task-name {
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.vtl-event-msg {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.vtl-event-msg strong { color: var(--text); }
.vtl-time {
  font-size: 0.68rem;
  color: var(--text-light);
  margin-top: 5px;
}

/* ===== Account Page ===== */
.acc-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.acc-avatar-wrap { position: relative; flex-shrink: 0; }
.acc-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}
.acc-avatar-initials {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; font-weight: 800; color: white;
  border: 3px solid rgba(255,255,255,0.3);
}
.acc-photo-btn {
  position: absolute; bottom: 0; right: -2px;
  width: 24px; height: 24px;
  background: var(--primary); color: white;
  border-radius: 50%; border: 2px solid var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.65rem;
  transition: var(--transition);
}
.acc-photo-btn:hover { background: var(--primary-dark); }
.acc-info { flex: 1; min-width: 0; }
.acc-name { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.acc-role-badge { margin: 5px 0; }
.acc-email { font-size: 0.78rem; color: var(--text-muted); }
.acc-phone { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }

.acc-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.acc-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
}
.acc-stat-val { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.acc-stat-lbl { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

.acc-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  padding-top: 4px;
}

@media (max-width: 768px) {
  .acc-profile-card { flex-direction: column; align-items: flex-start; gap: 14px; }
  .acc-stats-row { grid-template-columns: repeat(2, 1fr); }
  .acc-avatar, .acc-avatar-initials { width: 60px; height: 60px; font-size: 1.3rem; }
  .vtl-content { padding: 10px 12px; }
  .vtl-dot { width: 24px; height: 24px; }
  .vtl-dot-col { width: 30px; }
  .dash-welcome-card { flex-direction: column; align-items: flex-start; }
}

/* ===== Mobile Bottom Nav — 5 items ===== */
@media (max-width: 768px) {
  .bnav-item { font-size: 0.62rem; }
}

/* ===== Sidebar avatar with photo ===== */
.sidebar-user-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
