/* F&B Service — complements Tailwind CDN */
:root {
  --fnb-navy-950: #0a1628;
  --fnb-navy-900: #0f2744;
  --fnb-glass-border: rgba(255, 255, 255, 0.14);
}

html {
  scroll-behavior: smooth;
}

body.fnb-body {
  min-height: 100vh;
  background-color: var(--fnb-navy-950);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(99, 102, 241, 0.2), transparent 50%),
    linear-gradient(160deg, var(--fnb-navy-950), var(--fnb-navy-900) 45%, #0b1a30 100%);
}

.fnb-glass {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--fnb-glass-border);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.fnb-glass-strong {
  background: rgba(15, 39, 68, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.fnb-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fnb-table-wrap.fnb-table-wrap--stacked {
  overflow-x: visible;
}

/**
 * Below lg: tables marked .fnb-table--stacked render each body row as a card;
 * cell labels come from data-fnb-label (set by assets/js/app.js from <thead>).
 */
@media (max-width: 1023px) {
  main table.fnb-table--stacked {
    display: block;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  main table.fnb-table--stacked thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  main table.fnb-table--stacked tbody,
  main table.fnb-table--stacked tfoot {
    display: block;
  }

  main table.fnb-table--stacked tbody tr,
  main table.fnb-table--stacked tfoot tr {
    display: block;
    margin-bottom: 0.75rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.45);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    overflow: hidden;
  }

  main table.fnb-table--stacked tbody tr.fnb-table-row--message,
  main table.fnb-table--stacked tfoot tr.fnb-table-row--message {
    padding: 0.75rem 1rem;
    text-align: center;
  }

  main table.fnb-table--stacked tbody tr.fnb-table-row--message td,
  main table.fnb-table--stacked tfoot tr.fnb-table-row--message td {
    display: block;
    border: 0 !important;
    padding: 0.25rem 0 !important;
    text-align: center;
  }

  main table.fnb-table--stacked tbody tr.fnb-table-row--message td::before,
  main table.fnb-table--stacked tfoot tr.fnb-table-row--message td::before {
    content: none !important;
  }

  main table.fnb-table--stacked tbody td,
  main table.fnb-table--stacked tbody th,
  main table.fnb-table--stacked tfoot td,
  main table.fnb-table--stacked tfoot th {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.85rem !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
    text-align: right;
    font-size: 0.875rem;
  }

  main table.fnb-table--stacked tbody tr > td:last-child,
  main table.fnb-table--stacked tbody tr > th:last-child,
  main table.fnb-table--stacked tfoot tr > td:last-child {
    border-bottom: 0 !important;
  }

  main table.fnb-table--stacked tbody td::before,
  main table.fnb-table--stacked tbody th::before,
  main table.fnb-table--stacked tfoot td::before,
  main table.fnb-table--stacked tfoot th::before {
    content: attr(data-fnb-label);
    flex: 0 0 42%;
    max-width: 11rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.95);
    padding-top: 0.15rem;
  }

  /* Inputs and controls inside stacked cells stay full width of value column */
  main table.fnb-table--stacked tbody td input,
  main table.fnb-table--stacked tbody td select,
  main table.fnb-table--stacked tbody td textarea {
    width: 100%;
    max-width: 100%;
  }

  main table.fnb-table--stacked tbody td .flex.flex-wrap {
    justify-content: flex-end;
  }
}

/* PDF / export dashboard (light panel on main) */
@media (max-width: 1023px) {
  #managementDashboard table.fnb-table--stacked tbody tr,
  #managementDashboard table.fnb-table--stacked tfoot tr {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  }

  #managementDashboard table.fnb-table--stacked tbody td,
  #managementDashboard table.fnb-table--stacked tbody th,
  #managementDashboard table.fnb-table--stacked tfoot td {
    border-bottom-color: #e2e8f0 !important;
    color: #0f172a;
  }

  #managementDashboard table.fnb-table--stacked tbody td::before,
  #managementDashboard table.fnb-table--stacked tbody th::before,
  #managementDashboard table.fnb-table--stacked tfoot td::before {
    color: #64748b;
  }
}

.fnb-heat-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.fnb-heat-scroll-inner {
  min-width: 22rem;
}

.fnb-nav-link {
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.fnb-nav-link:hover {
  transform: translateY(-1px);
}

/* EM Departure KPI card — dark staff dropdown (matches report page) */
#emDepartureForm select.fnb-em-staff-select {
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: 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='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 0.75rem;
}

#emDepartureForm select.fnb-em-staff-select option {
  background-color: #0c1222;
  color: #f8fafc;
}

#emDepartureForm select.fnb-em-staff-select option:checked {
  background-color: #132238;
  color: #f8fafc;
}
