/**
 * Design System - Main Entry Point
 * Single SCSS entry point that imports all component styles.
 * 
 * Build output: dist/styles.css
 * Usage: Services copy from dist/ via copy-design-system.js
 */
/* ============================== */
/* FOUNDATION                     */
/* ============================== */
/**
 * Design System - CSS Tokens (Variables)
 *
 * Semantic naming convention without vendor prefixes.
 * HSL-ready format for future dark mode support.
 */
:root {
  /* ===================================== */
  /* PRIMARY COLOR SYSTEM                  */
  /* HSL-ready format: use hsl(var(--name)) */
  /* ===================================== */
  /* Primary (Brand Color) */
  --primary: 240 33% 37%;
  --primary-foreground: 0 0% 100%;
  --primary-hover: 240 33% 30%;
  /* Surface (Brand Beige) */
  --surface: 44 23% 91%;
  /* Accent (Brand Orange) */
  --accent: 26 100% 60%;
  /* ===================================== */
  /* NEUTRAL COLORS                        */
  /* ===================================== */
  /* Background */
  --background: 0 0% 100%;
  /* Muted (Subtle backgrounds) */
  --muted: 210 17% 98%;
  --muted-subtle: 210 14% 96%;
  --muted-foreground: 212 10% 73%;
  /* Border */
  --border: 210 14% 93%;
  --border-emphasis: 210 14% 83%;
  /* Foreground (Text colors) */
  --foreground-secondary: 210 7% 56%;
  --foreground: 210 9% 31%;
  --foreground-strong: 210 11% 15%;
  /* ===================================== */
  /* SEMANTIC COLORS                       */
  /* ===================================== */
  /* Success */
  --success: 145 63% 32%;
  --success-muted: 140 53% 90%;
  --success-foreground: 145 61% 23%;
  --success-text: 145 61% 23%;
  /* Warning */
  --warning: 25 95% 53%;
  --warning-muted: 38 100% 95%;
  --warning-foreground: 25 75% 28%;
  /* Destructive (Danger/Error) */
  --destructive: 354 70% 54%;
  --destructive-foreground: 0 0% 100%;
  --destructive-hover: 354 70% 45%;
  --destructive-active: 354 70% 40%;
  --destructive-muted: 354 70% 95%;
  --destructive-text: 354 58% 30%;
  /* Info */
  --info: 189 94% 43%;
  --info-muted: 189 67% 93%;
  --info-foreground: 189 75% 25%;
  --info-text: 189 75% 25%;
  /* ===================================== */
  /* CHART COLORS                          */
  /* ===================================== */
  --chart-pending: 212 10% 73%;
  --chart-inprogress: 25 95% 53%;
  --chart-completed: 145 63% 32%;
  --chart-expired: 354 70% 54%;
  /* ===================================== */
  /* SYNTAX HIGHLIGHTING                   */
  /* For code/JSON display (TASK-003)      */
  /* ===================================== */
  /* Keywords/property names (purple) */
  --syntax-keyword: 289 72% 32%;
  /* String values (green) */
  --syntax-string: 115 100% 23%;
  /* Number values (blue) */
  --syntax-number: 242 99% 40%;
  /* Boolean/null values (red) */
  --syntax-boolean: 354 67% 53%;
  /* ===================================== */
  /* RADIUS TOKENS                         */
  /* ===================================== */
  --radius-pill: 100px;
  --radius-card: 16px 16px 16px 4px;
  /* ===================================== */
  /* LAYOUT TOKENS                         */
  /* ===================================== */
  --header-main-height: 64px;
  --header-nav-height: 48px;
}

/**
 * Design System - Base Styles
 * Reset and foundational styles
 */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  /* Prevent layout shift from scrollbar appearing/disappearing */
  overflow-y: scroll;
}

body {
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: hsl(var(--foreground));
  background-color: hsl(var(--muted));
  min-height: 100vh;
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100px; /* Must be larger than element height to fully hide */
  left: 0;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Accessibility: Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
/**
 * Design System - Typography
 * Font families, headings, text styles
 */
/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: hsl(var(--foreground-strong));
  line-height: 1.3;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.125rem;
}

h5 {
  font-size: 1rem;
}

h6 {
  font-size: 0.875rem;
}

/* Text utilities */
.text-center {
  text-align: center;
}

.text-muted {
  color: hsl(var(--foreground-secondary));
}

/* ============================== */
/* COMPONENTS                     */
/* ============================== */
/**
 * Design System - Buttons
 * Brand-style buttons with hover effects
 *
 * Corner Pattern: 3 rounded corners, 1 sharp (bottom-right)
 * On hover: All corners become rounded
 */
/* ============================================
   Button Corner Variables
   ============================================ */
:root {
  /* Signature corner pattern: 3 round, 1 sharp (bottom-right) */
  --btn-radius-round: 16px;
  --btn-radius-sharp: 4px;
  /* Order: top-left, top-right, bottom-right, bottom-left */
  --btn-radius: var(--btn-radius-round) var(--btn-radius-round) var(--btn-radius-sharp) var(--btn-radius-round);
  --btn-radius-hover: var(--btn-radius-round);
}

/* ============================================
   Base Button Styles
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  /* Padding: Ensure text doesn't hit edges */
  padding: 0.75rem 1.5rem;
  min-height: 44px; /* Touch target accessibility */
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  /* Brand style: 3 rounded corners, 1 sharp (bottom-right) */
  border-radius: var(--btn-radius);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, border-radius 0.2s ease, color 0.2s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Focus state for accessibility */
.btn:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}

/* ============================================
   Primary Button - Brand Purple (Default)
   ============================================ */
.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover:not(:disabled) {
  background-color: hsl(var(--primary-hover));
  /* On hover: all corners become rounded */
  border-radius: var(--btn-radius-hover);
}

