/* ==========================================================================
   BMA SOFTWARE PROCUREMENT INTELLIGENCE PLATFORM - TORBIDD DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700;800&display=swap');

/* ========== DESIGN TOKENS (CSS CUSTOM PROPERTIES) ========== */
:root {
  /* Brand Palette (Primary Blue) */
  --primary-900: #164566;
  --primary-800: #1b557c;
  --primary-700: #21658f;
  --primary-600: #2773a5; /* Primary Brand Color */
  --primary-50: #e7f1f7;
  --primary-30: #f4f9fc;

  /* Neutral Surface Colors */
  --gray-950: #17212b; /* Primary text */
  --gray-900: #24313d; /* Headings */
  --gray-700: #4b5965; /* Secondary text */
  --gray-500: #71808c; /* Metadata */
  --gray-400: #9aa6af; /* Disabled / subtle text */
  --gray-300: #d3d9de; /* Borders */
  --gray-200: #e5e9ec; /* Dividers */
  --gray-100: #f1f4f6; /* Secondary backgrounds */
  --gray-50: #f8fafb;  /* Page backgrounds */
  --white: #ffffff;    /* Cards / primary surfaces */

  /* Semantic Colors */
  --success: #23835b;
  --success-light: #e8f5ef;
  --warning: #b7791f;
  --warning-light: #fdf7ed;
  --error: #c44545;
  --error-light: #fdf2f2;

  /* Layout Variables */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 68px;
  --topbar-height: 64px;
  --border-radius: 10px;     /* Standard card/button border radius */
  --border-radius-sm: 8px;   /* Small elements */
  --border-radius-xs: 4px;   /* Very small tags */

  /* Transitions */
  --transition: all 0.2s ease-in-out;

  /* Gradient Background and Card Gradients */
  --bg-gradient: linear-gradient(135deg, #f3f7f9 0%, #f8fafb 50%, #e9eff2 100%);
  --card-bg-gradient: linear-gradient(180deg, #ffffff 0%, #f8fafb 100%);
  --hero-bg-gradient: linear-gradient(140deg,
    rgba(39, 115, 165, 0.22) 0%,
    rgba(75, 156, 203, 0.30) 35%,
    rgba(52, 211, 153, 0.12) 70%,
    rgba(39, 115, 165, 0.10) 100%);
  
  /* High-end Shadows */
  --shadow-sm: 0 1px 2px rgba(22, 69, 102, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(22, 69, 102, 0.08), 0 2px 4px -1px rgba(22, 69, 102, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(22, 69, 102, 0.12), 0 4px 8px -2px rgba(22, 69, 102, 0.06);

  /* Language Selector Colors */
  --lang-toggle-bg: var(--gray-200);
  --lang-btn-active-bg: var(--white);
  --lang-btn-active-color: var(--gray-900);
}

/* ========== PROFESSIONAL DARK MODE THEME ========== */
body.dark-mode {
  color-scheme: dark;
  --primary-900: #e7f1f7;
  --primary-800: #c9dfec;
  --primary-700: #9bc0d7;
  --primary-600: #4b9ccb; /* High contrast brand blue for dark theme */
  --primary-50: #172a3a;  /* Dark slate primary tint */
  --primary-30: #0f1c28;

  --gray-950: #f8fafb; /* Light primary text */
  --gray-900: #ffffff; /* White headings */
  --gray-700: #cbd5e1; /* Slate 300 secondary text */
  --gray-500: #94a3b8; /* Slate 400 metadata */
  --gray-400: #64748b; /* Slate 500 disabled */
  --gray-300: #334155; /* Slate 700 solid borders */
  --gray-200: #1e293b; /* Slate 800 dividers */
  --gray-100: #0f172a; /* Slate 900 sidebar bg */
  --gray-50: #0b0f19;  /* Deep dark slate page bg */
  --white: #1e293b;    /* Slate 800 card surfaces */

  /* Dark Mode Semantics */
  --success: #34d399;
  --success-light: #064e3b;
  --warning: #fbbf24;
  --warning-light: #78350f;
  --error: #f87171;
  --error-light: #7f1d1d;

  /* Gradient Background and Card Gradients */
  --bg-gradient: linear-gradient(135deg, #0b0f19 0%, #0f172a 60%, #162438 100%);
  --card-bg-gradient: linear-gradient(180deg, #1e293b 0%, #151e2c 100%);
  --hero-bg-gradient: linear-gradient(140deg,
    #1d3f55 0%,
    #2d5166 38%,
    #226a50 72%,
    #1d3f55 100%);

  /* High-end Shadows (Dark Mode) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 16px -3px rgba(0, 0, 0, 0.5), 0 3px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.6), 0 6px 12px -3px rgba(0, 0, 0, 0.4);

  /* Language Selector Colors (Dark Mode) */
  --lang-toggle-bg: #0f172a;
  --lang-btn-active-bg: #334155;
  --lang-btn-active-color: #ffffff;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans Thai', 'Noto Sans', 'Arial', sans-serif;
  background: var(--bg-gradient);
  color: var(--gray-950);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ========== SCROLLBAR STYLES ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--gray-50);
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

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

/* ========== SIDEBAR (CLEAN NEUTRAL THEME) ========== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--gray-100);
  color: var(--gray-950);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid var(--gray-300);
  overflow: hidden;
  overflow-y: auto;
}

/* ── Collapsed state ── */
.sidebar.sidebar-collapsed {
  width: var(--sidebar-collapsed-width);
  overflow: visible;
}

.sidebar.sidebar-collapsed .sidebar-link-label,
.sidebar.sidebar-collapsed .sidebar-brand-text,
.sidebar.sidebar-collapsed .sidebar-footer span {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.18s ease, width 0.18s ease;
}

.sidebar-link-label,
.sidebar-brand-text {
  transition: opacity 0.22s ease;
}

/* Icon-only tooltips when collapsed */
.sidebar.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 10px 0;
  position: relative;
}

.sidebar.sidebar-collapsed .sidebar-link::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-900);
  color: var(--white);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.sidebar.sidebar-collapsed .sidebar-link:hover::after {
  opacity: 1;
}

/* Toggle button */
.sidebar-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
  margin-left: auto;
}

.sidebar-toggle-btn:hover {
  background: var(--gray-200);
  color: var(--gray-900);
}

.sidebar-toggle-btn svg {
  width: 18px;
  height: 18px;
}

.sidebar-brand {
  padding: 20px 16px;
  border-bottom: 1px solid var(--gray-300);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 72px;
  flex-shrink: 0;
}

.sidebar.sidebar-collapsed .sidebar-brand {
  flex-direction: column;
  gap: 6px;
  padding: 14px 8px;
  align-items: center;
  justify-content: center;
}

.sidebar.sidebar-collapsed .sidebar-toggle-btn {
  margin-left: 0;
}

.sidebar-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--gray-900);
  cursor: pointer;
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-600);
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-brand-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
}

.sidebar-brand-sub {
  font-size: 10px;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
}

.sidebar-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gray-500);
  padding: 12px 12px 6px;
  font-weight: 700;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--border-radius);
  color: var(--gray-700);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  margin-bottom: 2px;
}

