/* ── Dispatch — Global Polish ── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --surface: #f7f7f5;
  --ink: #111;
  --ink-muted: #888;
  --ink-faint: #bbb;
  --card: #fff;
  --border: #e8e8e5;
  --accent: #111;
  --accent-hover: #333;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ── Page entrance ── */
@keyframes enterUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

main { animation: enterUp 0.4s ease both; }

/* ── Project quick-open (press "p") ── */
@keyframes jumpIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.project-jump-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.28), 0 6px 16px -8px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  animation: jumpIn 0.14s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.project-jump-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.project-jump-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 15px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}
.project-jump-key {
  font-weight: 600;
  color: var(--ink-muted);
}

/* ── Nav refinement ── */
nav a, nav button, nav strong {
  transition: color 0.2s, opacity 0.2s;
}
nav img {
  transition: opacity 0.2s;
}
nav img:hover {
  opacity: 0.8;
}

/* ── Cards ── */
.dispatch-block,
a[class*="block bg-white"],
div[class*="bg-white border border-gray-200 rounded-lg"] {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a[class*="block bg-white"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* ── Buttons ── */
button, a[class*="bg-blue-600"], a[class*="bg-black"],
input[type="submit"], .login-btn {
  transition: all 0.2s ease;
}

a[class*="bg-blue-600"]:hover, button[class*="bg-blue-600"]:hover {
  transform: translateY(-0.5px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* ── Inputs ── */
input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]),
select, textarea {
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* ── Select dropdowns — custom arrow ── */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  padding-right: 30px;
}

/* ── Consistent control heights ── */
select,
input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]):not([type="date"]),
button.btn,
a.btn {
  height: 36px;
  line-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  box-sizing: border-box;
}

/* Date inputs need slightly different treatment */
input[type="date"] {
  height: 36px;
  box-sizing: border-box;
}

/* ── Status badges ── */
span[class*="rounded-full"] {
  letter-spacing: 0.02em;
}

/* ── Tech header bars ── */
div[class*="bg-gray-900 text-white"] {
  letter-spacing: 0.01em;
}

/* ── Task items ── */
.task-item {
  transition: border-color 0.15s, background 0.15s;
  border-left: 3px solid #e5e7eb;
}
.task-item:hover {
  border-color: #d0d0cd;
  border-left-color: #d0d0cd;
}
.task-item.has-sr { border-left-color: #a855f7; }
.task-item.has-estimate { border-left-color: #22c55e; }

/* ── Dispatch body slide ── */
.dispatch-body {
  overflow: hidden;
  transition: max-height 0.2s ease, opacity 0.15s ease;
}
.dispatch-body.collapsing {
  max-height: 0 !important;
  opacity: 0;
}

/* ── Work Queue Drawer (inline panel) ── */
#work-drawer.work-drawer-closed {
  display: none !important;
}
@media (min-width: 640px) {
  #work-drawer.work-drawer-open {
    display: block !important;
    animation: fadeIn 0.15s ease both;
  }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}
/* Expand layout when drawer is open (desktop only — drawer is hidden on mobile) */
@media (min-width: 640px) {
  #dispatch-layout.drawer-open {
    max-width: none;
  }
}
.draggable-work {
  user-select: none;
  -webkit-user-select: none;
}
.draggable-work:active {
  opacity: 0.7;
  transform: scale(0.98);
}
.dispatch-block.drag-over > div:first-child {
  box-shadow: 0 0 0 2px #2d56a6, inset 0 0 0 1px rgba(45, 86, 166, 0.2);
  background-color: #1e3f7a !important;
}

/* ── Sticky dispatch footer ── */
.dispatch-footer-sticky {
  position: sticky;
  bottom: 0;
  z-index: 40;
  padding: 16px 0;
}