.btn-primary:active:not(:disabled) {
  background-color: hsl(var(--primary-hover));
}

/* ============================================
   Secondary Button - Outlined
   ============================================ */
.btn-secondary {
  background-color: transparent;
  color: hsl(var(--primary));
  border: 2px solid hsl(var(--primary));
  /* Adjust padding to account for border */
  padding: calc(0.75rem - 2px) calc(1.5rem - 2px);
}

.btn-secondary:hover:not(:disabled) {
  background-color: hsl(var(--surface));
  /* On hover: all corners become rounded */
  border-radius: var(--btn-radius-hover);
}

.btn-secondary:active:not(:disabled) {
  background-color: hsl(var(--surface));
}

/* ============================================
   Ghost Button - Subtle/Text Button
   ============================================ */
.btn-ghost {
  background-color: transparent;
  color: hsl(var(--foreground-secondary));
}

.btn-ghost:hover:not(:disabled) {
  background-color: hsl(var(--muted-subtle));
  color: hsl(var(--foreground));
  /* On hover: all corners become rounded */
  border-radius: var(--btn-radius-hover);
}

.btn-ghost:active:not(:disabled) {
  background-color: hsl(var(--border));
}

/* ============================================
   Destructive Button - Red/Danger
   ============================================ */
.btn-destructive,
.btn-danger {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.btn-destructive:hover:not(:disabled),
.btn-danger:hover:not(:disabled) {
  background-color: hsl(var(--destructive-hover));
  /* On hover: all corners become rounded */
  border-radius: var(--btn-radius-hover);
}

.btn-destructive:active:not(:disabled),
.btn-danger:active:not(:disabled) {
  background-color: hsl(var(--destructive-active));
}

/* Outlined destructive variant */
.btn-destructive-outline,
.btn-danger-outline {
  background-color: transparent;
  color: hsl(var(--destructive));
  border: 2px solid hsl(var(--destructive));
  /* Adjust padding to account for border */
  padding: calc(0.75rem - 2px) calc(1.5rem - 2px);
}

.btn-destructive-outline:hover:not(:disabled),
.btn-danger-outline:hover:not(:disabled) {
  background-color: hsl(var(--destructive-muted));
  /* On hover: all corners become rounded */
  border-radius: var(--btn-radius-hover);
}

.btn-destructive-outline:active:not(:disabled),
.btn-danger-outline:active:not(:disabled) {
  background-color: hsl(var(--destructive-muted));
}

/* ============================================
   Button Sizes
   ============================================ */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  min-height: 36px;
  --btn-radius-round: 12px;
  --btn-radius-sharp: 3px;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
  min-height: 52px;
  --btn-radius-round: 20px;
  --btn-radius-sharp: 5px;
}

/**
 * Design System - Cards
 * Generic card component and domain-specific variants
 */
/* ============================================
   Generic Card Component
   ============================================ */
.card {
  background: hsl(var(--background));
  /* AKP style: 3 rounded corners, 1 square (bottom-left) */
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
  border-radius: 16px 16px 0 0; /* Match top corners of card */
}

.card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: hsl(var(--foreground-strong));
}

.card-body {
  padding: 1.5rem;
}

.card-body p {
  margin: 0;
  color: hsl(var(--foreground-secondary));
  line-height: 1.6;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid hsl(var(--border));
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Card with hover effect */
.card-interactive {
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}

.card-interactive:hover {
  box-shadow: 0 4px 12px rgba(64, 64, 127, 0.15);
  transform: translateY(-2px);
}

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

/* Stat Card */
.stat-card {
  background: hsl(var(--background));
  padding: 1.5rem;
  /* AKP style: 3 rounded corners, 1 square (bottom-left) */
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border-left: 4px solid hsl(var(--primary));
}

.stat-card h3 {
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--foreground-secondary));
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--primary));
  margin: 0;
}

/* Gauge Stat Card */
.stat-card-gauge {
  position: relative;
}

.gauge-container {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto;
}

.gauge-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.25rem;
  font-weight: 700;
  color: hsl(var(--primary));
}

/* Chart Card */
.chart-section {
  margin-bottom: 2rem;
}

.chart-card {
  background: hsl(var(--background));
  padding: 1.5rem;
  /* AKP style: 3 rounded corners, 1 square (bottom-left) */
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.chart-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 1rem;
}

.chart-card canvas {
  max-height: 250px;
}

/* Member Card */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.member-card {
  background: hsl(var(--background));
  /* AKP style: 3 rounded corners, 1 square (bottom-left) */
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s, transform 0.2s;
}

.member-card:hover {
  box-shadow: 0 4px 12px hsl(var(--primary)/0.15);
  transform: translateY(-2px);
}

.member-card h3 {
  color: hsl(var(--foreground-strong));
  margin-bottom: 0.75rem;
}

.member-info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: hsl(var(--foreground-secondary));
}

.member-info-item .label {
  font-weight: 500;
  color: hsl(var(--foreground));
  min-width: 60px;
}

.member-info-item .value {
  word-break: break-word;
}

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

/* Recent Activity Card */
.recent-activity {
  background: hsl(var(--background));
  padding: 1.5rem;
  /* AKP style: 3 rounded corners, 1 square (bottom-left) */
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.recent-activity h2 {
  margin-bottom: 1rem;
  color: hsl(var(--foreground-strong));
}

/**
 * Design System - Forms
 * Form containers, inputs, validation
 */
.form-container {
  background: hsl(var(--background));
  /* AKP style: 3 rounded corners, 1 square (bottom-left) */
  border-radius: var(--radius-card);
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  max-width: 500px;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.form-group .required {
  color: hsl(var(--destructive));
}

/* Input Fields */
.form-control,
input[type=text],
input[type=email],
input[type=tel],
input[type=search],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  background-color: hsl(var(--background));
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary)/0.15);
}

