*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f5f5f5;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
.nav {
  background: #1e293b;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav__brand {
  color: #f8fafc;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
  text-decoration: none;
}
.nav__brand:hover { text-decoration: none; color: #f8fafc; }
.nav__links { display: flex; gap: 24px; align-items: center; }
.nav__links a {
  color: #94a3b8;
  font-size: 14px;
}
.nav__links a:hover { color: #f8fafc; text-decoration: none; }

/* Nav toggle button (hamburger) */
.nav__toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}
.nav__toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #94a3b8;
  border-radius: 1px;
  transition: background 0.15s;
}
.nav__toggle:hover span { background: #f8fafc; }

/* App body + sidebar */
.app-body {
  display: flex;
  min-height: calc(100vh - 52px);
}

.sidebar {
  width: 0;
  overflow: hidden;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  transition: width 0.2s ease;
  flex-shrink: 0;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  align-self: flex-start;
}

body.sidebar-open .sidebar {
  width: 180px;
}

.sidebar__nav {
  padding: 16px 0;
  white-space: nowrap;
}

.sidebar__link {
  display: block;
  padding: 8px 20px;
  font-size: 14px;
  color: #475569;
  text-decoration: none;
}
.sidebar__link:hover { background: #f1f5f9; color: #1e293b; text-decoration: none; }
.sidebar__link--active { color: #1e293b; font-weight: 600; }

.main-content { flex: 1; min-width: 0; }

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px;
}

/* Page header */
.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
}
.page-header p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
}