.sidebar-link:hover {
  background: var(--gray-200);
  color: var(--gray-950);
}

.sidebar-link.active {
  background: var(--primary-50);
  color: var(--primary-900);
  font-weight: 600;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--primary-600);
  border-radius: 0 2px 2px 0;
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--gray-500);
}

.sidebar-link.active svg {
  color: var(--primary-700);
}

.sidebar-badge {
  margin-left: auto;
  background: var(--primary-600);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  text-align: center;
  font-size: 11px;
  color: var(--gray-400);
  padding: 12px 20px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
}

/* ========== MAIN WORKSPACE CONTENT ========== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed-width);
}

/* ========== DEMO BANNER ========== */
.demo-banner {
  background: var(--warning);
  color: var(--white);
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  z-index: 100;
}

body.dark-mode .demo-banner {
  background: var(--warning-light);
  color: var(--white);
}

/* ========== TOP BAR ========== */
.topbar {
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(22, 69, 102, 0.03);
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
}

.topbar-breadcrumb span {
  color: var(--gray-700);
  cursor: pointer;
}

.topbar-breadcrumb span:hover {
  color: var(--primary-700);
}

.topbar-breadcrumb span.active-crumb {
  color: var(--gray-950);
  font-weight: 600;
  cursor: default;
}

.topbar-breadcrumb svg {
  width: 14px;
  height: 14px;
  color: var(--gray-400);
}

.topbar-spacer {
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--gray-300);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--gray-500);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.topbar-icon-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  color: var(--gray-900);
  box-shadow: var(--shadow-md);
}

.topbar-icon-btn svg {
  width: 18px;
  height: 18px;
}

.topbar-icon-btn .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--error);
  border-radius: 50%;
  border: 1.5px solid var(--white);
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

/* Topbar Language Selector */
.lang-toggle {
  display: flex;
  background: var(--lang-toggle-bg);
  border-radius: var(--border-radius-sm);
  padding: 3px;
  gap: 2px;
  box-shadow: var(--shadow-sm);
}

.lang-btn {
  padding: 6px 12px;
  border: none;
  border-radius: var(--border-radius-xs);
  background: transparent;
  color: var(--gray-700);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.lang-btn.active {
  background: var(--lang-btn-active-bg);
  color: var(--lang-btn-active-color);
  box-shadow: var(--shadow-sm);
}

/* ========== PAGE CONTENT ========== */
.page-content {
  padding: 28px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 14px;
  color: var(--gray-500);
  font-weight: 400;
}

/* ========== STAT CARDS (FLAT & MINIMAL) ========== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg-gradient);
  border-radius: var(--border-radius);
  padding: 18px;
  border: 1px solid var(--gray-300);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.stat-card:hover {
  border-color: var(--primary-600);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.stat-card-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-card-icon.blue { background: var(--primary-30); color: var(--primary-700); }
.stat-card-icon.teal { background: var(--gray-100); color: var(--gray-700); }
.stat-card-icon.amber { background: var(--warning-light); color: var(--warning); }
.stat-card-icon.green { background: var(--success-light); color: var(--success); }

.stat-card-icon svg {
  width: 18px;
  height: 18px;
}

.stat-card-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-950);
  line-height: 1.1;
  margin-bottom: 2px;
}

.stat-card-change {
  font-size: 11.5px;
  font-weight: 500;
}

.stat-card-change.positive { color: var(--success); }
.stat-card-change.neutral { color: var(--gray-500); }

/* ========== SEARCH & FILTER AREA ========== */
.search-filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  flex: 1;
  min-width: 280px;
  position: relative;
}

