/* ============================================================
   DHIVEWORK – Main Stylesheet
   Design tokens extracted from original HTML
============================================================ */

/* Google Fonts are loaded in header.php */

:root {
  /* ===== ORANGE & BLUE THEME =====
     Blue stays the primary brand color; the former "green" accent
     slots are remapped to ORANGE so the whole UI reads orange+blue.
     Admin can override --blue-mid / --green-light live from Settings. */
  --blue-dark:   #0A2540;
  --blue-mid:    #1A56DB;   /* primary blue */
  --blue-light:  #3B82F6;
  --blue-pale:   #EFF6FF;
  --green-dark:  #C2410C;   /* orange-dark  (accent) */
  --green-mid:   #EA580C;   /* orange-mid   (accent) */
  --green-light: #F97316;   /* orange       (accent) */
  --green-pale:  #FFF7ED;   /* orange-pale  (accent) */
  --white:       #FFFFFF;
  --gray-50:     #F9FAFB;
  --gray-100:    #F3F4F6;
  --gray-200:    #E5E7EB;
  --gray-400:    #9CA3AF;
  --gray-600:    #4B5563;
  --gray-800:    #1F2937;
  --shadow-sm:   0 1px 3px rgba(10,37,64,.08), 0 1px 2px rgba(10,37,64,.06);
  --shadow-md:   0 4px 16px rgba(10,37,64,.1),  0 2px 6px rgba(10,37,64,.06);
  --shadow-lg:   0 12px 40px rgba(10,37,64,.14), 0 4px 12px rgba(10,37,64,.08);
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   22px;
  --radius-xl:   32px;
  --transition:  all .25s cubic-bezier(.4,0,.2,1);
  --font-display:'Clash Display', sans-serif;
  --font-body:   'DM Sans', sans-serif;
}

/* ============================================================ RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--gray-800);
  background: var(--white);
  overflow-x: hidden;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a  { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font-body); border: none; outline: none; }
input, select, textarea { font-family: var(--font-body); }

/* ============================================================ UTILITIES */
.container  { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section    { padding: 96px 0; }
.section-sm { padding: 64px 0; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 50px; font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.badge-blue  { background: var(--blue-pale);  color: var(--blue-mid); }
.badge-green { background: var(--green-pale); color: var(--green-dark); }
.badge-orange{ background: #FFF7ED; color: #C2410C; }
.badge-red   { background: #FEF2F2; color: #DC2626; }

.section-label { display: block; font-family: var(--font-display); font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-mid); margin-bottom: 12px; }
.section-title { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; line-height: 1.18; color: var(--blue-dark); margin-bottom: 16px; }
.section-sub  { font-size: 1.05rem; color: var(--gray-600); max-width: 540px; line-height: 1.7; }

/* ============================================================ BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 26px; border-radius: var(--radius-md); font-weight: 600; font-size: .95rem; transition: var(--transition); cursor: pointer; border: none; }
.btn-primary { background: var(--blue-mid); color: var(--white); box-shadow: 0 4px 14px rgba(26,86,219,.35); }
.btn-primary:hover { background: #1348b5; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(26,86,219,.42); }
.btn-green   { background: var(--green-light); color: var(--white); box-shadow: 0 4px 14px rgba(16,185,129,.35); }
.btn-green:hover  { background: #059669; transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--blue-mid); border: 2px solid var(--blue-mid); }
.btn-outline:hover { background: var(--blue-pale); transform: translateY(-2px); }
.btn-white   { background: var(--white); color: var(--blue-dark); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.btn-white:hover { background: var(--gray-50); transform: translateY(-2px); }
.btn-ghost   { background: var(--gray-100); color: var(--gray-600); font-size: .78rem; font-weight: 500; padding: 6px 14px; }
.btn-ghost:hover { background: var(--gray-200); }
.btn-sm  { padding: 8px 16px; font-size: .85rem; }
.btn-lg  { padding: 16px 32px; font-size: 1.05rem; }
.btn-full{ width: 100%; justify-content: center; }
.btn-danger { background: #DC2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

/* ============================================================ FORMS */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-weight: 600; font-size: .88rem; color: var(--gray-800); margin-bottom: 6px; }
.form-control { width: 100%; padding: 12px 16px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm); font-size: .95rem; color: var(--gray-800); background: var(--white); transition: var(--transition); }
.form-control:focus { outline: none; border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
.form-control::placeholder { color: var(--gray-400); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234B5563'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 40px; }
.form-hint { font-size: .8rem; color: var(--gray-400); margin-top: 4px; }
.form-error { font-size: .8rem; color: #DC2626; margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
textarea.form-control { resize: vertical; min-height: 120px; }

/* ============================================================ ALERTS */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); font-size: .92rem; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: var(--green-pale); color: var(--green-dark); border: 1px solid #FED7AA; }
.alert-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info    { background: var(--blue-pale); color: #1E40AF; border: 1px solid #BFDBFE; }
.alert-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }

/* ============================================================ NAVBAR */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229,231,235,.6);
  transition: var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow-md); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--blue-dark); }
