/* MendHall.com JSP Design System Stylesheet */

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

/* Shared Theme Tokens */
:root {
  --font-body: 'Outfit', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-main: var(--font-body);
  --font-num: 'Outfit', sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Consolas", monospace;

  --space-1: 6px;   --space-2: 10px;  --space-3: 14px;
  --space-4: 20px;  --space-5: 28px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-pill: 9999px;
  --accent-contrast: #ffffff;
}

/* ============================================================
   1) BRIGHT — "Warm Clay" (Default Light Theme)
   ============================================================ */
:root,
:root[data-theme="bright"],
:root[data-theme="light"],
.theme-light,
.theme-bright {
  --bg: #fbf8f4;
  --bg-app: var(--bg);
  --surface: #ffffff;
  --bg-header: var(--surface);
  --bg-sidebar: var(--surface);
  --bg-card: var(--surface);
  --surface-2: #f5efe7;
  --bg-input: var(--surface-2);
  --border: #e9e0d4;
  --border-soft: #f1e9dd;
  --border-color: var(--border);

  --text: #22201d;
  --text-main: var(--text);
  --muted: #7c7368;
  --text-muted: var(--muted);

  --accent: #c77c46;            /* Calm Amber Clay */
  --primary: var(--accent);
  --primary-light: color-mix(in srgb, var(--accent) 15%, transparent);
  --accent-contrast: #ffffff;
  --accent-2: #2f8f86;          /* Soft Teal */
  --secondary: var(--accent-2);
  --secondary-light: color-mix(in srgb, var(--accent-2) 15%, transparent);

  --ok: #4b8a52;
  --warn: #b8862f;
  --danger: #c0553f;

  --radius: 14px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 24px -16px rgba(199,124,70,.40);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: var(--shadow);
  --shadow-lg: 0 20px 45px rgba(199,124,70,.20);

  --logo-a: #c77c46;
  --logo-b: #e0a56f;
  --pin: #c77c46;
  --map-grid: transparent;
}

/* ============================================================
   2) DARK — "Blueprint Night"
   ============================================================ */
:root[data-theme="dark"],
.theme-dark {
  --bg: #0b1220;
  --bg-app: var(--bg);
  --surface: #111c30;
  --bg-header: var(--surface);
  --bg-sidebar: var(--surface);
  --bg-card: var(--surface);
  --surface-2: #0e1728;
  --bg-input: var(--surface-2);
  --border: #22334d;
  --border-soft: #1a2740;
  --border-color: var(--border);

  --text: #e7eef8;
  --text-main: var(--text);
  --muted: #8da2c0;
  --text-muted: var(--muted);

  --accent: #4cc2ff;            /* Print Cyan */
  --primary: var(--accent);
  --primary-light: color-mix(in srgb, var(--accent) 18%, transparent);
  --accent-contrast: #06243a;   /* Dark Text on Light Cyan */
  --accent-2: #f5b301;          /* Amber Highlight */
  --secondary: var(--accent-2);
  --secondary-light: color-mix(in srgb, var(--accent-2) 18%, transparent);

  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;

  --radius: 12px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow: 0 12px 30px -16px rgba(0,0,0,.7);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: var(--shadow);
  --shadow-lg: 0 20px 45px rgba(0,0,0,0.5);

  --logo-a: #4cc2ff;
  --logo-b: #8b5cf6;
  --pin: #4cc2ff;
  --map-grid: rgba(76,194,255,.06);   /* Faint blueprint grid */
}

/* ============================================================
   3) DISCRETE — "Concrete" (Understated Enterprise Slate)
   ============================================================ */
