/* 
 * Pasons Media Web — Warm Sand + Terracotta Design System
 * Palette: warm cream, terracotta, sand — light, airy, friendly
 */

:root {
  /* Brand — terracotta + warm earth */
  --navy: #B85C38;
  --navy-deep: #A04E2E;
  --royal: #C87941;
  --mid: #D4915E;
  --sky: #E8B98A;
  --teal: #C87941;
  --danger: #C0392B;
  --danger-tint: #FEF2F1;

  /* Warm sand surface palette */
  --bg: #FFFBF5;
  --card: #FFFFFF;
  --card-hover: #FFF8F0;
  --line: rgba(139, 90, 43, 0.07);
  --line-light: rgba(139, 90, 43, 0.03);

  /* Typography ink — warm brown */
  --ink: #2C1810;
  --ink-soft: #7A6B5D;
  --ink-faint: #B8A694;

  /* Liquid Glass (warm cream translucent material) */
  --glass-bg: rgba(255, 251, 245, 0.82);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px 0 rgba(139, 90, 43, 0.06);

  /* Flat accents — no gradients */
  --grad: #B85C38;
  --grad-hover: #A04E2E;
  --grad-soft: rgba(184, 92, 56, 0.04);

  /* Apple superellipse curves */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  /* Shadows — warm-tinted, diffuse, layered (Apple style) */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  --shadow-card-hover: 0 16px 48px rgba(0, 0, 0, 0.1), 0 6px 16px rgba(0, 0, 0, 0.05);

  /* Spring physics transitions (Apple Fluid Interfaces) */
  --transition-spring: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);

  /* Typography — SF Pro Display / System UI, sentence case */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
}

/* Base resets & typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  background: var(--bg);
  font-family: var(--font);
  color: var(--ink);
  min-height: 100dvh;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  line-height: 1.45;
  letter-spacing: -0.015em;
}

/* Apple-style thin scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.22);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Links — Apple-style blue */
a {
  color: var(--mid);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover {
  color: var(--navy-deep);
}

/* Base layout container */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Glassmorphic Header — Apple WWDC floating bar */
.app-header {
  background: rgba(245, 245, 247, 0.82);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.app-header .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  transition: var(--transition-fast);
}

.app-header .brand:hover {
  opacity: 0.9;
  transform: scale(0.98);
}

.app-header .brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: contain;
}

.app-header .meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

/* Apple-style pills — lightweight, precise */
.role-pill {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  border: 0.5px solid rgba(0, 0, 0, 0.04);
  letter-spacing: -0.005em;
}

.pending-pill {
  background: var(--grad);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(184, 92, 56, 0.18);
  letter-spacing: -0.005em;
}

/* Content Container */
.app-body {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem 7rem;
}

/* Translucent Glass Bottom Bar — floating Mac OS Dock */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(245, 245, 247, 0.85);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border-top: 0.5px solid rgba(0, 0, 0, 0.06);
  display: flex;
  justify-content: space-around;
  padding: 0.55rem 1rem calc(0.55rem + env(safe-area-inset-bottom));
  z-index: 50;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.03);
  transition: var(--transition-spring);
}

.bottom-nav a {
  flex: 1;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.45rem;
  border-radius: 12px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  transition: var(--transition-fast);
  position: relative;
}

.bottom-nav a .ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--ink-faint);
  transition: var(--transition-fast);
}

.bottom-nav a .ico svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.6;
  stroke: currentColor;
  fill: none;
}

.bottom-nav a:hover {
  color: var(--ink-soft);
  background: rgba(0, 0, 0, 0.03);
}

.bottom-nav a.active {
  color: var(--navy);
  font-weight: 600;
}

.bottom-nav a.active .ico {
  color: var(--navy);
  transform: translateY(-2px);
}

.bottom-nav a.active .ico svg {
  stroke-width: 2.0;
}

.bottom-nav a .badge-count {
  position: absolute;
  top: 3px;
  right: 20%;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  box-shadow: 0 2px 6px rgba(200, 30, 69, 0.25);
}

/* Premium Squircle Card Containers — Apple style diffuse depth */
.card {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  transition: var(--transition-spring);
  position: relative;
  overflow: hidden;
  /* Apple-style inner highlight — catches light on top edge */
  border-top: 1px solid rgba(255, 255, 255, 0.8);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: rgba(0, 0, 0, 0.08);
}

/* Tactile scale-downs on active press for cards */
.card:active {
  transform: scale(0.998) translateY(0);
  box-shadow: var(--shadow-sm);
  transition-duration: 0.08s;
}

