
/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* BRAND */
  --primary:           #4F46E5;
  --primary-dark:      #4338CA;
  --primary-light:     #EEF2FF;

  /* SURFACE */
  --sidebar-bg:        #FFFFFF;
  --nav-text:          #42526E;
  --nav-hover-bg:      #F4F5F7;
  --nav-hover-text:    #172B4D;
  --nav-active-bg:     #E9F2FF;
  --nav-active-border: #0052CC;

  /* TEXT */
  --text-dark:         #0F172A;
  --text-light:        #64748B;
  --text-white:        #FFFFFF;

  /* UI */
  --border:            #E2E8F0;
  --hover-bg:          #F1F5F9;
  --card-bg:           #FFFFFF;

  /* STATUS */
  --success:           #10B981;
  --warning:           #F59E0B;
  --danger:            #EF4444;

  /* EFFECTS */
  --shadow-soft:       0 6px 20px rgba(0,0,0,0.05);
  --shadow-hover:      0 12px 30px rgba(0,0,0,0.08);

  /* GRADIENT */
  --gradient-main:     linear-gradient(135deg, #4F46E5, #6366F1);
  --gradient-soft:     linear-gradient(135deg, #EEF2FF, #F5F3FF);

  /* LAYOUT */
  --sidebar-width:     180px;
  --sidebar-collapsed: 70px;
  --topbar-height:     60px;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================================================
   BASE
   ============================================================ */
body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(180deg, #F8FBFF, #F1F5F9);
  color: var(--text-dark);
  min-height: 100vh;
}

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

/* ============================================================
   SIDEBAR — BASE
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  flex-shrink: 0;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  padding: 20px 12px;

  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-soft);

  transition: width 0.3s ease, transform 0.3s ease;
  z-index: 200;
  overflow: hidden;
}

.sidebar-top,
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* LOGO (Sidebar) */
.sidebar .forge-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin: 0 auto;

  background: var(--gradient-main);
  color: white;
  font-size: 20px;

  box-shadow: 0 10px 25px rgba(79,70,229,0.35);
  transition: 0.3s;
  flex-shrink: 0;
}

.sidebar .forge-logo:hover {
  transform: scale(1.08);
}

.hammer {
  transform: rotate(-10deg);
  display: inline-block;
}

/* SIDEBAR LINKS */
.sidebar nav a,
.sidebar-bottom a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--nav-text);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.25s ease;
  position: relative;
  white-space: nowrap;
}

.sidebar a i {
  color: #6B778C;
  font-size: 17px;
  transition: 0.2s;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.sidebar a .nav-label {
  overflow: hidden;
  transition: opacity 0.25s ease, max-width 0.3s ease;
  max-width: 120px;
  opacity: 1;
}

/* HOVER */
.sidebar nav a:hover,
.sidebar-bottom a:hover {
  background: var(--hover-bg);
  color: var(--primary);
}

.sidebar a:hover i {
  color: var(--primary);
}

/* ACTIVE */
.sidebar nav a.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-border);
  box-shadow: 0 4px 14px rgba(0,82,204,0.15);
}

.sidebar nav a.active i {
  color: var(--nav-active-border);
}

.sidebar nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--nav-active-border);
}

/* =========================
   BOTTOM (MATCH TOP NAV)
========================= */

/* Container */
.sb-bottom {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid #eee;
}

/* Links (same as .sidebar nav a) */
.sb-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--nav-text);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.25s ease;
  position: relative;
  white-space: nowrap;
}

/* Icon (same as .sidebar a i) */
.sb-link i {
  color: #6B778C;
  font-size: 17px;
  transition: 0.2s;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* Text (same as .nav-label) */
.sb-text {
  overflow: hidden;
  transition: opacity 0.25s ease, max-width 0.3s ease;
  max-width: 120px;
  opacity: 1;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* HOVER (same as top) */
.sb-link:hover {
  background: var(--hover-bg);
  color: var(--primary);
}

.sb-link:hover i {
  color: var(--primary);
}

/* ACTIVE (optional if you want highlight on bottom items) */
.sb-link.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-border);
  box-shadow: 0 4px 14px rgba(0,82,204,0.15);
}

.sb-link.active i {
  color: var(--nav-active-border);
}

.sb-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--nav-active-border);
}


/* Collapse (same feel as top nav) */
.sidebar.collapsed .sb-text {
  opacity: 0;
  max-width: 0;
}