.search-input-wrapper svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--gray-400);
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  background: var(--white);
  transition: var(--transition);
  color: var(--gray-950);
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 2px var(--primary-50), var(--shadow-md);
}

.search-input::placeholder {
  color: var(--gray-400);
}

.filter-select {
  padding: 10px 32px 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371808c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  cursor: pointer;
  transition: var(--transition);
  color: var(--gray-700);
  min-width: 140px;
  box-shadow: var(--shadow-sm);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: var(--shadow-md);
}

/* ========== OPPORTUNITIES LIST GRID ========== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}

.project-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  border: 1px solid rgba(39, 115, 165, 0.08);
  padding: 22px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow:
    0 2px 10px -4px rgba(22, 69, 102, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body.dark-mode .project-card {
  background: rgba(30, 41, 59, 0.5);
  border-color: rgba(75, 156, 203, 0.1);
  box-shadow:
    0 2px 10px -4px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.project-card:hover {
  border-color: rgba(39, 115, 165, 0.25);
  box-shadow:
    0 12px 32px -8px rgba(39, 115, 165, 0.14),
    0 4px 10px -4px rgba(22, 69, 102, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-4px);
}

body.dark-mode .project-card:hover {
  border-color: rgba(75, 156, 203, 0.25);
  box-shadow:
    0 12px 32px -8px rgba(75, 156, 203, 0.12),
    0 4px 10px -4px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}


.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.project-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* Tags in Design System style */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: var(--border-radius-xs);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.tag.software { background: var(--primary-30); color: var(--primary-900); border: 1px solid var(--primary-50); }
.tag.category { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-300); }

/* Custom Category Label Tags */
.tag.ai { background: var(--primary-30); color: var(--primary-900); border: 1px solid var(--primary-50); }
.tag.website { background: var(--gray-100); color: var(--gray-900); border: 1px solid var(--gray-300); }
.tag.mobile { background: var(--gray-100); color: var(--gray-900); border: 1px solid var(--gray-300); }
.tag.database { background: var(--gray-100); color: var(--gray-900); border: 1px solid var(--gray-300); }

/* Dot Status Tags */
.tag.open-dot { color: var(--success); font-weight: 700; background: var(--success-light); border: 1px solid rgba(35, 131, 91, 0.15); }
.tag.closing-soon-dot { color: var(--warning); font-weight: 700; background: var(--warning-light); border: 1px solid rgba(183, 121, 31, 0.15); }
.tag.closed-dot { color: var(--error); font-weight: 700; background: var(--error-light); border: 1px solid rgba(196, 69, 69, 0.15); }

/* AI Classification Label Styling */
.ai-tag-label {
  display: inline-block;
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 4px;
}

.bookmark-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  transition: var(--transition);
  padding: 4px;
  border-radius: var(--border-radius-xs);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bookmark-btn:hover {
  color: var(--primary-600);
}

.bookmark-btn.active {
  color: var(--primary-600);
}

.bookmark-btn svg {
  width: 18px;
  height: 18px;
}

.project-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 42px;
}

.project-card-dept {
  font-size: 12.5px;
  color: var(--gray-700);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.project-card-dept svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--gray-500);
}

.project-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-200);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.meta-label {
  font-size: 10.5px;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.meta-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-900);
}

.meta-value.budget {
  color: var(--primary-900);
}

.meta-value.deadline-soon {
  color: var(--warning);
}

/* AI Verification Label at Card Bottom */
.source-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 12px;
  display: block;
}

/* ========== NO RESULTS / EMPTY STATES ========== */
.no-results, .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
  background: var(--card-bg-gradient);
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.no-results svg, .empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 14px;
  color: var(--gray-400);
}

/* ========== DETAIL VIEW LAYOUT ========== */
.detail-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius-sm);
  background: var(--white);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  color: var(--gray-700);
  transition: var(--transition);
  margin-bottom: 20px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.detail-back-btn:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
  color: var(--gray-950);
  box-shadow: var(--shadow-md);
}

.detail-back-btn svg {
  width: 16px;
  height: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}

.detail-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-card {
  background: var(--card-bg-gradient);
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-300);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.detail-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 8px;
}

.detail-card-title svg {
  width: 18px;
  height: 18px;
  color: var(--gray-500);
}

/* Detail Hero Header */
.detail-hero {
  position: relative;
}

.detail-hero-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.detail-hero-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
  line-height: 1.4;
}

.detail-hero-dept {
  font-size: 13.5px;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  font-weight: 500;
}

.detail-hero-dept svg {
  width: 16px;
  height: 16px;
  color: var(--gray-400);
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-200);
}

.detail-meta-item {
  text-align: center;
  padding: 12px 8px;
  background: var(--gray-100);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--gray-300);
}

.detail-meta-item .meta-label {
  margin-bottom: 4px;
}

