/* ============================================================================
   San Jose del Monte Treasury Queue — shared theme
   System accent: ORANGE → PINK. Every surface, button and highlight pulls from
   the tokens below, so the whole system (login, queue pages, dashboards) keeps
   one warm orange-to-pink identity.
   ============================================================================ */
:root {
  /* Brand ramp — the two accent hues the whole system is built from.
   ORANGE leads, PINK supports. */
  --brand-orange-light: #fdba74;
  --brand-orange: #f97316;
  --brand-orange-deep: #ea580c;
  --brand-pink-light: #f9a8d4;
  --brand-pink: #ec4899;
  --brand-pink-deep: #db2777;

  /* Flat fills, not blends. The system's two colours are used SEPARATELY --
     pink as the brand/primary, orange as the warm/priority signal -- so nothing
     fades one into the other. These are only fallbacks: every page overrides
     them with the saved theme (settings_head_tags()). */
  --accent-gradient: #f97316;
  --accent-gradient-soft: rgba(249, 115, 22, 0.14);

  /* Page backdrop — one flat wash over the building photo. */
  --queue-bg: rgba(255, 246, 236, 0.95);

  --surface: rgba(255, 255, 255, 0.96);
  --surface-strong: #ffffff;
  --surface-soft: #fff6f0;
  --border: rgba(190, 24, 93, 0.1);
  --border-strong: rgba(190, 24, 93, 0.2);
  --text-main: #40172c;
  --text-muted: #9a5b6e;
  --title-accent: #ea580c;
  --title-base: #7c2d4a;
  --accent: #f97316;
  --accent-dark: #c2410c;
  --accent-warm: #ec4899;
  --accent-soft: rgba(249, 115, 22, 0.12);
  --accent-warm-soft: rgba(236, 72, 153, 0.12);
  --success: #15803d;
  --success-soft: rgba(21, 128, 61, 0.12);
  --shadow: 0 18px 45px rgba(190, 24, 93, 0.12);
  --shadow-soft: 0 10px 28px rgba(190, 24, 93, 0.09);
  --glow-accent: 0 16px 34px rgba(249, 115, 22, 0.28);
}

/* The pink theme is now the system default dressed a touch warmer — kept as an
   explicit hook because every page opts in with data-theme="pink". */