.nav-logo-icon { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--blue-mid) 0%, var(--green-light) 100%); display: flex; align-items: center; justify-content: center; color: white; font-size: 1.1rem; }
.nav-logo span { color: var(--green-light); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 500; font-size: .92rem; color: var(--gray-600); transition: var(--transition); }
.nav-links a:hover, .nav-links a.active { background: var(--blue-pale); color: var(--blue-mid); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-actions .btn { padding: 9px 20px; font-size: .88rem; }
.nav-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--blue-pale); cursor: pointer; }
.nav-dropdown { position: relative; }
.nav-dropdown-menu { position: absolute; right: 0; top: 50px; background: white; border: 1px solid var(--gray-200); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); min-width: 200px; padding: 8px; display: none; z-index: 999; }
.nav-dropdown-menu.open { display: block; }
.nav-dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: .9rem; color: var(--gray-700); transition: var(--transition); }
.nav-dropdown-menu a:hover { background: var(--gray-50); color: var(--blue-mid); }
.nav-dropdown-menu hr { border: none; border-top: 1px solid var(--gray-200); margin: 6px 0; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; }
.nav-mobile-cta { display: none; align-items: center; gap: 7px; background: var(--blue-mid); color: #fff; font-weight: 700; font-size: .85rem; padding: 8px 16px; border-radius: 30px; white-space: nowrap; }
.nav-mobile-cta:hover { background: var(--blue-dark); color: #fff; }
.nav-mobile-cta i { font-size: .9rem; }
.hamburger span { width: 22px; height: 2px; background: var(--blue-dark); border-radius: 2px; transition: var(--transition); }
.mobile-menu { display: none; background: white; border-bottom: 1px solid var(--gray-200); padding: 16px 24px 24px; box-shadow: var(--shadow-lg); }
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 500; color: var(--gray-600); transition: var(--transition); }
.mobile-menu a:hover { background: var(--blue-pale); color: var(--blue-mid); }
.mobile-menu .mobile-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; border-top: 1px solid var(--gray-200); padding-top: 12px; }
.badge-count { background: #DC2626; color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: .65rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* ============================================================ HERO */
.hero {
  padding: 140px 0 100px;
  background: linear-gradient(135deg, var(--blue-dark) 0%, #0e3569 60%, #0d4d3b 100%);
  position: relative; overflow: hidden;
}
.hero::before { content: ''; position: absolute; width: 600px; height: 600px; border-radius: 50%; background: rgba(59,130,246,.08); top: -200px; right: -100px; }
.hero::after  { content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%; background: rgba(16,185,129,.06); bottom: -150px; left: -100px; }
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; background: rgba(16,185,129,.15); border: 1px solid rgba(16,185,129,.3); color: var(--green-light); padding: 6px 14px; border-radius: 50px; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 24px; }
.hero-title { font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 700; color: var(--white); line-height: 1.12; margin-bottom: 20px; }
.hero-title .accent { color: var(--green-light); }
.hero-sub { font-size: 1.1rem; color: rgba(255,255,255,.75); line-height: 1.7; margin-bottom: 36px; max-width: 480px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 48px; }
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-stat { }
.hero-stat strong { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--white); display: block; }
.hero-stat span { font-size: .82rem; color: rgba(255,255,255,.6); }
.hero-card { background: rgba(255,255,255,.08); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius-xl); padding: 32px; }
.hero-search-card { background: white; border-radius: var(--radius-xl); padding: 28px; box-shadow: var(--shadow-lg); }
.hero-search-card h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--blue-dark); margin-bottom: 20px; }
.hero-search-grid { display: flex; flex-direction: column; gap: 12px; }

/* ============================================================ SEARCH BAR */
.search-bar { background: var(--white); border: 1.5px solid var(--gray-200); border-radius: var(--radius-lg); padding: 8px; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-sm); }
.search-bar input { flex: 1; border: none; outline: none; padding: 8px 12px; font-size: .95rem; color: var(--gray-800); }
.search-bar select { border: none; outline: none; padding: 8px 12px; font-size: .88rem; color: var(--gray-600); background: var(--gray-50); border-radius: var(--radius-sm); }

/* ============================================================ CARDS */
.card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); transition: var(--transition); overflow: hidden; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card-body { padding: 24px; }
.card-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-100); }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); background: var(--gray-50); }

