/* ========================================
   ROOT VARIABLES
   ======================================== */
:root {
  --primary: #1A365D;
  --primary-light: #2D4A7A;
  --primary-dark: #0F2440;
  --gold: #D69E2E;
  --gold-light: #ECC94B;
  --success: #48BB78;
  --success-light: #C6F6D5;
  --danger: #FC8181;
  --danger-light: #FED7D7;
  --warning: #ED8936;
  --warning-light: #FEFCBF;
  --info: #4299E1;
  --info-light: #EBF4FF;
  --purple: #9F7AEA;
  --purple-light: #E9D8FD;
  --bg: #F7FAFC;
  --bg-card: #FFFFFF;
  --bg-sidebar: #1A202C;
  --text: #2D3748;
  --text-light: #718096;
  --text-muted: #A0AEC0;
  --border: #E2E8F0;
  --border-light: #F7FAFC;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 6px rgba(26, 54, 93, 0.08);
  --shadow-lg: 0 8px 25px rgba(26, 54, 93, 0.12);
  --shadow-hover: 0 8px 30px rgba(26, 54, 93, 0.18);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

/* ========================================
   RESET
   ======================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 65px;
}

.brand-logo {
  max-width: 100%;
  height: auto;
  max-height: 55px;
  width: auto;
  object-fit: contain;
}

.sidebar-search {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-search input {
  width: 100%;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: #FFFFFF;
  font-size: 0.8rem;
  outline: none;
}

.sidebar-search input::placeholder { color: var(--text-muted); }
.sidebar-search input:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #FFFFFF; }
.nav-item.active { background: rgba(214, 158, 46, 0.15); color: var(--gold); }
.nav-item .nav-icon { font-size: 1.1rem; width: 24px; text-align: center; }
.nav-item .nav-label { flex: 1; font-size: 0.9rem; font-weight: 500; }
.nav-item .nav-badge {
  font-size: 0.55rem;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  background: var(--success);
  color: #FFFFFF;
  font-weight: 600;
  text-transform: uppercase;
}
.nav-item .nav-arrow {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
  padding-left: 0.3rem;
}
.nav-item.active .nav-arrow { color: var(--gold); }

.nav-parent { position: relative; }

.nav-children {
  padding-left: 0.5rem;
  margin-left: 0.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-child {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.75rem 0.35rem 1.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  font-size: 0.82rem;
  position: relative;
}

.nav-child:hover { background: rgba(255, 255, 255, 0.05); color: #FFFFFF; }
.nav-child.active { background: rgba(214, 158, 46, 0.12); color: var(--gold); }
.nav-child.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 16px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
}
.nav-child .nav-icon { font-size: 0.85rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-child .nav-label { flex: 1; font-size: 0.8rem; font-weight: 400; }
.nav-child .nav-badge { display: none; }

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.user-info { display: flex; align-items: center; gap: 0.5rem; }
.user-avatar { font-size: 1.3rem; }
.user-name { color: #FFFFFF; font-size: 0.8rem; font-weight: 500; }
.version { font-size: 0.65rem; color: var(--text-muted); }

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 1.5rem 2rem;
  min-height: 100vh;
  background: var(--bg);
  max-width: 100%;
  overflow-x: hidden;
}

/* ========================================
   TOP HEADER
   ======================================== */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.header-left h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}
.breadcrumb { font-size: 0.8rem; color: var(--text-light); margin-top: 0.2rem; }
.breadcrumb .separator { margin: 0 0.4rem; color: var(--text-muted); }
#breadcrumbModule { color: var(--gold); font-weight: 500; }