:root[data-theme="discrete"],
.theme-discrete {
  --bg: #f4f4f2;
  --bg-app: var(--bg);
  --surface: #fcfcfb;
  --bg-header: var(--surface);
  --bg-sidebar: var(--surface);
  --bg-card: var(--surface);
  --surface-2: #ececea;
  --bg-input: var(--surface-2);
  --border: #dededa;
  --border-soft: #e6e6e2;
  --border-color: var(--border);

  --text: #26262b;
  --text-main: var(--text);
  --muted: #75757c;
  --text-muted: var(--muted);

  --accent: #4a5a6a;            /* Muted Steel Slate */
  --primary: var(--accent);
  --primary-light: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-contrast: #ffffff;
  --accent-2: #9a6b54;          /* Whisper of Terracotta */
  --secondary: var(--accent-2);
  --secondary-light: color-mix(in srgb, var(--accent-2) 12%, transparent);

  --ok: #4b7a52;
  --warn: #9a7b3f;
  --danger: #a7514b;

  --radius: 6px;
  --radius-lg: 10px;
  --radius-md: 6px;
  --radius-sm: 5px;
  --shadow: 0 6px 16px -12px rgba(20,20,25,.35);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.03);
  --shadow-md: var(--shadow);
  --shadow-lg: 0 10px 25px rgba(20,20,25,.15);

  --logo-a: #4a5a6a;
  --logo-b: #7d8b98;
  --pin: #4a5a6a;
  --map-grid: transparent;
}

/* ============================================================
   4) NEON — "Cyberpunk Glow"
   ============================================================ */
:root[data-theme="neon"],
.theme-neon {
  --bg: #070b14;
  --bg-app: var(--bg);
  --surface: #0e1626;
  --bg-header: var(--surface);
  --bg-sidebar: var(--surface);
  --bg-card: var(--surface);
  --surface-2: #141f36;
  --bg-input: var(--surface-2);
  --border: #1f3354;
  --border-soft: #172640;
  --border-color: var(--border);

  --text: #f0f6fc;
  --text-main: var(--text);
  --muted: #94a3b8;
  --text-muted: var(--muted);

  --accent: #00f0ff;            /* Electric Neon Cyan */
  --primary: var(--accent);
  --primary-light: rgba(0, 240, 255, 0.16);
  --accent-contrast: #041018;   /* Dark Text on Neon Cyan */
  --accent-2: #ff007f;          /* Neon Magenta */
  --secondary: var(--accent-2);
  --secondary-light: rgba(255, 0, 127, 0.16);

  --ok: #00ff88;
  --warn: #ffe600;
  --danger: #ff3366;

  --radius: 12px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow: 0 0 20px rgba(0, 240, 255, 0.25);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 0 15px rgba(0, 240, 255, 0.2);
  --shadow-lg: 0 0 30px rgba(0, 240, 255, 0.35);

  --logo-a: #00f0ff;
  --logo-b: #ff007f;
  --pin: #00f0ff;
  --map-grid: rgba(0, 240, 255, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  background: linear-gradient(135deg, var(--logo-a), var(--logo-b));
  color: white;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 20px;
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--logo-a) 70%, transparent);
  overflow: hidden;
  flex-shrink: 0;
}

/* Brand mark: SVG "M" of two gable roofs (see WEB-INF/jsp/fragments/brand-mark.jspf) */
.logo-icon .brand-mark {
  width: 100%;
  height: 100%;
  display: block;
}
.logo-icon:has(.brand-mark) {
  background: none;
  border-radius: 0;
  box-shadow: none;
}
.logo-icon .brand-mark rect:first-of-type {
  filter: drop-shadow(0 6px 10px color-mix(in srgb, var(--logo-a) 45%, transparent));
}

.logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
  line-height: 1.1;
}
.logo-text .brand-accent { color: var(--primary); }
.logo-text .brand-tld { font-size: 0.6em; font-weight: 500; color: var(--text-muted); margin-left: 1px; }

.brand-motto {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  letter-spacing: 0.2px;
  font-weight: 500;
}

/* Registration consent block */
.consent-box {
  background: var(--surface-2);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 6px 0 18px 0;
}
.consent-box label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-main);
}
.consent-box input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.consent-box a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dotted var(--primary);
}
.consent-box a:hover { border-bottom-style: solid; }
.consent-box.consent-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}
.consent-note {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 0 30px;
  line-height: 1.4;
}

