/* ========== DASHBOARD / APP CSS ========== */
.dashboard-page { background: var(--navy); min-height: 100vh; }
.app-layout { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  background: var(--navy-2);
  border-right: 1px solid var(--border);
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 200;
  width: 280px;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-logo { margin-bottom: 32px; padding-left: 12px; }
.sidebar-nav { flex: 1; overflow-y: auto; }
.sidebar-section { margin-bottom: 24px; }
.sidebar-section-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 16px; padding-left: 12px; font-weight: 700; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 12px;
  font-size: 0.95rem;
  transition: var(--transition);
  margin-bottom: 4px;
}
.sidebar-link:hover { background: rgba(255,255,255,0.05); color: #fff; }
.sidebar-link.active { background: var(--gold-glow); color: var(--gold); font-weight: 700; border: 1px solid var(--border-gold); }
.link-icon { font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0; }

.sidebar-user {
  margin-top: auto;
  padding: 16px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile overlay backdrop */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 199;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: 280px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== TOPBAR ===== */
.topbar {
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  flex-shrink: 0;
  gap: 12px;
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.topbar-title { font-size: 1.1rem; font-weight: 700; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--gold-gradient);
  color: #000;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  box-shadow: 0 4px 15px var(--gold-glow);
  flex-shrink: 0;
  font-size: 0.9rem;
}

/* Hamburger button */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: var(--transition); }

/* ===== DASHBOARD BODY ===== */
.dashboard-body { flex: 1; padding: 32px; }

/* ===== TABLE WRAPPER ===== */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== CARD ===== */
.card {
  background: var(--navy-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  overflow: hidden;
  width: 100%;
}

/* ===== DATA TABLE ===== */
.data-table { width: 100%; border-collapse: collapse; text-align: left; min-width: 580px; }
.data-table th { padding: 14px 16px; color: var(--text-muted); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 16px; border-bottom: 1px solid var(--border); color: var(--text-secondary); font-size: 0.9rem; }
.data-table tr:hover td { background: rgba(255,255,255,0.01); color: #fff; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

/* ===== PROJECTS GRID ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ===== BADGE ===== */
.badge { padding: 5px 10px; border-radius: 50px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; display: inline-flex; align-items: center; gap: 4px; }
.badge-gold { background: var(--gold-glow); color: var(--gold); border: 1px solid var(--border-gold); }
.badge-green { background: rgba(16,185,129,0.1); color: #10B981; border: 1px solid rgba(16,185,129,0.2); }
.badge-blue { background: rgba(37,99,235,0.1); color: #60A5FA; border: 1px solid rgba(37,99,235,0.2); }
.badge-gray { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); }
.badge-red { background: rgba(239,68,68,0.1); color: #F87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-orange { background: rgba(251,146,60,0.1); color: #FB923C; border: 1px solid rgba(251,146,60,0.2); }

/* ===== NOTIFICATION BUTTON ===== */
.notification-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}
.notification-btn:hover { background: rgba(255,255,255,0.1); }
.notif-badge {
  position: absolute;
  top: 6px; right: 6px;
  width: 14px; height: 14px;
  background: #ef4444;
  border-radius: 50%;
  font-size: 0.6rem;
  display: none;
  align-items: center; justify-content: center;
  font-weight: 700;
  border: 2px solid var(--navy);
}

/* ===== FILTER BAR ===== */
.filter-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 180px; }
.search-input input { width: 100%; }

/* ===== SECTION / PAGE HEADERS ===== */
.section-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-bottom: 32px; }

/* ===== RESPONSIVE: TABLET (≤1024px) ===== */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 40px rgba(0,0,0,0.6); }
  .main-content { margin-left: 0 !important; }
}

/* ===== RESPONSIVE: MOBILE (≤768px) ===== */
@media (max-width: 768px) {
  .topbar { padding: 0 16px; height: 60px; }
  .topbar-title { font-size: 0.9rem; }

  .dashboard-body { padding: 16px !important; }
  .page-header { margin-bottom: 20px !important; }
  .page-header h1, .page-title { font-size: 1.3rem !important; }

  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
  }

  .projects-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .filter-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .filter-bar select,
  .filter-bar .form-control,
  .filter-bar input { width: 100% !important; }
  .search-input { min-width: unset !important; }

  .data-table th, .data-table td { padding: 10px 8px; font-size: 0.82rem; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .hide-mobile { display: none !important; }

  /* Modal full screen on mobile */
  .modal-box { max-width: 100% !important; border-radius: 16px 16px 0 0; margin-top: auto; }
}

/* ===== RESPONSIVE: SMALL PHONE (≤480px) ===== */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr !important; }
  .topbar-title { display: none; }
  .avatar { width: 34px; height: 34px; font-size: 0.8rem; border-radius: 8px; }
  .notification-btn { width: 36px; height: 36px; }
}