/* Attention required / hot pipeline cards — flat warm accent bar */
.card.hot {
  border-color: rgba(184, 92, 56, 0.15);
  background: var(--card);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(184, 92, 56, 0.04);
}

.card.hot:hover {
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(184, 92, 56, 0.08);
}

.card.hot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3.5px;
  height: 100%;
  background: var(--navy);
  border-radius: 2px 0 0 2px;
}

/* Deterministic Typography */
h1, h2, h3, h4 {
  margin: 0 0 0.85rem;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.035em; /* tight tracking as it grows */
  line-height: 1.15;
}

h1 {
  font-size: 2.1rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

h4 {
  font-size: 1.05rem;
  letter-spacing: -0.015em;
}

p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.5;
  max-w: 65ch; /* readability limit */
}

.muted {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.faint {
  color: var(--ink-faint);
  font-size: 0.8rem;
}

/* Buttons — Apple-style tactile, weighted, physical */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 12px;
  padding: 0.6rem 1.15rem;
  transition: var(--transition-fast);
  text-decoration: none;
  font-family: inherit;
  user-select: none;
  letter-spacing: -0.01em;
  position: relative;
}

/* Apple-style tactile push — instant response on press */
.btn:active {
  transform: scale(0.96) translateY(1px);
  transition-duration: 0.06s;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--grad);
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.15), var(--shadow-inset);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
  background: var(--grad-hover);
  box-shadow: 0 4px 14px rgba(180, 83, 9, 0.22), var(--shadow-inset);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-outline {
  background: var(--card);
  color: var(--ink);
  border: 0.5px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  background: var(--card-hover);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--card);
  color: var(--danger);
  border: 0.5px solid rgba(200, 30, 69, 0.12);
  box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
  background: var(--danger-tint);
  border-color: rgba(200, 30, 69, 0.25);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(200, 30, 69, 0.08);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  border-radius: 10px;
}

.btn-block {
  width: 100%;
}

/* Forms — Apple design: labels on top, spacious, clean focus */
.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
  letter-spacing: -0.005em;
}

.input, select, textarea {
  width: 100%;
  border: 0.5px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 0.7rem 0.95rem;
  font-size: 0.92rem;
  color: var(--ink);
  font-family: inherit;
  transition: var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.input:hover, select:hover, textarea:hover {
  border-color: rgba(0, 0, 0, 0.12);
}

.input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--mid);
  background: var(--card);
  box-shadow: 0 0 0 3.5px rgba(184, 92, 56, 0.1), 0 1px 2px rgba(0, 0, 0, 0.02);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

/* Login Card — Apple-style centered, clean */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
  transition: var(--transition-spring);
  /* Apple light-catch top edge */
  border-top: 1px solid rgba(255, 255, 255, 0.8);
}

.login-card:hover {
  transform: translateY(-2px);
}

.login-card .logo {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  object-fit: contain;
  margin-bottom: 1.35rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition-spring);
}

.login-card .logo:hover {
  transform: scale(1.04) rotate(2deg);
}

.login-card h1 {
  margin-bottom: 0.35rem;
  font-size: 1.85rem;
  letter-spacing: -0.04em;
}

.login-card .sub {
  color: var(--ink-soft);
  margin-bottom: 1.85rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.login-card form {
  text-align: left;
}

.login-error {
  background: var(--danger-tint);
  color: var(--danger);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 1.35rem;
  text-align: left;
  border: 0.5px solid rgba(200, 30, 69, 0.08);
}

/* Flash alerts — Apple Banner style */
.flash-wrap {
  margin-bottom: 1.35rem;
}

.flash {
  border-radius: 12px;
  padding: 0.8rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.65rem;
  border: 0.5px solid var(--line);
  background: var(--card);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-spring);
}

.flash.success {
  border-color: rgba(16, 185, 129, 0.12);
  background: #F0FDF4;
  color: #065F46;
}

.flash.error {
  border-color: rgba(200, 30, 69, 0.12);
  background: var(--danger-tint);
  color: #991B1B;
}

.flash.info {
  border-color: rgba(180, 83, 9, 0.12);
  background: #F0F9FF;
  color: #0369A1;
}

/* Branch Cards — Apple-style tactile squircle grid */
.branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.25rem;
}

.branch-card {
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.65rem 1.25rem 1.4rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-spring);
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  /* Apple light-catch top edge */
  border-top: 1px solid rgba(255, 255, 255, 0.8);
}