.detail-meta-item .meta-value {
  font-size: 13.5px;
}

.detail-hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Professional Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--border-radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--primary-600);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-700);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--white);
  color: var(--primary-700);
  border: 1px solid var(--primary-50);
}

.btn-secondary:hover {
  background: var(--primary-30);
  border-color: var(--primary-50);
  box-shadow: var(--shadow-md);
}

.btn-bookmark {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-bookmark:hover {
  border-color: var(--primary-600);
  color: var(--primary-700);
  box-shadow: var(--shadow-md);
}

.btn-bookmark.active {
  background: var(--primary-30);
  border-color: var(--primary-600);
  color: var(--primary-900);
}

/* Descriptions */
.description-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-950);
}

.scope-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scope-item {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: var(--gray-100);
  border-radius: var(--border-radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--gray-950);
  border: 1px solid var(--gray-300);
}

.scope-item .scope-bullet {
  color: var(--primary-600);
  font-weight: 700;
  flex-shrink: 0;
}

/* AI Extract Tag Under Labels */
.ai-extract-label {
  font-size: 11px;
  color: var(--primary-600);
  font-weight: 500;
  margin-top: 4px;
  display: block;
}

/* ========== BIDDER ELIGIBILITY CHECKLIST ========== */
.qualifications-card {
  border-color: var(--primary-30) !important;
}

.qualifications-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--primary-30);
  color: var(--primary-900);
  border-radius: var(--border-radius-xs);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  border: 1px solid var(--primary-50);
}

.qualifications-badge.warning {
  background: var(--warning-light);
  color: var(--warning);
  border-color: rgba(183, 121, 31, 0.2);
}

.qualifications-badge svg {
  width: 14px;
  height: 14px;
}

.eligibility-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--white);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--gray-300);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--gray-950);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.checklist-item:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  box-shadow: var(--shadow-md);
}

.checklist-item.checked {
  border-color: var(--primary-600);
  background: var(--primary-30);
}

/* Checkbox Style */
.checklist-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-400);
  border-radius: var(--border-radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--white);
  transition: var(--transition);
  margin-top: 2px;
}

.checklist-item.checked .checklist-checkbox {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: var(--white);
}

.checklist-checkbox svg {
  width: 12px;
  height: 12px;
  stroke-width: 3px;
  opacity: 0;
  transition: var(--transition);
}

.checklist-item.checked .checklist-checkbox svg {
  opacity: 1;
}

.checklist-text {
  flex: 1;
}

.checklist-item.checked .checklist-text {
  color: var(--gray-500);
  text-decoration: line-through;
}

/* Match Gauge Panel */
.gauge-wrapper {
  background: var(--gray-100);
  border-radius: var(--border-radius);
  padding: 16px;
  border: 1px solid var(--gray-300);
  margin-top: 16px;
  box-shadow: var(--shadow-sm);
}

.gauge-header-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.gauge-container {
  height: 8px;
  background: var(--gray-300);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.gauge-fill {
  height: 100%;
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease-in-out;
  background-color: var(--error);
}

.gauge-fill.mid {
  background-color: var(--warning);
}

.gauge-fill.high {
  background-color: var(--success);
}

.gauge-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gauge-score {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.gauge-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--border-radius-xs);
  text-transform: uppercase;
}

.gauge-badge.red { background: var(--error-light); color: var(--error); border: 1px solid rgba(196, 69, 69, 0.15); }
.gauge-badge.amber { background: var(--warning-light); color: var(--warning); border: 1px solid rgba(183, 121, 31, 0.15); }
.gauge-badge.green { background: var(--success-light); color: var(--success); border: 1px solid rgba(35, 131, 91, 0.15); }

/* ========== BUDGET COMPARISON UI ========== */
.budget-comparison-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 700;
}

.budget-comparison-indicator.above {
  background: var(--warning-light);
  color: var(--warning);
  border: 1px solid rgba(183, 121, 31, 0.2);
}

.budget-comparison-indicator.normal {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(35, 131, 91, 0.2);
}

.budget-comparison-indicator.below {
  background: var(--primary-30);
  color: var(--primary-700);
  border: 1px solid var(--primary-50);
}

.budget-comparison-indicator svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.budget-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.budget-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.budget-bar-label {
  width: 80px;
  font-size: 11.5px;
  color: var(--gray-700);
  text-align: right;
  flex-shrink: 0;
  font-weight: 600;
}

.budget-bar-track {
  flex: 1;
  height: 22px;
  background: var(--gray-100);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--gray-300);
}

.budget-bar-fill {
  height: 100%;
  border-radius: var(--border-radius-sm);
  transition: width 0.6s ease;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
}

.budget-bar-fill.current {
  background: var(--primary-600);
}

.budget-bar-fill.avg {
  background: var(--gray-500);
}

/* Budget and Info Disclaimers */
.analysis-disclaimer {
  display: block;
  margin-top: 16px;
  font-size: 11.5px;
  color: var(--gray-500);
  line-height: 1.5;
  font-style: italic;
  border-top: 1px solid var(--gray-200);
  padding-top: 10px;
}

/* ========== HISTORICAL PRICE ANALYSIS PAGE ========== */
.chart-container {
  background: var(--card-bg-gradient);
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-300);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.chart-container canvas {
  max-height: 320px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 12px;
}