/* Actions dropdown */
.actions-dropdown { position: relative; flex-shrink: 0; }
.actions-dropdown summary {
  list-style: none;
  cursor: pointer;
}
.actions-dropdown summary::-webkit-details-marker { display: none; }
.actions-dropdown__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  min-width: 200px;
  z-index: 100;
  padding: 4px 0;
}
.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  font-size: 14px;
  text-align: left;
  color: #1e293b;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
}
.dropdown-item:hover { background: #f1f5f9; color: #1e293b; text-decoration: none; }
.dropdown-item--danger { color: #991b1b; }
.dropdown-item--danger:hover { background: #fee2e2; color: #991b1b; }
.dropdown-item--disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.dropdown-divider { height: 1px; background: #e2e8f0; margin: 4px 0; }

/* Cards */
.card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-bar select,
.filter-bar input[type="text"] {
  padding: 7px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  color: #1a1a1a;
}
.filter-bar button,
.filter-bar input[type="submit"] {
  padding: 7px 16px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.filter-bar button:hover,
.filter-bar input[type="submit"]:hover {
  background: #1d4ed8;
}

/* Opportunity list item */
.opportunity-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  align-items: start;
}
.opportunity-item__title {
  font-weight: 600;
  font-size: 15px;
  color: #1a1a1a;
  grid-column: 1;
}
.opportunity-item__meta {
  font-size: 13px;
  color: #64748b;
  grid-column: 1;
}
.opportunity-item__deadline {
  grid-column: 2;
  grid-row: 1 / 3;
  text-align: right;
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
  align-self: center;
}
.opportunity-item__deadline.overdue { color: #dc2626; }

/* Tags / badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}
.badge--sector  { background: #eff6ff; color: #1d4ed8; }
.badge--status              { background: #f0fdf4; color: #15803d; }
.badge--status-open         { background: #f0fdf4; color: #15803d; }
.badge--status-closed       { background: #f1f5f9; color: #475569; }
.badge--status-awarded      { background: #eff6ff; color: #1d4ed8; }
.badge--status-cancelled    { background: #fef2f2; color: #991b1b; }
.badge--warning { background: #fef9c3; color: #854d0e; }
.badge--error   { background: #fef2f2; color: #991b1b; }
.badge--neutral { background: #f1f5f9; color: #475569; }

/* Detail field list */
.field-list {
  display: grid;
  grid-template-columns: 160px 1fr;
  row-gap: 10px;
  font-size: 14px;
}
.field-list dt { color: #64748b; font-weight: 500; }
.field-list dd { margin: 0; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn--primary  { background: #2563eb; color: #fff; }
.btn--primary:hover  { background: #1d4ed8; color: #fff; }
.btn--secondary { background: #f1f5f9; color: #1e293b; border: 1px solid #cbd5e1; }
.btn--secondary:hover { background: #e2e8f0; color: #1e293b; }
.btn--sm { padding: 5px 12px; font-size: 13px; }
.btn--danger { background: #fee2e2; color: #991b1b; }
.btn--danger:hover { background: #fecaca; }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.tooltip-wrap { position: relative; display: inline-block; }
.tooltip-callout {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f8fafc;
  font-size: 12px;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 5px;
  pointer-events: none;
  z-index: 20;
}
.tooltip-callout::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1e293b;
}
.tooltip-wrap:hover .tooltip-callout { display: block; }

/* Draft sections */
.section-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 14px;
  overflow: hidden;
}
.section-card--flagged {
  border-color: #f59e0b;
}
.section-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  gap: 12px;
}
.section-card--flagged .section-card__header {
  background: #fffbeb;
  border-bottom-color: #f59e0b;
}
.section-card__title { font-weight: 600; font-size: 14px; margin: 0; }
.section-card__actions { display: flex; gap: 8px; flex-shrink: 0; }
.section-card__body { padding: 16px 20px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }

/* Validation result */
.validation-feedback {
  padding: 12px 20px;
  border-top: 1px solid #f59e0b;
  background: #fffbeb;
  font-size: 13px;
  color: #854d0e;
}
.validation-feedback strong {
  display: block;
  margin-bottom: 6px;
}
.validation-feedback__list {
  margin: 0 0 12px 0;
  padding-left: 20px;
}
.validation-feedback__list li {
  margin-bottom: 6px;
  line-height: 1.5;
}
.validation-feedback__list li:last-child {
  margin-bottom: 0;
}

/* Inline edit form */
.edit-form textarea {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
}
.edit-form__actions { display: flex; gap: 8px; margin-top: 10px; }

/* Pagination */
.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 24px;
}

/* Draft metadata strip */
.draft-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 20px;
}
.draft-meta strong { color: #1a1a1a; }

/* Awards split-panel layout */
.awards-list {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px;
}
.awards-panel {
  position: fixed;
  top: 52px;
  right: 0;
  width: 0;
  height: calc(100vh - 52px);
  overflow: hidden;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  box-shadow: -4px 0 16px rgba(0,0,0,0.08);
  transition: width 0.25s ease;
  z-index: 50;
}
.awards-panel.is-open {
  width: 480px;
  overflow-y: auto;
}
.awards-panel__inner {
  padding: 24px;
  min-width: 480px;
}
.awards-panel__close {
  background: none;
  border: none;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  float: right;
}
.awards-panel__close:hover { color: #1a1a1a; }
.award-card--active {
  border-color: #2563eb;
  background: #eff6ff;
}

/* Utilities */
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.align-center { align-items: center; }
.text-muted { color: #64748b; }
.text-sm { font-size: 13px; }

/* Form primitives */
.form-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 500;
}
.form-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.form-input:focus { outline: 2px solid #2563eb; outline-offset: 1px; border-color: transparent; }

/* Tendersmart landing page */
.ts-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0c2340 100%);
  color: #f8fafc;
  padding: 80px 24px;
  text-align: center;
}
.ts-hero__inner { max-width: 640px; margin: 0 auto; }
.ts-hero__badge {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  color: #94a3b8;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.ts-hero__title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -1px;
  margin: 0 0 16px;
}
.ts-hero__sub {
  font-size: 16px;
  line-height: 1.7;
  color: #94a3b8;
  margin: 0;
}

.ts-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}
.ts-stat {
  padding: 28px 48px;
  text-align: center;
  border-right: 1px solid #e2e8f0;
}
.ts-stat:last-child { border-right: none; }
.ts-stat__num {
  font-size: 32px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
}
.ts-stat__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  font-weight: 500;
}

.ts-pipeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 40px 0;
}
.ts-phase {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.ts-phase__num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e293b;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ts-phase__name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.ts-phase__desc { font-size: 13px; color: #64748b; line-height: 1.5; }

.ts-activity {
  display: flex;
  justify-content: center;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.ts-activity__item {
  padding: 16px 40px;
  text-align: center;
  border-right: 1px solid #e2e8f0;
}
.ts-activity__item:last-child { border-right: none; }
.ts-activity__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  font-weight: 500;
  margin-bottom: 4px;
}
.ts-activity__val {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

@media (max-width: 640px) {
  .ts-hero__title { font-size: 32px; }
  .ts-stats { flex-direction: column; }
  .ts-stat { border-right: none; border-bottom: 1px solid #e2e8f0; padding: 20px 24px; }
  .ts-stat:last-child { border-bottom: none; }
  .ts-activity { flex-direction: column; }
  .ts-activity__item { border-right: none; border-bottom: 1px solid #e2e8f0; padding: 14px 24px; }
  .ts-activity__item:last-child { border-bottom: none; }
  .ts-pipeline { grid-template-columns: 1fr; }
}

/* Sagewalk landing page */
.sw-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0f2942 100%);
  color: #f8fafc;
  padding: 80px 24px;
  text-align: center;
}
.sw-hero__inner { max-width: 600px; margin: 0 auto; }
.sw-hero__badge {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  color: #94a3b8;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.sw-hero__title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -1px;
  margin: 0 0 16px;
}
.sw-hero__sub {
  font-size: 16px;
  line-height: 1.7;
  color: #94a3b8;
  margin: 0 0 32px;
}
.sw-hero .btn { margin: 0 6px; }

.sw-phases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 40px 0;
}
.sw-phase {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.sw-phase__num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1e293b;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sw-phase__name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.sw-phase__desc { font-size: 13px; color: #64748b; line-height: 1.5; }

@media (max-width: 640px) {
  .sw-phases { grid-template-columns: 1fr; }
  .sw-hero__title { font-size: 32px; }
}

/* Page header row variant: title + action button side by side */
.page-header--row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* Sources list */
.sources-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 8px 8px 0 0;
  gap: 10px;
  flex-wrap: wrap;
}
.sources-header__filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.sources-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  align-items: center;
  padding: 14px 20px;
}

/* ── Responsive (mobile) ──────────────────────────────────── */
@media (max-width: 640px) {

  /* Nav: brand on top row, links on second row */
  .nav {
    flex-wrap: wrap;
    height: auto;
    padding: 0 16px;
    gap: 0;
  }
  .nav__brand {
    padding: 14px 0;
    flex: 1;
  }
  .nav__links {
    width: 100%;
    gap: 20px;
    padding-bottom: 12px;
  }

  /* Container */
  .container,
  .awards-list {
    padding: 16px;
  }

  /* Page header row: stack on mobile */
  .page-header--row {
    flex-direction: column;
    gap: 10px;
  }

  /* Filter bar: full-width stacked inputs */
  .filter-bar {
    flex-direction: column;
  }
  .filter-bar select,
  .filter-bar input[type="text"] {
    width: 100%;
  }

  /* Opportunity list item: move deadline below meta */
  .opportunity-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .opportunity-item__deadline {
    grid-column: 1;
    grid-row: auto;
    text-align: left;
  }

  /* Field list: stack label/value */
  .field-list {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }
  .field-list dt { margin-top: 8px; }
  .field-list dt:first-child { margin-top: 0; }

  /* Awards slide panel: full-width overlay */
  .awards-panel.is-open { width: 100%; }
  .awards-panel__inner { min-width: 0; padding: 16px; }

  /* Sources list: stack header filters + items */
  .sources-header { flex-direction: column; align-items: flex-start; }
  .sources-header__filters { width: 100%; }
  .sources-header__filters select { flex: 1; min-width: 0; }
  .sources-item { grid-template-columns: 1fr; }
  .sources-item__url { white-space: normal; overflow: visible; }

  /* Section card header: allow wrap */
  .section-card__header { flex-wrap: wrap; }

  /* Add source form: stack fields */
  .add-source-grid { grid-template-columns: 1fr !important; }

  /* Contractor show page: stack header actions */
  .contractor-header-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }
}

/* Scrollable details content */
.details-scroll {
  max-height: 320px;
  overflow-y: auto;
  box-shadow: inset 0 -12px 12px -12px rgba(0,0,0,0.06);
}
.details-scroll--tall {
  max-height: 480px;
  overflow-y: auto;
  box-shadow: inset 0 -12px 12px -12px rgba(0,0,0,0.06);
}

/* Tabs */
.tabs__nav {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 20px;
}
.tabs__tab {
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  transition: color 0.1s;
}
.tabs__tab:hover { color: #1e293b; background: #f8fafc; }
.tabs__tab--active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background: none;
}

/* ── Beat Audio Preview Mixer ───────────────────────────────────────────── */
.mixer-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #1e293b;
  border: 1px solid #334155;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.25s ease, border-color 0.25s ease;
  padding: 0;
}
.mixer-toggle::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #475569;
  top: 2px;
  left: 2px;
  transition: left 0.25s ease, background 0.25s ease;
}
.mixer-toggle--ambience[data-active="true"] {
  background: #064e3b;
  border-color: #10b981;
}
.mixer-toggle--ambience[data-active="true"]::after {
  left: 22px;
  background: #10b981;
}
.mixer-toggle--music[data-active="true"] {
  background: #451a03;
  border-color: #f59e0b;
}
.mixer-toggle--music[data-active="true"]::after {
  left: 22px;
  background: #f59e0b;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