.header-right { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.date-display {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #FFFFFF; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-hover); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg-card); border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: #FFFFFF; }
.btn-success:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: #FFFFFF; }
.btn-danger:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--text-muted); color: #FFFFFF; }

/* ========================================
   CONTENT SECTIONS
   ======================================== */
.content-section { animation: fadeIn 0.3s ease; }
.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.module-header { margin-bottom: 1.5rem; }
.module-header h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.module-header p { color: var(--text-light); font-size: 0.9rem; }

/* ========================================
   STATS GRID
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border);
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.stat-card .stat-icon { font-size: 2rem; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); }
.stat-primary .stat-icon { background: var(--info-light); }
.stat-success .stat-icon { background: var(--success-light); }
.stat-danger .stat-icon { background: var(--danger-light); }
.stat-warning .stat-icon { background: var(--warning-light); }
.stat-info .stat-icon { background: var(--info-light); }
.stat-purple .stat-icon { background: var(--purple-light); }
.stat-info { flex: 1; display: flex; flex-direction: column; }
.stat-value { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.75rem; color: var(--text-light); font-weight: 500; }
.stat-trend { font-size: 0.65rem; font-weight: 600; margin-top: 0.15rem; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ========================================
   QUICK ACTIONS
   ======================================== */
.quick-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
.action-btn:hover { background: var(--primary); color: #FFFFFF; border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-hover); }

/* ========================================
   CHARTS
   ======================================== */
.charts-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ========================================
   CHART OVERFLOW FIXES
   ======================================== */
.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-width: 100%;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chart-header h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }

.chart-container-wrapper {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.chart-container {
  position: relative;
  width: 100% !important;
  min-height: 200px;
  height: 220px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
}

#projMainChart {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
}

@media (max-width: 1200px) { .chart-container { height: 300px; } }
@media (max-width: 992px) { .chart-container { height: 280px; } .charts-row { grid-template-columns: 1fr; } }
@media (max-width: 768px) { .chart-container { height: 250px; min-height: 200px; } }
@media (max-width: 576px) { .chart-container { height: 220px; min-height: 180px; } }

/* ========================================
   BOTTOM ROW
   ======================================== */
.bottom-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}
.table-card, .activity-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.table-header h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.table-controls { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.search-input {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  background: var(--bg);
  color: var(--text);
  min-width: 140px;
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1); }
.filter-select {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--primary); }

/* ========================================
   TABLE
   ======================================== */
.table-wrapper { overflow-x: auto; max-height: 350px; overflow-y: auto; }
.table-wrapper::-webkit-scrollbar { width: 6px; height: 6px; }
.table-wrapper::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
thead th {
  background: var(--bg);
  padding: 0.5rem 0.6rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
tbody td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border-light); }
tbody tr:hover { background: var(--bg); }

