@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400..800&family=Coiny&family=Corinthia&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background: #FAFAFA;
  color: #111;
  font-size: 14px;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   PAGE SHELL
   Column layout: [header] then [dashboard-wrapper]
   header is fixed height, wrapper fills the rest
═══════════════════════════════════════════════════════════ */
.page-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   HEADER — full width, fixed height at top
═══════════════════════════════════════════════════════════ */
.dashboard-header {
  width: 100%;
  height: 72px;
  background: #fff;
  border-bottom: 1px solid #E5E5E5;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 100;
}

/* Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-full {
  width: 200px;
  height: auto;
  object-fit: contain;
  display: block;
}

button#sidebarToggle {
    margin-left: 27px;
}
/* Hamburger */
.sidebar-toggle {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #555;
  border-radius: 8px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: #F5F5F5; }

/* Search bar */
.dashboard-search {
  flex: 1;
  max-width: 420px;
  height: 46px;
  border: 1px solid #E5E5E5;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: #fff;
}
.dashboard-search i { color: #888; font-size: 16px; flex-shrink: 0; }
.dashboard-search input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #111;
  background: transparent;
}
.dashboard-search input::placeholder { color: #AAA; }

/* Right section */
.dashboard-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background 0.2s;
}
.icon-btn:hover { background: #F5F5F5; }

.dashboard-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.user-avatar-img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.dashboard-user span { font-weight: 500; font-size: 14px; }
.dashboard-user > i  { font-size: 12px; color: #888; }

/* ═══════════════════════════════════════════════════════════
   DASHBOARD WRAPPER
   Row layout: [sidebar] + [main]
   This fills all remaining height below the header
═══════════════════════════════════════════════════════════ */
.dashboard-wrapper {
  flex: 1;               /* fill all height below header */
  display: flex;
  overflow: hidden;      /* children manage their own scroll */
  min-height: 0;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════ */
.sidebar {
  width: 260px;
  min-width: 260px;
  height: 100%;          /* full height of dashboard-wrapper */
  background: #fff;
  border-right: 1px solid #E5E5E5;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 50;
  transition: width 0.3s ease, min-width 0.3s ease;
  overflow: hidden;
}

/* Collapsed desktop state */
.sidebar.collapsed {
  width: 80px;
  min-width: 80px;
}

/* Menu — grows to fill all space between top and logout */
.sidebar-menu {
  flex: 1;
  padding: 16px 14px;
  list-style: none;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-menu::-webkit-scrollbar { width: 0; }
.sidebar.collapsed .sidebar-menu { padding: 16px 0; }

.sidebar-menu li { margin-bottom: 4px; }

.sidebar-menu li a {
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  color: #111;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s;
  overflow: hidden;
}
.sidebar-menu li a.active            { background: #F7E6CA; }
.sidebar-menu li a:hover:not(.active){ background: #FAFAFA; }

.sidebar-menu li a i {
  font-size: 20px;
  flex-shrink: 0;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Badge */
.badge-pill {
    margin-left: auto;
    background: #111;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    font-style: normal;
    border-radius: 50px;
    padding: 4px 6px;
    flex-shrink: 0;
}

/* Collapsed: icons only */
.sidebar.collapsed .sidebar-menu li a {
  justify-content: center;
  padding: 0;
  width: 52px;
  margin: 0 auto;
}
.sidebar.collapsed .sidebar-menu li a span,
.sidebar.collapsed .badge-pill { display: none; }

/* Logout — pinned to bottom */
.sidebar-bottom {
  margin-top: 50px;
  flex-shrink: 0;
  border-top: 1px solid #F0F0F0;
}
.sidebar.collapsed .sidebar-bottom { padding: 16px 0; }

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 50px;
  width: 100%;
  border: 1px solid #E5E5E5;
  border-radius: 10px;
  text-decoration: none;
  color: #111;
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  transition: background 0.2s;
}
.logout-btn:hover { background: #FAFAFA; color: #111; }
.logout-btn i { font-size: 18px; flex-shrink: 0; }

.sidebar.collapsed .logout-btn {
  width: 52px;
  margin: 0 auto;
  gap: 0;
}
.sidebar.collapsed .logout-btn span { display: none; }

/* ═══════════════════════════════════════════════════════════
   MAIN — scrollable content area
═══════════════════════════════════════════════════════════ */
.dashboard-main {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: #FAFAFA;
  min-width: 0;
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.dashboard-main::-webkit-scrollbar { display: none; }

.dashboard-content {
  flex: 1;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Welcome ── */
.welcome-block h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.welcome-block p  { color: #888888; font-size: 14px; font-weight: 500; }

/* ── Banner ── */
.banner-card {
  background: #FDF3E3;
  border-radius: 16px;
  padding: 32px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}
.banner-text h2  { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.banner-text p   { color: #666; font-size: 13px; margin-bottom: 22px; max-width: 340px; }
.btn-dark {
  background: #111;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: opacity 0.2s;
}
.btn-dark:hover { opacity: 0.85; }
.banner-illustration { flex-shrink: 0; }

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-card {
  background: #fff;
  border: 1px solid #EBEBEB;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.stat-icon {
  width: 48px; height: 48px;
  background: #FDF3E3;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #C4A97D; flex-shrink: 0;
}
.stat-info  { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 12px; color: #888; }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1.1; }

/* ── Bottom Grid ── */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
}
.missions-card,
.suppliers-card {
  background: #fff;
  border: 1px solid #EBEBEB;
  border-radius: 16px;
  padding: 22px;
}
.card-header-row {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.card-header-row h3 { font-size: 16px; font-weight: 700; }
.view-all {
  font-size: 13px; font-weight: 500;
  color: #C4A97D; text-decoration: none;
  display: flex; align-items: center; gap: 4px;
}
.view-all:hover { color: #a8893f; }

/* Mission Items */
.missions-list {
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
}
.missions-list::-webkit-scrollbar { height: 4px; }
.missions-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 99px; }
.missions-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 99px; }

.mission-item {
  display: grid;
  grid-template-columns: 56px 1.5fr 1fr 1.5fr 1fr 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #F2F2F2;
}
.mission-item:last-child { border-bottom: none; }

.img-placeholder {
  width: 52px; height: 52px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #888; flex-shrink: 0;
}
.grey-bg  { background: #E8E8E8; }
.blue-bg  { background: #D6E8F5; }
.dark-bg  { background: #2E2E2E; color: #ccc; }
.light-bg { background: #F0F0F0; }

.mission-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mission-name strong {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mission-name span { font-size: 12px; color: #999; }

.mission-meta  { display: flex; flex-direction: column; gap: 2px; }
.meta-label    { font-size: 11px; color: #999; }
.meta-val      { font-size: 13px; font-weight: 500; }

.mission-progress-col { display: flex; flex-direction: column; gap: 6px; }
.progress-wrap { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.progress-bar-custom { flex: 1; height: 6px; background: #EBEBEB; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: #4CAF50; border-radius: 99px; }

.stage-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.stage-badge.sampling      { background: #FDF3E3; color: #C4A97D; }
.stage-badge.in-production { background: #E6F4EA; color: #2E7D32; }
.stage-badge.quality-check { background: #E8F0FE; color: #1A56DB; }

/* Suppliers */
.suppliers-list { display: flex; flex-direction: column; gap: 16px; }
.supplier-item  { display: flex; align-items: center; gap: 12px; }
.logo-sq {
    width: 44px;
    height: 44px;
    border-radius: 50px;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.supplier-info         { display: flex; flex-direction: column; gap: 1px; }
.supplier-info strong  { font-size: 13px; font-weight: 600; }
.supplier-info span    { font-size: 11px; color: #888; }
.stars                 { font-size: 12px; color: #F59E0B; margin-top: 2px; }
.stars small           { color: #888; font-size: 11px; }

/* Explore */
.explore-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.explore-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.explore-card {
  background: #fff; border: 1px solid #EBEBEB;
  border-radius: 16px; padding: 28px 20px;
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  gap: 10px; cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
}
.explore-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); transform: translateY(-2px); }
.explore-icon {
  width: 60px; height: 60px; background: #FDF3E3;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 24px; color: #C4A97D; margin-bottom: 4px;
}
.explore-card strong { font-size: 14px; font-weight: 700; }
.explore-card span   { font-size: 12px; color: #888; }

/* ═══════════════════════════════════════════════════════════
   FOOTER — inside dashboard-main, scrolls naturally
═══════════════════════════════════════════════════════════ */
.footer-section {
  background: #111;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid #2A2A2A;
  flex-shrink: 0;
}
.footer-section p { color: #fff; font-size: 14px; margin: 0; }

/* ═══════════════════════════════════════════════════════════
   MOBILE OVERLAY
═══════════════════════════════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
}
.sidebar-overlay.active { display: block; }

.dashboard-activities{
  width: 52px;
  height: 52px;
}
.logo-sq-img{
  width: 44px;
  height: 44px;
}
.user_icon_dashboard{
  width: 30px;
  height: 30px;
}
.sidebar-logo img {
    max-width: 170px;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */

@media (max-width: 1199px) {
  .stats-grid  { grid-template-columns: repeat(2, 1fr); }
  .bottom-grid { grid-template-columns: 1fr; }
}

@media (max-width: 991px) {
  /* Sidebar becomes off-canvas */
  .sidebar {
    position: fixed;
    left: -300px;
    top: 72px;
    width: 260px !important;
    min-width: 260px !important;
    height: calc(100vh - 72px);
    transition: left 0.3s ease;
    z-index: 1001;
    box-shadow: none;
  }
  .sidebar.mobile-active {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  }
  /* Always show full labels in mobile open state */
  .sidebar.mobile-active .sidebar-menu { padding: 16px 14px; }
  .sidebar.mobile-active .sidebar-menu li a {
    justify-content: flex-start; padding: 0 16px; width: auto; margin: 0;
  }
  .sidebar.mobile-active .sidebar-menu li a span,
  .sidebar.mobile-active .badge-pill { display: flex; }
  .sidebar.mobile-active .sidebar-bottom { padding: 16px 14px; }
  .sidebar.mobile-active .logout-btn { width: 100%; margin: 0; gap: 10px; }
  .sidebar.mobile-active .logout-btn span { display: block; }

  .dashboard-header { height: 64px; padding: 0 20px; }
  .sidebar { top: 64px; height: calc(100vh - 64px); }

  .dashboard-search { max-width: 260px; }
  .dashboard-content { padding: 20px; }
  .stats-grid  { grid-template-columns: repeat(2, 1fr); }
  .explore-grid { grid-template-columns: repeat(2, 1fr); }
  .mission-meta, .mission-progress-col { grid-column: 1 / -1; }
}
.arrow-profile{font-size: 12px;}

@media (max-width: 767px) {
  .bottom-grid { grid-template-columns: 1fr; }
  .banner-illustration { display: none; }
  .banner-card { padding: 24px; }
}

@media (max-width: 575px) {
  .dashboard-header { height: 60px; padding: 0 16px; gap: 10px; }
  .sidebar { top: 60px; height: calc(100vh - 60px); }
  .logo-full { width: 110px; }
  .dashboard-search { max-width: 160px; height: 40px; display: none; }
  .stats-grid { gap: 12px; }
  .stat-card  { padding: 16px; gap: 12px; }
  .stat-value { font-size: 20px; }
  .missions-card, .suppliers-card { padding: 16px; }
  .img-placeholder { width: 40px; height: 40px; font-size: 14px; }
  .explore-grid { gap: 10px; }
  .explore-card { padding: 20px 14px; }
  .explore-icon { width: 48px; height: 48px; font-size: 20px; }
  .dashboard-content { padding: 16px; gap: 16px; }
  .welcome-block h1 { font-size: 18px; }
  .dashboard-user span, .dashboard-user > i { display: none; }
  .sidebar-logo img {max-width: 120px;}
  button#sidebarToggle {margin-left: 0;}
  .dashboard-header-right {gap: 5px;}
}

@media (max-width: 400px) {
  .dashboard-search { display: none; }
 
}