/* Worker Card */
.worker-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); transition: var(--transition); overflow: hidden; }
.worker-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.worker-card-header { padding: 24px 24px 16px; display: flex; align-items: flex-start; gap: 14px; }
.worker-avatar-wrap { position: relative; flex-shrink: 0; }
.worker-avatar { width: 64px; height: 64px; border-radius: var(--radius-md); object-fit: cover; }
.worker-online { position: absolute; bottom: 2px; right: 2px; width: 12px; height: 12px; background: var(--green-light); border-radius: 50%; border: 2px solid white; }
.worker-info h4 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--blue-dark); margin-bottom: 2px; }
.worker-info .title { font-size: .85rem; color: var(--gray-600); margin-bottom: 6px; }
.worker-info .location { font-size: .8rem; color: var(--gray-400); display: flex; align-items: center; gap: 4px; }
.worker-card-body { padding: 0 24px 16px; }
.worker-skills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.worker-skill-tag { background: var(--blue-pale); color: var(--blue-mid); padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 500; }
.worker-card-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); display: flex; justify-content: space-between; align-items: center; }
.worker-rate { font-family: var(--font-display); font-weight: 700; color: var(--blue-dark); font-size: 1rem; }
.worker-rate span { font-size: .75rem; color: var(--gray-400); font-family: var(--font-body); font-weight: 400; }
.stars { color: #FBBF24; font-size: .85rem; }

/* Job Card */
.job-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); padding: 24px; transition: var(--transition); }
.job-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.job-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.job-card-top h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--blue-dark); }
.job-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; font-size: .82rem; color: var(--gray-600); }
.job-meta span { display: flex; align-items: center; gap: 4px; }
.job-budget { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--green-mid); }

/* Category Card */
.cat-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); padding: 28px 24px; text-align: center; transition: var(--transition); cursor: pointer; display: block; }
.cat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); border-color: var(--blue-pale); }
.cat-icon { width: 56px; height: 56px; border-radius: var(--radius-md); background: var(--blue-pale); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 1.4rem; color: var(--blue-mid); transition: var(--transition); }
.cat-card:hover .cat-icon { background: var(--blue-mid); color: white; }
.cat-card h4 { font-family: var(--font-display); font-weight: 600; font-size: .95rem; color: var(--blue-dark); margin-bottom: 4px; }
.cat-card p  { font-size: .8rem; color: var(--gray-400); }

/* ============================================================ GRID LAYOUTS */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }

/* ============================================================ SECTION HEADER */
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 48px; }
.section-header-text { }

/* ============================================================ FILTER BAR */
.filter-bar { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); padding: 20px 24px; margin-bottom: 28px; }
.filter-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
.filter-bar-title { font-weight: 700; font-size: .95rem; color: var(--blue-dark); margin-bottom: 16px; }

/* ============================================================ PAGINATION */
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 40px; flex-wrap: wrap; }
.page-btn { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .88rem; cursor: pointer; transition: var(--transition); border: 1.5px solid var(--gray-200); color: var(--gray-600); background: white; }
.page-btn:hover { border-color: var(--blue-mid); color: var(--blue-mid); }
.page-btn.active { background: var(--blue-mid); color: white; border-color: var(--blue-mid); }

/* ============================================================ FOOTER */
.footer { background: var(--blue-dark); color: rgba(255,255,255,.75); padding: 72px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand .nav-logo { color: white; margin-bottom: 16px; }
.footer-brand p { font-size: .9rem; line-height: 1.7; max-width: 280px; }
.footer-socials { display: flex; gap: 10px; margin-top: 20px; }
.footer-social { width: 38px; height: 38px; border-radius: var(--radius-sm); background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.7); transition: var(--transition); }
.footer-social:hover { background: var(--blue-mid); color: white; }
.footer-col h5 { font-family: var(--font-display); font-size: .85rem; font-weight: 700; color: white; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul a { font-size: .88rem; color: rgba(255,255,255,.65); transition: var(--transition); }
.footer-col ul a:hover { color: var(--green-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 24px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-bottom p { font-size: .82rem; }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { font-size: .82rem; color: rgba(255,255,255,.55); }
.footer-bottom-links a:hover { color: white; }

/* ============================================================ DASHBOARD LAYOUT */
.dash-wrap { display: flex; min-height: 100vh; padding-top: 70px; }
.sidebar { width: 260px; background: var(--blue-dark); flex-shrink: 0; position: fixed; top: 70px; left: 0; bottom: 0; overflow-y: auto; z-index: 100; transition: var(--transition); }
.sidebar-inner { padding: 24px 16px; }
.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 16px; background: rgba(255,255,255,.06); border-radius: var(--radius-md); margin-bottom: 24px; }
.sidebar-user img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.sidebar-user-info h4 { font-size: .9rem; font-weight: 600; color: white; }
.sidebar-user-info span { font-size: .75rem; color: rgba(255,255,255,.5); }
.sidebar-menu-title { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.3); padding: 0 12px; margin: 16px 0 8px; }
.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm); color: rgba(255,255,255,.65); font-size: .9rem; font-weight: 500; transition: var(--transition); margin-bottom: 2px; }
.sidebar-link:hover, .sidebar-link.active { background: rgba(255,255,255,.1); color: white; }
.sidebar-link.active { background: var(--blue-mid); color: white; }
.sidebar-link i { width: 18px; text-align: center; font-size: .9rem; }
.sidebar-badge { margin-left: auto; background: #DC2626; color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: .65rem; display: flex; align-items: center; justify-content: center; }
.dash-content { flex: 1; margin-left: 260px; padding: 32px; min-width: 0; }
.dash-header { margin-bottom: 28px; }
.dash-header h1 { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--blue-dark); }
.dash-header p { color: var(--gray-600); font-size: .95rem; }

