/*
 * Team Tracker Application Styles
 * Vanilla CSS with CSS Variables
 */

/* =================================
   CSS Reset & Base
   ================================= */

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

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  scroll-behavior: smooth;
}

/* =================================
   CSS Variables (Design Tokens)
   ================================= */

:root {
  /* Primary Colors */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;

  /* Semantic Colors */
  --color-success: #16a34a;
  --color-warning: #f59e0b;
  --color-danger: #dc2626;
  --color-info: #3b82f6;

  /* Neutral Colors */
  --color-background: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-border-muted: #f1f5f9;

  /* Typography */
  --font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size: 15px;
  --line-height: 1.5;

  /* Spacing */
  --spacing: 0.75rem;
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Borders & Shadows */
  --border-radius: 6px;
  --border-radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition: 0.15s ease;

  /* Icon Color Themes (Light Mode) */
  --icon-blue-bg: #dbeafe;
  --icon-blue-text: #1e40af;
  --icon-yellow-bg: #fef3c7;
  --icon-yellow-text: #92400e;
  --icon-gray-bg: #f3f4f6;
  --icon-gray-text: #6b7280;
  --icon-purple-bg: #ede9fe;
  --icon-purple-text: #6d28d9;
  --icon-green-bg: #d1fae5;
  --icon-green-text: #065f46;
  --icon-red-bg: #fee2e2;
  --icon-red-text: #991b1b;
  --icon-violet-bg: #e9d5ff;
  --icon-violet-text: #7c3aed;
}

/* =================================
   Base Element Styles
   ================================= */