/* ── Sticky action bar ── */
.action-bar {
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 -1px 0 rgba(255,255,255,0.06), 0 -8px 24px rgba(0,0,0,0.3);
  animation: slideUp 0.3s ease both;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.action-btn-primary {
  background: #fff;
  color: #000;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.action-btn-primary:hover { opacity: 0.88; transform: translateY(-0.5px); }

.action-btn-outline {
  background: transparent;
  color: #fff;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.25);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.action-btn-outline:hover { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.05); }

.action-btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.5);
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.action-btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,0.15); }

/* ── 44 Audio components ── */
fortyfour-recorder {
  --fortyfour-recorder-font-family: 'DM Sans', sans-serif;
  --fortyfour-recorder-font-size: 13px;
  --fortyfour-recorder-accent: #111;
  --fortyfour-recorder-background: #fff;
  --fortyfour-recorder-text: #111;
  --fortyfour-recorder-muted: #888;
  --fortyfour-recorder-border: #e0e0e0;
  --fortyfour-recorder-waveform-progress: #111;
}
fortyfour-recorder::part(button) {
  border-radius: 6px;
}
fortyfour-recorder::part(select) {
  border-radius: 6px;
}

fortyfour-player {
  --fortyfour-player-font-family: 'DM Sans', sans-serif;
  --fortyfour-player-font-size: 13px;
  --fortyfour-player-accent: #111;
  --fortyfour-player-background: #fff;
  --fortyfour-player-surface: #f4f4f2;
  --fortyfour-player-text: #111;
  --fortyfour-player-muted: #888;
  --fortyfour-player-border: #e0e0e0;
}

fortyfour-mini-player {
  --fortyfour-mini-player-accent: #111;
  --fortyfour-mini-player-background: #fff;
}

/* ── Collapse chevron ── */
.rotate-chevron-collapsed { transform: rotate(-90deg); }

/* ── Drag ghost ── */
.sortable-ghost {
  opacity: 0.3;
}
.drag-handle {
  transition: color 0.15s;
}

/* ── Stagger children in dispatch index ── */
.space-y-2 > a, .space-y-6 > div {
  animation: enterUp 0.35s ease both;
}
.space-y-2 > a:nth-child(1), .space-y-6 > div:nth-child(1) { animation-delay: 0s; }
.space-y-2 > a:nth-child(2), .space-y-6 > div:nth-child(2) { animation-delay: 0.04s; }
.space-y-2 > a:nth-child(3), .space-y-6 > div:nth-child(3) { animation-delay: 0.08s; }
.space-y-2 > a:nth-child(4), .space-y-6 > div:nth-child(4) { animation-delay: 0.12s; }
.space-y-2 > a:nth-child(5), .space-y-6 > div:nth-child(5) { animation-delay: 0.16s; }
.space-y-2 > a:nth-child(6), .space-y-6 > div:nth-child(6) { animation-delay: 0.2s; }
.space-y-2 > a:nth-child(n+7), .space-y-6 > div:nth-child(n+7) { animation-delay: 0.24s; }

/* ── Dividers ── */
.divide-y > div {
  transition: background 0.15s;
}
.divide-y > div:hover {
  background: rgba(0,0,0,0.01);
}

/* ── Flash messages ── */
.flash-auto-hide {
  animation: enterUp 0.3s ease both;
}

/* ── Tables ── */
table { border-spacing: 0; }
tbody tr {
  transition: background 0.15s;
}
tbody tr:hover {
  background: rgba(0,0,0,0.015);
}

/* ── Scrollbar (subtle) ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d0cd; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ── Projects: scrollable pills ── */
.stage-pills-scroll::-webkit-scrollbar { display: none; }
.stage-pills-scroll { scrollbar-width: none; }

/* ── Lucky charms rain (dashboard easter egg) ── */
.lucky-charm-drop {
  position: fixed;
  top: -10vh;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  animation: lucky-fall linear forwards;
}
@keyframes lucky-fall {
  to { transform: translateY(120vh) rotate(var(--rot, 360deg)); }
}