/* Center icons when collapsed */
.sidebar.collapsed .sb-link {
  justify-content: center;
}
/* ============================================================
   SIDEBAR — COLLAPSED (desktop)
   ============================================================ */
.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar.collapsed .nav-label {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}

.sidebar.collapsed .forge-logo {
  margin: 0 auto;
}

/* Tooltip on collapsed */
.sidebar.collapsed nav a,
.sidebar.collapsed .sidebar-bottom a {
  justify-content: center;
  padding: 12px;
  gap: 0;
}

.sidebar.collapsed a::after {
  content: attr(data-title);
  position: absolute;
  left: calc(var(--sidebar-collapsed) + 8px);
  top: 50%;
  transform: translateY(-50%);

  background: #172B4D;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;

  opacity: 0;
  transition: opacity 0.2s;
  z-index: 300;
}

.sidebar.collapsed a:hover::after {
  opacity: 1;
}

/* ============================================================
   OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(2px);
  z-index: 190;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

/* ============================================================
   MAIN WRAPPER
   ============================================================ */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-height);
  background: #FFFFFF;
  border-bottom: 1px solid #E5E7EB;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* TOGGLE BUTTON */
.toggle-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: #42526E;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
  flex-shrink: 0;
}

.toggle-btn:hover {
  background: #F4F5F7;
}

/* SEARCH BOX */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F4F5F7;
  padding: 7px 12px;
  border-radius: 8px;
  width: 240px;
  position: relative;
  transition: box-shadow 0.2s, border 0.2s;
  border: 1.5px solid transparent;
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-dark);
  width: 100%;
}

.search-box i {
  color: var(--text-light);
  font-size: 15px;
  flex-shrink: 0;
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.15);
}

/* .search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: white;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  display: none;
  max-height: 160px;
  overflow-y: auto;
  z-index: 999;
} */

.search-results div {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
}

.search-results div:hover {
  background: #f3f4f6;
}

/* ICON BUTTONS */
.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  transition: 0.25s;
}

.icon-btn:hover {
  background: #eef2ff;
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.icon-btn i {
  font-size: 16px;
  color: #374151;
}

/* BADGE */
.badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 20px;
  line-height: 1;
  font-weight: 600;
  border: 2px solid #fff;
  pointer-events: none;
}

/* USER INFO */
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: 0.2s;
}

.user-info:hover {
  background: var(--hover-bg);
}

.user-info .user-name {
  font-weight: 500;
  color: var(--text-dark);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-main);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

/* CREATE BUTTON */
.create-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: white;
  padding: 9px 16px;
  border-radius: 10px;
  border: none;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: 0.25s;
  white-space: nowrap;
  flex-shrink: 0;
}

.create-btn:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-hover);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main {
  flex: 1;
  padding: 32px 36px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: var(--gradient-main);
  padding: 36px;
  border-radius: 22px;
  color: white;
  box-shadow: 0 15px 40px rgba(79,70,229,0.25);
  position: relative;
  overflow: hidden;
  margin-bottom: 30px;
}

.hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  background: rgba(255,255,255,0.15);
  filter: blur(60px);
  top: -60px;
  right: -40px;
  pointer-events: none;
}

.hero h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 26px;
  font-weight: 700;
}

.hero p {
  margin-top: 8px;
  opacity: 0.85;
  font-size: 15px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 24px;
}

.hero-stats div {
  transition: 0.2s;
}

.hero-stats div:hover {
  transform: translateY(-4px);
}

.hero-stats .stat-value {
  font-size: 24px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
}

.hero-stats .stat-label {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 2px;
}

/* ============================================================
   CARDS GRID
   ============================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 20px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.card.big {
  grid-column: span 2;
}

.focus-card {
  background: var(--gradient-soft);
}

/* ============================================================
   ANALYTICS GRID
   ============================================================ */
.analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1.5fr;
  gap: 20px;
  margin-bottom: 30px;
}

/* ============================================================
   BOTTOM GRID
   ============================================================ */
.bottom-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 25px;
}

/* ============================================================
   TABLE
   ============================================================ */
.project-table {
  width: 100%;
  margin-top: 15px;
  border-collapse: collapse;
}

.project-table th {
  text-align: left;
  font-size: 13px;
  color: var(--text-light);
  padding-bottom: 8px;
}