/* Legal / manifesto standalone pages */
.legal-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 30px 20px 60px 20px;
}
.legal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.legal-header .logo-icon { width: 48px; height: 48px; }
.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 44px;
}
.legal-card h1 {
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.legal-card .legal-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-color);
}
.legal-card h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 28px 0 10px 0;
  color: var(--text-main);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.legal-card h2 .num {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
}
.legal-card p {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 12px;
  color: var(--text-main);
}
.legal-card ol, .legal-card ul { margin: 0 0 12px 22px; }
.legal-card li { font-size: 15px; line-height: 1.7; margin-bottom: 6px; }
.legal-card .pledge {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 18px 0;
  font-size: 15.5px;
  line-height: 1.7;
}
.legal-card .pledge strong { color: var(--primary); }
.legal-card .callout {
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 14px 0;
  font-size: 14px;
  line-height: 1.6;
}
.legal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}
.legal-toc {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 6px 18px;
  font-size: 13.5px;
  margin-bottom: 8px;
}
.legal-toc a { color: var(--primary); text-decoration: none; font-weight: 500; }
.legal-toc a:hover { text-decoration: underline; }
@media (max-width: 640px) {
  .legal-card { padding: 26px 20px; }
  .legal-card h1 { font-size: 24px; }
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Header layout */
.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-pill);
  transition: var(--transition);
  white-space: nowrap;
}

.header-select {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}
.header-select:hover {
  border-color: var(--primary);
}

.header-sub-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-pill);
  border: 1.5px solid #f59e0b;
  color: #b45309;
  background: #fffbeb;
  transition: var(--transition);
  white-space: nowrap;
}
:root[data-theme="dark"] .header-sub-badge,
.theme-dark .header-sub-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: #f59e0b;
}
:root[data-theme="neon"] .header-sub-badge,
.theme-neon .header-sub-badge {
  background: rgba(255, 0, 127, 0.12);
  color: #00f0ff;
  border-color: #00f0ff;
}
:root[data-theme="discrete"] .header-sub-badge,
.theme-discrete .header-sub-badge {
  background: var(--surface-2);
  color: var(--text-main);
  border-color: var(--border-color);
}
.header-sub-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
}

.header-user-block {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.header-profile-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  transition: var(--transition);
}
.header-profile-link:hover {
  opacity: 0.88;
}

.header-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-color);
  flex-shrink: 0;
}

.header-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.header-username {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-main);
}

.header-user-role {
  font-size: 9.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.header-logout-btn {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  height: 30px;
  font-weight: 600;
}

/* Mobile / Responsive Hamburger button */
.header-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 38px;
  height: 38px;
  padding: 9px 8px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  z-index: 1001;
}
.header-menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: var(--transition);
}
.header-menu-toggle:hover {
  border-color: var(--primary);
}
.header-menu-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.header-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.header-menu-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Header Dropdown Menu (for screens where items cannot fit) */
.header-dropdown-menu {
  display: none;
  position: absolute;
  top: 72px;
  right: 16px;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  padding: 16px;
  z-index: 2000;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.header-dropdown-menu.open {
  display: block;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-user-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
}

.dropdown-profile-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.dropdown-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-color);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 10px 0;
}

.dropdown-nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dropdown-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}
.dropdown-nav-item:hover, .dropdown-nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.dropdown-prefs-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.dropdown-pref-col {
  flex: 1;
}

/* Responsive query when header items cannot fit comfortably */
@media (max-width: 1180px) {
  .header-nav-left,
  .header-right {
    display: none !important;
  }
  .header-menu-toggle {
    display: flex !important;
  }
}

.role-badge {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background-color: var(--primary-light);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  border: 1px dashed var(--primary);
}

.select-input {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  font-family: var(--font-main);
  outline: none;
  font-size: 14px;
  cursor: pointer;
  background-color: var(--bg-card);
  color: var(--text-main);
  transition: var(--transition);
}

.select-input:hover {
  border-color: var(--primary);
}

.select-input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px var(--secondary-light);
}

/* Page Layout with left sidebar */
.main-wrapper {
  display: flex;
  margin-top: 70px;
  min-height: calc(100vh - 70px);
}

.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 70px;
  bottom: 0;
  left: 0;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 18px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.content-window {
  flex-grow: 1;
  margin-left: 260px;
  padding: 40px;
  background-color: var(--bg-app);
}

/* Card components */
.card {
  background-color: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-md);
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  outline: none;
  font-family: var(--font-main);
  font-size: 15px;
  background-color: var(--bg-input);
  color: var(--text-main);
  transition: var(--transition);
}