.status-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 600;
}
.status-active { background: var(--success-light); color: #276749; }
.status-onleave { background: var(--warning-light); color: #975A16; }
.status-inactive { background: var(--danger-light); color: #9B2C2C; }

/* ========================================
   ACTIVITY FEED
   ======================================== */
.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.activity-header h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.activity-badge {
  font-size: 0.55rem;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  background: var(--success);
  color: #FFFFFF;
  font-weight: 600;
  text-transform: uppercase;
}
.activity-feed { display: flex; flex-direction: column; gap: 0.4rem; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon { font-size: 1.1rem; width: 30px; height: 30px; background: var(--bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity-text { flex: 1; font-size: 0.8rem; }
.activity-time { font-size: 0.65rem; color: var(--text-muted); flex-shrink: 0; }

/* ========================================
   ADMIN PANEL
   ======================================== */
.admin-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.admin-header { margin-bottom: 1.5rem; }
.admin-header h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.admin-subtitle { color: var(--text-light); font-size: 0.9rem; }

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.upload-card {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 2px dashed var(--border);
  text-align: center;
  transition: all 0.2s;
}
.upload-card:hover { border-color: var(--primary); background: var(--info-light); }
.upload-icon { font-size: 1.8rem; margin-bottom: 0.3rem; }
.upload-card h4 { font-family: var(--font-display); font-size: 0.9rem; margin-bottom: 0.2rem; }
.upload-card p { font-size: 0.65rem; color: var(--text-light); margin-bottom: 0.5rem; }
.file-input { display: block; margin: 0.3rem auto; font-size: 0.7rem; color: var(--text-light); width: 100%; }
.upload-btn { width: 100%; justify-content: center; font-size: 0.75rem; }

.admin-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.admin-message { padding: 0.6rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; display: none; }
.admin-message.show { display: block; }
.admin-message.success { background: var(--success-light); color: #276749; border: 1px solid var(--success); }
.admin-message.error { background: var(--danger-light); color: #9B2C2C; border: 1px solid var(--danger); }
.admin-message.info { background: var(--info-light); color: #2B6CB0; border: 1px solid var(--info); }

.data-status { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.data-status h4 { font-family: var(--font-display); font-size: 0.9rem; margin-bottom: 0.5rem; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0.5rem; }
.status-item { background: var(--bg); padding: 0.4rem 0.6rem; border-radius: var(--radius-sm); display: flex; justify-content: space-between; align-items: center; }
.status-label { font-size: 0.7rem; color: var(--text-light); }
.status-count { font-family: var(--font-mono); font-weight: 600; font-size: 0.9rem; color: var(--primary); }

/* ========================================
   NOTIFICATIONS
   ======================================== */
.notifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.notification-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.2s;
}
.notification-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.notification-icon { font-size: 1.6rem; }
.notification-info { flex: 1; display: flex; flex-direction: column; }
.notification-count { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.notification-label { font-size: 0.7rem; color: var(--text-light); font-weight: 500; }

/* ========================================
   CALENDAR
   ======================================== */
.calendar-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}
.calendar-card, .calendar-events-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.calendar-card h3, .calendar-events-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.calendar-view { min-height: 280px; }
.calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
}
.calendar-day {
  padding: 0.25rem;
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.calendar-day:hover { background: var(--bg); }
.calendar-day.today { background: var(--primary); color: #FFFFFF; font-weight: 600; }
.calendar-day.has-event { background: var(--warning-light); color: var(--warning); font-weight: 600; }
.calendar-day.weekend { color: var(--text-muted); }

.upcoming-events { display: flex; flex-direction: column; gap: 0.4rem; }
.upcoming-event {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: all 0.2s;
}
.upcoming-event:hover { background: var(--border-light); }
.upcoming-event .event-date { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); min-width: 50px; }
.upcoming-event .event-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.upcoming-event .event-text { flex: 1; font-size: 0.8rem; }

/* ========================================
   REPORT FILTERS
   ======================================== */
.report-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  align-items: center;
}
.report-filters select, .report-filters input { min-width: 160px; }

/* ========================================
   EMPLOYEE ACTIONS
   ======================================== */
.employee-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

/* ========================================
   ADMIN DASHBOARD - FACILITIES STYLES
   ======================================== */
.selector-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 20px;
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.selector-bar .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selector-bar .field label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-light);
}

.selector-bar select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 34px 10px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  min-width: 220px;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23718096'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.selector-bar select:hover { border-color: var(--primary); }
.selector-bar select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.selector-bar .field.project select { min-width: 340px; }

.code-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-light);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.category-tabs .cat-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 9px 16px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .03em;
  color: var(--text-light);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 7px;
}

.category-tabs .cat-tab:hover { border-color: var(--text-muted); color: var(--text); }
.category-tabs .cat-tab.active { background: var(--bg); border-color: var(--primary); color: var(--text); }
.category-tabs .cat-tab .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.project-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.project-tabs .proj-tab {
  flex: 1;
  min-width: 190px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.project-tabs .proj-tab:hover { border-color: var(--text-muted); }
.project-tabs .proj-tab.active { background: var(--bg); border-color: var(--primary); }

.project-tabs .proj-tab .tab-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.project-tabs .proj-tab .tab-name {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-tabs .proj-tab .tab-util {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-light);
}

.project-tabs .proj-tab .rail-track { margin-top: 0; height: 8px; }

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
}

.panel-title .accent-bar {
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--primary);
  margin-right: 9px;
  vertical-align: -2px;
  border-radius: 1px;
}

.panel-note { font-size: 11.5px; color: var(--text-light); font-family: var(--font-mono); }

.segmented {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px;
}

.segmented button {
  background: none;
  border: none;
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: .03em;
}

.segmented button.active { background: var(--border); color: var(--text); }
.segmented button:hover { color: var(--text); }

.grid-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.grid-metrics .mini-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.grid-metrics .mini-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.grid-metrics .mini-name {
  font-weight: 600;
  font-size: 12.5px;
  font-family: var(--font-display);
}

.grid-metrics .mini-figs {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-light);
  margin-top: 10px;
  font-family: var(--font-mono);
}

.grid-metrics .mini-chart { height: 52px; margin-top: 8px; }

/* ========================================
   PROJECT GRID - FIX OVERFLOW
   ======================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.project-grid .mini-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: all 0.15s;
  min-width: 0;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.project-grid .mini-card .mini-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.project-grid .mini-card .mini-name {
  font-weight: 600;
  font-size: 12px;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.project-grid .mini-card .mini-name .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.project-grid .mini-card .mini-chart {
  height: 40px;
  margin-top: 4px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.project-grid .mini-card .mini-chart canvas {
  max-width: 100% !important;
  max-height: 100% !important;
}

.project-grid .mini-card .mini-figs {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-light);
  margin-top: 6px;
  font-family: var(--font-mono);
  flex-wrap: wrap;
  gap: 2px;
}

.project-grid .mini-card .mini-figs span {
  white-space: nowrap;
}

/* Responsive Project Grid */
@media (max-width: 1200px) {
  .project-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .project-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .project-grid .mini-card { padding: 10px 12px; }
}
@media (max-width: 480px) {
  .project-grid { grid-template-columns: 1fr; }
}

/* ========================================
   ORGANOGRAM - FIXED POSITION DIAGRAM
   ======================================== */

.org-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-height: 500px;
  overflow: hidden;
}

.org-header { margin-bottom: 1rem; }
.org-header h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.org-subtitle { color: var(--text-light); font-size: 0.9rem; }

.org-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.org-controls .btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
}