/* Stat Cards */
.stat-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; margin-bottom: 28px; }
.stat-card { background: white; border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); }
.stat-card-icon { width: 48px; height: 48px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 16px; }
.stat-card-icon.blue  { background: var(--blue-pale); color: var(--blue-mid); }
.stat-card-icon.green { background: var(--green-pale); color: var(--green-mid); }
.stat-card-icon.orange{ background: #FFF7ED; color: #EA580C; }
.stat-card-icon.purple{ background: #F5F3FF; color: #7C3AED; }
.stat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--blue-dark); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: .82rem; color: var(--gray-400); }
.stat-change { font-size: .78rem; margin-top: 6px; font-weight: 500; }
.stat-change.up { color: var(--green-mid); }
.stat-change.down { color: #DC2626; }

/* Sidebar toggle for mobile */
.sidebar-toggle { display: none; position: fixed; bottom: 24px; right: 24px; z-index: 200; width: 52px; height: 52px; border-radius: 50%; background: var(--blue-mid); color: white; box-shadow: var(--shadow-lg); font-size: 1.2rem; align-items: center; justify-content: center; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }

/* ============================================================ PROFILE PAGE */
.profile-hero { background: linear-gradient(135deg, var(--blue-dark) 0%, #0e3569 100%); padding: 40px 0; }
.profile-hero-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.profile-hero-avatar { width: 100px; height: 100px; border-radius: var(--radius-lg); object-fit: cover; border: 4px solid rgba(255,255,255,.2); }
.profile-hero-name { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; color: white; }
.profile-hero-title { color: rgba(255,255,255,.75); font-size: 1rem; }
.profile-hero-meta { display: flex; gap: 20px; margin-top: 8px; flex-wrap: wrap; }
.profile-hero-meta span { font-size: .85rem; color: rgba(255,255,255,.6); display: flex; align-items: center; gap: 6px; }
.profile-body { padding: 40px 0; }
.profile-grid { display: grid; grid-template-columns: 1fr 320px; gap: 28px; }

/* ============================================================ MESSAGES */
.msg-layout { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - 140px); background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); overflow: hidden; }
.msg-list { border-right: 1px solid var(--gray-200); overflow-y: auto; }
.msg-list-header { padding: 20px; border-bottom: 1px solid var(--gray-200); font-family: var(--font-display); font-weight: 700; color: var(--blue-dark); }
.msg-conv-item { padding: 16px 20px; cursor: pointer; transition: var(--transition); border-bottom: 1px solid var(--gray-100); display: flex; gap: 12px; align-items: flex-start; }
.msg-conv-item:hover { background: var(--gray-50); }
.msg-conv-item.active { background: var(--blue-pale); }
.msg-conv-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.msg-conv-name { font-weight: 600; font-size: .9rem; color: var(--blue-dark); }
.msg-conv-preview { font-size: .8rem; color: var(--gray-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.msg-conv-time { font-size: .75rem; color: var(--gray-400); margin-left: auto; flex-shrink: 0; }
.msg-chat { display: flex; flex-direction: column; }
.msg-chat-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; gap: 12px; }
.msg-chat-body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg-bubble-wrap { display: flex; gap: 8px; align-items: flex-end; }
.msg-bubble-wrap.own { flex-direction: row-reverse; }
.msg-bubble { max-width: 70%; padding: 10px 14px; border-radius: 16px; font-size: .9rem; line-height: 1.5; }
.msg-bubble.other { background: var(--gray-100); color: var(--gray-800); border-bottom-left-radius: 4px; }
.msg-bubble.own   { background: var(--blue-mid); color: white; border-bottom-right-radius: 4px; }
.msg-time { font-size: .72rem; color: var(--gray-400); margin-top: 2px; }
.msg-input-bar { padding: 16px 20px; border-top: 1px solid var(--gray-200); display: flex; gap: 10px; }
.msg-input-bar input { flex: 1; padding: 10px 16px; border: 1.5px solid var(--gray-200); border-radius: 30px; font-size: .9rem; outline: none; transition: var(--transition); }
.msg-input-bar input:focus { border-color: var(--blue-mid); }

/* ============================================================ ADMIN PANEL */
.admin-sidebar { background: var(--gray-800); }
.admin-sidebar .sidebar-link.active { background: var(--blue-mid); }
.admin-sidebar .sidebar-menu-title { color: rgba(255,255,255,.3); }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { background: var(--gray-50); color: var(--gray-600); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.admin-table td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); font-size: .9rem; vertical-align: middle; }
.admin-table tr:hover td { background: var(--gray-50); }
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--gray-200); }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.status-active   { background: var(--green-pale); color: var(--green-dark); }
.status-pending  { background: #FFFBEB; color: #92400E; }
.status-suspended{ background: #FEF2F2; color: #991B1B; }
.status-open     { background: var(--blue-pale); color: var(--blue-mid); }
.status-closed   { background: var(--gray-100); color: var(--gray-600); }

/* ============================================================ TESTIMONIAL */
.testimonial-card { background: white; border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-100); }
.testimonial-text { font-size: .97rem; color: var(--gray-600); line-height: 1.7; margin-bottom: 20px; font-style: italic; }
.testimonial-text::before { content: '"'; font-size: 2rem; color: var(--blue-mid); line-height: 0; vertical-align: -12px; margin-right: 4px; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-author img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.testimonial-author-name { font-weight: 600; font-size: .9rem; color: var(--blue-dark); }
.testimonial-author-role { font-size: .8rem; color: var(--gray-400); }

/* ============================================================ HOW IT WORKS */
.step-card { text-align: center; padding: 32px 24px; }
.step-number { width: 52px; height: 52px; border-radius: var(--radius-md); background: var(--blue-pale); color: var(--blue-mid); font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.step-card h4 { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--blue-dark); margin-bottom: 10px; }
.step-card p  { font-size: .9rem; color: var(--gray-600); line-height: 1.6; }

/* ============================================================ MODALS */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 2000; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: white; border-radius: var(--radius-xl); max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { padding: 24px 28px 0; display: flex; justify-content: space-between; align-items: center; }
.modal-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--blue-dark); }
.modal-close { width: 32px; height: 32px; border-radius: 50%; background: var(--gray-100); color: var(--gray-600); display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; font-size: 1rem; transition: var(--transition); }
.modal-close:hover { background: var(--gray-200); }
.modal-body { padding: 24px 28px 28px; }

