/* =====================================================================
   Token Management System - application styles
   Layered on top of Bootstrap 5.
   ===================================================================== */

:root {
  --tms-navy: #12263f;
  --tms-accent: #2563eb;
  --tms-surface: #f4f6fa;
}

.app-body {
  background: var(--tms-surface);
}

.app-navbar {
  background: var(--tms-navy);
}

.card {
  border: 1px solid rgba(18, 38, 63, .08);
  border-radius: .6rem;
  box-shadow: 0 1px 2px rgba(18, 38, 63, .05);
}

.stat-card {
  border-left-width: 4px !important;
}

/* ------------------------------------------------------------- login -- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--tms-navy), #24476f);
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: .8rem;
}

/* ---------------------------------------------------------- operator -- */
.token-display {
  font-size: clamp(3rem, 12vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--tms-navy);
}
.current-token-card {
  background: #fff;
  border: 2px solid var(--tms-accent);
}
.btn-touch {
  min-height: 64px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: .03em;
}
.queue-list {
  max-height: 60vh;
  overflow-y: auto;
}
.counter-choice {
  cursor: pointer;
}
.counter-choice:hover {
  border-color: var(--tms-accent);
}

/* ------------------------------------------------- token generation -- */
.btn-service {
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .25rem;
  font-weight: 600;
}
.btn-service .service-name { font-size: 1.15rem; }
.btn-service .service-code { font-size: .8rem; opacity: .7; font-weight: 400; }

.token-display-xl {
  font-size: clamp(4rem, 18vw, 8rem);
  font-weight: 800;
  line-height: 1;
  color: var(--tms-navy);
}

/* ------------------------------------------------------ print slip --- */
.print-slip {
  max-width: 320px;
  margin: 2rem auto;
  padding: 1.25rem;
  font-family: "Segoe UI", Arial, sans-serif;
}
.slip-org { font-size: 1.05rem; font-weight: 700; }
.slip-label { font-size: .8rem; letter-spacing: .12em; }
.slip-token { font-size: 3.6rem; font-weight: 800; line-height: 1.1; }
.slip-line { font-size: .9rem; margin: .15rem 0; }
.slip-note { font-size: .8rem; margin-top: .5rem; }

@media print {
  body { background: #fff; }
  .d-print-none, .app-navbar, .alert { display: none !important; }
  .print-slip { margin: 0; max-width: 100%; }
  .card { border: 0; box-shadow: none; }
  a[href]:after { content: ""; }
}

/* ------------------------------------------------------ TV display --- */
.app-body-blank { margin: 0; }

.display-screen {
  min-height: 100vh;
  background: #0b1a2d;
  color: #fff;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", Arial, sans-serif;
}
.display-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 2px solid rgba(255, 255, 255, .12);
}
.display-org { font-size: clamp(1.1rem, 2.4vw, 2rem); font-weight: 700; letter-spacing: .04em; }
.display-clock { font-size: clamp(1rem, 2vw, 1.7rem); opacity: .85; font-variant-numeric: tabular-nums; }

.display-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}
.display-now-label {
  font-size: clamp(1rem, 2.6vw, 2rem);
  letter-spacing: .35em;
  opacity: .75;
}
.display-token {
  font-size: clamp(5rem, 22vw, 16rem);
  font-weight: 800;
  line-height: .95;
  letter-spacing: .03em;
  color: #ffd166;
}
.display-token.flash { animation: tokenFlash 1s ease-in-out 3; }
@keyframes tokenFlash {
  0%, 100% { color: #ffd166; }
  50%      { color: #fff; }
}
.display-counter {
  font-size: clamp(1.8rem, 7vw, 5rem);
  font-weight: 700;
  margin-top: .5rem;
}
.display-instruction {
  font-size: clamp(1rem, 2.6vw, 2rem);
  opacity: .8;
  margin-top: 1rem;
}

.display-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
  padding: 0 2rem 1rem;
}
.display-grid .cell {
  background: rgba(255, 255, 255, .07);
  border-radius: .6rem;
  padding: .75rem 1rem;
  text-align: center;
}
.display-grid .cell .tok { font-size: clamp(1.5rem, 3.5vw, 2.6rem); font-weight: 700; color: #ffd166; }
.display-grid .cell .ctr { font-size: clamp(.85rem, 1.6vw, 1.1rem); opacity: .85; }

.display-footer {
  border-top: 2px solid rgba(255, 255, 255, .12);
  padding: 1rem 2rem 1.25rem;
}
.display-recent-label { font-size: .8rem; letter-spacing: .3em; opacity: .6; margin-bottom: .5rem; }
.display-recent {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  font-size: clamp(1rem, 2vw, 1.5rem);
}
.display-recent .item { opacity: .85; }
.display-recent .item strong { color: #ffd166; margin-right: .4rem; }
.display-status { margin-top: .75rem; font-size: .95rem; opacity: .8; }

/* --------------------------------------------------------- toasts ---- */
.tms-toast-stack {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: min(90vw, 380px);
}

/* -------------------------------------------------------- tablets ---- */
@media (max-width: 991.98px) {
  .btn-touch { min-height: 72px; font-size: 1.1rem; }
  .queue-list { max-height: 45vh; }
}