.form-control::placeholder,
input::placeholder {
  color: hsl(var(--muted-foreground));
}

.form-control.error {
  border-color: hsl(var(--destructive));
}

.form-hint {
  font-size: 0.85rem;
  color: hsl(var(--foreground-secondary));
  margin-top: 0.25rem;
}

.form-error {
  font-size: 0.85rem;
  color: hsl(var(--destructive));
  margin-top: 0.25rem;
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--muted-subtle));
}

/* Search Bar */
.search-bar {
  margin-bottom: 1rem;
}

.search-bar input {
  max-width: 300px;
}

/* Search Container */
.search-container {
  width: 100%;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: 0.5rem;
  background-color: hsl(var(--background));
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary)/0.15);
}

.search-input::placeholder {
  color: hsl(var(--muted-foreground));
}

/**
 * Design System - Tables
 * Table containers and styling
 */
.table-container {
  background: hsl(var(--background));
  /* AKP style: 3 rounded corners, 1 square (bottom-left) */
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  text-align: left;
  padding: 1rem;
  background: hsl(var(--muted));
  font-weight: 600;
  font-size: 0.8rem;
  color: hsl(var(--foreground-secondary));
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid hsl(var(--border));
}

table td {
  padding: 1rem;
  border-bottom: 1px solid hsl(var(--muted-subtle));
  color: hsl(var(--foreground));
}

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

/* Interactive Rows - Opt-in via .table-interactive class */
.table-interactive tbody tr {
  cursor: pointer;
  transition: all 0.15s ease;
}

.table-interactive tbody tr:hover {
  background-color: hsl(var(--surface));
  box-shadow: 0 2px 8px hsl(var(--primary)/0.1);
  transform: translateY(-1px);
}

.table-interactive tbody tr:active {
  transform: translateY(0);
}

.table-interactive tbody tr:focus {
  outline: 2px solid hsl(var(--primary));
  outline-offset: -2px;
}

/* ============================================
   Sortable Column Headers
   CFS-021: Pagination Patterns
   ============================================ */
.table-header-cell--sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
}

.table-header-cell--sortable:hover {
  background-color: hsl(var(--muted-subtle));
}

.table-header-cell--sortable:focus {
  /* DS-002: Use box-shadow instead of outline to follow border-radius */
  outline: none;
  box-shadow: inset 0 0 0 2px hsl(var(--primary));
  border-radius: 4px; /* DS-002: Add border-radius so inset box-shadow appears rounded */
}

.table-header-cell--sorted {
  font-weight: 700;
  color: hsl(var(--primary));
}

.table-header-text {
  display: inline;
}

.table-sort-indicator {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.75em;
  opacity: 0.8;
}

/**
 * Design System - DataTable Styles
 *
 * Styles for the DataTable god component:
 * - Pagination controls
 * - Loading/empty/error states
 * - Skeleton animations
 *
 * Part of CFS-021: Pagination Patterns
 */
/* ============================================
   DataTable Wrapper
   ============================================ */
.data-table-wrapper {
  position: relative;
}

.data-table-content {
  min-height: 200px;
}

/* ============================================
   Loading Overlay
   ============================================ */
.data-table-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.data-table-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid hsl(var(--border));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: data-table-spin 0.8s linear infinite;
}

@keyframes data-table-spin {
  to {
    transform: rotate(360deg);
  }
}
/* ============================================
   Empty State
   ============================================ */
.data-table-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: hsl(var(--background));
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.data-table-empty-content {
  text-align: center;
  padding: 2rem;
}

.data-table-empty-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.data-table-empty-description {
  margin: 0;
  color: hsl(var(--foreground-secondary));
}

/* ============================================
   Error State
   ============================================ */
.data-table-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: hsl(var(--destructive-muted));
  border-radius: var(--radius-card);
  border: 1px solid hsl(var(--destructive));
}

.data-table-error-content {
  text-align: center;
  padding: 2rem;
}

.data-table-error-icon {
  display: block;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.data-table-error-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: hsl(var(--destructive-text));
}

.data-table-error-message {
  margin: 0 0 1rem;
  color: hsl(var(--destructive-text));
}

.data-table-retry {
  margin-top: 0.5rem;
}

/* ============================================
   Skeleton Loading
   ============================================ */