.form-textarea {
  width: 100%;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  outline: none;
  font-family: var(--font-main);
  font-size: 15px;
  background-color: var(--bg-input);
  color: var(--text-main);
  transition: var(--transition);
}

select option {
  background-color: var(--surface);
  color: var(--text-main);
}

.form-input:hover, .form-textarea:hover {
  border-color: var(--primary);
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--secondary);
  background-color: var(--surface);
  color: var(--text-main);
  box-shadow: 0 0 0 4px var(--secondary-light);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: var(--transition);
}

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

.btn-primary:hover {
  opacity: 0.9;
}

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

.btn-secondary:hover {
  opacity: 0.9;
}

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
}

/* Dark Mode Leaflet Map Filter */
[data-theme="dark"] .leaflet-tile-container img {
  filter: brightness(0.7) invert(1) contrast(1.2) hue-rotate(200deg);
}

.btn-danger {
  background-color: #e74c3c;
  color: white;
}

/* Badging */
.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-draft { background-color: #f1f3f5; color: #495057; }
.badge-published { background-color: #e3f2fd; color: #1e88e5; }
.badge-changed { background-color: #fff8e1; color: #f57f17; }
.badge-withdrawn { background-color: #eceff1; color: #607d8b; }
.badge-contracted { background-color: #e8f5e9; color: #2e7d32; }
.badge-completed { background-color: #e0f2f1; color: #00796b; }
.badge-cancelled { background-color: #ffebee; color: #c62828; }
.badge-pending { background-color: #f8fafc; color: #475569; border: 1px solid #cbd5e1; }
.badge-preliminarily_accepted { background-color: #fef3c7; color: #b45309; border: 1px solid #fde68a; font-weight: 700; }
.badge-accepted { background-color: #dcfce7; color: #15803d; font-weight: 700; }
.badge-rejected { background-color: #fee2e2; color: #b91c1c; }

/* Interactive Bids Calendar */
.calendar-day-cell {
  transition: background-color 0.2s, box-shadow 0.2s;
}

.calendar-day-cell:hover {
  box-shadow: inset 0 0 0 1.5px rgba(2, 132, 199, 0.4);
}

/* Gantt Timeline */
.gantt-chart-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  padding: 20px;
}

.gantt-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  border-bottom: 1px solid var(--border-color);
}

.gantt-header-label {
  padding: 12px;
  font-weight: 600;
  background-color: #f8fafc;
  border-right: 1px solid var(--border-color);
}

.gantt-timeline-header {
  display: flex;
  position: relative;
  background-color: #f8fafc;
}

.gantt-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  border-bottom: 1px solid var(--border-color);
  align-items: center;
}

.gantt-row-label {
  padding: 15px 12px;
  font-weight: 500;
  border-right: 1px solid var(--border-color);
}

.gantt-timeline-row {
  position: relative;
  height: 50px;
  background-color: #fafbfc;
}

.gantt-task-bar {
  position: absolute;
  height: 32px;
  top: 9px;
  background: linear-gradient(90deg, var(--secondary), #26c6da);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 3px 6px rgba(0, 166, 153, 0.15);
}

/* Chat Trail */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 380px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #ffffff;
}

.chat-messages {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.chat-bubble {
  max-width: 75%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
}

.chat-bubble.sent {
  align-self: flex-end;
  background-color: var(--primary);
  color: white;
  border-bottom-right-radius: 2px;
}

.chat-bubble.received {
  align-self: flex-start;
  background-color: #f1f3f5;
  color: var(--text-main);
  border-bottom-left-radius: 2px;
}

.chat-input-area {
  padding: 15px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
}

/* Monitoring Cockpit Hover desc */
.cockpit-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 15px;
  cursor: pointer;
  position: relative;
  background-color: white;
}

.cockpit-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.tooltip-desc {
  visibility: hidden;
  width: 250px;
  background-color: #333;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 10px;
  position: absolute;
  z-index: 10;
  bottom: 110%;
  left: 50%;
  margin-left: -125px;
  opacity: 0;
  transition: opacity 0.3s;
}

.cockpit-item:hover .tooltip-desc {
  visibility: visible;
  opacity: 1;
}

/* Map */
.map-view-container {
  height: 380px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
#map {
  height: 100%;
  width: 100%;
}

/* Responsive 3-Column Layout for Cockpit Dashboard */
.my-jobs-container {
  display: grid;
  grid-template-columns: 25% 45% 30%;
  gap: 20px;
  align-items: start;
}

.job-list-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  cursor: pointer;
  background-color: #ffffff;
  transition: var(--transition);
}

.job-list-item:hover, .job-list-item.active {
  border-color: var(--primary);
  background-color: var(--primary-light);
}

.mobile-only-btn {
  display: none;
}

/* Tooltip styles */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 240px;
  background-color: #1e293b;
  color: #ffffff;
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  position: absolute;
  z-index: 1050;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  font-size: 11px;
  line-height: 1.4;
  font-weight: normal;
  text-transform: none;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* Mobile responsive rules */
@media (max-width: 991px) {
  .my-jobs-container {
    grid-template-columns: 1fr;
  }
  .mobile-hidden {
    display: none !important;
  }
  .mobile-only-btn {
    display: block;
  }
}

/* ----------------------------------------------------
   3-PANE MAILBOX LAYOUT & MESSAGE BUBBLES
   ---------------------------------------------------- */
.mailbox-3pane-layout {
  display: grid;
  grid-template-columns: 28% 44% 28%;
  gap: 15px;
  height: calc(100vh - 120px);
  min-height: 580px;
}

.mailbox-left-pane {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 15px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.mailbox-center-pane {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 15px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.mailbox-right-pane {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 15px;
  box-shadow: var(--shadow-sm);
  overflow-y: auto;
}

.thread-list-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  background: #fafbfc;
  transition: var(--transition);
}

.thread-list-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.thread-list-item.active {
  border-color: var(--primary);
  background: #fff0f6;
  box-shadow: 0 2px 6px rgba(255, 46, 147, 0.15);
}

.snippet-2-lines {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  color: #475569;
  line-height: 1.4;
  margin-top: 5px;
}

/* Trail alignment & tones */
.msg-trail-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  padding: 10px 5px;
}

.msg-bubble {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}

/* Messages sent by Logged In User: ALIGNED LEFT, SLIGHTLY DARKER WHITE TONE */
.msg-bubble-user-sent {
  align-self: flex-start;
  margin-right: auto;
  background-color: #f1f5f9; /* Slightly darker white / soft slate tone */
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-bottom-left-radius: 4px;
}

/* Messages sent by Counterpart: ALIGNED RIGHT, BRIGHTER WHITE TONE */
.msg-bubble-counterpart-sent {
  align-self: flex-end;
  margin-left: auto;
  background-color: #ffffff; /* Brighter pure white tone */
  color: #0f172a;
  border: 1px solid #e2e8f0;
  box-shadow: 0 3px 8px rgba(0,0,0,0.06);
  border-bottom-right-radius: 4px;
}

@media (max-width: 1024px) {
  .mailbox-3pane-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* ----------------------------------------------------
   GANTT CALENDAR DISPLAY VIEW & LEGAL CONFIRMATION MODAL
   ---------------------------------------------------- */
.gantt-calendar-view {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  background: #f8fafc;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-top: 15px;
}

.calendar-day-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  min-height: 100px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-day-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 4px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

.calendar-task-pill {
  background: linear-gradient(135deg, #7c4dff, #00e5ff);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  cursor: pointer;
}

/* Legal Accept Bid Terms Modal Warning Box */
.modal-confirm-warning-box {
  background: #fff5f5;
  border: 1.5px solid #feb2b2;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

.modal-confirm-warning-title {
  color: #c53030;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.modal-confirm-warning-text {
  color: #9b2c2c;
  font-size: 13px;
  line-height: 1.5;
}

/* ----------------------------------------------------
   ADVANCED JOB SEARCH FILTER BAR & ROUNDED RESULTS CARDS
   ---------------------------------------------------- */
.search-filter-bar {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.search-filter-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr 1.5fr auto;
  gap: 15px;
  align-items: center;
}

@media (max-width: 1024px) {
  .search-filter-grid {
    grid-template-columns: 1fr;
  }
}

.budget-slider-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.budget-slider-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary);
}

.range-slider-input {
  width: 100%;
  accent-color: var(--secondary);
  cursor: pointer;
}

.radius-select-box {
  display: flex;
  gap: 6px;
}

.search-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.search-result-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.search-result-short-desc {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: #475569;
  margin: 10px 0 14px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Account Type Toggle & Company Section */
.account-type-toggle-container {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 6px;
  margin-bottom: 22px;
}

.account-type-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: var(--transition);
  user-select: none;
}

.account-type-btn.active {
  background: var(--surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.account-type-btn:hover:not(.active) {
  color: var(--text-main);
  background: color-mix(in srgb, var(--surface-2) 80%, var(--primary));
}

.company-placeholder-box {
  background: var(--surface-2);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 18px;
  margin-bottom: 22px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.company-live-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  margin-top: 6px;
  line-height: 1.4;
}

.company-live-alert.alert-warning {
  background-color: #fffbeb;
  border: 1px solid #fef3c7;
  color: #b45309;
}

.company-live-alert.alert-success {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

/* Pagination Navigation Controls */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 25px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.pagination-btn {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 36px;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--border-soft);
}

.pagination-info {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0 8px;
}

/* ============================================================
   Job Preview Description Text & Scope Specifications
   ============================================================ */
.job-preview-description-box,
#pop-scope,
.search-result-short-desc,
.job-scope-desc,
.scope-text-box {
  background-color: #f1f5f9;
  color: #090d16 !important; /* Crisp dark text */
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-weight: 550;
  line-height: 1.6;
}

/* Neon Theme: High-contrast darker job description text on preview modals & cards */
:root[data-theme="neon"] .job-preview-description-box,
:root[data-theme="neon"] #pop-scope,
:root[data-theme="neon"] .search-result-short-desc,
:root[data-theme="neon"] .job-scope-desc,
:root[data-theme="neon"] .scope-text-box,
:root[data-theme="neon"] #job-preview-modal-body p.job-preview-description-box,
:root[data-theme="neon"] #job-details-popup-modal #pop-scope,
.theme-neon .job-preview-description-box,
.theme-neon #pop-scope,
.theme-neon .search-result-short-desc,
.theme-neon .job-scope-desc,
.theme-neon .scope-text-box,
.theme-neon #job-preview-modal-body p.job-preview-description-box,
.theme-neon #job-details-popup-modal #pop-scope {
  background-color: #e2e8f0 !important;
  color: #000000 !important; /* Pitch black / maximum dark text for ultra clarity */
  border: 1.5px solid #94a3b8 !important;
  font-weight: 600 !important;
  text-shadow: none !important;
}

/* Dark Theme: High-contrast darker job description text */
:root[data-theme="dark"] .job-preview-description-box,
:root[data-theme="dark"] #pop-scope,
:root[data-theme="dark"] .search-result-short-desc,
:root[data-theme="dark"] .job-scope-desc,
:root[data-theme="dark"] .scope-text-box,
:root[data-theme="dark"] #job-preview-modal-body p.job-preview-description-box,
:root[data-theme="dark"] #job-details-popup-modal #pop-scope,
.theme-dark .job-preview-description-box,
.theme-dark #pop-scope,
.theme-dark .search-result-short-desc,
.theme-dark .job-scope-desc,
.theme-dark .scope-text-box,
.theme-dark #job-preview-modal-body p.job-preview-description-box,
.theme-dark #job-details-popup-modal #pop-scope {
  background-color: #e2e8f0 !important;
  color: #000000 !important; /* Pitch black dark text */
  border: 1.5px solid #94a3b8 !important;
  font-weight: 600 !important;
  text-shadow: none !important;
}

/* ============================================================
   Neon Theme: Bright Message Button Text & Enhanced Button Contrast
   ============================================================ */
:root[data-theme="neon"] .sidebar-link[href*="messages"],
.theme-neon .sidebar-link[href*="messages"] {
  color: #f8fafc !important; /* Brighter crisp white-slate text */
  font-weight: 600 !important;
}

:root[data-theme="neon"] .sidebar-link[href*="messages"]:hover,
:root[data-theme="neon"] .sidebar-link[href*="messages"].active,
.theme-neon .sidebar-link[href*="messages"]:hover,
.theme-neon .sidebar-link[href*="messages"].active {
  color: #00f0ff !important; /* Radiant neon cyan */
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

:root[data-theme="neon"] #trail-reply-box button,
:root[data-theme="neon"] .mailbox-left-pane .btn,
:root[data-theme="neon"] .mailbox-center-pane .btn,
:root[data-theme="neon"] .mailbox-right-pane .btn,
:root[data-theme="neon"] #tab-particular-job,
:root[data-theme="neon"] #tab-all-bidder,
:root[data-theme="neon"] #tab-all-poster,
:root[data-theme="neon"] #chat-send-btn,
:root[data-theme="neon"] button[onclick*="submitNegotiation"],
:root[data-theme="neon"] button[onclick*="Correspondence"],
:root[data-theme="neon"] .btn-message,
:root[data-theme="neon"] a[href*="messages"].btn,
.theme-neon #trail-reply-box button,
.theme-neon .mailbox-left-pane .btn,
.theme-neon .mailbox-center-pane .btn,
.theme-neon .mailbox-right-pane .btn,
.theme-neon #tab-particular-job,
.theme-neon #tab-all-bidder,
.theme-neon #tab-all-poster,
.theme-neon #chat-send-btn,
.theme-neon button[onclick*="submitNegotiation"],
.theme-neon button[onclick*="Correspondence"],
.theme-neon .btn-message,
.theme-neon a[href*="messages"].btn {
  color: #ffffff !important; /* Crisp, brilliant bright white */
  font-weight: 700 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 6px rgba(0, 240, 255, 0.4) !important;
  letter-spacing: 0.3px;
}

:root[data-theme="neon"] .btn-primary,
.theme-neon .btn-primary {
  color: #ffffff !important; /* Bright white text on primary buttons */
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

:root[data-theme="neon"] .btn-outline,
.theme-neon .btn-outline {
  color: #f8fafc !important; /* Brighter outline button text */
  border-color: #38bdf8 !important;
  font-weight: 600 !important;
}

:root[data-theme="neon"] .btn-outline:hover,
.theme-neon .btn-outline:hover {
  color: #ffffff !important;
  border-color: #00f0ff !important;
  background-color: rgba(0, 240, 255, 0.22) !important;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}

/* ============================================================
   Dashboard & Result Tiles: Darker Text on Edit Ad Buttons
   ============================================================ */
.btn-edit-ad,
button.btn-edit-ad,
a.btn-edit-ad,
.btn-edit-job {
  color: #090d16 !important; /* Extra dark slate text */
  background-color: #f1f5f9 !important;
  border: 1.5px solid #cbd5e1 !important;
  font-weight: 700 !important;
  text-shadow: none !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-edit-ad:hover,
button.btn-edit-ad:hover,
a.btn-edit-ad:hover,
.btn-edit-job:hover {
  background-color: #e2e8f0 !important;
  color: #000000 !important;
  border-color: #94a3b8 !important;
}

:root[data-theme="neon"] .btn-edit-ad,
:root[data-theme="neon"] button.btn-edit-ad,
:root[data-theme="neon"] a.btn-edit-ad,
.theme-neon .btn-edit-ad,
.theme-neon button.btn-edit-ad,
.theme-neon a.btn-edit-ad,
:root[data-theme="dark"] .btn-edit-ad,
:root[data-theme="dark"] button.btn-edit-ad,
:root[data-theme="dark"] a.btn-edit-ad,
.theme-dark .btn-edit-ad,
.theme-dark button.btn-edit-ad,
.theme-dark a.btn-edit-ad {
  background-color: #e2e8f0 !important;
  color: #000000 !important; /* High contrast pitch-black text */
  border: 1.5px solid #94a3b8 !important;
  font-weight: 700 !important;
  text-shadow: none !important;
}

:root[data-theme="neon"] .btn-edit-ad:hover,
.theme-neon .btn-edit-ad:hover,
:root[data-theme="dark"] .btn-edit-ad:hover,
.theme-dark .btn-edit-ad:hover {
  background-color: #ffffff !important;
  color: #000000 !important;
  border-color: #64748b !important;
}