/* ===== DIAGRAM WRAPPER ===== */
.org-diagram-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  padding: 20px 0;
  position: relative;
}

.org-diagram {
  position: relative;
  width: 1100px;
  height: 850px;
  margin: 0 auto;
  min-width: 1100px;
}

/* ===== EMPLOYEE CARDS ===== */
.org-employee-card {
  position: absolute;
  width: 260px;
  height: 120px;
  padding: 16px 18px;
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  z-index: 10;
  transition: transform 0.2s;
}

.org-employee-card:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}

.org-employee-card .org-accent {
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  width: 6px;
  border-radius: 10px 0 0 10px;
}

.org-accent.blue { background: #2d8cff; }
.org-accent.green { background: #25b978; }
.org-accent.orange { background: #ff8a22; }
.org-accent.purple { background: #9658f0; }
.org-accent.red { background: #ff5860; }

.org-employee-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 2px;
  color: var(--text);
}

.org-employee-role {
  margin-top: 4px;
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.3;
}

.org-employee-dept {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Indirect badge */
.org-indirect-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 10px;
  background: #fefcbf;
  color: #975a16;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 10px;
  border: 1px solid #ed8936;
  letter-spacing: 0.5px;
}

/* ===== CARD POSITIONS ===== */
.card-md { left: 420px; top: 20px; }
.card-priya { left: 30px; top: 260px; }
.card-rohit { left: 420px; top: 260px; }
.card-vikram { left: 810px; top: 260px; }
.card-neha { left: 420px; top: 440px; }
.card-karan { left: 200px; top: 620px; }
.card-sanjay { left: 640px; top: 620px; }

/* ===== CONNECTOR LINES ===== */
.org-line {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

/* Direct Reporting - Solid Black */
.org-line.direct {
  background: #000000;
}

/* Indirect Reporting - Yellow Dotted */
.org-line.indirect {
  background: transparent;
}

/* ===== DIRECT LINE POSITIONS ===== */

/* Aditya -> Priya */
.md-to-priya-v {
  left: 549px;
  top: 140px;
  width: 4px;
  height: 48px;
}
.md-to-priya-h {
  left: 160px;
  top: 186px;
  width: 389px;
  height: 4px;
}
.md-to-priya-down {
  left: 158px;
  top: 186px;
  width: 4px;
  height: 74px;
}

/* Aditya -> Rohit */
.md-to-rohit {
  left: 549px;
  top: 140px;
  width: 4px;
  height: 120px;
}

/* Rohit -> Neha */
.rohit-to-neha {
  left: 549px;
  top: 380px;
  width: 4px;
  height: 60px;
}

/* Neha -> Children */
.neha-to-children-v {
  left: 549px;
  top: 560px;
  width: 4px;
  height: 36px;
}
.neha-to-children-h {
  left: 330px;
  top: 594px;
  width: 438px;
  height: 4px;
}
.neha-to-karan-v {
  left: 330px;
  top: 594px;
  width: 4px;
  height: 26px;
}
.neha-to-sanjay-v {
  left: 768px;
  top: 594px;
  width: 4px;
  height: 26px;
}

/* ===== INDIRECT LINE POSITIONS ===== */

/* Aditya -> Vikram (Yellow Dotted) */
.md-to-vikram-h {
  left: 549px;
  top: 186px;
  width: 540px;
  height: 0;
  border-top: 4px dotted #f2c400;
}
.md-to-vikram-v {
  left: 1087px;
  top: 186px;
  width: 0;
  height: 74px;
  border-left: 4px dotted #f2c400;
}

/* Yellow arrowhead for indirect line */
.md-to-vikram-v::after {
  content: "";
  position: absolute;
  left: -8px;
  bottom: -2px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 14px solid #f2c400;
}

/* ===== LEGEND ===== */
.org-legend {
  position: absolute;
  top: 18px;
  right: 30px;
  width: 210px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  z-index: 20;
}

.org-legend-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
  color: var(--text);
}

.org-legend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0;
  font-size: 12px;
  color: var(--text-light);
}

.org-legend-line {
  display: inline-block;
  width: 50px;
  flex: 0 0 50px;
}

.org-legend-line.solid {
  height: 4px;
  background: #000000;
}

.org-legend-line.dotted {
  height: 0;
  border-top: 4px dotted #f2c400;
}

/* ===== FOOTER NOTE ===== */
.org-note {
  position: absolute;
  left: 140px;
  right: 140px;
  top: 780px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  color: var(--text);
  font-size: 13px;
  flex-wrap: wrap;
  z-index: 15;
}

.org-note strong {
  color: var(--primary);
  font-size: 14px;
}

.org-note .yellow-text {
  color: #f2c400;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .org-diagram {
    transform: scale(0.85);
    transform-origin: top left;
  }
}

@media (max-width: 992px) {
  .org-diagram {
    transform: scale(0.7);
    transform-origin: top left;
  }
}

@media (max-width: 768px) {
  .org-diagram {
    transform: scale(0.55);
    transform-origin: top left;
  }
  .org-legend {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    margin-bottom: 15px;
  }
}

@media (max-width: 480px) {
  .org-diagram {
    transform: scale(0.4);
    transform-origin: top left;
  }
}

/* ===== TOGGLE LEGEND ===== */
.org-legend.hidden {
  display: none;
}

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ========================================
   INITIATIVES STYLES
   ======================================== */

.init-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.init-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: all 0.2s;
}

.init-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
}

.init-text {
  font-size: 13px;
  line-height: 1.5;
  flex: 1;
}

.init-title {
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 13px;
  margin-bottom: 3px;
  color: var(--text);
}

.init-desc {
  color: var(--text-light);
  font-size: 12px;
}

.init-saving {
  font-family: var(--font-mono);
  color: var(--success);
  font-size: 13px;
  white-space: nowrap;
  text-align: right;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  min-width: 100px;
}

.init-saving .lbl {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .init-item {
    flex-direction: column;
    padding: 12px 14px;
  }
  .init-saving {
    border-left: none;
    border-top: 1px solid var(--border);
    padding-left: 0;
    padding-top: 8px;
    min-width: auto;
    width: 100%;
    text-align: left;
  }
}