.data-table-skeleton {
  height: 1rem;
  background: linear-gradient(90deg, hsl(var(--muted-subtle)) 25%, hsl(var(--border)) 50%, hsl(var(--muted-subtle)) 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: data-table-skeleton-pulse 1.5s ease-in-out infinite;
}

.data-table-skeleton--short {
  width: 60%;
}

@keyframes data-table-skeleton-pulse {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
.data-table-skeleton-row td {
  padding: 1rem;
}

/* ============================================
   Row Actions
   ============================================ */
.data-table-actions {
  text-align: right;
  white-space: nowrap;
}

.data-table-actions button {
  margin-left: 0.5rem;
}

.data-table-actions button:first-child {
  margin-left: 0;
}

/* ============================================
   Pagination Controls
   ============================================ */
.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: hsl(var(--muted));
  border-top: 1px solid hsl(var(--border));
  flex-wrap: wrap;
  gap: 1rem;
}

.table-pagination--hidden {
  display: none;
}

.table-pagination-info {
  color: hsl(var(--foreground-secondary));
  font-size: 0.875rem;
}

.table-pagination-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.table-pagination-rows-per-page {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  /* DS-003: Prevent label and dropdown from wrapping to multiple lines */
  flex-wrap: nowrap;
  white-space: nowrap;
}

.table-pagination-rows-per-page label {
  color: hsl(var(--foreground-secondary));
  font-size: 0.875rem;
  /* DS-003: Ensure label stays on single line */
  white-space: nowrap;
  flex-shrink: 0; /* DS-003: Prevent label from shrinking and wrapping */
}

.table-pagination-select {
  padding: 0.375rem 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  cursor: pointer;
}

.table-pagination-select:focus {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 1px;
}

.table-pagination-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.table-pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-pagination-numbers {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.table-pagination-prev,
.table-pagination-next {
  padding: 0.5rem 0.75rem;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.table-pagination-prev:hover:not(:disabled),
.table-pagination-next:hover:not(:disabled) {
  background: hsl(var(--muted-subtle));
  border-color: hsl(var(--border-emphasis));
}

.table-pagination-prev:focus,
.table-pagination-next:focus {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 1px;
}

.table-pagination-prev:disabled,
.table-pagination-next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.table-pagination-page {
  min-width: 2rem;
  padding: 0.5rem;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: 4px;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.table-pagination-page:hover:not(:disabled):not(.table-pagination-page--current) {
  background: hsl(var(--muted-subtle));
  border-color: hsl(var(--border-emphasis));
}

.table-pagination-page:focus {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 1px;
}

.table-pagination-page:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.table-pagination-page--current {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--background));
  font-weight: 600;
  cursor: default;
}

.table-pagination-ellipsis {
  padding: 0.5rem 0.25rem;
  color: hsl(var(--muted-foreground));
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
  .table-pagination {
    flex-direction: column;
    align-items: stretch;
  }
  .table-pagination-info {
    text-align: center;
  }
  .table-pagination-controls {
    justify-content: center;
  }
  .table-pagination-rows-per-page {
    justify-content: center;
  }
  .table-pagination-pages {
    justify-content: center;
  }
}
/**
 * Design System - Header Component
 * Two-row header with brand and navigation
 *
 * Layout (top to bottom):
 * - .header-main (white, 64px): Brand, user info, notification center, logout
 * - .header-nav (gray, 48px): Navigation links
 */
/* Header height variables - used by other components (toasts, notifications) */
:root {
  --header-main-height: 64px; /* User info bar (white) */
  --header-nav-height: 48px; /* Navigation bar (gray) */
  --header-total-height: 112px; /* Total: 64 + 48 */
}

.header {
  box-shadow: 0 2px 8px hsl(var(--foreground-strong)/0.08);
}

/* Main Header Bar - White background */
.header-main {
  background-color: hsl(var(--background));
  border-bottom: 1px solid hsl(var(--border));
}

/* Navigation Bar - Light gray background */
.header-nav {
  background-color: hsl(var(--muted));
  border-bottom: 1px solid hsl(var(--border));
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-main .header-container {
  height: var(--header-main-height);
}

.header-nav .header-container {
  height: var(--header-nav-height);
  justify-content: flex-start;
}

/* Header Brand - Logo + Text */
.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-logo {
  flex-shrink: 0;
  color: hsl(var(--primary));
}

.header-logo svg {
  height: 28px;
  width: auto;
  display: block;
}

.header-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  border-left: 1px solid hsl(var(--border));
  padding-left: 1rem;
}

/* 2-line product name */
.header-brand-line1 {
  font-size: 0.85rem;
  font-weight: 600;
  color: hsl(var(--primary));
  white-space: nowrap;
}

.header-brand-line2 {
  font-size: 0.85rem;
  font-weight: 600;
  color: hsl(var(--primary));
  white-space: nowrap;
}

/* Navigation - Horizontal links */
.nav {
  display: flex;
  gap: 0;
  height: 100%;
}

.nav a {
  color: hsl(var(--foreground));
  text-decoration: none;
  padding: 0 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  height: 48px;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
  min-width: 100px;
  justify-content: center;
}

.nav a:hover,
.nav a:focus {
  color: hsl(var(--primary));
  background-color: hsl(var(--primary)/0.05);
}

.nav a.active {
  color: hsl(var(--primary));
  border-bottom-color: hsl(var(--accent));
  font-weight: 500;
}

/* Header Right Section (Tenant Selector + Notifications + User Info) */
.header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Notification Center Wrapper */
.notification-center-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* User Info in Header */
.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: hsl(var(--foreground));
  font-size: 0.9rem;
  line-height: 1; /* CFS-041 Addendum B: Consistent baseline alignment */
}

/* User email display - align with button */
.user-info .user-email {
  line-height: 1;
  display: flex;
  align-items: center;
}

.user-info .user-name {
  font-weight: 500;
  color: hsl(var(--foreground));
  line-height: 1;
}

/* Tenant Selector (Super-Admin only) */
.tenant-selector-wrapper {
  display: flex;
  align-items: center;
}

.tenant-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tenant-selector-label {
  font-size: 0.85rem;
  color: hsl(var(--foreground-secondary));
  font-weight: 500;
}

.tenant-selector-dropdown {
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: all 0.2s;
  min-width: 180px;
}

.tenant-selector-dropdown:hover {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--muted));
}

.tenant-selector-dropdown:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary)/0.1);
}

.tenant-selector-empty,
.tenant-selector-error {
  font-size: 0.85rem;
  color: hsl(var(--foreground-secondary));
  padding: 0.5rem;
}

/* Sign Out Button - AKP style with 3 round + 1 square corner */
.user-info .logout-link,
.user-info .logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary));
  text-decoration: none;
  padding: 0.5rem 1.25rem;
  background-color: transparent;
  border: 2px solid hsl(var(--primary));
  border-radius: 100px 4px 100px 100px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1; /* CFS-041 Addendum B: Consistent alignment */
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.1s, border-radius 0.2s;
}

.user-info .logout-link:hover,
.user-info .logout-link:focus,
.user-info .logout-btn:hover,
.user-info .logout-btn:focus {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  transform: translateY(-1px);
  border-radius: 100px;
}

.user-info .logout-link:active,
.user-info .logout-btn:active {
  transform: translateY(0);
}