body {
  font-family: var(--font-family);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Avoid mid-transition colors while the theme flips */
.theme-switching, .theme-switching * {
  transition: none !important;
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Images */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* Form Elements */
input, button, textarea, select {
  font: inherit;
}

input, select, textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input[type="checkbox"], input[type="radio"] {
  width: auto;
  margin-right: 0.5rem;
}

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

select {
  cursor: pointer;
  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='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* Buttons */
button, [role="button"], input[type="submit"], input[type="button"], .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  color: #ffffff;
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

button:hover, [role="button"]:hover, input[type="submit"]:hover, input[type="button"]:hover, .btn:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  text-decoration: none;
}

button:active, [role="button"]:active {
  transform: translateY(0);
}

button:disabled, [role="button"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Secondary Button */
button.secondary, [role="button"].secondary, .btn-secondary {
  color: var(--color-text);
  background: var(--color-background);
  border-color: var(--color-border);
}

button.secondary:hover, [role="button"].secondary:hover, .btn-secondary:hover {
  background: var(--color-border-muted);
  border-color: var(--color-border);
}

/* Contrast/Outline Button */
button.contrast, [role="button"].contrast, .btn-contrast {
  color: var(--color-text);
  background: transparent;
  border-color: var(--color-border);
}

button.contrast:hover, [role="button"].contrast:hover, .btn-contrast:hover {
  background: var(--color-border-muted);
}

/* Danger Button */
button.danger, [role="button"].danger, .btn-danger {
  color: #ffffff;
  background: var(--color-danger);
  border-color: var(--color-danger);
}

button.danger:hover, [role="button"].danger:hover, .btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.75rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

tbody tr:hover {
  background: var(--color-border-muted);
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.container-fluid {
  width: 100%;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 2rem;
  }
  .container-fluid {
    padding: 0 2rem;
  }
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

h4 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

hgroup {
  margin-bottom: 1.5rem;
}

hgroup h1, hgroup h2, hgroup h3 {
  margin-bottom: 0.25rem;
}

hgroup p {
  margin-top: 0.25rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Improved card styling */
.card,
article {
  background: var(--color-surface);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  /* border: 1px solid var(--color-border); */
}

article header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

article header h3 {
  margin-bottom: 0.25rem;
}

article header p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

article footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

/* Nested cards should be lighter */
article article,
.card .card {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: none;
}

/* Grid utilities */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Badge styling - more subtle */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

.badge-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}

/* Alert styling - cleaner */
.alert {
  padding: 0.875rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  border-left: 3px solid;
  font-size: 0.9rem;
}

.alert strong {
  display: block;
  margin-bottom: 0.25rem;
}

.alert-notice {
  background: #eff6ff;
  color: #1e40af;
  border-color: #3b82f6;
}

.alert-alert {
  background: #fef2f2;
  color: #991b1b;
  border-color: #ef4444;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border-color: #f59e0b;
}

[data-theme="dark"] .alert-notice {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
}

[data-theme="dark"] .alert-alert {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

[data-theme="dark"] .alert-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

.alert ul {
  margin: 0.5rem 0 0 0;
  padding-left: 1.25rem;
}

.alert li {
  margin: 0.25rem 0;
}

/* Stats card - more compact */
.stat-card {
  text-align: center;
  padding: 1.25rem;
}

.stat-card h3 {
  font-size: 2rem;
  margin: 0.25rem 0 0.5rem 0;
  color: var(--primary);
  font-weight: 700;
}

.stat-card p, .stat-card h4 {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.stat-card svg {
  font-size: 1.5rem;
  color: var(--color-text-muted);
  opacity: 0.5;
}

.stat-delta {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.25rem;
  color: var(--color-text-muted);
}

.stat-card-danger h3 {
  color: var(--color-danger);
}

.stat-card-danger .stat-delta {
  color: var(--color-danger);
}

main table a[href^="/engineers/"]:not([role="button"]) {
  color: var(--color-text);
  font-weight: 600;
}

main table a[href^="/engineers/"]:not([role="button"]):hover {
  color: var(--primary);
  text-decoration: underline;
}

.kpi-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.kpi-grid .stat-card { text-align: left; }

.stat-card-primary h3 { font-size: 3.5rem; line-height: 1; }

.stat-card-primary.has-overdue .stat-delta { color: var(--color-danger); }

@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: 1fr; }
}

/* Empty state - cleaner */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--color-text-muted);
}

.empty-state svg {
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
}

/* Lists - better spacing */
ul li, ol li {
  margin-bottom: 0.5rem;
}

article ul, article ol {
  margin: 0;
  padding-left: 0;
}

article ul li {
  list-style: none;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

article ul li:last-child {
  border-bottom: none;
}

/* Table improvements */
table {
  font-size: 0.9rem;
}

table td, table th {
  padding: 0.75rem 0.5rem;
}

/* Button improvements - more compact and refined */
button, [role="button"], input[type="submit"], input[type="button"] {
  padding: 0.4rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 6px;
  transition: all 0.15s ease;
}

/* Primary action buttons */
a[role="button"]:not(.secondary):not(.contrast),
button:not(.secondary):not(.contrast),
input[type="submit"],
input[type="button"] {
  background: var(--primary);
  border-color: var(--primary);
}

a[role="button"]:not(.secondary):not(.contrast):hover,
button:not(.secondary):not(.contrast):hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
}

/* Smaller icon buttons */
button i, button svg, [role="button"] i, [role="button"] svg {
  margin-right: 0.35rem;
  font-size: 0.875em;
}

[role="button"] i:last-child:only-child,
[role="button"] svg:last-child:only-child,
button i:last-child:only-child,
button svg:last-child:only-child {
  margin-right: 0;
}

[role="group"] {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

[role="group"] [role="button"],
[role="group"] button {
  margin: 0;
}

/* Form improvements */
input, select, textarea {
  font-size: 0.9rem;
}

label {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

/* Navigation - flexbox layout */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

nav ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

nav ul li {
  margin: 0;
  padding: 0;
}

/* Logo styling */
.nav-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.875rem;
  flex-shrink: 0;
}

nav ul li strong {
  font-size: 1rem;
  color: var(--color-text);
  font-weight: 600;
}

/* Navigation links with icons */
nav ul li a {
  font-size: 0.8125rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  transition: all 0.15s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

nav ul li a i,
nav ul li a svg {
  font-size: 0.875rem;
  opacity: 0.85;
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
}

nav ul li a:not(.active):hover {
  background-color: var(--color-border-muted);
  color: var(--color-text);
  transform: translateY(-1px);
}

nav ul li a:not(.active):hover svg {
  opacity: 1;
}

nav ul li a.active {
  background-color: var(--primary);
  color: white;
  font-weight: 600;
}

nav ul li a.active svg {
  opacity: 1;
}

/* Logout link styling */
nav ul li a.nav-logout {
  color: var(--color-text-muted);
}

nav ul li a.nav-logout:hover {
  color: var(--color-danger);
  background-color: rgba(220, 38, 38, 0.1);
}

/* Brand link special styling */
nav ul:first-child li a {
  padding: 0.25rem 0;
}

nav ul:first-child li a:hover strong {
  color: var(--primary);
}

/* Responsive navigation - hide text on tablets */
@media (max-width: 992px) {
  nav ul li a .nav-text {
    display: none;
  }

  nav ul li a {
    padding: 0.45rem 0.625rem;
    justify-content: center;
  }

  nav ul li strong {
    display: none;
  }

  .nav-logo {
    margin: 0 auto;
  }
}

/* Responsive navigation - show everything on desktop */
@media (min-width: 993px) {
  nav ul li a i {
    margin-right: 0;
  }
}

/* Utility classes */
.text-center { text-align: center; }
.text-muted {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.text-red { color: #dc2626; }

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

/* Icon improvements (lucide replaces <i> with <svg>) */
svg.lucide {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  opacity: 0.85;
}

.icon-spin {
  animation: icon-spin 1.2s linear infinite;
}

@keyframes icon-spin {
  to { transform: rotate(360deg); }
}

/* Icon spacing in buttons */
button i:first-child:not(:last-child),
button svg:first-child:not(:last-child),
[role="button"] i:first-child:not(:last-child),
[role="button"] svg:first-child:not(:last-child) {
  margin-right: 0.4rem;
}

button i:last-child:not(:first-child),
button svg:last-child:not(:first-child),
[role="button"] i:last-child:not(:first-child),
[role="button"] svg:last-child:not(:first-child) {
  margin-left: 0.4rem;
}

/* Definition list improvements */
dl {
  margin: 0;
}

dt {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  margin-top: 0.75rem;
}

dt:first-child {
  margin-top: 0;
}

dd {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
}

/* Metadata styling */
.metadata {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.metadata i {
  font-size: 0.8rem;
}

/* Container improvements */
.container {
  padding: 1.5rem 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 2rem 2rem;
  }
}

/* Small text helper */
small {
  font-size: 0.85rem;
}

/* =================================
   List Card Component Styles
   ================================= */

.list-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 500px), 1fr));
}

.list-card {
  background: var(--color-surface);
  border-radius: 8px;
  padding: 0;
  margin-bottom: 0;
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.list-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.list-card.overdue {
  border-left: 3px solid #dc2626;
}

.list-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.list-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Filter Chips */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--color-text);
}

.filter-chip-remove {
  text-decoration: none;
  color: var(--color-text-muted);
  font-weight: bold;
  font-size: 1rem;
  line-height: 1;
}

.filter-chip-remove:hover {
  color: var(--color-danger);
}

.filter-clear-all {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-left: 0.5rem;
}

/* =================================
   Icon Status Colors (Unified)
   Using CSS variables for automatic dark mode support
   ================================= */

/* Blue: completed, in_progress, standup, info, time */
.list-card-icon.completed, .list-card-icon.in_progress, .list-card-icon.standup,
.detail-hero-icon.completed, .detail-hero-icon.in_progress, .detail-hero-icon.standup,
.stat-box-icon.info, .stat-box-icon.in_progress, .stat-box-icon.time,
.action-item-icon.in_progress {
  background: var(--icon-blue-bg);
  color: var(--icon-blue-text);
}

/* Yellow: pending, not_started, demo, priority, action, on_leave */
.list-card-icon.pending, .list-card-icon.not_started, .list-card-icon.demo, .list-card-icon.on_leave,
.detail-hero-icon.pending, .detail-hero-icon.not_started, .detail-hero-icon.demo, .detail-hero-icon.on_leave,
.stat-box-icon.priority, .stat-box-icon.action,
.action-item-icon.pending {
  background: var(--icon-yellow-bg);
  color: var(--icon-yellow-text);
}

/* Gray: cancelled, paused, inactive, age */
.list-card-icon.cancelled, .list-card-icon.paused, .list-card-icon.inactive,
.detail-hero-icon.cancelled, .detail-hero-icon.paused, .detail-hero-icon.inactive,
.stat-box-icon.age,
.action-item-icon.cancelled {
  background: var(--icon-gray-bg);
  color: var(--icon-gray-text);
}

/* Purple: calendar, all_hands, transferred, date, context */
.list-card-icon.calendar, .list-card-icon.all_hands, .list-card-icon.transferred,
.detail-hero-icon.calendar, .detail-hero-icon.all_hands, .detail-hero-icon.transferred,
.stat-box-icon.date, .stat-box-icon.context,
.related-card-icon {
  background: var(--icon-purple-bg);
  color: var(--icon-purple-text);
}

/* Green: retrospective, active, progress, completed (stat), attendees */
.list-card-icon.retrospective, .list-card-icon.active,
.detail-hero-icon.retrospective, .detail-hero-icon.active,
.stat-box-icon.progress, .stat-box-icon.completed, .stat-box-icon.attendees,
.action-item-icon.completed {
  background: var(--icon-green-bg);
  color: var(--icon-green-text);
}

/* Violet: planning */
.list-card-icon.planning,
.detail-hero-icon.planning {
  background: var(--icon-violet-bg);
  color: var(--icon-violet-text);
}

/* Red: overdue */
.stat-box-icon.overdue {
  background: var(--icon-red-bg);
  color: var(--icon-red-text);
}

.list-card-title {
  flex: 1;
  min-width: 0;
}

.list-card-title h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.list-card-title h3 a {
  color: var(--color-text);
  text-decoration: none;
}

.list-card-title h3 a:hover {
  color: var(--primary);
}

.list-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.list-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.list-card-meta i {
  font-size: 0.75rem;
  opacity: 0.7;
}

.list-card-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.list-card-content {
  padding: 0 1.25rem 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.list-card-content p {
  margin: 0.5rem 0 0 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.list-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  background: var(--color-background);
  margin-top: auto;
}

.list-card-actions {
  display: flex;
  gap: 0.5rem;
}

.list-card-actions [role="button"] {
  padding: 0.35rem 0.625rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
  .list-card-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .list-card-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .list-card-badge {
    align-items: flex-start;
    flex-direction: row;
  }

  .list-card-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .list-card-actions {
    width: 100%;
  }

  .list-card-actions [role="button"] {
    flex: 1;
  }
}

/* =================================
   Dark Mode Support
   ================================= */

[data-theme="dark"] {
  /* Primary Colors */
  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --primary-light: rgba(96, 165, 250, 0.18);

  /* Neutral Colors */
  --color-background: #0f172a;
  --color-surface: #1e293b;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-border: #334155;
  --color-border-muted: #273449;

  /* Semantic Colors */
  --color-success: #22c55e;
  --color-warning: #fbbf24;
  --color-danger: #ef4444;
  --color-info: #60a5fa;

  /* Icon Color Themes (Dark Mode) */
  --icon-blue-bg: rgba(59, 130, 246, 0.2);
  --icon-blue-text: #93c5fd;
  --icon-yellow-bg: rgba(251, 191, 36, 0.2);
  --icon-yellow-text: #fbbf24;
  --icon-gray-bg: rgba(107, 114, 128, 0.2);
  --icon-gray-text: #9ca3af;
  --icon-purple-bg: rgba(139, 92, 246, 0.2);
  --icon-purple-text: #c4b5fd;
  --icon-green-bg: rgba(16, 185, 129, 0.2);
  --icon-green-text: #6ee7b7;
  --icon-red-bg: rgba(239, 68, 68, 0.2);
  --icon-red-text: #fca5a5;
  --icon-violet-bg: rgba(139, 92, 246, 0.2);
  --icon-violet-text: #c4b5fd;
}

[data-theme="dark"] .list-card {
  border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .list-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Icon colors now handled by CSS variables in unified icon section */

[data-theme="dark"] .badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

[data-theme="dark"] .badge-warning {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

[data-theme="dark"] .badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

[data-theme="dark"] .badge-info {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

[data-theme="dark"] .badge-secondary {
  background: rgba(107, 114, 128, 0.2);
  color: #d1d5db;
  border-color: rgba(255,255,255,0.1);
}

/* =================================
   Detail Page Styles
   ================================= */

/* Hero Header */
.detail-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--color-surface);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
}

.detail-hero-icon {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  /* Default color - overridden by status classes in unified icon section */
  background: var(--icon-blue-bg);
  color: var(--icon-blue-text);
}

.detail-hero-content {
  flex: 1;
  min-width: 0;
}

.detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.detail-hero h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.75rem;
  line-height: 1.3;
}

.detail-hero-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.detail-hero-subtitle .separator {
  opacity: 0.5;
}

.detail-hero-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.detail-hero-actions [role="button"] {
  padding: 0.4rem 0.875rem;
  font-size: 0.8125rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0;
}

.stat-box-link {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  cursor: pointer;
}

.stat-box-link:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  text-decoration: none;
}

.stat-box-link:hover h4 {
  color: var(--primary);
}

/* =================================
   Dual Panel Grid (Side-by-Side)
   ================================= */

.dual-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.panel-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0;
  margin-bottom: 0;
  overflow: hidden;
}

