html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 0;
}

/* Base layout styles moved from scoped CSS to avoid missing stylesheet issues. */
a.navbar-brand {
  white-space: nowrap;
  text-align: left;
  word-break: normal;
  overflow-wrap: normal;
  flex-shrink: 0;
}

a {
  color: #0077cc;
}

.btn-primary {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
}

.border-top {
  border-top: 1px solid #e5e5e5;
}

.border-bottom {
  border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05);
}

button.accept-policy {
  font-size: 1rem;
  line-height: inherit;
}

.footer {
  position: static;
  width: 100%;
  white-space: normal;
  line-height: 1.4;
  padding: 0.75rem 0;
}

/* Procurement module */
.procurement-nav .btn {
  min-width: 140px;
}

.procurement-table th,
.procurement-table td {
  vertical-align: top;
}

.procurement-table .doc-amount-cell {
  min-width: 220px;
}

.procurement-table .doc-activities {
  min-height: 6rem;
}

.procurement-table .doc-actions {
  min-width: 170px;
}

.procurement-breadcrumbs .breadcrumb {
  font-size: 0.85rem;
  margin-bottom: 0;
}

.procurement-breadcrumbs .breadcrumb-item + .breadcrumb-item::before {
  color: #94a3b8;
}

.procurement-breadcrumbs .breadcrumb-item a {
  text-decoration: none;
}

.procurement-share-hero {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
}

.procurement-share-request {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1rem;
  background: #ffffff;
  margin-bottom: 1rem;
}

.procurement-share-request h5 {
  margin-bottom: 0.5rem;
}

.procurement-share-docs {
  margin-top: 0.75rem;
}

.procurement-share-docs table {
  margin-bottom: 0;
}

.procurement-share-proof {
  font-size: 0.85rem;
  color: #475569;
}

.procurement-share-proof-list {
  display: grid;
  gap: 0.5rem;
}

.procurement-share-proof strong {
  font-weight: 600;
}

.procurement-page {
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom));
}

.procurement-cta-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  padding: 0.65rem 0.9rem calc(0.65rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid #d7deea;
  box-shadow: 0 -8px 16px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(2px);
}

.procurement-cta-sticky .btn {
  width: 100%;
}

.procurement-cta-sticky-top {
  position: sticky;
  top: 0.75rem;
  z-index: 1030;
  padding: 0.65rem 0.9rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #d7deea;
  border-radius: 0.65rem;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.procurement-cta-sticky-top .btn {
  width: 100%;
}

@media (min-width: 768px) {
  .procurement-cta-sticky.procurement-cta-inline-desktop {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }

  .procurement-cta-sticky.procurement-cta-inline-desktop .btn {
    width: auto;
  }

  .procurement-cta-sticky-top.procurement-cta-inline-desktop .btn {
    width: auto;
  }
}

.page-cta-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1035;
  padding: 0.65rem 0.9rem calc(0.65rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid #d7deea;
  box-shadow: 0 -8px 16px rgba(15, 23, 42, 0.08);
}

.page-cta-sticky .btn {
  width: 100%;
}

.page-cta-sticky-top {
  position: sticky;
  top: 0.75rem;
  z-index: 1030;
  padding: 0.65rem 0.9rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #d7deea;
  border-radius: 0.65rem;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
  margin-bottom: 1rem;
}

.page-cta-sticky-top .btn {
  width: 100%;
}

.page-with-sticky-cta {
  padding-bottom: calc(6.5rem + env(safe-area-inset-bottom));
}

.procurement-field-focus {
  outline: 2px solid #1e6fd9;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(30, 111, 217, 0.2);
}

details.card > summary.card-header {
  cursor: pointer;
  list-style: none;
}

details.card > summary.card-header::-webkit-details-marker {
  display: none;
}

.status-legend-toggle summary {
  cursor: pointer;
  font-weight: 600;
  color: #475569;
}

.comment-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.comment-summary-title {
  font-weight: 600;
  color: #111827;
}

.comment-summary-latest {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  color: #0f172a;
}

.comment-summary-meta {
  color: #64748b;
  font-size: 0.8rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid currentColor;
  background: transparent;
  color: #334155;
}

.status-pill .status-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-pill.status-draft {
  color: #64748b;
}

.status-pill.status-submitted {
  color: #475569;
}

.status-pill.status-approved {
  color: #1d4ed8;
}

.status-pill.status-changesrequested {
  color: #b45309;
}

.status-pill.status-rejected {
  color: #b91c1c;
}

.status-pill.status-paymentpending {
  color: #0e7490;
  font-weight: 700;
}

.status-pill.status-paid {
  color: #15803d;
  font-weight: 700;
}

.status-pill.status-auditready {
  color: #0f766e;
  font-weight: 700;
}

.status-pill.status-cancelled {
  color: #6b7280;
}

.status-pill.status-fulfilled {
  color: #0f766e;
}

.status-pill.status-closed {
  color: #475569;
}

.procurement-table tr.status-row-changesrequested > * {
  background-color: #fff7ed;
}

.procurement-table tr.status-row-rejected > * {
  background-color: #fff1f2;
}

.comment-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.comment-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.75rem;
  color: #6b7280;
}