.chart-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
}

.chart-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Historical Table */
.historical-table-wrapper {
  overflow-x: auto;
}

.historical-table {
  width: 100%;
  border-collapse: collapse;
}

.historical-table th,
.historical-table td {
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-200);
}

.historical-table th {
  font-weight: 700;
  color: var(--gray-700);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  background: var(--gray-100);
}

.historical-table td {
  color: var(--gray-950);
}

.historical-table tr:hover td {
  background: var(--gray-50);
}

.outlier-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: var(--border-radius-xs);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.outlier-badge.high {
  background: var(--error-light);
  color: var(--error);
  border: 1px solid rgba(196, 69, 69, 0.15);
}

.outlier-badge.normal {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(35, 131, 91, 0.15);
}

.outlier-badge.low {
  background: var(--primary-30);
  color: var(--primary-900);
  border: 1px solid var(--primary-50);
}

/* ========== SETTINGS / CONFIGURATION PAGE ========== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.settings-card {
  background: var(--card-bg-gradient);
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-300);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.settings-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 6px;
}

.settings-card-desc {
  font-size: 12.5px;
  color: var(--gray-500);
  margin-bottom: 20px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-200);
}

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

.toggle-label {
  font-size: 13.5px;
  color: var(--gray-900);
  font-weight: 600;
}

.toggle-sublabel {
  font-size: 11.5px;
  color: var(--gray-500);
  margin-top: 1px;
}

/* Toggle Switch Style */
.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-300);
  border-radius: 11px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--white);
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary-600);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* Interest Tags */
.interest-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.interest-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-700);
  font-family: inherit;
  box-shadow: var(--shadow-sm);
}

.interest-tag:hover {
  border-color: var(--primary-600);
  color: var(--primary-800);
  background: var(--primary-30);
  box-shadow: var(--shadow-md);
}

.interest-tag.active {
  background: var(--primary-50);
  border-color: var(--primary-600);
  color: var(--primary-900);
  font-weight: 700;
}

/* Budget Range Preference */
.budget-range-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.budget-range-inputs input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--white);
  color: var(--gray-950);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.budget-range-inputs input:focus {
  outline: none;
  border-color: var(--primary-600);
  box-shadow: 0 0 0 2px var(--primary-50), var(--shadow-md);
}

.budget-range-inputs input::placeholder {
  color: var(--gray-400);
}

.budget-range-inputs input.input-error {
  border: 1.5px solid var(--error) !important;
  box-shadow: 0 0 0 3px rgba(196, 69, 69, 0.18) !important;
  background-color: var(--error-light);
  color: var(--error);
  font-weight: 600;
}

.budget-range-inputs span {
  color: var(--gray-400);
  font-weight: 600;
}

.budget-range-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--error-light);
  border: 1px solid rgba(196, 69, 69, 0.35);
  border-left: 4px solid var(--error);
  padding: 9px 13px;
  border-radius: var(--border-radius-sm);
  color: #991b1b;
  font-size: 13px;
  font-weight: 600;
  margin-top: 10px;
  box-shadow: 0 2px 8px rgba(196, 69, 69, 0.1);
  animation: errorPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.budget-range-error svg {
  width: 18px;
  height: 18px;
  color: var(--error);
  flex-shrink: 0;
}

body.dark-mode input[type="number"] {
  color-scheme: dark;
}

body.dark-mode .budget-range-inputs input {
  color-scheme: dark;
  background: #0f172a;
  border-color: #334155;
  color: #f8fafb;
}

body.dark-mode .budget-range-inputs input::-webkit-inner-spin-button,
body.dark-mode .budget-range-inputs input::-webkit-outer-spin-button {
  opacity: 0.85;
  cursor: pointer;
}

body.dark-mode .budget-range-inputs input:hover::-webkit-inner-spin-button,
body.dark-mode .budget-range-inputs input:hover::-webkit-outer-spin-button,
body.dark-mode .budget-range-inputs input:focus::-webkit-inner-spin-button,
body.dark-mode .budget-range-inputs input:focus::-webkit-outer-spin-button {
  opacity: 1;
}

body.dark-mode .budget-range-inputs input:focus {
  border-color: var(--primary-600);
  background: #0b1320;
  box-shadow: 0 0 0 2px rgba(75, 156, 203, 0.25), var(--shadow-md);
}

body.dark-mode .budget-range-inputs input::placeholder {
  color: #64748b;
}

body.dark-mode .budget-range-inputs span {
  color: #94a3b8;
}

body.dark-mode .budget-range-error {
  background: rgba(196, 69, 69, 0.16);
  border-color: rgba(196, 69, 69, 0.45);
  border-left-color: #ef4444;
  color: #fca5a5;
}

body.dark-mode .budget-range-inputs input.input-error {
  background-color: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
  color: #fca5a5 !important;
}

.settings-save-btn {
  margin-top: 20px;
  border-top: 1px solid var(--gray-200);
  padding-top: 16px;
}