.panel-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  margin: 0;
}

.panel-card header h3 {
  margin: 0;
  font-size: 0.95rem;
}

.panel-count {
  background: var(--color-border-muted);
  color: var(--color-text-muted);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.panel-card footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--color-border);
  margin: 0;
}

.panel-card footer [role="button"] {
  flex: 1;
  justify-content: center;
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
}

.panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  color: var(--color-text-muted);
  gap: 0.5rem;
}

.panel-empty i {
  font-size: 1.5rem;
  opacity: 0.3;
}

.panel-more {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  background: var(--color-border-muted);
}

/* Compact List Items */
.compact-list {
  display: flex;
  flex-direction: column;
}

.compact-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.compact-list-item:last-child {
  border-bottom: none;
}

.compact-list-item:hover {
  background: var(--color-border-muted);
  text-decoration: none;
}

.compact-list-item.overdue {
  border-left: 3px solid #dc2626;
}

.compact-list-item.stale {
  border-left: 3px solid #f59e0b;
}

.compact-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.compact-item-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-item-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.compact-item-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mini-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
  max-width: 100px;
}

.mini-progress-fill {
  height: 100%;
  border-radius: 2px;
}

.mini-progress-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  min-width: 32px;
}

.compact-item-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.compact-item-badge.overdue {
  background: var(--icon-red-bg);
  color: var(--icon-red-text);
}

.compact-item-badge.stale {
  background: var(--icon-yellow-bg);
  color: var(--icon-yellow-text);
}

@media (max-width: 768px) {
  .dual-panel-grid {
    grid-template-columns: 1fr;
  }
}

/* History Link Bar */
.history-link-bar {
  margin-bottom: 1.5rem;
}

.history-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.2s ease;
}

.history-link:hover {
  border-color: var(--primary);
  background: var(--color-border-muted);
  text-decoration: none;
}

.history-link i:first-child {
  font-size: 1.1rem;
  color: var(--primary);
}

.history-link span:first-of-type {
  font-weight: 500;
}

.history-link-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.history-link i:last-child {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

/* Client Trigger Link */
.client-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  padding: 0.5rem 0.75rem;
  margin: -0.5rem -0.75rem;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.client-trigger:hover {
  background: var(--color-border-muted);
  text-decoration: none;
}

.client-trigger strong {
  color: var(--color-text);
}

.client-trigger small {
  color: var(--color-text-muted);
}

.client-trigger .trigger-arrow {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.client-trigger:hover .trigger-arrow {
  opacity: 1;
}

/* =================================
   Modal Styles
   ================================= */

.modal {
  padding: 0;
  border: none;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 500px;
  width: 90%;
  background: var(--color-surface);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-content {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.modal-content header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin: 0;
}

.modal-content header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  padding: 0.5rem;
  margin: -0.5rem;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: 6px;
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: var(--color-border-muted);
  color: var(--color-text);
  transform: none;
}

.modal-body {
  padding: 1rem 1.5rem 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  color: var(--color-text-muted);
}

.modal-empty i {
  font-size: 2rem;
  opacity: 0.3;
  margin-bottom: 0.75rem;
}

/* Assignment Items in Modal */
.assignment-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.assignment-item:last-child {
  margin-bottom: 0;
}

.assignment-item.active {
  border-color: #86efac;
  background: #f0fdf4;
}

[data-theme="dark"] .assignment-item.active {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
}

.assignment-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--icon-gray-bg);
  color: var(--icon-gray-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.assignment-item.active .assignment-icon {
  background: var(--icon-green-bg);
  color: var(--icon-green-text);
}

.assignment-content {
  flex: 1;
  min-width: 0;
}

.assignment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.assignment-header strong {
  font-size: 0.95rem;
}

.assignment-description {
  margin: 0.5rem 0 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.stat-box-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  /* Colors handled by unified icon section */
}

.stat-box-content {
  flex: 1;
}

.stat-box-content h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.25rem 0;
  color: var(--color-text);
}

.stat-box-content small {
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

.stat-box-content progress {
  margin-top: 0.5rem;
  width: 100%;
}

/* Content Section */
.content-section {
  line-height: 1.7;
  color: var(--color-text);
}

.content-section p {
  margin-bottom: 1rem;
}

/* Related Card */
.related-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.related-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  /* Colors handled by unified icon section (defaults to purple) */
}

.related-card-content {
  flex: 1;
}

.related-card-content h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.related-card-content p {
  margin: 0.25rem 0 0 0;
  font-size: 0.95rem;
}

.related-card-action [role="button"] {
  padding: 0.4rem 0.875rem;
  font-size: 0.8125rem;
}

/* Action Items List */
.action-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.action-item-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.action-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  /* Colors handled by unified icon section */
}

.action-item-content {
  flex: 1;
}

