/* ═══════════════════════════════════════════════════
   WRWD — Application Stylesheet
   Font: Hanken Grotesk (loaded via Google Fonts in head.php)
═══════════════════════════════════════════════════ */

/* ----- Base ----- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  background-color: #f8f9ff;
  color: #0b1c30;
  min-height: 100dvh;
  /* Tactile dot-grid canvas */
  background-image: radial-gradient(circle, #c2c6d6 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ----- Safe-area helpers ----- */
.safe-area-top    { padding-top:    env(safe-area-inset-top, 0px); }
.pb-safe          { padding-bottom: env(safe-area-inset-bottom, 16px); }

/* ----- Card elevation system ----- */
.card-level-1 {
  background: #ffffff;
  border: 1px solid #c2c6d6;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card-level-1:hover {
  box-shadow: 0 8px 16px rgba(0,0,0,0.10);
  transform: translateY(-2px) scale(1.005);
}
.card-level-2 {
  background: #ffffff;
  border: 1px solid #c2c6d6;
  box-shadow: 0 8px 16px rgba(0,0,0,0.10);
}

/* ----- Status strip (4px left border accent) ----- */
.status-strip {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
}

/* ----- Sticky note component ----- */
.sticky-note {
  background: linear-gradient(145deg, #fffde7 0%, #fff9c4 100%);
  border: 1px solid #f5e642;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.08);
  position: relative;
  padding: 16px;
}
.sticky-note::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 0 18px 18px;
  border-color: transparent transparent #ede033 transparent;
}

/* ----- Material Symbols FILL utility ----- */
.icon-fill { font-variation-settings: 'FILL' 1; }
.icon-outlined { font-variation-settings: 'FILL' 0; }

/* ----- Progress bar animation ----- */
@keyframes progress-fill {
  from { width: 0; }
}
.progress-animated {
  animation: progress-fill 0.8s cubic-bezier(0.4,0,0.2,1) forwards;
}

/* ----- Skeleton loader ----- */
.skeleton {
  background: linear-gradient(90deg, #e5eeff 25%, #d3e4fe 50%, #e5eeff 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ----- Toast notifications ----- */
#toast-container {
  position: fixed;
  bottom: 90px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
@media (min-width: 768px) {
  #toast-container { bottom: 24px; right: 24px; }
}
.toast {
  background: #213145;
  color: #eaf1ff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  pointer-events: all;
  animation: toast-in 0.3s ease forwards;
  max-width: 320px;
}
.toast.out { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in  { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; transform:translateY(8px); } }

/* ----- Page fade-in ----- */
main { animation: page-in 0.25s ease both; }
@keyframes page-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

/* ----- Scrollbar styling (Webkit) ----- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c2c6d6; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #727785; }

/* ----- Focus ring ----- */
:focus-visible {
  outline: 2px solid #0058be;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ----- Kanban column drag-over state ----- */
.kanban-col.drag-over {
  background: #eff4ff;
  border-color: #0058be;
}

/* ----- Stage timeline connector ----- */
.stage-connector {
  width: 2px;
  background: linear-gradient(to bottom, #0058be, #c2c6d6);
  margin: 0 auto;
  flex-shrink: 0;
}

/* ----- Print styles ----- */
@media print {
  header, nav, #toast-container { display: none !important; }
  body { background: white; background-image: none; }
  .card-level-1, .card-level-2 { box-shadow: none; border: 1px solid #ccc; }
}

/* ─── Dark mode ─── */
html.dark body {
  background-color: #1a2332;
  background-image: radial-gradient(circle, #2d3748 1px, transparent 1px);
  color: #eaf1ff;
}
html.dark .bg-surface-container-lowest { background-color: #213145 !important; }
html.dark .bg-surface-container-low    { background-color: #1e2d3f !important; }
html.dark .bg-surface-container        { background-color: #253550 !important; }
html.dark .bg-surface                  { background-color: #213145 !important; }
html.dark .border-outline-variant      { border-color: #3d526b !important; }
html.dark .text-on-surface             { color: #eaf1ff !important; }
html.dark .text-on-surface-variant     { color: #93a8bf !important; }
html.dark header                       { background-color: rgba(26,35,50,0.95) !important; border-color: #3d526b; }
html.dark nav.fixed                    { background-color: #1a2332 !important; border-color: #3d526b; }
html.dark input, html.dark select, html.dark textarea {
  background-color: #1a2332 !important;
  color: #eaf1ff !important;
  border-color: #3d526b !important;
}

/* ─── Compact mode ─── */
html.compact .p-md  { padding: 12px !important; }
html.compact .p-lg  { padding: 20px !important; }
html.compact .gap-gutter { gap: 12px !important; }
html.compact .py-md { padding-top: 12px !important; padding-bottom: 12px !important; }
html.compact .mb-gutter { margin-bottom: 12px !important; }
html.compact .h-16  { height: 52px !important; }

/* ─── No dot-grid ─── */
html.no-dotgrid body {
  background-image: none !important;
}