/* ============================================================ EMPTY STATES */
.empty-state { text-align: center; padding: 64px 24px; }
.empty-state i { font-size: 3rem; color: var(--gray-200); margin-bottom: 20px; }
.empty-state h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--blue-dark); margin-bottom: 8px; }
.empty-state p { color: var(--gray-400); font-size: .9rem; }

/* ============================================================ BREADCRUMB */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--gray-400); margin-bottom: 24px; flex-wrap: wrap; }
.breadcrumb a { color: var(--blue-mid); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb i { font-size: .7rem; }

/* ============================================================ TABS */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--gray-200); margin-bottom: 28px; overflow-x: auto; }
.tab-btn { padding: 10px 20px; font-weight: 600; font-size: .9rem; color: var(--gray-600); border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer; white-space: nowrap; background: none; border: none; border-bottom: 2px solid transparent; transition: var(--transition); }
.tab-btn.active { color: var(--blue-mid); border-bottom-color: var(--blue-mid); }
.tab-btn:hover { color: var(--blue-mid); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================ CHIPS */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; background: var(--gray-100); border-radius: 20px; font-size: .8rem; color: var(--gray-600); font-weight: 500; }
.chip-remove { cursor: pointer; color: var(--gray-400); font-size: .7rem; }
.chip-remove:hover { color: #DC2626; }

/* ============================================================ LOADER */
.spinner { width: 24px; height: 24px; border: 3px solid var(--gray-200); border-top-color: var(--blue-mid); border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,.8); z-index: 9999; display: none; align-items: center; justify-content: center; }
.loading-overlay.active { display: flex; }