/* ========== TOAST NOTIFICATION POPUP ========== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 18px;
  background: var(--gray-900);
  color: var(--white);
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(80px);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast.toast-error {
  background: #991b1b;
  border-left: 4px solid #ef4444;
  box-shadow: 0 4px 16px rgba(153, 27, 27, 0.4);
}

.toast.toast-error svg {
  color: #fecaca;
}

.toast svg {
  width: 16px;
  height: 16px;
  color: var(--primary-50);
  flex-shrink: 0;
}

@keyframes errorPop {
  0% { opacity: 0; transform: translateY(-4px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.shake-anim {
  animation: shakeX 0.4s ease-in-out;
}

/* ==========================================================================
   ENTRANCE ANIMATIONS
   ========================================================================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(30px, -25px) scale(1.08); }
  66%      { transform: translate(-15px, 15px) scale(0.95); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-20px, 20px) scale(1.05); }
  66%      { transform: translate(25px, -18px) scale(0.92); }
}
@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(15px, 22px) scale(1.1); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(75, 156, 203, 0.3); }
  50%      { box-shadow: 0 0 20px 6px rgba(75, 156, 203, 0.15); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}

.anim-fade-up {
  opacity: 0;
  animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.anim-delay-1 { animation-delay: 0.12s; }
.anim-delay-2 { animation-delay: 0.24s; }
.anim-delay-3 { animation-delay: 0.38s; }

/* ==========================================================================
   LANDING PAGE — PREMIUM HERO
   ========================================================================== */
body:has(.home-page),
.main-content.home-bg,
.main-content:has(.home-page) {
  background: var(--hero-bg-gradient);
}

.home-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  width: 100%;
}

.home-hero-wrapper {
  width: 100%;
  padding: 24px 0 10px;
}

.home-hero-wrapper .hero-section {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 28px 24px;
}

.hero-section {
  background: transparent;
  border: none;
  position: relative;
  box-shadow: none;
}

.hero-section::after {
  display: none;
}

/* Animated floating orbs */
.hero-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
}

.hero-orb-1 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(75, 156, 203, 0.55), transparent 70%);
  top: -60px;
  right: 8%;
  animation: orbFloat1 10s ease-in-out infinite;
}

.hero-orb-2 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(39, 115, 165, 0.45), transparent 70%);
  bottom: -40px;
  left: 4%;
  animation: orbFloat2 12s ease-in-out infinite;
}

.hero-orb-3 {
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.38), transparent 70%);
  top: 30%;
  right: 28%;
  animation: orbFloat3 14s ease-in-out infinite;
}

body.dark-mode .hero-orb {
  opacity: 0.35;
}
body.dark-mode .hero-orb-1 {
  background: radial-gradient(circle, rgba(75, 156, 203, 0.45), transparent 70%);
}
body.dark-mode .hero-orb-2 {
  background: radial-gradient(circle, rgba(52, 211, 153, 0.30), transparent 70%);
}
body.dark-mode .hero-orb-3 {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.28), transparent 70%);
}

body.dark-mode .hero-section {
  background: transparent;
  border: none;
  box-shadow: none;
}

body.dark-mode .hero-section::after {
  display: none;
}

.hero-content {
  max-width: 680px;
  position: relative;
  z-index: 2;
}

/* Hero Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: linear-gradient(135deg, rgba(39, 115, 165, 0.12), rgba(75, 156, 203, 0.08));
  color: var(--primary-600);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-radius: 24px;
  margin-bottom: 18px;
  border: 1px solid rgba(39, 115, 165, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.dark-mode .hero-badge {
  background: linear-gradient(135deg, rgba(75, 156, 203, 0.2), rgba(52, 211, 153, 0.1));
  border-color: rgba(75, 156, 203, 0.3);
  color: #67e8f9;
}

.hero-badge-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  animation: dotPulse 2s ease-in-out infinite;
}

/* Hero Brand Name */
.hero-brand-name {
  font-size: 54px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-900) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 4px 16px rgba(39, 115, 165, 0.18);
  display: inline-block;
}