.branch-card:hover {
  border-color: rgba(0, 0, 0, 0.1);
  transform: translateY(-5px);
  box-shadow: var(--shadow-card-hover);
  text-decoration: none;
}

.branch-card:active {
  transform: scale(0.97) translateY(0);
  transition-duration: 0.08s;
}

/* External agency branch cards — flat warm accent */
.branch-card-external {
  border-color: rgba(184, 92, 56, 0.1);
  background: var(--card);
}

.branch-card-external:hover {
  border-color: rgba(184, 92, 56, 0.18);
  box-shadow: 0 16px 48px rgba(184, 92, 56, 0.1), 0 6px 16px rgba(184, 92, 56, 0.05);
}

.branch-avatar-external {
  background: #B85C38;
  box-shadow: 0 6px 16px rgba(184, 92, 56, 0.15);
}

.branch-card-external:hover .branch-avatar-external {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(184, 92, 56, 0.25);
}

.external-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  color: #A04E2E;
  background: rgba(184, 92, 56, 0.08);
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  margin-top: 0.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Kind badges — Apple-style lightweight labels */
.kind-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.kind-badge-internal {
  color: var(--ink-soft);
  background: rgba(0, 0, 0, 0.04);
}

.kind-badge-external {
  color: #A04E2E;
  background: rgba(184, 92, 56, 0.08);
}

/* Apple squircle (superellipse) avatar — refined depth */
.branch-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  background: var(--navy);
  box-shadow: 0 4px 12px rgba(184, 92, 56, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: var(--transition-fast);
  /* Inner highlight for Apple depth */
  border: 0.5px solid rgba(255, 255, 255, 0.12);
}

.branch-card:hover .branch-avatar {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 20px rgba(184, 92, 56, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.branch-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
  letter-spacing: -0.025em;
  font-weight: 650;
  color: var(--ink);
}

.branch-stats {
  font-size: 0.78rem;
  color: var(--ink-faint);
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* Video Card — refined Apple-style layout */
.video-card {
  position: relative;
}

.video-card .top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.video-card .title {
  font-weight: 650;
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.video-card .client-line {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: -0.005em;
  flex-shrink: 0;
}

/* Pipeline Dot Indicators — Apple-style glowing active */
.dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.9rem 0;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  transition: var(--transition-fast);
}

.live-tag {
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 0.5rem;
  background: rgba(10, 143, 137, 0.08);
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.chip {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  color: var(--ink-soft);
  font-weight: 500;
  border: 0.5px solid rgba(0, 0, 0, 0.03);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 0.5px solid var(--line-light);
}

.note-box {
  background: var(--danger-tint);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.9rem;
  border: 0.5px solid rgba(200, 30, 69, 0.06);
}

.concept {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0.5rem 0 0.9rem;
  white-space: pre-wrap;
  line-height: 1.55;
  letter-spacing: -0.005em;
}

/* Bento Grid Dashboard — Apple-style diffuse depth */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.bento-card {
  grid-column: span 12;
  background: var(--card);
  border: 0.5px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-spring);
  position: relative;
  overflow: hidden;
  /* Apple light-catch top edge */
  border-top: 1px solid rgba(255, 255, 255, 0.8);
}

.bento-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.bento-card:active {
  transform: scale(0.998) translateY(0);
  transition-duration: 0.08s;
}

@media (min-width: 768px) {
  .bento-stat-main { grid-column: span 6; }
  .bento-stat-sub { grid-column: span 3; }
  .bento-pipeline { grid-column: span 7; }
  .bento-attention { grid-column: span 5; }
  .bento-team { grid-column: span 12; }
}

@media (min-width: 1024px) {
  .bento-stat-main { grid-column: span 3; }
  .bento-stat-sub { grid-column: span 3; }
  .bento-pipeline { grid-column: span 8; }
  .bento-attention { grid-column: span 4; }
  .bento-team { grid-column: span 4; }
  .bento-pipeline { grid-column: span 8; }
}

/* Stat formatting — Apple-style tabular figures */
.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.35rem;
  font-variant-numeric: tabular-nums;
  font-family: var(--font);
}

.stat-label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* Stage Bar Chart — Apple-style clean */
.bar-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0.75rem;
}

.bar-row:last-child {
  margin-bottom: 0;
}

.bar-label {
  width: 100px;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: -0.005em;
}

.bar-track {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 4px;
  transition: var(--transition-spring);
}

.bar-n {
  width: 30px;
  text-align: right;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Tables — Apple style: clean, negative space, subtle hover */
.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 0.5px solid var(--line);
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--card);
}