[data-theme='pink'] {
  --queue-bg: rgba(255, 244, 232, 0.95);
  --surface: rgba(255, 255, 255, 0.94);
  --surface-strong: #fffaf7;
  --surface-soft: #fff3f1;
  --border: rgba(190, 24, 93, 0.12);
  --border-strong: rgba(190, 24, 93, 0.22);
  --text-main: #4a1230;
  --text-muted: #9d4b72;
  --title-accent: #ea580c;
  --title-base: #831843;
  --accent: #f97316;
  --accent-dark: #c2410c;
  --accent-warm: #ec4899;
  --accent-soft: rgba(249, 115, 22, 0.14);
  --accent-warm-soft: rgba(236, 72, 153, 0.14);
  --success: #db2777;
  --success-soft: rgba(236, 72, 153, 0.12);
  --shadow: 0 18px 45px rgba(131, 24, 67, 0.14);
  --shadow-soft: 0 10px 28px rgba(131, 24, 67, 0.1);
  --glow-accent: 0 16px 34px rgba(249, 115, 22, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Public Sans', sans-serif;
  color: var(--text-main);
  background: #fde7d8 url('IMG/bgIMG.jpg') center bottom / cover no-repeat fixed;
}

/* Orange→pink wash over the city hall building photo. This is the page gradient:
   it must stay translucent (so the building reads as a faint backdrop) and it
   must come from --queue-bg so a theme can restyle the whole system at once.
   It used to be three identical opaque stops, i.e. a flat block of colour that
   both killed the gradient and hid the photo entirely. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--queue-bg);
  background-attachment: fixed;
}

.queue-shell {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 32px;
}

.queue-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.queue-brand-logo {
  height: clamp(66px, 5.4vw, 86px);
  width: auto;
  flex: none;
  filter: drop-shadow(0 6px 12px rgba(131, 24, 67, 0.18));
}

.queue-brand-text {
  min-width: 0;
}

.queue-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.queue-brand h1 {
  margin: 0;
  font-size: clamp(1.75rem, 2vw, 2.35rem);
  line-height: 1.15;
  font-weight: 800;
  color: var(--title-accent);
}

.queue-brand h1 span {
  display: block;
  margin-top: 2px;
  font-size: 0.72em;
  font-weight: 700;
  color: var(--title-base);
}

.queue-brand p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 1.12rem;
  font-weight: 500;
}

.queue-topbar-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.meta-chip {
  min-width: 185px;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.meta-chip-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-chip-value {
  margin-top: 6px;
  display: block;
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text-main);
}

.queue-toolbar {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  color: var(--accent);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-strong);
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.back-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
  background: rgba(255, 255, 255, 0.96);
}

.queue-page-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-card {
  margin-top: 18px;
  padding: 28px;
  border-radius: 30px;
  background: var(--surface-strong, #ffffff);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.hero-card-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.hero-copy h2 {
  margin: 0;
  font-size: clamp(2.3rem, 2.7vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--title-base);
}

.hero-copy p {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--text-muted);
  font-size: 1.18rem;
  line-height: 1.6;
}

.hero-status {
  min-width: 220px;
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.hero-status-label {
  display: block;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 800;
}

.hero-status-value {
  margin-top: 10px;
  display: block;
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--accent);
}

.summary-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.summary-card {
  padding: 18px 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.summary-label {
  display: block;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.summary-value {
  display: block;
  margin-top: 10px;
  font-size: 2.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.summary-value.summary-accent {
  color: var(--accent);
}

.summary-note {
  margin-top: 8px;
  display: block;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.queue-list-card {
  margin-top: 22px;
  padding: 18px;
  border-radius: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.queue-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 8px 18px;
}

.queue-list-head h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--title-base);
}

.queue-list-head p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.queue-list-tag {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.queue-table-wrap {
  max-height: 560px;
  overflow-x: auto;
  overflow-y: auto;
  padding-right: 4px;
}

.queue-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
}

.queue-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 248, 245, 0.97);
  padding: 0 18px 10px;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.queue-table tbody tr {
  background: var(--surface-strong);
  box-shadow: 0 8px 24px rgba(190, 24, 93, 0.05);
}

.queue-table tbody td {
  padding: 22px 20px;
  font-size: 1.15rem;
  border-top: 1px solid rgba(251, 207, 232, 0.6);
  border-bottom: 1px solid rgba(251, 207, 232, 0.6);
  vertical-align: middle;
}

.queue-table tbody td:first-child {
  border-left: 1px solid rgba(251, 207, 232, 0.6);
  border-radius: 20px 0 0 20px;
}

.queue-table tbody td:last-child {
  border-right: 1px solid rgba(251, 207, 232, 0.6);
  border-radius: 0 20px 20px 0;
}

.queue-number-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--title-base);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.queue-number-btn strong {
  font-size: 1.25rem;
  font-weight: 800;
}

.queue-number-btn span {
  display: block;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

.queue-number-btn:hover strong {
  color: var(--accent);
}

.queue-date {
  color: var(--text-main);
  font-weight: 700;
}

.queue-description {
  max-width: 260px;
  color: var(--text-muted);
  line-height: 1.5;
}

.queue-empty {
  padding: 32px 18px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
}

.done-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 124px;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid rgba(21, 128, 61, 0.18);
  background: var(--success-soft);
  color: var(--success);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.done-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(21, 128, 61, 0.12);
  background: rgba(21, 128, 61, 0.16);
}

/* "Done" state — filled green so it visually announces "finish & remove". */
.done-btn.is-complete {
  background: #15803d;
  color: #ffffff;
  border-color: #15803d;
}

.done-btn.is-complete:hover {
  background: #166534;
  border-color: #166534;
  box-shadow: 0 10px 20px rgba(21, 128, 61, 0.25);
}

/* Priority Next button: clean outline style in the same amber as the rail. */
.queue-row.is-priority .done-btn {
  border-color: rgba(217, 119, 6, 0.45);
  background: #ffffff;
  color: #b45309;
  font-weight: 800;
  box-shadow: none;
}

.queue-row.is-priority .done-btn:hover {
  background: #fff7ed;
  border-color: #d97706;
  box-shadow: none;
  transform: none;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(76, 18, 43, 0.4);
  backdrop-filter: blur(8px);
}

.modal.active {
  display: flex;
}

.modal-content {
  width: min(680px, 100%);
  background: #ffffff;
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: 0 22px 60px rgba(131, 24, 67, 0.2);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px;
  background: var(--surface-soft, #fff4ec);
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--title-base);
}

.close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.modal-body {
  padding: 26px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-card {
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.detail-card.full {
  grid-column: 1 / -1;
}

.detail-card-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-card-value {
  display: block;
  margin-top: 8px;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.55;
}

.amount-value {
  color: var(--accent);
  font-size: 1.4rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 26px 26px;
}

.modal-btn {
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-main);
  font-size: 1.08rem;
  font-weight: 800;
  cursor: pointer;
}

.modal-btn.primary {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
}

.queue-footer {
  margin-top: 24px;
  padding: 18px 6px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.queue-footer strong {
  color: var(--title-base);
}

@media (max-width: 1180px) {
  .queue-shell {
    padding: 22px 18px 28px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .queue-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .queue-topbar-meta {
    justify-content: flex-start;
  }

  .meta-chip {
    flex: 1 1 180px;
    min-width: 0;
  }

  .hero-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-status {
    min-width: 0;
    width: 100%;
  }

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

@media (max-width: 768px) {
  .queue-shell {
    padding: 16px 14px 24px;
  }

  .queue-topbar,
  .hero-card,
  .queue-list-card {
    border-radius: 24px;
  }

  .queue-topbar {
    padding: 20px;
  }

  .queue-brand {
    gap: 14px;
  }

  .queue-brand h1 {
    font-size: 1.4rem;
  }

  .queue-brand p {
    font-size: 0.88rem;
  }

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

  .hero-card {
    padding: 22px;
  }

  .hero-copy h2 {
    font-size: 1.6rem;
  }

  .hero-copy p {
    font-size: 0.95rem;
  }

  .hero-status-value {
    font-size: 1.6rem;
  }

  .queue-list-head {
    align-items: flex-start;
  }

  .queue-table {
    min-width: 640px;
  }

  .queue-table-wrap {
    max-height: 500px;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    padding: 14px;
  }

  .modal-content {
    border-radius: 22px;
  }

  .modal-header {
    padding: 20px 20px;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-footer {
    padding: 0 20px 20px;
    flex-wrap: wrap;
  }

  .modal-btn {
    flex: 1 1 140px;
  }

  .queue-footer {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 540px) {
  .queue-shell {
    padding: 12px 10px 20px;
  }

  .queue-topbar {
    padding: 16px;
    border-radius: 20px;
  }

  .queue-brand {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 10px;
  }

  .queue-brand-logo {
    height: 62px;
  }

  .queue-brand h1 {
    font-size: 1.25rem;
  }

  .queue-brand h1 span {
    font-size: 0.7em;
  }

  .queue-topbar-meta {
    width: 100%;
    gap: 8px;
  }

  .meta-chip {
    flex: 1 1 calc(50% - 8px);
    padding: 10px 12px;
    border-radius: 14px;
  }

  .meta-chip-value {
    font-size: 0.9rem;
  }

  .queue-toolbar {
    margin-top: 16px;
    gap: 10px;
  }

  .back-link,
  .queue-page-badge {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .hero-card {
    padding: 18px;
    border-radius: 20px;
  }

  .hero-copy h2 {
    font-size: 1.4rem;
  }

  .hero-status {
    padding: 14px 16px;
    border-radius: 18px;
  }

  .hero-status-value {
    font-size: 1.4rem;
  }

  .summary-card {
    padding: 16px;
    border-radius: 20px;
  }

  .summary-value {
    font-size: 1.5rem;
  }

  .queue-list-card {
    padding: 14px;
    border-radius: 20px;
  }

  .queue-list-head {
    padding: 6px 4px 14px;
  }

  .queue-list-head h3 {
    font-size: 1.1rem;
  }

  .queue-list-head p {
    font-size: 0.88rem;
  }

  .queue-list-tag {
    padding: 8px 12px;
    font-size: 0.72rem;
  }

  .queue-table {
    min-width: 560px;
  }

  .queue-table tbody td {
    padding: 16px 14px;
    font-size: 0.92rem;
  }

  .done-btn {
    min-width: 0;
    width: 100%;
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .modal-header h2 {
    font-size: 1.15rem;
  }

  .detail-card {
    padding: 14px 16px;
    border-radius: 16px;
  }

  .modal-btn {
    width: 100%;
    flex: 1 1 100%;
  }
}

@media (max-width: 380px) {
  .queue-brand h1 {
    font-size: 1.1rem;
  }

  .meta-chip {
    flex: 1 1 100%;
  }

  .hero-copy h2 {
    font-size: 1.25rem;
  }

  .summary-value {
    font-size: 1.35rem;
  }
}

.queue-row.is-serving td {
  background: rgba(236, 72, 153, 0.08);
  border-left: 3px solid var(--accent, #ec4899);
}

.queue-row.is-serving .queue-number-btn strong {
  color: var(--accent, #ec4899);
}

/* Minimalist priority treatment — restrained, no gradients/pulse/shadows.
   The signal comes from a single 3-px amber rail on the left edge plus a
   small flat badge. Enough to spot at a glance, not enough to feel loud. */
.queue-row.is-priority td {
  background: #fffaf2;
  border-top-color: rgba(245, 158, 11, 0.18);
  border-bottom-color: rgba(245, 158, 11, 0.18);
}

.queue-row.is-priority td:first-child {
  border-left: 3px solid #f59e0b;
}

.queue-row.is-priority.is-serving td {
  background: #fff5e6;
}

.queue-row.is-priority .queue-number-btn strong {
  color: #b45309;
}

/* Matches the queue-view.php badge: solid white pill with deep amber
   text — readable against any row tint and consistent across the system. */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #ffffff;
  color: #b45309;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  vertical-align: middle;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(180, 83, 9, 0.18);
}

.priority-badge i {
  font-size: 0.82rem;
  color: #d97706;
}

/* "Being served by Cashier N" pill — tells a cashier that a colleague is already
   processing this number so they don't re-call it. Amber = another window has
   it; slate = it's this station's own call. */
.servedby-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
  line-height: 1.4;
  white-space: nowrap;
}

.servedby-badge i {
  font-size: 0.9rem;
}

.servedby-badge.is-mine {
  background: #e2e8f0;
  color: #334155;
  border-color: #cbd5e1;
}