/* Sign In Button - AKP style matching logout button */
.user-info .login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary));
  text-decoration: none;
  padding: 0.5rem 1.25rem;
  background-color: transparent;
  border: 2px solid hsl(var(--primary));
  border-radius: 100px 4px 100px 100px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1; /* CFS-041 Addendum B: Consistent alignment */
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, transform 0.1s, border-radius 0.2s;
}

.user-info .login-link:hover,
.user-info .login-link:focus {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  transform: translateY(-1px);
  border-radius: 100px;
}

.user-info .login-link:active {
  transform: translateY(0);
}

/**
 * Design System - Panels
 * Slide panels and popovers/modals
 */
/* ============================================
   Popover/Modal
   ============================================ */
.popover-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.popover-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.popover-card {
  background: hsl(var(--background));
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 450px;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.2s ease;
}

.popover-overlay.visible .popover-card {
  transform: scale(1) translateY(0);
}

.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
  border-radius: 12px 12px 0 0;
}

.popover-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: hsl(var(--foreground-strong));
}

.popover-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 4px;
  transition: color 0.15s, background-color 0.15s;
}

.popover-close:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--border));
}

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

.popover-card form {
  padding: 1.5rem;
}

/* Modal/Popover Actions - Right-aligned buttons */
.popover-actions,
.modal-actions {
  display: flex;
  justify-content: flex-end; /* Right-align */
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  /* Removed border-top per user feedback - cleaner modal design */
}

/* Modal title styling */
.popover-card h3,
.modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: hsl(var(--foreground-strong));
  margin: 0;
}

/* ============================================
   Slide Panel
   ============================================ */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.panel-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 60%;
  max-width: 600px;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile */
  background: hsl(var(--background));
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-panel.open {
  transform: translateX(0);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .slide-panel {
    width: 85%;
    max-width: none;
  }
}
@media (max-width: 480px) {
  .slide-panel {
    width: 95%;
  }
}
.slide-panel .panel-header {
  position: sticky;
  top: 0;
  background: hsl(var(--primary));
  color: hsl(var(--background));
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1;
}

.slide-panel .panel-header h2 {
  color: hsl(var(--background));
  margin: 0;
  font-size: 1.25rem;
}

.slide-panel .panel-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: background-color 0.15s, color 0.15s;
}

.slide-panel .panel-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: hsl(var(--background));
}

.slide-panel .panel-close:focus-visible {
  outline: 2px solid hsl(var(--background));
  outline-offset: 2px;
}

.slide-panel .panel-content {
  padding: 1.5rem;
}

/* Member Info in Panel */
.member-info-section {
  margin-bottom: 2rem;
}

.member-info {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.member-info dt {
  font-weight: 600;
  color: hsl(var(--foreground-secondary));
  font-size: 0.85rem;
}

.member-info dd {
  color: hsl(var(--foreground));
}

/* Flow History in Panel */
.flow-history-section h3 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.flow-card {
  background: hsl(var(--muted));
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid hsl(var(--border));
}

.flow-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.flow-type {
  font-weight: 600;
  color: hsl(var(--primary));
}

.flow-card-meta {
  font-size: 0.85rem;
  color: hsl(var(--foreground-secondary));
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.flow-events,
.flow-answers {
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.flow-events summary,
.flow-answers summary {
  cursor: pointer;
  color: hsl(var(--primary));
  font-weight: 500;
}

.flow-events ul {
  margin: 0.5rem 0 0 1rem;
  padding: 0;
  list-style: none;
}

.flow-events li {
  display: flex;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid hsl(var(--border));
}

.flow-events li:last-child {
  border-bottom: none;
}

.event-time {
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
}

.event-type {
  color: hsl(var(--foreground));
}

.flow-answers pre {
  background: hsl(var(--background));
  padding: 0.75rem;
  border-radius: 4px;
  margin-top: 0.5rem;
  overflow-x: auto;
  font-size: 0.8rem;
  border: 1px solid hsl(var(--border));
}

.empty-state {
  text-align: center;
  color: hsl(var(--muted-foreground));
  padding: 2rem;
  font-style: italic;
}

/**
 * Design System - Toasts
 * Notification messages
 */
.toast-container {
  position: fixed;
  /*
   * DS-001 / BUG-007 fix: Toast positioning relative to header.
   * Uses CSS custom properties from header.css for maintainability.
   * --header-total-height: Combined height of user info + navigation bars
   * --toast-top-offset: Dynamic offset when notification panel is open
   *
   * Horizontal positioning: Matches header container's right edge.
   * On wide screens (>1200px + padding): Toast aligns with header content area.
   * On narrow screens: Toast uses 1.5rem padding from viewport edge.
   */
  top: calc(var(--header-total-height, 112px) + 8px + var(--toast-top-offset, 0px));
  /* Right position: viewport edge - matches header padding */
  right: max(1.5rem, (100vw - 1200px) / 2);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  /* Smooth transition when panel opens/closes */
  transition: top 0.2s ease-out;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px hsl(var(--foreground-strong)/0.15);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}
.toast.fade-out {
  animation: slideOutRight 0.4s ease forwards;
}

.toast-success {
  background: hsl(var(--success-muted));
  color: hsl(var(--success-text));
  border-left: 4px solid hsl(var(--success));
}

.toast-error {
  background: hsl(var(--destructive-muted));
  color: hsl(var(--destructive-text));
  border-left: 4px solid hsl(var(--destructive));
}

.toast-info {
  background: hsl(var(--info-muted));
  color: hsl(var(--info-text));
  border-left: 4px solid hsl(var(--info));
}

/* Messages (inline, not toast) */
.message {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.message-success {
  background-color: hsl(var(--success-muted));
  color: hsl(var(--success-text));
  border: 1px solid hsl(var(--success)/0.3);
}

.message-error {
  background-color: hsl(var(--destructive-muted));
  color: hsl(var(--destructive-text));
  border: 1px solid hsl(var(--destructive)/0.3);
}

.message-info {
  background-color: hsl(var(--info-muted));
  color: hsl(var(--info-text));
  border: 1px solid hsl(var(--info)/0.3);
}

/**
 * Design System - Notifications
 *
 * Styles for the notification system:
 * - Inline field errors
 * - Notification bell with badge
 * - Notification panel
 * - Notification items
 * - Toast notifications
 *
 * Uses design system tokens from colors.css
 */
/* ===== Inline Field Errors ===== */
.field-error {
  color: hsl(var(--destructive-text));
  font-size: 0.85rem;
  margin-top: 0.25rem;
  padding: 0.25rem 0;
}

.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea,
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: hsl(var(--destructive));
}

.form-field.has-error input:focus,
.form-field.has-error select:focus,
.form-field.has-error textarea:focus,
.form-group.has-error input:focus,
.form-group.has-error select:focus,
.form-group.has-error textarea:focus {
  border-color: hsl(var(--destructive));
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.form-field.is-valid input,
.form-field.is-valid select,
.form-field.is-valid textarea,
.form-group.is-valid input,
.form-group.is-valid select,
.form-group.is-valid textarea {
  border-color: hsl(var(--success));
}

.form-field.is-valid input:focus,
.form-field.is-valid select:focus,
.form-field.is-valid textarea:focus,
.form-group.is-valid input:focus,
.form-group.is-valid select:focus,
.form-group.is-valid textarea:focus {
  border-color: hsl(var(--success));
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.2);
}

/* ===== Notification Bell ===== */
.notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s;
}

.notification-bell:hover {
  background-color: hsl(var(--muted-subtle));
}

/* DS-006: Bell icon connected state when panel is open */
.notification-bell--active,
.notification-bell--active:hover {
  background-color: hsl(var(--muted-subtle));
}

.notification-bell--active .notification-bell__icon {
  color: hsl(var(--primary)); /* Purple when active */
}

.notification-bell:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(64, 64, 127, 0.3);
}

.notification-bell__icon {
  font-size: 1.25rem;
  line-height: 1;
  color: hsl(var(--foreground-secondary)); /* Grayscale - matches AP aesthetic */
}

.notification-bell:hover .notification-bell__icon {
  color: hsl(var(--primary)); /* Purple on hover */
}

.notification-bell__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  color: hsl(var(--background));
  background-color: hsl(var(--destructive));
  border-radius: 9px;
}

