/* ─────────────────────────────────────────────
   Dashboard Styles
   ───────────────────────────────────────────── */

/* ── Login ── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-md);
}

.login-logo {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.login-logo span { color: var(--green); }

.login-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-group input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-mid);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus { border-color: var(--green); }

.login-error {
  background: #FEF2F2;
  color: #B91C1C;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  margin-bottom: 1rem;
}

.btn-primary {
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  padding: 10px 20px;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary.full-width { width: 100%; margin-bottom: 1rem; }

.forgot-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.forgot-link:hover { color: var(--text-secondary); }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Topbar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 54px;
}

.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.logo {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.3px;
}
.logo span { color: var(--green); }

.pharmacy-pill {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface-2);
  border-radius: 20px;
  padding: 3px 10px;
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.online-label { font-size: 13px; color: var(--text-secondary); }

.btn-ghost-sm {
  font-size: 12px;
  color: var(--text-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
}
.btn-ghost-sm:hover { background: var(--surface-2); }

/* ── Stats Bar ── */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 24px;
}

.stat-val {
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-primary);
}

.stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  white-space: nowrap;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

/* ── Board ── */
.board {
  padding: 1.5rem;
  max-width: 1600px;
}

.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-tertiary);
  font-size: 14px;
}
.empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  color: var(--green);
}

/* ── Ticket ── */
.ticket {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
  animation: fadeIn 0.25s ease;
}
.ticket:hover { box-shadow: var(--shadow-md); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ticket[data-status="ready"] {
  border-color: var(--green);
  border-width: 1.5px;
}
.ticket[data-status="picked_up"] {
  opacity: 0.4;
}

.ticket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ticket-code {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 4px;
  color: var(--text-primary);
}
.font-mono { font-family: var(--font-mono); }

.ticket-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 20px;
}
.badge-new   { background: var(--status-new);   color: var(--status-new-txt); }
.badge-ready { background: var(--status-ready); color: var(--status-ready-txt); }
.badge-done  { color: var(--status-done-txt); background: var(--surface-2); }

.ticket-time {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.ticket-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── Ticket Items ── */
.ticket-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ticket-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--r-sm);
  padding: 3px 4px;
  margin: -3px -4px;
  transition: background 0.15s;
}
.ticket-item:hover { background: var(--surface-2); color: var(--text-primary); }

.ticket-item-qty {
  font-weight: 500;
  font-size: 11px;
  color: var(--text-primary);
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}

.ticket-item-name {
  line-height: 1.4;
}

/* ── Hint Strip ── */
.ticket-hint-strip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #92400E;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--r-md);
  padding: 8px 10px;
  line-height: 1.4;
}

/* ── Ticket Actions ── */
.ticket-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-ready {
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  border: none;
  border-radius: var(--r-md);
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  transition: background 0.15s;
}
.btn-ready:hover { background: #c2ebdb; }

.btn-decline {
  background: transparent;
  color: #B91C1C;
  font-size: 12px;
  font-family: var(--font);
  border: 1px solid #FECACA;
  border-radius: var(--r-md);
  padding: 6px 12px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s;
}
.btn-decline:hover { background: #FEF2F2; }

.btn-pickup {
  background: transparent;
  color: var(--text-tertiary);
  font-size: 12px;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 7px 12px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s;
}
.btn-pickup:hover { background: var(--surface-2); }

/* ── Product Modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}
.modal-backdrop:not([hidden]) {
  display: flex;
}

.modal-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  overflow: hidden;
  position: relative;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: background 0.15s;
  z-index: 1;
}
.modal-close:hover { background: rgba(0,0,0,0.15); }

.modal-img-wrap {
  background: var(--surface-2);
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-product-img {
  max-height: 150px;
  max-width: 80%;
  object-fit: contain;
}

.modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.modal-category {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--green);
  font-weight: 500;
  margin-bottom: 4px;
}

.modal-product-name {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 8px;
  line-height: 1.3;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.modal-hint {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--r-md);
  padding: 10px 14px;
}

.hint-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #92400E;
  margin-bottom: 5px;
}

.modal-hint p {
  font-size: 13px;
  color: #78350F;
  line-height: 1.5;
}

.stat-item {
  cursor: pointer;
  transition: background 0.15s;
  border-radius: var(--r-sm);
  padding: 10px 24px;
}
.stat-item:hover { background: var(--surface-2); }
.stat-active { background: var(--green-light) !important; color: var(--green-dark) !important; border-radius: var(--r-sm); }

.badge-declined { background: #FEF2F2; color: #B91C1C; }

.btn-decline-pharma {
  background: #B91C1C;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  border: none;
  border-radius: var(--r-md);
  padding: 6px 12px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s;
}
.btn-decline-pharma:hover { opacity: 0.88; }

/* ── Screening Strip ── */
.ticket-screening-strip {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.screening-answer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.screening-answer-row:last-child { border-bottom: none; }
.screening-answer-q { color: var(--text-secondary); }
.screening-answer-v { font-weight: 500; white-space: normal; flex-shrink: 0; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.screening-answer-v.yes { color: #B91C1C; }
.screening-answer-v.no  { color: #166534; }
.screening-answer-v.val { color: var(--text-primary); }