.project-table td {
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.status.active  { color: var(--success); }
.status.warning { color: var(--warning); }
.status.success { color: var(--success); }
.status.danger  { color: var(--danger); }

/* ============================================================
   PROGRESS
   ============================================================ */
.progress {
  height: 8px;
  background: #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 6px;
}

/* ============================================================
   ACTIVITY
   ============================================================ */
.activity {
  margin-top: 15px;
}

.activity span {
  font-size: 12px;
  color: var(--text-light);
}

/* ============================================================
   ACTION BUTTON
   ============================================================ */
.action-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  transition: 0.2s;
  font-size: 14px;
  text-align: center;
}

.action-btn:hover {
  background: var(--hover-bg);
}

/* ============================================================
   CHART CARD
   ============================================================ */
.chart-card {
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  padding: 24px;
  border: 1px solid var(--border);
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
section {
  margin-bottom: 30px;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 14px;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(25px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero { animation: fadeUp 0.5s ease both; }
.card { animation: fadeUp 0.55s ease both; }
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.10s; }
.card:nth-child(4) { animation-delay: 0.15s; }

/* ============================================================
   MOBILE SEARCH TOGGLE (hidden icon shown on small screens)
   ============================================================ */
.search-toggle-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 18px;
  padding: 6px;
  border-radius: 6px;
}

.search-toggle-btn:hover {
  background: var(--hover-bg);
}

/* ============================================================
   TABLE SCROLL WRAPPER
   ============================================================ */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* ---- LARGE TABLETS (max 1100px) ---- */
@media (max-width: 1100px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .card.big {
    grid-column: span 2;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: 28px;
  }
}

/* ---- TABLETS (max 900px) ---- */
@media (max-width: 900px) {
  .main {
    padding: 24px 20px;
  }

  .bottom-grid {
    grid-template-columns: 1fr;
  }

  .user-info .user-name,
  .user-info .user-role {
    display: none;
  }

  .search-box {
    width: 180px;
  }
}

/* ---- SMALL TABLETS / LARGE PHONES (max 768px) ---- */
@media (max-width: 768px) {

  /* --- SIDEBAR becomes a fixed drawer --- */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width) !important; /* override collapsed state */
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Show overlay only when drawer is open */
  .sidebar-overlay {
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .sidebar.mobile-open ~ .sidebar-overlay,
  .sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
  }

  /* nav labels always visible inside drawer */
  .sidebar .nav-label {
    opacity: 1 !important;
    max-width: 120px !important;
  }

  .sidebar nav a,
  .sidebar-bottom a {
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
  }

  /* Remove desktop tooltip on mobile */
  .sidebar a::after {
    display: none !important;
  }

  /* --- MAIN takes full width --- */
  .main-wrapper {
    width: 100%;
  }

  /* --- TOPBAR adjustments --- */
  .topbar {
    padding: 0 14px;
    gap: 8px;
  }

  /* Hide search box, show icon trigger instead */
  .search-box {
    display: none;
  }

  .search-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Show search as full-width bar when active */
  .search-box.mobile-active {
    display: flex;
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
    z-index: 110;
    padding: 10px 16px;
    background: white;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }

  /* Hide create button text on mobile */
  .create-btn .btn-label {
    display: none;
  }

  .create-btn {
    padding: 9px 12px;
    border-radius: 10px;
  }

  /* --- MAIN padding --- */
  .main {
    padding: 20px 14px;
  }

  /* --- HERO --- */
  .hero {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .hero h1 {
    font-size: 20px;
  }

  .hero p {
    font-size: 14px;
  }

  .hero-stats {
    gap: 20px;
    flex-wrap: wrap;
  }

  .hero-stats .stat-value {
    font-size: 20px;
  }

  /* --- CARDS GRID --- */
  .cards {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .card.big {
    grid-column: span 2;
  }

  /* --- ANALYTICS + BOTTOM GRIDS --- */
  .analytics-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }
}

/* ---- PHONES (max 480px) ---- */
@media (max-width: 480px) {
  /* Single column cards */
  .cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }
/* 
  .card.big {
    grid-column: span 1;
  } */

  /* Hero further compressed */
  .hero {
    padding: 20px 16px;
    border-radius: 14px;
    margin-bottom: 20px;
  }

  .hero h1 {
    font-size: 18px;
  }

  .hero-stats {
    gap: 16px;
  }

  /* Topbar compact */
  .topbar {
    padding: 0 10px;
    gap: 6px;
  }

  /* Main padding */
  .main {
    padding: 16px 12px;
  }

  /* Smaller icon buttons */
  .icon-btn {
    width: 34px;
    height: 34px;
  }

  /* Table horizontal scroll */
  .project-table {
    min-width: 520px;
  }

  /* Section margin */
  section {
    margin-bottom: 20px;
  }
}