.action-item-content h4 {
  text-transform: none;
  letter-spacing: normal;
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.action-item-content h4 a {
  color: var(--color-text);
  text-decoration: none;
}

.action-item-content h4 a:hover {
  color: var(--primary);
}

.action-item-content p {
  margin: 0;
  font-size: 0.85rem;
}

.action-item-content .separator {
  opacity: 0.5;
  margin: 0 0.25rem;
}

.action-item-actions [role="button"] {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

/* Attendees List */
.attendees-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.attendee-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
}

.attendee-badge i {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .detail-hero {
    flex-direction: column;
    padding: 1.5rem;
  }

  .detail-hero-icon {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
  }

  .detail-hero h1 {
    font-size: 1.5rem;
  }

  .detail-hero-actions {
    width: 100%;
    flex-direction: column;
  }

  .detail-hero-actions [role="button"] {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .action-item-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .action-item-actions {
    width: 100%;
  }

  .action-item-actions [role="button"] {
    width: 100%;
  }
}

/* Dark mode icon colors now handled by CSS variables in unified icon section */

/* =================================
   Login Page Enhancements
   ================================= */

/* Status Notice Banners */
.notice-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.notice-banner.transferred {
  background: #faf5ff;
  border: 2px solid #e9d5ff;
}

.notice-banner.contract-ended {
  background: #fef2f2;
  border: 2px solid #fecaca;
}

.notice-banner-icon {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}

.notice-banner.transferred .notice-banner-icon {
  background: #ede9fe;
  color: #6d28d9;
}

.notice-banner.contract-ended .notice-banner-icon {
  background: #fee2e2;
  color: #dc2626;
}

.notice-banner-body { flex: 1; }

.notice-banner-body h3 { margin: 0 0 0.25rem 0; }
.notice-banner.transferred .notice-banner-body h3 { color: #6d28d9; }
.notice-banner.contract-ended .notice-banner-body h3 { color: #dc2626; }

.notice-banner-body p { margin: 0; font-size: 0.9rem; }
.notice-banner.transferred .notice-banner-body p { color: #7c3aed; }
.notice-banner.contract-ended .notice-banner-body p { color: #b91c1c; }

[data-theme="dark"] .notice-banner.transferred { background: rgba(139, 92, 246, 0.1); }
[data-theme="dark"] .notice-banner.contract-ended { background: rgba(239, 68, 68, 0.1); }

/* Dark mode gradient for login icon */
[data-theme="dark"] .login-icon-gradient {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
}

/* Login card shadow */
.login-card {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .login-card {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

/* =================================
   Navigation Dark Mode
   ================================= */

[data-theme="dark"] .nav-logo {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

[data-theme="dark"] nav ul li a.nav-logout:hover {
  background-color: rgba(239, 68, 68, 0.15);
}

/* =================================
   Attention Required Banner
   ================================= */

.attention-banner {
  background: #fef2f2;
  border: 2px solid #fecaca;
  border-left: 4px solid #dc2626;
}

.attention-banner header h3 {
  color: #dc2626;
  margin-bottom: 0;
}

.attention-banner header h3 i {
  margin-right: 0.5rem;
}

.attention-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.attention-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.attention-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--icon-red-bg);
  color: var(--icon-red-text);
}

.attention-content {
  flex: 1;
  min-width: 0;
}

.attention-content strong {
  display: block;
  font-size: 0.95rem;
}

.attention-content strong a {
  color: var(--color-text);
}

.attention-content strong a:hover {
  color: var(--primary);
}

.attention-content p {
  margin: 0.25rem 0 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* =================================
   1-on-1 Prep Summary
   ================================= */

.prep-summary {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #bae6fd;
}

.prep-summary header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom-color: #bae6fd;
}

.prep-summary header h3 {
  color: #0369a1;
}

.prep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.prep-stat {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.prep-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prep-stat-content h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.prep-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}

/* =================================
   Goals List Enhanced
   ================================= */

.goals-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.goal-card {
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.goal-card:hover {
  border-color: var(--primary);
}

.goal-card.overdue {
  border-left: 3px solid #dc2626;
}

.goal-card.stale {
  border-left: 3px solid #f59e0b;
}

.goal-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.goal-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.goal-title {
  flex: 1;
  min-width: 0;
}

.goal-title h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.goal-title h4 a {
  color: var(--color-text);
  text-decoration: none;
}

.goal-title h4 a:hover {
  color: var(--primary);
}

.goal-title p {
  margin: 0;
  font-size: 0.85rem;
}

.goal-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.progress-bar-container {
  flex: 1;
  height: 8px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  min-width: 40px;
  text-align: right;
}

.goal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.goal-meta i {
  margin-right: 0.25rem;
  opacity: 0.7;
}

/* =================================
   1-on-1 Cards Enhanced
   ================================= */

.one-on-one-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.one-on-one-card {
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.one-on-one-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.one-on-one-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--icon-purple-bg);
  color: var(--icon-purple-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.one-on-one-title {
  flex: 1;
}

.one-on-one-title h4 {
  margin: 0;
  font-size: 0.95rem;
}

.one-on-one-title h4 a {
  color: var(--color-text);
}

.one-on-one-title h4 a:hover {
  color: var(--primary);
}

.one-on-one-title p {
  margin: 0.25rem 0 0 0;
  font-size: 0.8rem;
}

.one-on-one-stats {
  display: flex;
  gap: 1.5rem;
  padding: 0.75rem;
  background: var(--color-surface);
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.one-on-one-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.one-on-one-stat .stat-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
}

.one-on-one-stat .stat-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.one-on-one-stat.has-pending {
  background: rgba(220, 38, 38, 0.1);
  border-radius: 4px;
  padding: 0.5rem;
  margin: -0.5rem;
}

.one-on-one-preview {
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.one-on-one-preview p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Action item row overdue styling */
.action-item-row.overdue {
  border-left: 3px solid #dc2626;
}

/* =================================
   Dark Mode - Dashboard Components
   ================================= */

[data-theme="dark"] .attention-banner {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
}

[data-theme="dark"] .attention-item {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .prep-summary {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(56, 189, 248, 0.1) 100%);
  border-color: rgba(56, 189, 248, 0.3);
}

[data-theme="dark"] .prep-summary header {
  border-bottom-color: rgba(56, 189, 248, 0.3);
}

[data-theme="dark"] .prep-summary header h3 {
  color: #38bdf8;
}

[data-theme="dark"] .prep-stat {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .goal-card {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .one-on-one-card {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .one-on-one-stats {
  background: var(--color-background);
}

[data-theme="dark"] .action-item-row {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* =================================
   Responsive - Dashboard Components
   ================================= */

@media (max-width: 768px) {
  .attention-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .attention-item [role="button"] {
    width: 100%;
  }

  .prep-grid {
    grid-template-columns: 1fr 1fr;
  }

  .one-on-one-stats {
    flex-direction: column;
    gap: 0.75rem;
  }

  .one-on-one-stat {
    flex-direction: row;
    justify-content: space-between;
  }

  .goal-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .prep-grid {
    grid-template-columns: 1fr;
  }
}

/* =================================
   Unified Profile Card
   ================================= */

.profile-card {
  background: var(--color-surface);
  border-radius: 12px;
  border: 1px solid var(--color-border);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.profile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 1.5rem 0 1.5rem;
}

.profile-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.profile-card-actions [role="button"] {
  padding: 0.4rem 0.875rem;
  font-size: 0.8125rem;
}

.profile-card-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 1.5rem;
}

.profile-identity {
  display: flex;
  gap: 1.25rem;
}

.profile-identity-icon {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  background: var(--icon-blue-bg);
  color: var(--icon-blue-text);
}

.profile-identity-icon.active {
  background: var(--icon-green-bg);
  color: var(--icon-green-text);
}

.profile-identity-icon.inactive {
  background: var(--icon-gray-bg);
  color: var(--icon-gray-text);
}

.profile-identity-icon.on_leave {
  background: var(--icon-yellow-bg);
  color: var(--icon-yellow-text);
}

.profile-identity-icon.transferred {
  background: var(--icon-purple-bg);
  color: var(--icon-purple-text);
}

.profile-identity-content {
  flex: 1;
  min-width: 0;
}

.profile-identity-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.profile-identity-content h1 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  line-height: 1.3;
}

.profile-identity-meta {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-identity-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-identity-meta i {
  width: 1rem;
  text-align: center;
  opacity: 0.7;
}

.profile-identity-client {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.profile-identity-client strong {
  font-size: 0.95rem;
  color: var(--color-text);
}

.profile-identity-client small {
  display: block;
  margin-top: 0.25rem;
  color: var(--color-text-muted);
}

.profile-technologies {
  border-left: 1px solid var(--color-border);
  padding-left: 2rem;
}

.profile-tech-section {
  margin-bottom: 1.25rem;
}

.profile-tech-section:last-child {
  margin-bottom: 0;
}

.profile-tech-section h4 {
  margin: 0 0 0.75rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-tech-section h4 i {
  font-size: 0.85rem;
  opacity: 0.7;
}

.profile-top-tech-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-top-tech-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.profile-top-tech-item strong {
  font-size: 0.95rem;
}

.profile-tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Responsive Profile Card */
@media (max-width: 768px) {
  .profile-card-main {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .profile-technologies {
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding-left: 0;
    padding-top: 1.5rem;
  }

  .profile-identity-icon {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }

  .profile-identity-content h1 {
    font-size: 1.25rem;
  }

  .profile-card-header {
    flex-direction: column;
    gap: 1rem;
  }

  .profile-card-actions {
    width: 100%;
  }

  .profile-card-actions [role="button"] {
    flex: 1;
  }
}

/* =================================
   Flash Auto-Dismiss
   ================================= */

.flash-message {
  animation: flash-fade-out 0.5s ease-in 4.5s forwards;
}

@keyframes flash-fade-out {
  from { opacity: 1; max-height: 100px; margin-bottom: 1rem; padding: 0.75rem 1rem; }
  to { opacity: 0; max-height: 0; margin-bottom: 0; padding: 0; overflow: hidden; }
}

/* =================================
   Turbo Progress Bar
   ================================= */

.turbo-progress-bar {
  background: linear-gradient(to right, var(--color-primary), var(--color-primary-hover, #2563eb));
  height: 3px;
}

/* =================================
   Check-in Structured Form
   ================================= */

/* Score Pills — Rating Widget */
.score-pills {
  display: flex;
  gap: var(--spacing-sm);
  margin: var(--spacing-sm) 0;
}

.score-pill {
  display: inline-flex;
  cursor: pointer;
}

.score-pill input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.score-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all var(--transition);
}

.score-pill:hover span {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.score-pill input:checked + span {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

/* Score Pills — Display (show page) */
.score-pills-display {
  display: flex;
  gap: var(--spacing-xs);
  margin: var(--spacing-sm) 0;
}

.score-pill-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.8125rem;
}

.score-pill-display.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.score-pill-display.active.score-low {
  border-color: var(--color-danger);
  background: var(--color-danger);
}

.score-pill-display.active.score-mid {
  border-color: var(--color-warning);
  background: var(--color-warning);
}

.score-pill-display.active.score-high {
  border-color: var(--color-success);
  background: var(--color-success);
}

input[type="range"] {
  accent-color: var(--primary);
}

fieldset {
  border: 0;
  margin: 0 0 var(--spacing-md);
  padding: 0;
}

legend {
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0;
}

/* Tag Chips — Checkbox Widget */
.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin: var(--spacing-sm) 0;
}

.tag-chip {
  display: inline-flex;
  cursor: pointer;
}

.tag-chip input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tag-chip span {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  transition: all var(--transition);
}

.tag-chip:hover span {
  border-color: var(--primary);
  color: var(--primary);
}

.tag-chip input:checked + span {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-hover);
  font-weight: 500;
}

.tag-chips-display {
  margin: var(--spacing-sm) 0;
}

/* Response Block */
.response-block {
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  border: 1px solid var(--color-border-muted);
  border-radius: var(--border-radius);
  background: var(--color-surface);
}

.response-block:last-child {
  margin-bottom: 0;
}

.response-question {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.response-question p {
  margin: 0;
  font-weight: 500;
  color: var(--color-text);
  flex: 1;
}

.response-badges {
  display: flex;
  gap: var(--spacing-xs);
  flex-shrink: 0;
}

/* Category Group */
.category-group {
  margin-bottom: var(--spacing-xl);
}

.category-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--color-border);
}

.category-header i {
  color: var(--primary);
  font-size: 1.125rem;
}

.category-header h3 {
  margin: 0;
  font-size: 1.125rem;
  color: var(--color-text);
}

/* Suggestion Banner */
.suggestion-banner {
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

.suggestion-banner p {
  margin: 0 0 var(--spacing-sm) 0;
  color: var(--primary-hover);
}

.suggestion-banner i {
  color: var(--color-warning);
}

.suggestion-banner ul {
  margin: 0;
  padding-left: var(--spacing-lg);
}

.suggestion-banner li {
  color: var(--primary-hover);
  font-size: 0.875rem;
  margin-bottom: var(--spacing-xs);
}

/* Check-in Header */
.check-in-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

/* Dark Mode Overrides */
[data-theme="dark"] .response-block {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .suggestion-banner {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .suggestion-banner p,
[data-theme="dark"] .suggestion-banner li {
  color: var(--primary-light);
}

[data-theme="dark"] .score-pill span {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .tag-chip span {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .tag-chip input:checked + span {
  background: rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .category-header {
  border-color: var(--color-border);
}

/* =================================
   Phase 3: Engineer Profile Upgrade
   ================================= */

/* Risk Flags Banner */
.risk-flags {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.risk-flag {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 500;
}

.risk-flag i {
  flex-shrink: 0;
}

.risk-flag-red {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.risk-flag-amber {
  background: #fffbeb;
  border: 1px solid #fed7aa;
  color: #92400e;
}

[data-theme="dark"] .risk-flag-red {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.3);
  color: #fca5a5;
}

[data-theme="dark"] .risk-flag-amber {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

/* Check-in Metrics Row */
.check-in-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

@media (max-width: 768px) {
  .check-in-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .check-in-metrics {
    grid-template-columns: 1fr;
  }
}

/* Trend Arrows */
.trend-arrow {
  font-size: 1.1rem;
  font-weight: 700;
  margin-left: 0.25rem;
}

.trend-up {
  color: var(--color-success);
}

.trend-down {
  color: var(--color-danger);
}

.trend-neutral {
  color: var(--color-text-muted);
}

/* Score Trend Chart */
.score-trend-chart {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.panel-card .score-trend-chart {
  padding: var(--spacing-md) 1.25rem;
}

.score-trend-row {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
}

.score-trend-label {
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  flex-shrink: 0;
}

.score-trend-date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}

.score-trend-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.score-bar-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.score-bar-legend {
  width: 20px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.score-bar-track {
  flex: 1;
  height: 20px;
  background: var(--color-border-muted);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.score-bar {
  height: 100%;
  border-radius: var(--border-radius);
  transition: width 0.3s ease;
  min-width: 4px;
}

.score-bar-wellbeing {
  background: linear-gradient(90deg, #f87171, #ef4444, #16a34a);
  background: #ef4444;
}

.score-bar-wellbeing[style*="width: 6"], .score-bar-wellbeing[style*="width: 7"],
.score-bar-wellbeing[style*="width: 8"], .score-bar-wellbeing[style*="width: 9"],
.score-bar-wellbeing[style*="width: 100"] {
  background: var(--color-success);
}

.score-bar-career {
  background: var(--color-info);
}

.score-bar-value {
  min-width: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* Override score bar colors by width ranges via classes computed server-side is fragile.
   Instead, use simpler approach: wellbeing = warm red/green, career = blue */
.score-bar-wellbeing {
  background: #f87171;
}

.score-bar-career {
  background: #60a5fa;
}

/* Tag Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) 0;
}

.tag-cloud-item {
  display: inline-flex;
}

.tag-cloud-size-1 {
  font-size: 0.85rem;
}

.tag-cloud-size-2 {
  font-size: 1rem;
}

.tag-cloud-size-3 {
  font-size: 1.15rem;
}

/* Check-in Timeline */
.check-in-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-entry {
  border-bottom: 1px solid var(--color-border-muted);
  color: var(--color-text);
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  list-style: none;
  cursor: pointer;
  transition: background var(--transition);
}

.timeline-row::-webkit-details-marker { display: none; }

.timeline-row:hover {
  background: var(--color-border-muted);
}

.timeline-preview {
  margin: var(--spacing-xs) 0 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.timeline-entry[open] .timeline-preview { display: none; }

.timeline-chevron {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  transition: transform var(--transition);
}

.timeline-entry[open] .timeline-chevron { transform: rotate(180deg); }

.timeline-detail {
  padding: 0 var(--spacing-md) var(--spacing-md) calc(var(--spacing-md) * 2 + 12px);
}

.timeline-detail p {
  margin: 0 0 var(--spacing-sm);
  font-size: 0.9rem;
}

.timeline-entry:last-child {
  border-bottom: none;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.timeline-dot-one_on_one {
  background: var(--color-info);
}

.timeline-dot-feedback_session {
  background: #14b8a6;
}

.timeline-content {
  flex: 1;
  min-width: 0;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.score-summary-pills {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.score-pill-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--border-radius);
  background: var(--color-border-muted);
  color: var(--color-text-muted);
}

.score-pill-inline.score-low {
  background: #fee2e2;
  color: #991b1b;
}

.score-pill-inline.score-mid {
  background: #fef3c7;
  color: #92400e;
}

.score-pill-inline.score-high {
  background: #d1fae5;
  color: #065f46;
}

.score-pill-inline i {
  font-size: 0.7rem;
}

[data-theme="dark"] .score-pill-inline {
  background: var(--color-surface);
  color: var(--color-text-muted);
}

[data-theme="dark"] .score-pill-inline.score-low {
  background: rgba(220, 38, 38, 0.15);
  color: #fca5a5;
}

[data-theme="dark"] .score-pill-inline.score-mid {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}

[data-theme="dark"] .score-pill-inline.score-high {
  background: rgba(22, 163, 74, 0.15);
  color: #86efac;
}

/* Quick Actions Grid (5 buttons) */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--spacing-sm);
}

@media (max-width: 768px) {
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .score-trend-row {
    flex-direction: column;
  }

  .score-trend-label {
    min-width: auto;
    flex-direction: row;
    align-items: center;
  }
}

/* =================================
   VP Team Dashboard
   ================================= */

.team-dashboard {
  max-width: 100%;
}

/* Period Tabs */
.period-tabs {
  display: flex;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-lg);
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0;
}

.period-tab {
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  text-decoration: none;
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.period-tab:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.period-tab.active {
  color: var(--primary);
  background: var(--color-surface);
  border-color: var(--color-border);
  border-bottom: 2px solid var(--color-surface);
}

/* Flags Section */
.flags-section {
  margin-bottom: var(--spacing-lg);
}

.flag-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius);
  margin-bottom: var(--spacing-xs);
  font-size: 0.875rem;
}

.flag-item-red {
  background: rgba(220, 38, 38, 0.08);
  border-left: 3px solid var(--color-danger);
}

.flag-item-amber {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--color-warning);
}

.flag-level-indicator {
  display: none;
}

.flag-content {
  flex: 1;
}

.flag-content a {
  font-weight: 600;
}

/* Engineers Table */
.engineers-table {
  width: 100%;
  border-collapse: collapse;
}

.engineers-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 2px solid var(--color-border);
}

.engineers-table td {
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--color-border-muted);
  vertical-align: middle;
}

.engineers-table tbody tr:hover {
  background: var(--color-border-muted);
}

.table-responsive {
  overflow-x: auto;
}

/* Score Cell Colors */
.score-cell {
  font-weight: 700;
  font-size: 1rem;
}

.score-cell-danger {
  color: var(--color-danger);
}

.score-cell-warning {
  color: var(--color-warning);
}

.score-cell-success {
  color: var(--color-success);
}

/* Bar Chart (Horizontal) */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.bar-chart-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.bar-chart-label {
  min-width: 120px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  text-align: right;
  flex-shrink: 0;
}

.bar-chart-bar-container {
  flex: 1;
  height: 20px;
  background: var(--color-border-muted);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.bar-chart-bar {
  height: 100%;
  border-radius: var(--border-radius);
  min-width: 4px;
  transition: width 0.3s ease;
}

.bar-chart-bar-info {
  background: var(--color-info);
}

.bar-chart-bar-danger {
  background: var(--color-danger);
}

.bar-chart-count {
  min-width: 90px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* Systemic Note */
.systemic-note {
  font-size: 0.8125rem;
  color: var(--color-warning);
  font-style: italic;
  padding: var(--spacing-xs) 0 var(--spacing-xs) 130px;
  margin: 0;
}

.systemic-note i {
  margin-right: var(--spacing-xs);
}

/* Dark Mode: Team Dashboard */
[data-theme="dark"] .period-tab {
  color: #9ca3af;
}

[data-theme="dark"] .period-tab:hover {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .period-tab.active {
  color: #93c5fd;
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .flag-item-red {
  background: rgba(220, 38, 38, 0.12);
}

[data-theme="dark"] .flag-item-amber {
  background: rgba(245, 158, 11, 0.12);
}

[data-theme="dark"] .engineers-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .score-cell-danger {
  color: #f87171;
}

[data-theme="dark"] .score-cell-warning {
  color: #fcd34d;
}

[data-theme="dark"] .score-cell-success {
  color: #86efac;
}

[data-theme="dark"] .stat-delta {
  color: #9ca3af;
}

[data-theme="dark"] .stat-card-danger h3 {
  color: #f87171;
}

[data-theme="dark"] .bar-chart-bar-container {
  background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .bar-chart-bar-info {
  background: #60a5fa;
}

[data-theme="dark"] .bar-chart-bar-danger {
  background: #f87171;
}

[data-theme="dark"] .systemic-note {
  color: #fcd34d;
}

/* Team Dashboard Responsive */
@media (max-width: 768px) {
  .period-tabs {
    flex-wrap: wrap;
  }

  .bar-chart-label {
    min-width: 80px;
    font-size: 0.75rem;
  }

  .bar-chart-count {
    min-width: 70px;
  }

  .systemic-note {
    padding-left: var(--spacing-sm);
  }
}

/* =================================
   Check-in Context Panel
   ================================= */

.context-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  margin-bottom: var(--spacing-lg);
  overflow: hidden;
}

.context-panel-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-border-muted);
  border-bottom: 1px solid var(--color-border);
}

.context-panel-header i {
  color: var(--primary);
  font-size: 1rem;
}

.context-panel-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.context-section {
  border-bottom: 1px solid var(--color-border);
}

.context-section:last-child {
  border-bottom: none;
}

.context-section-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-lg);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
}

.context-section-header::-webkit-details-marker {
  display: none;
}

.context-section-header::before {
  content: "\f054";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 0.65rem;
  color: var(--color-text-muted);
  transition: transform var(--transition);
}

details[open] > .context-section-header::before {
  transform: rotate(90deg);
}

.context-section-header i {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.context-section-body {
  padding: 0 var(--spacing-lg) var(--spacing-md) var(--spacing-lg);
}

.context-item {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-xs) 0;
  font-size: 0.85rem;
}

.context-item-label {
  min-width: 60px;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.context-item-value {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  align-items: center;
}

.context-note {
  display: block;
  font-size: 0.85rem;
  margin-bottom: var(--spacing-xs);
  line-height: 1.4;
}

.context-empty {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.context-empty i {
  opacity: 0.4;
}

.context-goal-item {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--color-border-muted);
}

.context-goal-item:last-child {
  border-bottom: none;
}

.context-goal-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-xs);
}

.context-goal-title {
  font-size: 0.875rem;
  font-weight: 500;
}

.context-goal-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex-shrink: 0;
}

.context-goal-tags {
  display: flex;
  gap: var(--spacing-xs);
  margin-top: var(--spacing-xs);
}

.context-resource-link {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.context-resource-link:hover {
  color: var(--primary);
}

.context-action-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--color-border-muted);
}

.context-action-item:last-child {
  border-bottom: none;
}

.context-action-title {
  font-weight: 500;
}

.context-action-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex-shrink: 0;
}

/* Dark Mode: Context Panel */
[data-theme="dark"] .context-panel {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] .context-panel-header {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--color-border);
}

[data-theme="dark"] .context-section {
  border-color: var(--color-border);
}

[data-theme="dark"] .context-goal-item,
[data-theme="dark"] .context-action-item {
  border-color: rgba(255, 255, 255, 0.05);
}

/* Summary: edit button revealed on hover, toggled via JS */

.summary-edit-form {
  display: none;
}

.summary-edit-btn,
.summary-cancel-btn {
  cursor: pointer;
}

.summary-container:not(.show-edit) .summary-edit-btn {
  display: none;
}

.summary-container:hover .summary-edit-btn,
.summary-container.show-edit .summary-edit-btn {
  display: inline-flex;
}

.summary-container.show-edit .summary-edit-form {
  display: block;
}

.summary-container.show-edit #summary-display {
  display: none;
}

/* =================================
   Engineer Show: Two-Column Layout
   ================================= */

.show-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.show-layout-sidebar {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (max-width: 768px) {
  .show-layout {
    grid-template-columns: 1fr;
  }

  .show-layout-sidebar {
    position: static;
    order: -1;
  }
}

/* =================================
   Section Nav
   ================================= */

.section-nav {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.25rem;
  background: var(--color-border-muted);
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.section-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.section-nav-link:hover {
  color: var(--color-text);
  background: var(--color-surface);
  text-decoration: none;
}

.section-nav-link i {
  font-size: 0.7rem;
  opacity: 0.7;
}

/* =================================
   Sidebar Card
   ================================= */

.sidebar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem 1.125rem;
}

.sidebar-card-title {
  margin: 0 0 0.875rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-card-title i {
  font-size: 0.85rem;
  opacity: 0.7;
}

.sidebar-card-title small {
  margin-left: auto;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.sidebar-empty i {
  font-size: 1.25rem;
  opacity: 0.3;
}

.sidebar-empty small {
  font-size: 0.75rem;
}

/* =================================
   Sidebar Metrics
   ================================= */

.sidebar-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.sidebar-metric {
  text-align: center;
}

.sidebar-metric-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.sidebar-metric-value small {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.sidebar-metric-value.sidebar-metric-low {
  color: var(--color-danger);
}

.sidebar-metric-label {
  display: block;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

/* Trend arrow inside sidebar-metric-value */
.sidebar-metric-value .trend-arrow {
  font-size: 0.85rem;
  vertical-align: middle;
}

/* =================================
   Score Trend Chart (Sidebar)
   ================================= */

.show-layout-sidebar .score-trend-row {
  flex-direction: column;
  gap: 0.25rem;
}

.show-layout-sidebar .score-trend-label {
  min-width: auto;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.show-layout-sidebar .score-trend-date {
  font-size: 0.8rem;
}

.show-layout-sidebar .score-bar-track {
  height: 16px;
}

.show-layout-sidebar .score-bar-value {
  font-size: 0.75rem;
  min-width: 26px;
}

/* =================================
   Tag Cloud Links
   ================================= */

.tag-cloud-link {
  text-decoration: none;
  color: inherit;
}

.tag-cloud-link:hover {
  text-decoration: none;
  opacity: 0.85;
}

/* =================================
   Admin Placeholder
   ================================= */

.admin-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  background: var(--color-border-muted);
  border-radius: 8px;
  border: 1px dashed var(--color-border);
}

.admin-placeholder i {
  opacity: 0.5;
  font-size: 0.9rem;
}

/* =================================
   Check-ins Index: Toolbar & Filters
   ================================= */

.index-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.index-toolbar [role="button"] {
  flex-shrink: 0;
}

.filter-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-bar-controls select {
  width: auto;
  font-size: 0.85rem;
  padding: 0.4rem 2rem 0.4rem 0.75rem;
}

/* =================================
   Active Filter Tags
   ================================= */

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary-hover);
  background: var(--primary-light);
  border-radius: 4px;
}

.active-filter-clear {
  color: var(--primary-hover);
  padding: 0.1rem;
  border-radius: 2px;
  line-height: 1;
}

.active-filter-clear:hover {
  background: var(--color-border-muted);
  color: var(--color-danger);
}

/* =================================
   List Card: Draft State
   ================================= */

.list-card-draft {
  opacity: 0.85;
  border-left: 3px dashed var(--color-warning);
}

.list-card-draft:hover {
  opacity: 1;
}

.list-card-draft .list-card-title h3 a {
  color: var(--color-text-muted);
}

/* Score pills inside list-card-badge */
.list-card-badge .score-summary-pills {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

/* =================================
   Form: Progress Indicator
   ================================= */

.form-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-muted);
}

.form-progress i {
  opacity: 0.5;
}

/* =================================
   Form: Static Field
   ================================= */

.form-static-field {
  margin-bottom: 1rem;
}

.form-static-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

/* =================================
   Engineer Logs
   ================================= */

.log-form-inline {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-muted);
}

.log-form-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.log-form-row textarea {
  flex: 1;
  width: auto;
  min-height: 3rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-family: inherit;
  resize: vertical;
  background: var(--color-surface);
  color: var(--color-text);
}

.log-form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.log-form-row input[type="submit"] {
  flex-shrink: 0;
  width: auto;
}

.log-timeline {
  padding: 0 0 0.5rem 0;
}

.log-entry {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--color-border-muted);
}

.log-entry:last-child {
  border-bottom: none;
}

.log-entry-content p {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
}

.log-entry-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.log-entry-author {
  font-weight: 500;
  color: var(--color-text-muted);
}

.log-entry-time {
  opacity: 0.8;
}

.log-entry-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.log-action-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  transition: color 0.15s;
}

.log-action-link:hover {
  color: var(--primary);
}

.log-action-link.log-action-delete:hover {
  color: var(--color-danger);
}

/* Form panels (theme-aware) */
.form-panel {
  --panel-bg: var(--icon-gray-bg);
  --panel-text: var(--icon-gray-text);
  background: var(--panel-bg);
  border: 1px solid color-mix(in srgb, var(--panel-text) 30%, transparent);
  padding: 1rem;
  margin: 1rem 0;
}

.form-panel h4 {
  margin: 0 0 0.75rem 0;
  color: var(--panel-text);
}

.form-panel-purple { --panel-bg: var(--icon-purple-bg); --panel-text: var(--icon-purple-text); }
.form-panel-red { --panel-bg: var(--icon-red-bg); --panel-text: var(--icon-red-text); }
.form-panel-blue { --panel-bg: var(--icon-blue-bg); --panel-text: var(--icon-blue-text); }
.form-panel-amber { --panel-bg: var(--icon-yellow-bg); --panel-text: var(--icon-yellow-text); }

.top-technology-entry {
  border: 1px solid var(--color-border);
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 0.375rem;
}

.top-technology-entry button.remove-top-technology {
  border-color: var(--color-danger);
  display: block;
  width: auto;
  margin: 0 0 0.5rem auto;
  padding: 0.25rem 0.5rem;
  background: var(--color-danger);
  color: #fff;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.75rem;
}

/* Form polish */
form label > small {
  display: block;
  font-weight: 400;
  color: var(--color-text-muted);
}

form label > :is(input, select, textarea) + small:not(.text-muted) {
  color: var(--color-danger);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.form-actions input[type="submit"],
article[aria-label="Filter engineers"] input[type="submit"] {
  width: auto;
}

article[aria-label="Filter engineers"] input[type="submit"] {
  margin-top: 0.75rem;
}

/* Data tables and pagination */
.data-table td small.d-block { display: block; }

.data-table tr.row-overdue td:first-child {
  box-shadow: inset 3px 0 0 var(--color-danger);
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  align-self: center;
  margin: 0;
}

.filter-check input { width: auto; margin: 0; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
}

.pagy {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

.pagy a {
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  color: var(--color-text);
  font-size: 0.875rem;
  text-decoration: none;
}

.pagy a[href]:hover { background: var(--primary-light); }

.pagy a[aria-current="page"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pagy a:not([href]):not([aria-current]) { opacity: 0.45; }

.inline-form { display: inline-block; margin: 0 0 0 0.5rem; }

.btn-sm { padding: 0.15rem 0.6rem; font-size: 0.8rem; }

.row-status { white-space: nowrap; }

.flash-message.flash-undo { animation-delay: 9.5s; }

.row-progress { white-space: nowrap; }

.row-progress progress {
  width: 90px;
  height: 0.5rem;
  margin: 0 0.5rem 0 0;
  vertical-align: middle;
}

.row-actions { text-align: right; white-space: nowrap; }

/* Dashboard attention lists */
.attention-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.attention-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border-muted);
}

.attention-list li:last-child { border-bottom: 0; }

.attention-list li .btn-sm { margin-left: auto; }

.attention-list li form { margin-left: auto; }

.attention-main { flex: 1 1 12rem; min-width: 0; }

.attention-main small { display: block; }

.attention-grid { align-items: start; }

.attention-grid article header h3 { display: flex; align-items: center; gap: 0.5rem; }

/* Profile tabs and menu */
.profile-tabs {
  display: flex;
  gap: 0.25rem;
  margin: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.profile-tab {
  padding: 0.5rem 1rem;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-weight: 500;
  text-decoration: none;
}

.profile-tab:hover { color: var(--color-text); }

.profile-tab[aria-current="page"] {
  border-bottom-color: var(--primary);
  color: var(--color-text);
}

.profile-page > .panel-card,
.profile-page > .grid,
.profile-page > .history-link-bar { margin-bottom: 1rem; }

.compact-item-title {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

button.client-trigger {
  width: 100%;
  background: none;
  border: 0;
  color: inherit;
  text-align: left;
}

details.menu { position: relative; }

details.menu > summary { list-style: none; cursor: pointer; }

details.menu > summary::-webkit-details-marker { display: none; }

details.menu ul {
  position: absolute;
  right: 0;
  z-index: 10;
  min-width: 11rem;
  margin: 0.25rem 0 0;
  padding: 0.25rem;
  list-style: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

details.menu li a {
  display: block;
  padding: 0.4rem 0.75rem;
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--border-radius);
}

details.menu li a:hover { background: var(--primary-light); }

.profile-identity-client button.client-trigger {
  justify-content: flex-start;
  background: transparent;
  border: 0;
  color: inherit;
}

.profile-identity-client button.client-trigger:hover { background: var(--color-border-muted); }

nav.profile-tabs {
  justify-content: flex-start;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.panel-card .tag-cloud { padding: 0.75rem 1rem; }

/* Check-in form layout */
.check-in-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.check-in-aside {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 0.75rem 0;
  background: var(--color-background);
  border-top: 1px solid var(--color-border);
}

.score-scale {
  display: flex;
  justify-content: space-between;
  max-width: 16rem;
  margin-top: 0.25rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

details.menu button.menu-danger {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  border: 0;
  color: var(--color-danger);
}

details.menu button.menu-danger:hover { background: var(--primary-light); }

/* Compact top technology rows */
.top-technology-entry {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr auto;
  gap: 0.75rem;
  align-items: end;
}

.top-technology-entry label { margin: 0; }

.top-technology-entry button.remove-top-technology {
  display: inline-flex;
  margin: 0 0 0.25rem 0;
  padding: 0.4rem 0.6rem;
}

.top-technology-entry button.remove-top-technology {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.top-technology-entry button.remove-top-technology:hover {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}

/* Theme refinements: readable buttons in dark mode, brand, focus, motion */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

[data-theme="dark"] a[role="button"]:not(.secondary):not(.contrast),
[data-theme="dark"] button:not(.secondary):not(.contrast):not(.menu-danger):not(.menu-item):not(.menu-action):not(.remove-top-technology),
[data-theme="dark"] input[type="submit"],
[data-theme="dark"] nav ul li a.active {
  color: #0f172a;
}

[data-theme="dark"] nav ul li a.active i { color: #0f172a; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.data-table td, .data-table th { font-variant-numeric: tabular-nums; }

article, .card { box-shadow: var(--shadow-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Engineer options admin */
.option-rename { display: flex; align-items: center; gap: 0.5rem; margin: 0; }

.option-rename input[type="text"] { margin: 0; }

.option-add {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.option-add input[type="text"] { margin: 0; }

/* Mobile layout: wrapping nav, scrollable tables, touch-sized controls */
@media (max-width: 768px) {
  body { overflow-x: hidden; }

  nav { flex-wrap: wrap; gap: 0.25rem; padding: 0.5rem 0; }
  nav ul { flex-wrap: wrap; }

  nav ul li a,
  nav ul li button,
  #theme-toggle,
  main button,
  main [role="button"],
  main input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
  }

  main table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .profile-card-main > * { min-width: 0; }
  .profile-identity-meta span { overflow-wrap: anywhere; }
  .client-trigger { white-space: normal; text-align: left; }
  .profile-tabs { overflow-x: auto; }
  .profile-tab { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
}

/* Admin dropdown and secondary logout */
.nav-menu { position: relative; margin: 0; }

.nav-menu summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  border: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
  color: var(--primary);
}

.nav-menu summary::-webkit-details-marker,
.nav-menu summary::after { display: none; }

.nav-menu summary:hover { background-color: var(--color-border-muted); }

.nav-menu summary.active { background-color: var(--primary); color: white; }

.nav-menu ul {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  z-index: 20;
  flex-direction: column;
  align-items: stretch;
  min-width: 10rem;
  padding: 0.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.nav-menu ul li a { min-height: 44px; white-space: nowrap; }

.nav-menu-header {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid var(--color-border);
}

.nav-menu-email { font-weight: 600; color: var(--color-text); }

.nav-menu-header small { color: var(--color-text-muted); }

.nav-menu ul li button.menu-item {
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  background: transparent;
  border: 0;
  color: var(--color-text);
  font-size: 0.8125rem;
  transform: none;
}

.nav-menu ul li button.menu-item:hover {
  background: var(--color-border-muted);
  color: var(--color-danger);
}

.nav-menu ul li button#theme-toggle.menu-item:hover { color: var(--color-text); }

@media (max-width: 992px) {
  .nav-menu summary { justify-content: center; min-width: 44px; padding: 0.45rem 0.625rem; }
  .nav-menu summary .nav-text { display: none; }
  .nav-menu ul li a .nav-text { display: inline; }
}

/* Team health: severity-colored blocker bars, top-aligned cards */
.bar-chart-bar-warning { background: var(--color-warning); }

[data-theme="dark"] .bar-chart-bar-warning { background: #fbbf24; }

.team-dashboard .grid-2 { align-items: start; }

/* Secondary submit inputs, role badges, stable row actions */
input[type="submit"].secondary {
  color: var(--color-text);
  background: var(--color-background);
  border-color: var(--color-border);
}

input[type="submit"].secondary:hover {
  background: var(--color-border-muted);
  border-color: var(--color-border);
}

[data-theme="dark"] input[type="submit"].secondary { color: var(--color-text); }

.badge-primary {
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

[data-theme="dark"] .badge-primary {
  background: rgba(96, 165, 250, 0.2);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.3);
}

.row-status .badge { display: inline-block; min-width: 6rem; text-align: center; }

.option-rename input[type="text"] { flex: 1 1 auto; min-width: 8rem; }

.option-rename input[type="submit"] { flex: 0 0 auto; width: auto; }

/* Calmer form panels, aligned form rows, login spacing */
.form-panel {
  background: var(--color-surface);
  border-left: 4px solid var(--panel-text);
}

form .grid-2 { align-items: start; }

.login-card label { margin-bottom: 1rem; }

.login-card label.show-password {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.login-card label.show-password input { margin: 0; width: auto; }

/* Sortable headers, filter checkbox below filters */
.data-table th[aria-sort] a { color: inherit; text-decoration: none; }

.data-table th[aria-sort="ascending"] a,
.data-table th[aria-sort="descending"] a { color: var(--primary); }

.data-table th[aria-sort] a:hover { text-decoration: underline; }

article[aria-label="Filter engineers"] .filter-check { margin-top: 0.75rem; }

@media (max-width: 768px) {
  .options-table,
  .options-table tbody { display: block; overflow: visible; }

  .options-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.25rem 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
  }

  .options-table td { display: block; padding: 0; border: 0; }
  .options-table td:first-child { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  main table.table-cards,
  .table-cards tbody,
  .table-cards tr { display: block; overflow: visible; }

  .table-cards thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .table-cards tr {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
  }

  .table-cards td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.25rem 0;
    border: 0;
    text-align: right;
  }

  .table-cards td::before {
    content: attr(data-label);
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .table-cards td:first-child {
    display: block;
    padding-bottom: 0.5rem;
    text-align: left;
  }

  .table-cards td:first-child::before,
  .table-cards td[data-label=""]::before { display: none; }

  .table-cards td[data-label=""] { justify-content: flex-end; }
  .table-cards td:empty { display: none; }

  .data-table.table-cards tr.row-overdue { border-left: 3px solid var(--color-danger); }
  .data-table.table-cards tr.row-overdue td:first-child { box-shadow: none; }
}

.record-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.record-nav-next { margin-left: auto; }

.filter-search { margin-bottom: 0.75rem; }

@media (max-width: 992px) {
  .check-in-layout { grid-template-columns: minmax(0, 1fr); }

  .check-in-aside {
    position: static;
    max-height: none;
    order: -1;
  }
}

details.menu li form { margin: 0; }

details.menu button.menu-action {
  width: 100%;
  justify-content: flex-start;
  background: transparent;
  border: 0;
  color: var(--color-text);
  transform: none;
}

details.menu button.menu-action:hover { background: var(--color-border-muted); }

details.menu button.menu-action.menu-danger { color: var(--color-danger); }
