/* src/css/tokens.css */
:root {
  --font-display: "Outfit", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --bg-deep: #f5f3f0;
  --bg-surface: #ffffff;
  --bg-elevated: #fafaf8;
  --bg-input: #f0eee9;
  --border: #e2dfd8;
  --border-hover: #c8c4bc;
  --text-primary: #1a1a1a;
  --text-secondary: #5c564e;
  --text-tertiary: #74706a;
  --accent: #a67908;
  --accent-hover: #8a6407;
  --accent-glow: rgba(166, 121, 8, 0.15);
  --accent-text: #ffffff;
  --focus-ring: var(--accent);
  --focus-ring-offset: 2px;
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.08);
  --success: #15803d;
  --success-bg: rgba(21, 128, 61, 0.08);
  --info: #2563eb;
  --info-bg: rgba(37, 99, 235, 0.08);
  --status-open: #2563eb;
  --status-open-bg: rgba(37, 99, 235, 0.1);
  --status-planned: #7c3aed;
  --status-planned-bg: rgba(124, 58, 237, 0.1);
  --status-in-progress: #b45309;
  --status-in-progress-bg: rgba(180, 83, 9, 0.1);
  --status-shipped: #15803d;
  --status-shipped-bg: rgba(21, 128, 61, 0.1);
  --status-declined: #dc2626;
  --status-declined-bg: rgba(220, 38, 38, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;
  --sidebar-width: 220px;
  --sidebar-bg: #1a1a1a;
  --sidebar-text: #a0a0a0;
  --sidebar-text-active: #ffffff;
  --sidebar-accent: var(--accent);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg-deep: #0a0a0a;
    --bg-surface: #141414;
    --bg-elevated: #1e1e1e;
    --bg-input: #1a1a1a;
    --border: #2a2a2a;
    --border-hover: #3a3a3a;
    --text-primary: #ebebeb;
    --text-secondary: #9e9e9e;
    --text-tertiary: #7a7a7a;
    --accent: #f0b429;
    --accent-hover: #d4a017;
    --accent-glow: rgba(240, 180, 41, 0.12);
    --accent-text: #0a0a0a;
    --focus-ring: var(--accent);
    --danger: #f43f5e;
    --danger-bg: rgba(244, 63, 94, 0.12);
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.12);
    --info: #60a5fa;
    --info-bg: rgba(96, 165, 250, 0.12);
    --status-open: #60a5fa;
    --status-open-bg: rgba(96, 165, 250, 0.12);
    --status-planned: #c084fc;
    --status-planned-bg: rgba(192, 132, 252, 0.12);
    --status-in-progress: #fbbf24;
    --status-in-progress-bg: rgba(251, 191, 36, 0.12);
    --status-shipped: #34d399;
    --status-shipped-bg: rgba(52, 211, 153, 0.12);
    --status-declined: #f43f5e;
    --status-declined-bg: rgba(244, 63, 94, 0.12);
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --sidebar-bg: #0f0f0f;
  }
}

/* src/css/base.css */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg-deep);
  color: var(--text-primary);
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
}
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}
:focus:not(:focus-visible) {
  outline: none;
}
.skip-link {
  position: fixed;
  top: var(--space-md);
  left: var(--space-md);
  z-index: 10000;
  background: var(--accent);
  color: var(--accent-text);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  transform: translateY(-200%);
  transition: transform 150ms ease;
}
.skip-link:focus {
  transform: translateY(0);
}

/* src/css/layout.css */
#app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}
#sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.sidebar-logo {
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--sidebar-text-active);
  letter-spacing: -0.02em;
}
.sidebar-logo span {
  color: var(--sidebar-accent);
}
.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--space-sm);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 150ms, color 150ms;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--sidebar-text-active);
}
.sidebar-link:focus-visible {
  outline: 2px solid var(--sidebar-accent);
  outline-offset: -2px;
}
.sidebar-link[aria-current=page] {
  color: var(--sidebar-text-active);
  background: rgba(255, 255, 255, 0.08);
  border-left-color: var(--sidebar-accent);
}
.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.6;
}
.sidebar-link[aria-current=page] svg {
  opacity: 1;
}
.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-text);
  opacity: 0.5;
  padding: var(--space-lg) var(--space-md) var(--space-xs);
}
.sidebar-user {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: auto;
}
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
}
.sidebar-user-name {
  font-size: 0.8rem;
  color: var(--sidebar-text-active);
  font-weight: 500;
}
.sidebar-user-role {
  font-size: 0.7rem;
  color: var(--sidebar-text);
}
#page-content {
  padding: var(--space-2xl);
  max-width: 1100px;
  width: 100%;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}
.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
}