.comment-meta-text {
  color: #6b7280;
}

.comment-text {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.comment-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.comment-badge-request {
  background: #f1f5f9;
  color: #334155;
}

.comment-badge-document {
  background: #ecfeff;
  color: #0e7490;
}

.comment-badge-approval {
  background: #dbeafe;
  color: #1e40af;
}

.comment-badge-reject {
  background: #fee2e2;
  color: #991b1b;
}

.comment-badge-changes {
  background: #ffedd5;
  color: #9a3412;
}

.comment-badge-status {
  background: #e2e8f0;
  color: #475569;
}

.comment-badge-cancel {
  background: #fee2e2;
  color: #991b1b;
}

.comment-badge-proof {
  background: #ecfeff;
  color: #0f766e;
}

.comment-badge-proof-rejected {
  background: #fee2e2;
  color: #b91c1c;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.timeline-item {
  position: relative;
  padding-left: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #cbd5e1;
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: 0.22rem;
  top: 1.1rem;
  bottom: -0.9rem;
  width: 2px;
  background: #e2e8f0;
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.75rem;
  color: #64748b;
}

.timeline-doc {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1f2937;
}

.timeline-text {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: #1f2937;
}

@media (max-width: 768px) {
  .procurement-nav .btn {
    width: 100%;
  }

  .procurement-table thead {
    display: none;
  }

  .procurement-table,
  .procurement-table tbody,
  .procurement-table tr,
  .procurement-table td {
    display: block;
    width: 100%;
  }

  .procurement-table tr {
    margin-bottom: 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 0.5rem;
    background: #fff;
  }

  .procurement-table td {
    border: none;
    padding: 0.5rem 0.75rem;
  }

  .procurement-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #6c757d;
    margin-bottom: 0.25rem;
  }

  .procurement-table .doc-actions {
    padding-bottom: 0.75rem;
  }

  .procurement-table .doc-comments-row {
    margin-top: -0.5rem;
    border-top: none;
  }

  .procurement-table .doc-comments-row td {
    background: transparent;
    border-radius: 0 0 0.5rem 0.5rem;
  }
}

/* Kanban board */
.kanban-toolbar .btn {
  white-space: normal;
}

.kanban-board .card {
  border-radius: 10px;
}

.kanban-column {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 8px;
}

.kanban-card {
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.kanban-card.dragging {
  opacity: 0.6;
  transform: scale(0.98);
}

@media (max-width: 768px) {
  .kanban-filters .btn,
  .kanban-actions .btn {
    width: 100%;
  }
}

/* Onboard phone input must remain readable on narrow screens. */
.onboard-phone-group .onboard-country-select {
  flex: 0 0 12rem;
  max-width: 62%;
}

.onboard-phone-group .onboard-local-number-input {
  min-width: 8rem;
}

@media (max-width: 430px) {
  .onboard-phone-group {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .onboard-phone-group .onboard-country-select,
  .onboard-phone-group .onboard-local-number-input {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }
}