/* ===== Notification Panel ===== */
.notification-panel {
  position: absolute;
  /*
   * Positioning strategy:
   * The panel is inside .notification-center-wrapper which is positioned relative.
   * The wrapper is vertically centered in the 64px header, but we need the panel
   * to start at the bottom of the header bar, not the bottom of the wrapper.
   *
   * Header height: 64px
   * Bell icon height: ~40px, centered = starts at ~12px from top
   * So bottom of wrapper is at ~52px from header top
   * We need to offset down by ~12px to reach header bottom (64px)
   *
   * CFS-041 Addendum B: Right edge aligns with logout button (user-info section)
   * .header-right layout: [tenant-selector] [notification-center] [user-info]
   * Gap from notification-center to user-info: 1.5rem (24px)
   * user-info width: email (~150px) + gap (16px) + logout button (~100px) = ~266px
   * Total offset needed: 24px + 266px = ~290px
   * Panel extends right by 290px to align right edge with logout button right edge
   */
  top: calc(100% + 12px); /* Flush with header bottom */
  right: -290px; /* Offset to align right edge with logout button */
  width: 400px;
  max-width: calc(100vw - 32px);
  max-height: 500px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-card); /* Rounded corners all around */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 100;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* DS-004: Focus outline for notification panel follows border-radius */
.notification-panel:focus {
  outline: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 0 0 3px rgba(64, 64, 127, 0.3);
}

.notification-panel:focus-within {
  /* Subtle focus enhancement when any child element is focused */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/*
 * DS-005: Removed pop-out arrow/triangle per bug report.
 * The notification panel now has a clean rectangular appearance.
 * Previously: CFS-041 Addendum B added arrow pointing to bell icon.
 */
/* Ensure hidden attribute works with display: flex */
.notification-panel[hidden] {
  display: none;
}

.notification-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem; /* Reduced from 1rem 1.25rem */
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted));
  flex-shrink: 0;
}

.notification-panel__title {
  margin: 0;
  font-size: 0.9rem; /* Reduced from 1rem */
  font-weight: 600;
  color: hsl(var(--foreground-strong));
}

/* Header actions container for mark-all and clear-all buttons */
.notification-panel__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notification-panel__mark-all {
  padding: 0.375rem 0.75rem;
  font-size: 0.85rem;
  color: hsl(var(--primary));
  background: transparent;
  border: 1px solid hsl(var(--primary));
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.notification-panel__mark-all:hover:not(:disabled) {
  background-color: hsl(var(--primary));
  color: hsl(var(--background));
}

.notification-panel__mark-all:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Clear all button with grayscale icon */
.notification-panel__clear-all {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  color: hsl(var(--muted-foreground)); /* Grayscale */
  transition: color 0.2s, background-color 0.2s;
}

.notification-panel__clear-all:hover:not(:disabled) {
  color: hsl(var(--foreground-secondary));
  background-color: hsl(var(--muted-subtle));
}

.notification-panel__clear-all:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.notification-panel__clear-all svg {
  width: 18px;
  height: 18px;
}

.notification-panel__list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notification-panel__empty {
  padding: 2rem;
  text-align: center;
  color: hsl(var(--foreground-secondary));
}

.notification-panel__empty p {
  margin: 0;
  font-size: 0.9rem;
}

/* ===== Notification Item ===== */
.notification-item {
  position: relative;
  padding: 0.75rem 1rem; /* Reduced from 1rem 1.25rem */
  border-bottom: 1px solid hsl(var(--muted-subtle));
  cursor: pointer;
  transition: background-color 0.15s;
}

.notification-item:hover {
  background-color: hsl(var(--muted));
}

.notification-item:focus {
  /* DS-004: Use box-shadow instead of outline to follow border-radius */
  outline: none;
  box-shadow: inset 0 0 0 2px hsl(var(--primary));
  background-color: hsl(var(--muted-subtle));
}

.notification-item--unread {
  background-color: rgba(64, 64, 127, 0.08); /* Slightly more visible - was 0.05 */
}

.notification-item--unread .notification-item__title {
  font-weight: 700; /* Bold title for unread */
}

.notification-item--unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px; /* Slightly thicker accent - was 3px */
  background-color: hsl(var(--primary));
}