body.dark-mode .hero-brand-name {
  background: linear-gradient(135deg, #60a5fa 0%, #93c5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 4px 24px rgba(96, 165, 250, 0.25);
}

/* Hero Title — gradient text */
.hero-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--gray-950) 0%, var(--primary-600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark-mode .hero-title {
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 70%, #93c5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-subtitle {
  font-size: 15px;
  color: var(--gray-700);
  margin-bottom: 26px;
  line-height: 1.65;
  max-width: 580px;
}

body.dark-mode .hero-subtitle {
  color: #cbd5e1;
}

/* Search bar — frosted glass */
.hero-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 6px 6px 14px;
  border: 1px solid rgba(39, 115, 165, 0.18);
  border-radius: 14px;
  max-width: 560px;
  box-shadow:
    0 4px 16px -4px rgba(22, 69, 102, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.hero-search-bar:focus-within {
  border-color: var(--primary-600);
  background: #ffffff;
  box-shadow:
    0 4px 16px -4px rgba(39, 115, 165, 0.18),
    0 0 0 3px rgba(39, 115, 165, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.dark-mode .hero-search-bar {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(75, 156, 203, 0.25);
  box-shadow:
    0 4px 16px -4px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.dark-mode .hero-search-bar:focus-within {
  background: #0f172a;
  border-color: #4b9ccb;
  box-shadow:
    0 6px 20px -4px rgba(75, 156, 203, 0.25),
    0 0 0 3px rgba(75, 156, 203, 0.18);
}

.hero-search-bar svg {
  width: 18px;
  height: 18px;
  color: var(--gray-400);
  flex-shrink: 0;
}

body.dark-mode .hero-search-bar svg {
  color: #4b9ccb;
}

.hero-search-bar input {
  flex: 1;
  border: none;
  padding: 10px 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-950);
  background: transparent;
}

body.dark-mode .hero-search-bar input {
  color: #f8fafb;
}

.hero-search-bar input:focus {
  outline: none;
}

.hero-search-bar button {
  background: linear-gradient(135deg, #2773a5, #1b557c);
  color: #ffffff;
  border: none;
  padding: 11px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px -2px rgba(39, 115, 165, 0.4);
  white-space: nowrap;
}

.hero-search-bar button:hover {
  background: linear-gradient(135deg, #1b557c, #164566);
  box-shadow: 0 4px 16px -4px rgba(39, 115, 165, 0.5);
  transform: translateY(-1px);
}

body.dark-mode .hero-search-bar button {
  background: linear-gradient(135deg, #4b9ccb, #2773a5);
  box-shadow: 0 3px 12px rgba(75, 156, 203, 0.35);
}

/* Hero Stats Row */
.hero-stats-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

.hero-stat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(39, 115, 165, 0.14);
  border-radius: 12px;
  box-shadow: 0 2px 8px -2px rgba(22, 69, 102, 0.06);
  transition: all 0.25s ease;
  cursor: pointer;
}

.hero-stat-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -4px rgba(22, 69, 102, 0.12);
  border-color: var(--primary-600);
}

body.dark-mode .hero-stat-chip {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(75, 156, 203, 0.18);
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.25);
}

body.dark-mode .hero-stat-chip:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: #4b9ccb;
  box-shadow: 0 6px 18px -4px rgba(75, 156, 203, 0.22);
}

.hero-stat-num {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-600);
}

body.dark-mode .hero-stat-num {
  color: #67e8f9;
}

.hero-stat-label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 500;
}

body.dark-mode .hero-stat-label {
  color: #cbd5e1;
}

.hero-stat-chip.accent {
  border-color: rgba(196, 69, 69, 0.25);
  background: rgba(253, 242, 242, 0.65);
}

.hero-stat-chip.accent .hero-stat-num {
  color: var(--error);
}

body.dark-mode .hero-stat-chip.accent {
  border-color: rgba(248, 113, 113, 0.25);
  background: rgba(127, 29, 29, 0.3);
}

body.dark-mode .hero-stat-chip.accent .hero-stat-num {
  color: #f87171;
}

/* ==========================================================================
   SECTION HEADERS — Premium Centered Style
   ========================================================================== */
.section-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.section-header-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gray-300), transparent);
}

body.dark-mode .section-header-line {
  background: linear-gradient(90deg, transparent, rgba(75, 156, 203, 0.2), transparent);
}

.section-header-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* ==========================================================================
   LANDING CAPABILITIES GRID — Premium Glassmorphism Cards
   ========================================================================== */

/* Divider inside the hero box before core capabilities */
.hero-inner-divider {
  margin-top: 28px;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 0;
  position: relative;
  z-index: 2;
}