/* src/css/components.css */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h2,
.card-header h3 {
  font-family: var(--font-display);
  font-weight: 600;
}
.card-body {
  padding: var(--space-lg);
}
.card-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 150ms,
    color 150ms,
    border-color 150ms,
    box-shadow 150ms;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-text);
}
.btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  opacity: 0.9;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-ghost:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  min-height: 36px;
  min-width: 36px;
}
.form-group {
  margin-bottom: var(--space-md);
}
.form-label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}
.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 150ms, box-shadow 150ms;
}
.form-input:focus-visible,
.form-select:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
  border-color: var(--accent);
}
.form-input::placeholder {
  color: var(--text-tertiary);
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b6560' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
textarea.form-input {
  resize: vertical;
  min-height: 100px;
}
.form-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: var(--space-xs);
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.875rem;
}
.table tr:hover td {
  background: var(--bg-elevated);
}
.table-row-clickable {
  cursor: pointer;
}
.table-row-clickable:focus-visible td {
  background: var(--bg-elevated);
  outline: none;
}
.table-row-clickable:focus-visible td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-open {
  color: var(--status-open);
  background: var(--status-open-bg);
}
.status-planned {
  color: var(--status-planned);
  background: var(--status-planned-bg);
}
.status-in_progress {
  color: var(--status-in-progress);
  background: var(--status-in-progress-bg);
  animation: pulse 2s ease-in-out infinite;
}
.status-shipped {
  color: var(--status-shipped);
  background: var(--status-shipped-bg);
}
.status-declined {
  color: var(--status-declined);
  background: var(--status-declined-bg);
}
.role-owner {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-glow);
}
.role-admin {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--info);
  background: var(--info-bg);
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.score-positive {
  color: var(--success);
}
.score-negative {
  color: var(--danger);
}
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-xl);
}
.tab-btn {
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 150ms, border-color 150ms;
}
.tab-btn:hover {
  color: var(--text-primary);
}
.tab-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-btn[aria-selected=true] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* src/css/patterns.css */
.search-bar {
  width: 100%;
  padding: 10px 14px 10px 40px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 150ms, box-shadow 150ms;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a09a92' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}
.search-bar:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
  border-color: var(--accent);
}
.search-bar::placeholder {
  color: var(--text-tertiary);
}
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  min-width: 280px;
  max-width: 400px;
  animation: slideInRight 300ms ease;
  pointer-events: auto;
  position: relative;
  overflow: hidden;
}
.toast-success {
  background: var(--success-bg);
  border-left: 3px solid var(--success);
  color: var(--text-primary);
}
.toast-error {
  background: var(--danger-bg);
  border-left: 3px solid var(--danger);
  color: var(--text-primary);
}
.toast-info {
  background: var(--info-bg);
  border-left: 3px solid var(--info);
  color: var(--text-primary);
}
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: currentColor;
  animation: shrink linear forwards;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
}
.modal-overlay[hidden] {
  display: none;
}
.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 480px;
  width: 90%;
  animation: scaleIn 200ms ease;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}
.modal-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-lg);
}
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(
      ellipse at 50% 40%,
      var(--accent-glow) 0%,
      transparent 60%),
    var(--bg-deep);
}
.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-xl);
  color: var(--accent);
}
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-secondary);
}
.empty-state svg {
  margin: 0 auto var(--space-md);
  opacity: 0.4;
}
.empty-state p {
  font-size: 0.9rem;
}

/* src/css/utilities.css */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes shrink {
  from {
    width: 100%;
  }
  to {
    width: 0;
  }
}
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}
.animate-in {
  animation: fadeInUp 300ms ease both;
}
.stagger-1 {
  animation-delay: 40ms;
}
.stagger-2 {
  animation-delay: 80ms;
}
.stagger-3 {
  animation-delay: 120ms;
}
.stagger-4 {
  animation-delay: 160ms;
}
.stagger-5 {
  animation-delay: 200ms;
}
.stagger-6 {
  animation-delay: 240ms;
}
.stagger-7 {
  animation-delay: 280ms;
}
.stagger-8 {
  animation-delay: 320ms;
}
.stagger-9 {
  animation-delay: 360ms;
}
.stagger-10 {
  animation-delay: 400ms;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}
.mono {
  font-family: var(--font-mono);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-sm {
  font-size: 0.8rem;
}
.text-center {
  text-align: center;
}
.mt-xs {
  margin-top: var(--space-xs);
}
.mt-sm {
  margin-top: var(--space-sm);
}
.mt-md {
  margin-top: var(--space-md);
}
.mt-lg {
  margin-top: var(--space-lg);
}
.mt-xl {
  margin-top: var(--space-xl);
}
.mt-2xl {
  margin-top: var(--space-2xl);
}
.mb-xs {
  margin-bottom: var(--space-xs);
}
.mb-sm {
  margin-bottom: var(--space-sm);
}
.mb-md {
  margin-bottom: var(--space-md);
}
.mb-lg {
  margin-bottom: var(--space-lg);
}
.mb-xl {
  margin-bottom: var(--space-xl);
}
.mb-2xl {
  margin-bottom: var(--space-2xl);
}
.flex {
  display: flex;
}
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gap-xs {
  gap: var(--space-xs);
}
.gap-sm {
  gap: var(--space-sm);
}
.gap-md {
  gap: var(--space-md);
}
.gap-lg {
  gap: var(--space-lg);
}
.gap-xl {
  gap: var(--space-xl);
}
.hidden {
  display: none;
}
@media (max-width: 768px) {
  #app-shell {
    grid-template-columns: 1fr;
  }
  #sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: auto;
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 200;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .sidebar-logo,
  .sidebar-section-label,
  .sidebar-user {
    display: none;
  }
  .sidebar-nav {
    flex-direction: row;
    padding: var(--space-xs) var(--space-sm);
    gap: 0;
    width: 100%;
    justify-content: space-around;
  }
  .sidebar-link {
    flex-direction: column;
    gap: 2px;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.7rem;
    border-left: none;
    border-top: 3px solid transparent;
    text-align: center;
  }
  .sidebar-link[aria-current=page] {
    border-left-color: transparent;
    border-top-color: var(--sidebar-accent);
  }
  #page-content {
    margin-bottom: 64px;
    padding: var(--space-lg);
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }
  .page-title {
    font-size: 1.35rem;
  }
}

/* src/css/styles.css */