table.data th, table.data td {
  text-align: left;
  padding: 0.85rem 1.15rem;
  border-bottom: 0.5px solid var(--line-light);
}

table.data th {
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 0.5px solid var(--line);
  background: rgba(0, 0, 0, 0.01);
}

table.data tr {
  transition: var(--transition-fast);
}

table.data tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

/* Section headers — Apple-style clean */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.15rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.section-head .links {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

/* History List — clean timeline */
.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.history-list li {
  padding: 0.75rem 0;
  border-bottom: 0.5px solid var(--line-light);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.15rem;
}

.history-list li:last-child {
  border-bottom: none;
}

/* Utility classes */
.row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
}

.spacer {
  flex: 1;
}

.mt-0 { margin-top: 0; }
.mb-1 { margin-bottom: 1rem; }

.empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--ink-soft);
  background: var(--card);
  border: 1.5px dashed rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-lg);
  font-weight: 500;
}

/* Floating Mac OS Dock — desktop refinement */
@media (min-width: 900px) {
  .bottom-nav {
    max-width: 640px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1.5rem;
    border-radius: var(--radius-xl);
    border: 0.5px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.03);
    background: rgba(245, 245, 247, 0.88);
  }
  .app-body {
    padding-bottom: 8.5rem;
  }
}

/* ================================================================
   Pagination — single-line centered pill bar
   ================================================================ */

.pagination {
  width: 100%;
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

.pgn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  text-decoration: none;
  background: transparent;
  border: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
  user-select: none;
  cursor: pointer;
}

.pgn-btn:hover {
  background: rgba(184, 92, 56, 0.08);
  color: var(--ink);
  text-decoration: none;
}

.pgn-btn:active {
  transform: scale(0.93);
}

.pgn-cur {
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(184, 92, 56, 0.25);
  cursor: default;
  pointer-events: none;
}

.pgn-off {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

.pgn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.pgn-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 38px;
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-weight: 500;
  user-select: none;
}

/* ────────────────────────────────────────────────────────
   Report page
   ──────────────────────────────────────────────────────── */

.report-page {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 5rem;
}

/* Header */
.report-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.report-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.25rem;
}

.report-subtitle {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 0;
  letter-spacing: -0.005em;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, transform 100ms ease;
  letter-spacing: -0.005em;
}
.btn-export:hover {
  background: var(--navy-deep);
  transform: translateY(-1px);
}
.btn-export:active {
  transform: scale(0.97);
}

/* Period pills */
.period-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.period-pill {
  display: inline-flex;
  padding: 0.45rem 0.95rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  transition: all 180ms ease;
  letter-spacing: -0.005em;
}
.period-pill:hover {
  border-color: var(--mid);
  color: var(--ink);
}
.period-pill.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* Totals cards */
.report-totals {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.total-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.65rem 1.2rem;
  min-width: 72px;
}

.total-num {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.total-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Table */
.report-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--card);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 700px;
}

.report-table thead th {
  padding: 0.7rem 0.75rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.report-table thead th.sticky-left {
  text-align: left;
  left: 0;
  z-index: 2;
  min-width: 140px;
}

.report-table tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line-light);
  text-align: center;
  white-space: nowrap;
}

.report-table tbody td.sticky-left {
  position: sticky;
  left: 0;
  background: var(--card);
  z-index: 1;
  text-align: left;
}

.report-table tbody tr.row-external td.sticky-left {
  background: #FFF8F0;
}

.report-table tbody tr.row-external td {
  background: #FFF8F0;
}

.report-table tbody tr:last-child td {
  border-bottom: none;
}

.branch-name {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.kind-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 0.3rem;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.kind-tag.internal {
  background: var(--grad-soft);
  color: var(--navy);
}
.kind-tag.external {
  background: #FFF0EA;
  color: #B85C38;
}

.stage-count,
.count-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-soft);
}

.posted-cell {
  color: #059669;
}

.date-cell {
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.empty-row {
  text-align: center;
  padding: 2.5rem 1rem !important;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-faint);
}
.empty-state p {
  margin: 0;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.empty-state span {
  font-size: 0.78rem;
}

/* Mobile responsiveness for report */
@media (max-width: 768px) {
  .report-header {
    flex-direction: column;
  }
  .report-title {
    font-size: 1.25rem;
  }
  .report-totals {
    gap: 0.4rem;
  }
  .total-card {
    padding: 0.45rem 0.7rem;
    min-width: 56px;
  }
  .total-num {
    font-size: 1.05rem;
  }
  .total-label {
    font-size: 0.6rem;
  }
}