.notification-item__header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.notification-item__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: bold;
  border-radius: 50%;
}

.notification-item__icon--success {
  color: hsl(var(--success));
  background-color: hsl(var(--success-muted));
}

.notification-item__icon--error {
  color: hsl(var(--destructive));
  background-color: hsl(var(--destructive-muted));
}

.notification-item__icon--warning {
  color: hsl(var(--warning));
  background-color: rgba(253, 126, 20, 0.15);
}

.notification-item__icon--info {
  color: hsl(var(--info));
  background-color: hsl(var(--info-muted));
}

.notification-item__content {
  flex: 1;
  min-width: 0;
}

.notification-item__title {
  font-weight: 600;
  font-size: 0.85rem; /* Reduced from 0.9rem */
  color: hsl(var(--foreground-strong));
  margin-bottom: 0.25rem;
}

.notification-item__message {
  font-size: 0.8rem; /* Reduced from 0.85rem */
  color: hsl(var(--foreground-secondary));
  word-wrap: break-word;
}

.notification-item__time {
  flex-shrink: 0;
  font-size: 0.7rem; /* Reduced from 0.75rem */
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

.notification-item__dismiss {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-left: 0.5rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: hsl(var(--muted-foreground));
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.notification-item:hover .notification-item__dismiss,
.notification-item:focus .notification-item__dismiss {
  opacity: 1;
}

.notification-item__dismiss:hover {
  color: hsl(var(--destructive));
}

.notification-item__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding: 0;
  font-size: 0.8rem;
  color: hsl(var(--primary));
  background: transparent;
  border: none;
  cursor: pointer;
}

.notification-item__toggle:hover {
  text-decoration: underline;
}

.notification-item__toggle-icon {
  font-size: 0.6rem;
}

.notification-item__details {
  margin-top: 0.75rem;
  padding: 0.75rem;
  font-size: 0.8rem;
  background-color: hsl(var(--muted));
  border-radius: 4px;
  color: hsl(var(--foreground));
}

.notification-item__details-list {
  margin: 0;
  padding: 0;
}

.notification-item__details-list dt {
  font-weight: 600;
  margin-top: 0.5rem;
  color: hsl(var(--foreground));
}

.notification-item__details-list dt:first-child {
  margin-top: 0;
}

.notification-item__details-list dd {
  margin: 0.25rem 0 0 0;
}

.notification-item__details-list code {
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.85em;
  padding: 0.1rem 0.3rem;
  background-color: hsl(var(--border));
  border-radius: 3px;
}

.notification-item__details-list ul {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}

.notification-item__details-list li {
  margin-bottom: 0.25rem;
}

/* ===== Toast Enhancements ===== */
/* Extends existing toasts.css */
.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  max-width: 400px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  animation: toast-slide-in 0.3s ease-out;
}

.toast__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: bold;
  border-radius: 50%;
}

.toast__icon--success {
  color: hsl(var(--success));
  background-color: rgba(25, 135, 84, 0.2);
}

.toast__icon--error {
  color: hsl(var(--destructive));
  background-color: rgba(220, 53, 69, 0.2);
}

.toast__icon--warning {
  color: hsl(var(--warning));
  background-color: rgba(253, 126, 20, 0.2);
}

.toast__icon--info {
  color: hsl(var(--info));
  background-color: rgba(13, 202, 240, 0.2);
}

.toast__content {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-weight: 600;
  font-size: 0.9rem;
  color: hsl(var(--foreground-strong));
}

.toast__message {
  font-size: 0.85rem;
  color: hsl(var(--foreground-secondary));
  margin-top: 0.25rem;
  word-wrap: break-word;
}

.toast__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  color: hsl(var(--muted-foreground));
  background: transparent;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.toast__close:hover {
  opacity: 1;
}

.toast--success {
  background: hsl(var(--background));
  border-left: 4px solid hsl(var(--success));
}

.toast--error {
  background: hsl(var(--background));
  border-left: 4px solid hsl(var(--destructive));
}

.toast--warning {
  background: hsl(var(--background));
  border-left: 4px solid hsl(var(--warning));
}

.toast--info {
  background: hsl(var(--background));
  border-left: 4px solid hsl(var(--info));
}

.toast--dismissing {
  animation: toast-slide-out 0.3s ease-in forwards;
}

@keyframes toast-slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes toast-slide-out {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}
/* ===== Critical System Banner ===== */
.system-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: hsl(var(--info-muted));
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.system-banner--warning {
  background: rgba(253, 126, 20, 0.15);
}

.system-banner--critical {
  background: hsl(var(--destructive-muted));
}

.system-banner__icon {
  font-size: 1.25rem;
  line-height: 1;
}

.system-banner__content {
  flex: 1;
}

.system-banner__content strong {
  display: block;
  color: hsl(var(--foreground-strong));
}