/* ============================================================ RESPONSIVE */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-card { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-hero-inner { grid-template-columns: auto 1fr; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-actions > *:not(.nav-mobile-cta):not(.hamburger) { display: none; }
  .hamburger { display: flex; }
  .nav-mobile-cta { display: inline-flex; }
  .hero { padding: 110px 0 60px; }
  .hero-title { font-size: 2rem; }
  .hero-actions { flex-direction: column; }
  .section { padding: 64px 0; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .form-row { grid-template-columns: 1fr; }
  .msg-layout { grid-template-columns: 1fr; }
  .msg-list { display: none; }
  .msg-list.open { display: block; border-right: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .grid-4 { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-num { font-size: 1.5rem; }
  .hero-stats { gap: 20px; }
  .btn-lg { padding: 13px 22px; font-size: .95rem; }
  .filter-grid { grid-template-columns: 1fr; }
  .admin-table { font-size: .82rem; }
  .admin-table th, .admin-table td { padding: 10px 12px; }
}

@media (max-width: 320px) {
  .hero-title { font-size: 1.7rem; }
  .stat-cards { grid-template-columns: 1fr; }
}

/* ============================================================ WALLET / ESCROW BADGES */
.escrow-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-pale); color: var(--green-dark);
  padding: 4px 12px; border-radius: 20px; font-size: .78rem; font-weight: 600;
  border: 1px solid #FED7AA;
}
.wallet-card {
  background: linear-gradient(135deg, var(--blue-dark) 0%, #7c2d12 100%);
  border-radius: var(--radius-xl); padding: 28px 32px; color: white;
  position: relative; overflow: hidden;
}
.wallet-card::before {
  content: ''; position: absolute; width: 200px; height: 200px;
  border-radius: 50%; background: rgba(255,255,255,.04);
  top: -60px; right: -60px;
}
.wallet-balance-label { font-size: .8rem; color: rgba(255,255,255,.55); margin-bottom: 4px; }
.wallet-balance-amount { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; }

/* ============================================================ KYC STATUS */
.kyc-none      { color: var(--gray-400); }
.kyc-pending   { color: #D97706; }
.kyc-approved  { color: var(--green-mid); }
.kyc-rejected  { color: #DC2626; }

/* ============================================================ GIG IMAGE GALLERY */
.gig-gallery-thumb {
  width: 80px; height: 60px; object-fit: cover;
  border-radius: var(--radius-sm); cursor: pointer;
  border: 2px solid transparent; transition: var(--transition);
}
.gig-gallery-thumb:hover,
.gig-gallery-thumb.active { border-color: var(--blue-mid); }

/* ============================================================ JOB STATUS TIMELINE */
.job-timeline { display: flex; gap: 0; margin: 20px 0; overflow-x: auto; }
.job-timeline-step {
  flex: 1; min-width: 80px; text-align: center; position: relative; padding: 0 8px;
}
.job-timeline-step::before {
  content: ''; position: absolute; top: 16px; left: 50%; right: -50%;
  height: 2px; background: var(--gray-200); z-index: 0;
}
.job-timeline-step:last-child::before { display: none; }
.job-timeline-dot {
  width: 32px; height: 32px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; position: relative; z-index: 1;
  border: 2px solid var(--gray-200); background: white; color: var(--gray-400);
}
.job-timeline-step.done .job-timeline-dot  { background: var(--green-mid); border-color: var(--green-mid); color: white; }
.job-timeline-step.active .job-timeline-dot{ background: var(--blue-mid); border-color: var(--blue-mid); color: white; }
.job-timeline-step.done::before            { background: var(--green-mid); }
.job-timeline-label { font-size: .72rem; color: var(--gray-400); font-weight: 500; }
.job-timeline-step.done .job-timeline-label   { color: var(--green-mid); font-weight: 600; }
.job-timeline-step.active .job-timeline-label { color: var(--blue-mid); font-weight: 600; }

/* ============================================================ DELIVERY PROOF GRID */
.proof-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.proof-img {
  width: 110px; height: 80px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--gray-200);
  cursor: zoom-in; transition: var(--transition);
}
.proof-img:hover { transform: scale(1.03); box-shadow: var(--shadow-md); }

/* ============================================================ NOTIFICATION ITEM */
.notif-item { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--gray-100); transition: var(--transition); }
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: var(--blue-pale); }
.notif-item.unread:hover { background: #dbeafe; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-mid); flex-shrink: 0; margin-top: 6px; }

/* ============================================================ BANK ACCOUNT CARD */
.bank-card {
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-md);
  padding: 16px; cursor: pointer; transition: var(--transition);
}
.bank-card:hover, .bank-card.selected { border-color: var(--blue-mid); background: var(--blue-pale); }
.bank-name { font-weight: 700; font-size: .9rem; color: var(--blue-dark); }
.bank-number { font-size: .82rem; color: var(--gray-600); font-family: monospace; letter-spacing: .05em; }

/* ============================================================ SETTINGS TABS */
.settings-nav { display: flex; gap: 4px; border-bottom: 2px solid var(--gray-200); margin-bottom: 28px; overflow-x: auto; white-space: nowrap; }
.settings-nav a { padding: 10px 18px; font-weight: 600; font-size: .88rem; color: var(--gray-600); border-bottom: 2px solid transparent; margin-bottom: -2px; display: inline-flex; align-items: center; gap: 7px; transition: var(--transition); }
.settings-nav a:hover  { color: var(--blue-mid); }
.settings-nav a.active { color: var(--blue-mid); border-bottom-color: var(--blue-mid); }

/* ============================================================ TRANSACTION TYPES */
.txn-credit  { color: var(--green-mid); font-weight: 700; }
.txn-debit   { color: #DC2626; font-weight: 700; }
.txn-escrow  { color: #D97706; font-weight: 700; }
.txn-icon    { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .82rem; flex-shrink: 0; }
.txn-icon.credit  { background: var(--green-pale); color: var(--green-mid); }
.txn-icon.debit   { background: #FEF2F2; color: #DC2626; }
.txn-icon.escrow  { background: #FFF7ED; color: #D97706; }

/* ============================================================ MOBILE RESPONSIVE ADDITIONS */
@media (max-width: 768px) {
  .wallet-card { padding: 20px; }
  .wallet-balance-amount { font-size: 1.8rem; }
  .job-timeline { gap: 0; }
  .job-timeline-step { min-width: 64px; }
  .proof-img { width: 90px; height: 68px; }
  .gig-gallery-thumb { width: 64px; height: 50px; }
  .settings-nav { flex-wrap: nowrap; overflow-x: auto; }
}

@media (max-width: 480px) {
  .wallet-balance-amount { font-size: 1.5rem; }
  .bank-card { padding: 12px; }
}

/* ============================================================
   V3 ADDITIONS — Preloader, Toasts, Particles, Badges
============================================================ */

/* ---- Preloader ---- */
#dw-preloader{position:fixed;inset:0;z-index:99999;background:var(--blue-dark);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;
  transition:opacity .5s ease,visibility .5s ease;
  animation:dwPreloaderFailsafe 0s linear 4s forwards}
#dw-preloader.hide{opacity:0;visibility:hidden}
/* Pure-CSS failsafe: if JS never hides it, fade out after 4s so content is reachable */
@keyframes dwPreloaderFailsafe{to{opacity:0;visibility:hidden;pointer-events:none}}
#dw-preloader .pl-logo{font-family:var(--font-display);font-weight:700;font-size:2rem;color:#fff;letter-spacing:.5px}
#dw-preloader .pl-logo span{color:var(--green-light)}
#dw-preloader .pl-bar{width:160px;height:5px;border-radius:99px;background:rgba(255,255,255,.18);overflow:hidden}
#dw-preloader .pl-bar i{display:block;height:100%;width:40%;border-radius:99px;
  background:var(--green-light);animation:plslide 1s infinite ease-in-out}
@keyframes plslide{0%{margin-left:-40%}100%{margin-left:100%}}

/* ---- Toast popups ---- */
#toast-root{position:fixed;top:16px;right:16px;left:16px;z-index:100000;display:flex;
  flex-direction:column;gap:10px;align-items:flex-end;pointer-events:none}
.toast{pointer-events:auto;max-width:380px;width:100%;background:#fff;border-left:5px solid var(--gray-400);
  border-radius:12px;box-shadow:var(--shadow-lg);padding:13px 16px;font-size:.9rem;font-weight:500;
  display:flex;gap:10px;align-items:flex-start;animation:toastin .3s ease}
.toast.success{border-left-color:var(--green-light)}
.toast.error,.toast.danger{border-left-color:#DC2626}
.toast.info{border-left-color:var(--blue-mid)}
.toast.warning{border-left-color:#F59E0B}
.toast .t-ico{font-size:1.05rem;margin-top:1px}
.toast.success .t-ico{color:var(--green-light)}
.toast.error .t-ico,.toast.danger .t-ico{color:#DC2626}
.toast.info .t-ico{color:var(--blue-mid)}
.toast .t-tx{flex:1;color:var(--gray-800)}
.toast .t-cl{cursor:pointer;color:var(--gray-400);font-weight:700;line-height:1}
@keyframes toastin{from{transform:translateX(20px);opacity:0}to{transform:translateX(0);opacity:1}}
@media (max-width:480px){#toast-root{align-items:stretch}.toast{max-width:100%}}

/* ---- Hero particles canvas ---- */
#hero-particles{position:absolute;inset:0;z-index:0;pointer-events:none}
.hero{position:relative}
.hero .container,.hero-inner{position:relative;z-index:2}

/* ---- Badge pills ---- */
.badge-pill{display:inline-flex;align-items:center;gap:5px;font-size:.72rem;font-weight:700;
  padding:3px 10px;border-radius:30px;margin:2px}

/* ---- Extra small-screen hardening ---- */
@media (max-width:768px){
  table{max-width:100%}
  .table-wrap{-webkit-overflow-scrolling:touch}
  .btn{white-space:normal}
}
@media (max-width:480px){
  .btn-full-sm{width:100%}
  h1,h2,h3{overflow-wrap:break-word;word-break:break-word}
}

/* ============================================================
   MOBILE DASHBOARD REDESIGN  (top bar + drawer + bottom tabs)
   Desktop is unchanged; everything here is hidden >900px.
   ============================================================ */
.dash-topbar { display: none; }
.bottom-nav { display: none; }
.sidebar-close { display: none; }

@media (max-width: 900px) {
  /* Hide the marketing navbar inside the dashboard on mobile */
  body.has-dash .navbar { display: none; }

  /* --- Top bar --- */
  .dash-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; height: 60px; z-index: 130;
    background: #fff; border-bottom: 1px solid var(--gray-200);
    padding: 0 14px; gap: 10px;
  }
  .dash-topbar-burger {
    width: 42px; height: 42px; border: none; background: var(--blue-pale);
    color: var(--blue-mid); border-radius: var(--radius-md); font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  }
  .dash-topbar-logo {
    font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
    color: var(--blue-dark); letter-spacing: -.5px;
  }
  .dash-topbar-logo span { color: var(--green-light); }
  .dash-topbar-actions { display: flex; align-items: center; gap: 12px; }
  .dash-topbar-ic { position: relative; color: var(--gray-600); font-size: 1.2rem; padding: 4px; }
  .dash-dot { position: absolute; top: 2px; right: 2px; width: 9px; height: 9px; border-radius: 50%; background: #DC2626; border: 2px solid #fff; }
  .dash-topbar-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; cursor: pointer; border: 2px solid var(--gray-200); }

  /* --- The dashboard layout adjusts to the fixed top bar --- */
  .dash-wrap { padding-top: 60px; }
  .dash-content { margin-left: 0; padding: 18px 14px 96px; }   /* bottom space for tab bar */

  /* --- Slide-in drawer (full nav) --- */
  .sidebar {
    top: 0; height: 100vh; width: 82%; max-width: 320px; z-index: 200;
    transform: translateX(-100%); box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { z-index: 150; }
  .sidebar-inner { padding-top: 20px; position: relative; }
  .sidebar-close {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 12px; right: 12px; width: 34px; height: 34px;
    background: rgba(255,255,255,.12); color: #fff; border: none; border-radius: 50%;
    font-size: 1rem; cursor: pointer; z-index: 2;
  }

  /* --- Kill the old floating round toggle (replaced by top bar burger) --- */
  .sidebar-toggle { display: none !important; }

  /* --- Bottom tab bar (matches reference) --- */
  .bottom-nav {
    display: flex; align-items: center; justify-content: space-around;
    position: fixed; left: 0; right: 0; bottom: 0; height: 64px; z-index: 130;
    background: #fff; border-top: 1px solid var(--gray-200);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 16px rgba(0,0,0,.06);
  }
  .bottom-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--gray-400); font-size: .68rem; font-weight: 600; padding: 8px 2px; min-width: 0;
  }
  .bottom-nav-item .bn-ic { position: relative; font-size: 1.15rem; line-height: 1; }
  .bottom-nav-item.active { color: var(--blue-mid); }
  .bn-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bn-dot { position: absolute; top: -3px; right: -6px; width: 8px; height: 8px; border-radius: 50%; background: #DC2626; border: 2px solid #fff; }
  /* Center raised Home button */
  .bottom-nav-home {
    flex-shrink: 0; width: 58px; height: 58px; margin-top: -22px; border-radius: 50%;
    background: var(--blue-mid); color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; box-shadow: 0 6px 18px rgba(26,86,219,.4); border: 4px solid #fff;
  }
  .bottom-nav-home.active { background: var(--blue-dark); }
}

/* Extra tightening for very small phones */
@media (max-width: 380px) {
  .dash-topbar-logo { font-size: 1rem; }
  .bottom-nav-item { font-size: .62rem; }
  .bottom-nav-item .bn-ic { font-size: 1.05rem; }
  .bottom-nav-home { width: 52px; height: 52px; font-size: 1.25rem; }
}

/* ============================================================
   GLOBAL MOBILE SAFETY NET
   Inline grid-template-columns styles (used across many pages)
   override stylesheet rules, so they need !important to stack.
   This also kills any horizontal overflow site-wide.
   ============================================================ */
@media (max-width: 820px) {
  /* Any element with an inline grid -> single column */
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  /* Common helper grids -> single column */
  .profile-grid,
  .grid-2, .grid-3, .grid-4,
  .form-row,
  .filter-grid { grid-template-columns: 1fr !important; }

  /* Stat cards stay 2-up for compactness */
  .stat-cards { grid-template-columns: 1fr 1fr !important; }

  /* Nothing may exceed the viewport width */
  html, body { max-width: 100%; overflow-x: hidden; }
  img, video, canvas, iframe, table { max-width: 100%; }
  .card, .panel, .container { max-width: 100%; }

  /* Wide fixed inline widths shrink to fit */
  [style*="width:320px"], [style*="width: 320px"],
  [style*="width:340px"], [style*="width: 340px"],
  [style*="width:240px"], [style*="width: 240px"],
  [style*="width:200px"], [style*="width: 200px"] { width: 100% !important; }

  /* Tables scroll instead of breaking layout */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Tame oversized headings on small screens */
  h1 { font-size: 1.5rem !important; }
  h2 { font-size: 1.3rem !important; }
}

@media (max-width: 480px) {
  /* On the smallest screens stat cards stack fully */
  .stat-cards { grid-template-columns: 1fr 1fr !important; }
  /* Reduce big inline paddings that cause overflow */
  .card-body[style*="padding:28px"], .card-body[style*="padding: 28px"] { padding: 18px !important; }
}