/* ---- VERY SMALL PHONES (max 360px) ---- */
@media (max-width: 360px) {
  .create-btn {
    padding: 8px 10px;
  }

  .topbar-right {
    gap: 6px;
  }

  .hero h1 {
    font-size: 16px;
  }
}

/* ============================================================
   DEMO-ONLY STYLES (remove in production)
   ============================================================ */
.demo-card-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 8px;
}

.demo-number {
  font-size: 28px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  color: var(--text-dark);
}

.demo-change {
  font-size: 12px;
  margin-top: 4px;
}

.demo-change.up   { color: var(--success); }
.demo-change.down { color: var(--danger); }

.demo-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 80px;
  margin-top: 20px;
}

.demo-bar {
  flex: 1;
  border-radius: 6px 6px 0 0;
  background: var(--primary-light);
  transition: 0.3s;
  cursor: pointer;
}

.demo-bar.active {
  background: var(--primary);
}

.demo-bar:hover {
  background: var(--primary);
  opacity: 0.85;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 5px;
  flex-shrink: 0;
}

.activity-dot.success { background: var(--success); }
.activity-dot.warning { background: var(--warning); }
.activity-dot.danger  { background: var(--danger); }

.activity-text {
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.5;
}

.activity-time {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

/* clickable cards */
.clickable {
  cursor: pointer;
  transition: 0.2s;
}

.clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

/* activity */
.activity-item {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.activity-item span {
  font-size: 12px;
  color: #888;
}

/* search dropdown */
.search-results {
  position: absolute;
  background: white;
  width: 250px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  margin-top: 5px;
  z-index: 100;
}

.search-item {
  padding: 10px;
  cursor: pointer;
}

.search-item:hover {
  background: #f3f4f6;
}

/* ============================================================
   ROLE DASHBOARD PANELS (merged into home)
   ============================================================ */
.dash-panel {
  margin-bottom: 28px;
}

.dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dash-panel-head h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-panel-head h3 i {
  color: var(--primary);
}

.dash-muted {
  font-size: 13px;
  color: var(--text-light);
}

.dash-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.dash-admin-projects {
  grid-column: 1 / -1;
}

.dash-admin-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.dash-stat-tile {
  flex: 1;
  min-width: 100px;
}

.dash-stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.dash-stat-num {
  font-size: 22px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: var(--text-dark);
}

.dash-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.dash-list-row:last-child {
  border-bottom: none;
}

.dash-list-row a {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
}

.dash-list-row a:hover {
  color: var(--primary);
}

.status-pill {
  position: static;
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  line-height: 1.2;
}

.status-pill--todo {
  background: #f1f5f9;
  color: #475569;
}

.status-pill--in_progress {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pill--in_review {
  background: #f3e8ff;
  color: #7c3aed;
}

.status-pill--done {
  background: #dcfce7;
  color: #15803d;
}

/* Developer kanban */
.dev-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.dev-column {
  background: #f4f5f7;
  padding: 12px;
  border-radius: 14px;
  width: 260px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.dev-col-header {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.dev-card {
  background: var(--card-bg);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.dev-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.dev-card--muted {
  opacity: 0.85;
}

.dev-card--done {
  opacity: 0.75;
}

.dev-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.dev-title a {
  color: var(--text-dark);
  text-decoration: none;
}

.dev-title a:hover {
  color: var(--primary);
}

.dev-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.priority-tag {
  font-size: 11px;
  font-weight: 600;
}

.priority-tag--high {
  color: var(--danger);
}

.priority-tag--medium {
  color: var(--warning);
}

.priority-tag--low {
  color: var(--success);
}

.dev-btn {
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  transition: 0.2s;
}

.dev-btn--primary {
  background: var(--primary);
  color: #fff;
}

.dev-btn--primary:hover {
  background: var(--primary-dark);
}

.dev-btn--success {
  background: var(--success);
  color: #fff;
}

.dev-btn--success:hover {
  filter: brightness(1.05);
}

.dev-btn--ghost {
  background: transparent;
  color: var(--text-dark);
  border: 1px solid var(--border);
}

.dev-btn--ghost:hover {
  background: var(--hover-bg);
}

/* Tester cards */
.tester-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tester-card h4 {
  font-size: 15px;
  margin-bottom: 6px;
}

.tester-card h4 a {
  color: var(--text-dark);
  text-decoration: none;
}

.tester-card h4 a:hover {
  color: var(--primary);
}

.tester-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.tester-actions .dev-btn {
  flex: 1;
  width: auto;
}

.user-task-list .card-body {
  padding-top: 8px;
  padding-bottom: 8px;
}


/* ============================================================
   DESKTOP-FIRST ENHANCEMENTS (min-width)
   ============================================================ */

/* ---- LARGE DESKTOP (>=1280px) ---- */
@media (min-width: 1280px) {

  .main {
    padding: 36px 48px;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }

  .analytics-grid {
    grid-template-columns: 2fr 1.6fr;
    gap: 24px;
  }

  .bottom-grid {
    grid-template-columns: 2fr 1fr;
    gap: 24px;
  }

  .hero {
    padding: 40px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero-stats {
    gap: 44px;
  }
}

/* ---- EXTRA LARGE DESKTOP (>=1440px) ---- */
@media (min-width: 1440px) {

  .main {
    padding: 40px 60px;
  }

  .cards {
    gap: 28px;
  }

  .card {
    padding: 26px;
  }

  .hero {
    padding: 44px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .hero-stats .stat-value {
    font-size: 26px;
  }
}

/* ---- ULTRA WIDE (>=1600px) ---- */
@media (min-width: 1600px) {

  .main {
    max-width: 1500px;
    margin: 0 auto;
  }

  .cards {
    grid-template-columns: repeat(4, 1fr);
  }

  .card.big {
    grid-column: span 2;
  }
}

/* ============================================================
   TABLET IMPROVEMENTS (refinement)
   ============================================================ */

@media (max-width: 900px) {

  /* Better spacing */
  .hero {
    padding: 26px 22px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .hero-stats {
    gap: 22px;
  }

  /* Cards tighter */
  .cards {
    gap: 16px;
  }

  /* Topbar optimization */
  .topbar {
    padding: 0 16px;
  }
}

/* ============================================================
   MOBILE UX IMPROVEMENTS (refinement)
   ============================================================ */

@media (max-width: 768px) {

  /* Prevent content shift */
  .app {
    overflow-x: hidden;
  }

  /* Better sidebar animation */
  .sidebar {
    transition: transform 0.28s ease;
  }

  /* Topbar spacing */
  .topbar-left,
  .topbar-right {
    gap: 8px;
  }

  /* Make icons tighter */
  .icon-btn {
    width: 36px;
    height: 36px;
  }

  /* Hero readability */
  .hero {
    line-height: 1.4;
  }

  /* Stats wrap better */
  .hero-stats div {
    min-width: 80px;
  }
}

/* ============================================================
   SMALL MOBILE IMPROVEMENTS
   ============================================================ */

@media (max-width: 480px) {

  /* Improve tap targets */
  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .toggle-btn {
    width: 34px;
    height: 34px;
  }

  /* Cards cleaner */
  .card {
    padding: 18px;
    border-radius: 16px;
  }

  /* Reduce visual noise */
  .hero::after {
    display: none;
  }

  /* Better stacking */
  .hero-stats {
    justify-content: space-between;
  }

  /* Search dropdown full width */
  .search-results {
    width: 100%;
    left: 0;
    right: 0;
  }
}

/* ============================================================
   MICRO POLISH (GLOBAL IMPROVEMENTS)
   ============================================================ */

/* Smooth scroll (optional but premium feel) */
html {
  scroll-behavior: smooth;
}

/* Better focus states */
button:focus,
input:focus {
  outline: none;
}

/* Improve card rendering */
.card {
  will-change: transform;
}

/* Improve animation performance */
.sidebar,
.card,
.hero {
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* ===== NAV BADGE (Reports Alerts) ===== */
.nav-label {
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
}

.nav-badge {
  background:#de350b; /* Jira red */
  color:#fff;
  font-size:11px;
  padding:2px 6px;
  border-radius:10px;
  margin-left:8px;
  min-width:18px;
  text-align:center;
}