.system-banner__content p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: hsl(var(--foreground));
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 480px) {
  .notification-panel {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
  }
  /* DS-005: Arrow removed from desktop; this rule now obsolete but kept for clarity */
  .toast-container {
    right: 0.75rem;
    left: 0.75rem;
  }
  .toast {
    max-width: none;
  }
}
/* ============================== */
/* LAYOUT                         */
/* ============================== */
/**
 * Design System - Layout
 * Main content, page headers, sections
 */
/* Main Content Container */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Page Header */
.page-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.page-header h2 {
  color: hsl(var(--foreground-strong));
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.section-actions {
  display: flex;
  gap: 0.75rem;
}

/* Loading State Container */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: hsl(var(--foreground-secondary));
}

/* Note: .loading-spinner styles are in utilities.css */
/* ============================== */
/* UTILITIES                      */
/* ============================== */
/**
 * Design System - Utilities
 * Helper classes for spacing, visibility, etc.
 */
/* Visibility */
.hidden {
  display: none !important;
}

/* Spacing - Margin Top */
.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

/* Spacing - Margin Bottom */
.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-None,
.status-Pending {
  background-color: hsl(var(--muted-subtle));
  color: hsl(var(--foreground-secondary));
}

.status-Sent {
  background-color: #e3f2fd;
  color: #1565c0;
}

.status-Opened {
  background-color: #f3e5f5;
  color: #7b1fa2;
}

.status-InProgress {
  background-color: #fff3e0;
  color: #ef6c00;
}

.status-Completed {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.status-Expired {
  background-color: #ffebee;
  color: #c62828;
}

/* ============================================
   Loading Spinners
   Polished AKP-branded loading indicators
   ============================================ */
/* Main Loading Spinner - used for page/section loading states */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  gap: 1rem;
}

.loading-spinner::before {
  content: "";
  width: 44px;
  height: 44px;
  border: 3px solid transparent;
  border-top-color: hsl(var(--primary));
  border-right-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spinner-rotate 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  box-shadow: 0 0 0 1px rgba(64, 64, 127, 0.1), 0 4px 12px rgba(64, 64, 127, 0.15);
}

.loading-spinner-text {
  color: hsl(var(--foreground-secondary));
  font-size: 0.9rem;
  font-weight: 500;
}

/* Smaller inline spinner for buttons and compact areas */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-right-color: currentColor;
  border-radius: 50%;
  animation: spinner-rotate 0.7s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  vertical-align: middle;
}

/* Medium spinner for inline contexts */
.spinner-sm {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: hsl(var(--primary));
  border-right-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spinner-rotate 0.7s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

/* Large spinner for full-page loading */
.spinner-lg {
  width: 56px;
  height: 56px;
  border: 4px solid transparent;
  border-top-color: hsl(var(--primary));
  border-right-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spinner-rotate 0.9s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  box-shadow: 0 0 0 1px rgba(64, 64, 127, 0.1), 0 6px 16px rgba(64, 64, 127, 0.2);
}

/* Spinner animation - smooth ease for polished feel */
@keyframes spinner-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
/* Three-dot loader alternative (for variety) */
.loading-dots {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.loading-dots::before,
.loading-dots::after,
.loading-dots span {
  content: "";
  width: 8px;
  height: 8px;
  background-color: hsl(var(--primary));
  border-radius: 50%;
  animation: dot-pulse 1.4s ease-in-out infinite;
}

.loading-dots::before {
  animation-delay: 0s;
}

.loading-dots span {
  animation-delay: 0.2s;
}

.loading-dots::after {
  animation-delay: 0.4s;
}

@keyframes dot-pulse {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}
/* Legacy support - keep old animation name working */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* Error State */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 1rem;
  text-align: center;
}

.error-state-icon {
  font-size: 2.5rem;
  color: hsl(var(--muted-foreground));
}

.error-state-message {
  color: hsl(var(--destructive));
  font-weight: 500;
}

.error-state-detail {
  color: hsl(var(--foreground-secondary));
  font-size: 0.9rem;
}

.btn-retry {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background: hsl(var(--primary));
  color: hsl(var(--background));
  border: none;
  border-radius: 100px 4px 100px 100px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-retry:hover {
  background-color: hsl(var(--primary-hover));
  border-radius: 100px;
}

/**
 * Design System - Responsive
 * Media queries for different screen sizes
 */
@media (min-width: 768px) {
  .page-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .search-container {
    width: auto;
  }
}
@media (max-width: 1024px) {
  .slide-panel {
    width: 80%;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  /* Header responsive adjustments */
  .header-main .header-container {
    height: auto;
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.75rem;
  }
  .header-nav .header-container {
    height: auto;
    padding: 0;
  }
  .header-brand {
    flex-direction: column;
    gap: 0.5rem;
  }
  .header-brand-text {
    border-left: none;
    padding-left: 0;
    text-align: center;
  }
  .nav {
    width: 100%;
  }
  .nav a {
    flex: 1;
    justify-content: center;
    padding: 0.75rem 0.5rem;
  }
  .section-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  .slide-panel {
    width: 100%;
    max-width: none;
  }
  .stats-row {
    grid-template-columns: 1fr;
  }
  .member-info {
    grid-template-columns: 1fr;
  }
  .popover-card {
    width: 95%;
    margin: 1rem;
  }
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  table {
    font-size: 0.9rem;
  }
  table th,
  table td {
    padding: 0.75rem 0.5rem;
  }
}
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  .header-container {
    padding: 0.5rem 1rem;
  }
  .main {
    padding: 1rem;
  }
  .form-container {
    padding: 1.5rem;
  }
  .member-card {
    padding: 1rem;
  }
  .members-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .stat-value {
    font-size: 1.75rem;
  }
  /* Hide columns marked with .hide-on-mobile class on small screens */
  .hide-on-mobile {
    display: none;
  }
}

/*# sourceMappingURL=styles.css.map */
