:root {
  --brand-primary: #0f172a;
  --brand-primary-2: #1e293b;
  --brand-accent: #f59e0b;
  --brand-accent-2: #fbbf24;
  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
}
* { -webkit-tap-highlight-color: transparent; }
html, body { font-family: 'Inter', system-ui, -apple-system, sans-serif; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

.brand-bg { background-color: var(--brand-primary); }
.brand-bg-2 { background-color: var(--brand-primary-2); }
.brand-text { color: var(--brand-primary); }
.accent { color: var(--brand-accent); }
.accent-bg { background-color: var(--brand-accent); }

/* Login pin pad */
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 280px; margin: 0 auto; }
.pin-key { font-size: 1.6rem; font-weight: 600; padding: 18px 0; border-radius: 14px; background: rgba(255,255,255,0.06); color: white; border: 1px solid rgba(255,255,255,0.12); transition: transform .05s ease; }
.pin-key:active { transform: scale(0.96); background: rgba(255,255,255,0.16); }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 24px 0; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; background: rgba(255,255,255,0.18); }
.pin-dot.filled { background: var(--brand-accent); }

.user-tile { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); transition: all .15s ease; }
.user-tile:hover { background: rgba(255,255,255,0.10); transform: translateY(-2px); }

.sidebar-link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; color: rgba(255,255,255,0.78); transition: all .12s ease; }
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: white; }
.sidebar-link.active { background: rgba(245,158,11,0.18); color: var(--brand-accent); }
.sidebar-link i { font-size: 1.2rem; }

.badge-red { background: #ef4444; color: white; font-size: 0.7rem; padding: 2px 7px; border-radius: 999px; font-weight: 600; min-width: 20px; text-align: center; display: inline-block; }

.card { background: white; border-radius: 14px; box-shadow: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04); border: 1px solid #e2e8f0; }
.card-pad { padding: 20px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 0.875rem; transition: all .12s; cursor: pointer; }
.btn-primary { background: var(--brand-primary); color: white; }
.btn-primary:hover { background: var(--brand-primary-2); }
.btn-accent { background: var(--brand-accent); color: var(--brand-primary); }
.btn-accent:hover { background: var(--brand-accent-2); }
.btn-ghost { background: transparent; color: var(--brand-primary); border: 1px solid #cbd5e1; }
.btn-ghost:hover { background: #f1f5f9; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }

.progress-rail { background: #e2e8f0; height: 8px; border-radius: 999px; overflow: hidden; }
.progress-fill { background: linear-gradient(90deg, var(--brand-accent), var(--brand-accent-2)); height: 100%; border-radius: 999px; transition: width .4s ease; }

.status-pill { font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; display: inline-block; }
.status-not_started { background: #e2e8f0; color: #475569; }
.status-in_progress { background: #fef3c7; color: #92400e; }
.status-complete { background: #d1fae5; color: #065f46; }
.status-pending { background: #e2e8f0; color: #475569; }

.input { width: 100%; padding: 10px 14px; border-radius: 10px; border: 1px solid #cbd5e1; font-size: 0.9rem; transition: border-color .12s; }
.input:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 3px rgba(245,158,11,0.18); }

.message-bubble { max-width: 75%; padding: 10px 14px; border-radius: 14px; line-height: 1.4; }
.message-mine { background: var(--brand-primary); color: white; border-bottom-right-radius: 4px; margin-left: auto; }
.message-theirs { background: white; color: #0f172a; border-bottom-left-radius: 4px; border: 1px solid #e2e8f0; }

.fade-in { animation: fade-in .25s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; position: fixed; z-index: 50; height: 100vh; width: 80%; max-width: 320px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 45; display: none; }
  .sidebar.open + .sidebar-overlay { display: block; }
}

@media print {
  .no-print, .sidebar, .sidebar-overlay, header.no-print { display: none !important; }
  body, html { background: white !important; overflow: visible !important; }
  body { padding: 0 !important; margin: 0 !important; }
  main, main > div, .min-h-screen { display: block !important; height: auto !important; min-height: 0 !important; overflow: visible !important; }
  .flex-1 { flex: none !important; }
  .card { box-shadow: none !important; border: 1px solid #cbd5e1 !important; break-inside: avoid; page-break-inside: avoid; }
  .progress-rail { border: 1px solid #94a3b8; }
  .progress-fill { background: #475569 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .accent, .brand-text, .text-amber-600, .text-emerald-600, .badge-red, .status-pill, .accent-bg {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .scrollbar-thin::-webkit-scrollbar, ::-webkit-scrollbar { display: none !important; width: 0 !important; }
  .grid { grid-template-columns: 1fr !important; }
  .lg\:grid-cols-4, .md\:grid-cols-2, .lg\:grid-cols-3 { grid-template-columns: repeat(2, 1fr) !important; }
  a { color: inherit !important; text-decoration: none !important; }
  @page { margin: 0.5in; size: letter; }
}

.kbd { font-family: ui-monospace, SFMono-Regular, monospace; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 0.85em; border: 1px solid #cbd5e1; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