.landing-card {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(39, 115, 165, 0.1);
  border-radius: 16px;
  padding: 28px 24px;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 4px 16px -6px rgba(22, 69, 102, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

/* Gradient accent border on hover */
.landing-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1.5px;
  background: linear-gradient(135deg, rgba(39, 115, 165, 0.4), rgba(75, 156, 203, 0.2), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.landing-card:hover::before {
  opacity: 1;
}

.landing-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 16px 40px -10px rgba(39, 115, 165, 0.18),
    0 4px 12px -4px rgba(22, 69, 102, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.dark-mode .landing-card {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(75, 156, 203, 0.22);
  box-shadow:
    0 4px 16px -6px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.dark-mode .landing-card-title {
  color: #ffffff;
}

body.dark-mode .landing-card-desc {
  color: #cbd5e1;
}

body.dark-mode .landing-card-link {
  color: #60a5fa;
}

body.dark-mode .landing-card::before {
  background: linear-gradient(135deg, rgba(75, 156, 203, 0.5), rgba(52, 211, 153, 0.3), transparent);
}

body.dark-mode .landing-card:hover {
  box-shadow:
    0 16px 40px -10px rgba(75, 156, 203, 0.15),
    0 4px 12px -4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Card Number */
.landing-card-number {
  font-size: 40px;
  font-weight: 900;
  color: rgba(39, 115, 165, 0.07);
  position: absolute;
  top: 12px;
  right: 18px;
  line-height: 1;
  pointer-events: none;
  transition: color 0.35s ease;
}

.landing-card:hover .landing-card-number {
  color: rgba(39, 115, 165, 0.14);
}

body.dark-mode .landing-card-number {
  color: rgba(75, 156, 203, 0.1);
}

body.dark-mode .landing-card:hover .landing-card-number {
  color: rgba(75, 156, 203, 0.2);
}

.landing-card-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(39, 115, 165, 0.1), rgba(75, 156, 203, 0.06));
  color: var(--primary-600);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border: 1px solid rgba(39, 115, 165, 0.12);
  transition: all 0.35s ease;
}

.landing-card:hover .landing-card-icon {
  background: linear-gradient(135deg, rgba(39, 115, 165, 0.18), rgba(75, 156, 203, 0.1));
  box-shadow: 0 0 16px -4px rgba(39, 115, 165, 0.25);
  transform: scale(1.05);
}

body.dark-mode .landing-card-icon {
  background: linear-gradient(135deg, rgba(75, 156, 203, 0.15), rgba(52, 211, 153, 0.05));
  border-color: rgba(75, 156, 203, 0.2);
}

.landing-card-icon svg {
  width: 22px;
  height: 22px;
}

.landing-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.landing-card-desc {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.55;
  margin-bottom: 18px;
}

.landing-card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-600);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.landing-card:hover .landing-card-link {
  gap: 8px;
  color: var(--primary-800);
}

/* ==========================================================================
   HOME SECTION LAYOUTS (WHITE BOTTOM SECTION)
   ========================================================================== */
.home-bottom-section {
  width: 100%;
  background: #ffffff;
  border-top: 1px solid var(--gray-200);
  flex: 1;
  padding: 36px 0 48px;
  box-shadow: 0 -4px 20px rgba(22, 69, 102, 0.03);
}

body.dark-mode .home-bottom-section {
  background: #0f172a;
  border-top: 1px solid var(--gray-300);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.home-bottom-content {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 28px;
}

.home-bottom-section .project-card {
  background: #ffffff;
  border: 1px solid var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.home-bottom-section .project-card:hover {
  border-color: var(--primary-600);
  box-shadow: var(--shadow-md);
}

body.dark-mode .home-bottom-section .project-card {
  background: #1e293b;
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.home-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.home-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}

.home-section-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-600);
  cursor: pointer;
  transition: all 0.2s ease;
}

.home-section-link:hover {
  text-decoration: underline;
  color: var(--primary-800);
}

.recent-projects-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Home Footer */
.home-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
  text-align: center;
}

body.dark-mode .home-footer {
  border-color: rgba(75, 156, 203, 0.1);
}

/* ========== RESPONSIVE DESIGN & MOBILE COMPACT VERIFICATION ========== */
@media (max-width: 1200px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .landing-grid {
    grid-template-columns: 1fr;
  }
  .recent-projects-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .main-content {
    margin-left: 0;
  }

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

  .stats-row {
    grid-template-columns: 1fr;
  }

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

  .detail-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-content {
    padding: 16px;
  }

  /* Landing Page Compact Mobile */
  .home-hero-wrapper {
    padding: 16px 0 8px;
  }
  .home-hero-wrapper .hero-section {
    padding: 0 16px 16px;
    margin-bottom: 0;
    text-align: center;
  }
  .home-bottom-section {
    padding: 24px 0 36px;
  }
  .home-bottom-content {
    padding: 0 16px;
  }

  .hero-content {
    margin: 0 auto;
  }

  .hero-orb-1 { width: 140px; height: 140px; }
  .hero-orb-2 { width: 100px; height: 100px; }
  .hero-orb-3 { width: 80px; height: 80px; }

  .hero-badge {
    margin-bottom: 10px;
    padding: 3px 12px;
    font-size: 10px;
  }

  .hero-title {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 6px;
  }

  .hero-subtitle {
    font-size: 12px;
    margin-bottom: 16px;
    line-height: 1.4;
    max-width: 100%;
  }

  .hero-search-bar {
    max-width: 100%;
    padding: 4px 4px 4px 10px;
    border-radius: 10px;
  }

  .hero-search-bar input {
    padding: 8px 6px;
    font-size: 12.5px;
  }

  .hero-search-bar button {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 8px;
  }

  .hero-stats-row {
    justify-content: center;
    margin-top: 16px;
    gap: 8px;
  }

  .hero-stat-chip {
    padding: 6px 12px;
    border-radius: 10px;
  }

  .hero-stat-num {
    font-size: 13px;
  }

  .hero-stat-label {
    font-size: 10px;
  }

  .section-header {
    margin-bottom: 16px;
    gap: 12px;
  }

  .section-header-title {
    font-size: 14px;
  }

  /* 3-Column Compact Grid (No Description) for Mobile */
  .landing-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px;
    margin-bottom: 16px;
  }

  .landing-card {
    padding: 14px 8px;
    text-align: center;
    border-radius: 12px;
  }

  .landing-card-number {
    display: none;
  }

  .landing-card-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 10px;
    border-radius: 10px;
  }

  .landing-card-icon svg {
    width: 17px;
    height: 17px;
  }

  .landing-card-title {
    font-size: 11px;
    line-height: 1.3;
    margin-bottom: 4px;
    font-weight: 700;
  }

  .landing-card-desc {
    display: none !important;
  }

  .landing-card-link {
    font-size: 10px;
    font-weight: 700;
  }

  .home-section-header {
    margin-top: 4px;
    margin-bottom: 12px;
  }

  .home-section-title {
    font-size: 14px;
  }

  .home-section-link {
    font-size: 11px;
  }
}
