/* ===========================================================
   FONT IMPORTS & BASE GLOBALS
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

/* ===========================================================
   ACCESSIBILITY IMPROVEMENTS
   =========================================================== */

/* Skip to main content link - hidden by default, visible on focus */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--sm-accent-primary);
  color: var(--sm-text-dark);
  padding: 0.5em 1em;
  text-decoration: none;
  font-weight: 700;
  z-index: 10000;
  border-radius: 0 0 4px 0;
}

.skip-to-content:focus {
  top: 0;
  outline: 3px solid var(--sm-accent-secondary);
  outline-offset: 2px;
}

/* Screen reader only text - visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Improved focus indicators for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--sm-accent-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Remove default outline for mouse users, keep for keyboard users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* Enhanced focus for interactive elements */
.btn:focus-visible,
.nav-link:focus-visible,
.menu-toggle:focus-visible {
  outline: 3px solid var(--sm-accent-primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px var(--sm-bg-dark), 0 0 0 5px var(--sm-accent-primary);
}

/* Table caption styling */
table caption {
  text-align: left;
  margin-bottom: 0.5em;
  font-weight: 600;
  color: var(--sm-accent-primary);
}

/* Ensure tables are announced properly */
table[role="table"] {
  border-collapse: separate;
}

/* Improve focus visibility for links */
a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Ensure buttons are keyboard accessible */
button,
.btn,
a.btn {
  cursor: pointer;
}

button:disabled,
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Live region for screen reader announcements */
.sr-live-region {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ===========================================================
   PRINT STATISTICS DASHBOARD
   =========================================================== */

.print-statistics-dashboard {
  padding: 0;
  max-width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.print-stats-card {
  background: rgba(34, 40, 50, 0.93);
  border: 1px solid rgba(65, 224, 253, 0.2);
  border-radius: 26px;
  padding: 2rem 1.8rem;
  box-shadow: 0 6px 38px rgba(38, 214, 228, 0.1);
  backdrop-filter: blur(6px);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.print-stats-card:hover {
  box-shadow: 0 10px 40px rgba(65, 224, 253, 0.15);
  border-color: rgba(65, 224, 253, 0.3);
}

.print-stats-card > h3 {
  color: var(--sm-accent-primary);
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 1.4em;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 12px rgba(65, 224, 253, 0.3);
  border-bottom: 2px solid rgba(65, 224, 253, 0.2);
  padding-bottom: 0.8rem;
}

.print-stats-filters {
  margin-bottom: 0;
}


.stats-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: flex-end;
}

.stats-filter-form label {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  color: var(--sm-accent-primary);
  font-weight: 600;
  font-size: 0.95em;
  letter-spacing: 0.03em;
}

.stats-filter-form input[type="date"],
.stats-filter-form select {
  padding: 0.6em 0.9em;
  background: rgba(34, 40, 50, 0.96);
  color: #e2e2fa;
  border: 1.5px solid rgba(65, 224, 253, 0.35);
  border-radius: 12px;
  font-size: 1em;
  font-family: 'Inter', system-ui, sans-serif;
  transition: border 0.19s, box-shadow 0.16s;
  box-shadow: 0 0px 6px rgba(65, 224, 253, 0.09);
}

.stats-filter-form input[type="date"]:focus,
.stats-filter-form select:focus {
  border-color: var(--sm-accent-primary);
  outline: none;
  box-shadow: 0 2px 18px rgba(65, 224, 253, 0.4);
}

.stats-filter-form .btn {
  margin-top: 0;
  align-self: flex-end;
}

/* Statistics Cards Wrapper */
.print-stats-cards-wrapper {
  margin-bottom: 0;
}

/* Statistics Cards */
.print-stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.8rem;
  margin-bottom: 0;
}

.stat-card {
  background: rgba(24, 28, 34, 0.7);
  border: 1px solid rgba(65, 224, 253, 0.15);
  border-radius: 16px;
  padding: 1.6rem 1.4rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: 0 2px 12px rgba(38, 214, 228, 0.06);
  backdrop-filter: blur(4px);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(65, 224, 253, 0.25);
  border-color: rgba(65, 224, 253, 0.4);
}

.stat-card h4 {
  color: var(--sm-accent-primary);
  font-size: 0.85em;
  font-weight: 700;
  margin: 0 0 1rem 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.9;
}

.stat-value {
  font-size: 2.8em;
  font-weight: 800;
  color: #f2f7ff;
  line-height: 1.2;
  text-shadow: 0 2px 12px rgba(65, 224, 253, 0.3);
  letter-spacing: -0.02em;
}

/* Charts Wrapper */
.print-stats-charts-wrapper {
  margin-bottom: 0;
}

/* Chart Containers */
.print-stats-charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 0;
}

.chart-container {
  background: rgba(24, 28, 34, 0.6);
  border: 1px solid rgba(65, 224, 253, 0.15);
  border-radius: 16px;
  padding: 1.5rem 1.3rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.chart-container:hover {
  box-shadow: 0 6px 24px rgba(65, 224, 253, 0.15);
  border-color: rgba(65, 224, 253, 0.3);
}

.chart-container h3 {
  color: var(--sm-accent-primary);
  margin-top: 0;
  margin-bottom: 1.2rem;
  font-size: 1.1em;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 8px rgba(65, 224, 253, 0.25);
}

.chart-container canvas {
  max-height: 400px;
}

/* Print Timeline */
.print-timeline-container {
  margin-bottom: 0;
}

.print-timeline-container .print-timeline {
  margin-top: 1rem;
}

.print-timeline {
  position: relative;
  padding-left: 2rem;
}

.print-timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(65, 224, 253, 0.3);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
  padding-left: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.75rem;
  top: 0.25rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sm-accent-primary);
  border: 3px solid rgba(34, 40, 50, 0.95);
  z-index: 1;
  box-shadow: 0 0 0 2px rgba(65, 224, 253, 0.3), 0 2px 8px rgba(65, 224, 253, 0.4);
}

.timeline-item[data-status="finish"]::before,
.timeline-item[data-status="complete"]::before {
  background: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3), 0 2px 8px rgba(74, 222, 128, 0.4);
}

.timeline-item[data-status="failed"]::before,
.timeline-item[data-status="fail"]::before {
  background: #f87171;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.3), 0 2px 8px rgba(248, 113, 113, 0.4);
}

.timeline-date {
  color: var(--sm-accent-primary);
  font-weight: 600;
  font-size: 0.9em;
  margin-bottom: 0.5rem;
}

.timeline-content h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1em;
}

.timeline-content h4 a {
  color: #f2f7ff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.timeline-content h4 a:hover {
  color: var(--sm-accent-primary);
  text-shadow: 0 2px 8px rgba(65, 224, 253, 0.4);
}

.timeline-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.9em;
  color: #b0c4de;
}

.status-badge {
  display: inline-block;
  padding: 0.25em 0.75em;
  border-radius: 12px;
  font-size: 0.85em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.status-finish,
.status-badge.status-complete {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.status-badge.status-failed,
.status-badge.status-fail {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.status-badge.status-unknown {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.4);
}

/* Responsive adjustments for print statistics */
@media (max-width: 1200px) {
  .print-stats-charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .print-statistics-dashboard {
    gap: 1.5rem;
  }
  
  .print-stats-card {
    padding: 1.5rem 1.3rem;
  }
  
  .print-stats-cards {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
  }
  
  .stat-value {
    font-size: 2.2em;
  }
  
  .stat-card {
    padding: 1.4rem 1.2rem;
  }
  
  .print-stats-charts {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .chart-container {
    padding: 1.3rem 1.1rem;
  }
  
  .stats-filter-form {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .stats-filter-form label {
    width: 100%;
  }
}

/* Universal box-sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Base font family, background, and colors */
body,
.site-title,
.site-title-glow,
.main-nav,
.nav-link,
.nav-links li a,
.neon-title,
.filament-fields label,
.spoolman-table-wrapper th,
.homepage-btn,
.add-filament-btn,
.add-spool-btn {
  font-family: 'Roboto', system-ui, sans-serif;
}

body {
  background: #15181f;
  color: #e2e2fa;
  letter-spacing: 0.01em;
  max-width: 100vw;
  overflow-x: hidden;
}

a {
  color: #fff;
  text-decoration: none;
}

/* ===========================================================
   CSS VARIABLES
   =========================================================== */

:root {
  /* Backgrounds */
  --sm-bg: radial-gradient(circle at top, #0f172a 0%, #020617 45%, #000 100%);
  --sm-card: rgba(15, 23, 42, 0.6);
  --sm-card-alt: rgba(34, 40, 50, 0.87);
  --sm-bg-dark: #181a22;
  --sm-bg-darker: #0d1a24;
  
  /* Borders */
  --sm-border: rgba(148, 163, 184, 0.25);
  --sm-border-light: rgba(148, 163, 184, 0.12);
  --sm-border-accent: rgba(38, 214, 228, 0.13);
  --sm-border-accent-strong: rgba(38, 214, 228, 0.25);
  
  /* Accent Colors */
  --sm-accent: #49f4ff;
  --sm-accent-primary: #41e0fd;
  --sm-accent-secondary: #26d6e4;
  --sm-accent-tertiary: #b26dff;
  --sm-accent-danger: #de3263;
  --sm-accent-warning: #f5c542;
  --sm-accent-soft: rgba(73, 244, 255, 0.12);
  --sm-accent-soft-strong: rgba(73, 244, 255, 0.25);
  
  /* Text Colors */
  --sm-text: #e2e8f0;
  --sm-text-light: #e2faff;
  --sm-text-muted: rgba(226, 232, 240, 0.6);
  --sm-text-dark: #0e141a;
  
  /* Spacing */
  --sm-spacing-xs: 0.25rem;
  --sm-spacing-sm: 0.5rem;
  --sm-spacing-md: 1rem;
  --sm-spacing-lg: 1.5rem;
  --sm-spacing-xl: 2rem;
  
  /* Border Radius */
  --sm-radius-sm: 8px;
  --sm-radius-md: 12px;
  --sm-radius-lg: 18px;
  --sm-radius-xl: 20px;
  --sm-radius-full: 999px;
  --sm-radius: 18px;
  
  /* Shadows */
  --sm-shadow: 0 18px 40px rgba(0,0,0,.20);
  --sm-shadow-accent: 0 2px 18px rgba(65, 224, 253, 0.4);
  
  /* Fonts */
  --sm-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sm-font-family: 'Roboto', system-ui, sans-serif;
  
  /* Font Sizes - Unified Scale */
  --sm-font-xs: 0.75rem;      /* 12px */
  --sm-font-sm: 0.875rem;     /* 14px */
  --sm-font-base: 1rem;       /* 16px */
  --sm-font-md: 1.05rem;      /* 16.8px */
  --sm-font-lg: 1.125rem;     /* 18px */
  --sm-font-xl: 1.25rem;      /* 20px */
  --sm-font-2xl: 1.5rem;      /* 24px */
  --sm-font-3xl: 1.875rem;    /* 30px */
  --sm-font-4xl: 2.25rem;     /* 36px */
  
  /* Font Weights - Unified Scale */
  --sm-font-normal: 400;
  --sm-font-medium: 500;
  --sm-font-semibold: 600;
  --sm-font-bold: 700;
  --sm-font-extrabold: 800;
  
  /* Container Widths - Unified */
  --sm-container-xs: 640px;
  --sm-container-sm: 768px;
  --sm-container-md: 1024px;
  --sm-container-lg: 1200px;
  --sm-container-xl: 1400px;
  --sm-container-full: 95vw;
  
  /* Button Heights - Unified */
  --sm-btn-height-xs: 28px;
  --sm-btn-height-sm: 36px;
  --sm-btn-height-md: 44px;
  --sm-btn-height-lg: 52px;
  
  /* Button Padding - Unified */
  --sm-btn-padding-xs: 0.25rem 0.75rem;
  --sm-btn-padding-sm: 0.5rem 1rem;
  --sm-btn-padding-md: 0.75rem 1.5rem;
  --sm-btn-padding-lg: 1rem 2rem;
  
  /* Table Row Heights - Unified */
  --sm-table-row-height: 48px;
  --sm-table-row-height-compact: 40px;
  --sm-table-row-height-comfortable: 56px;
  
  /* Form Input Heights - Unified */
  --sm-input-height-sm: 36px;
  --sm-input-height-md: 44px;
  --sm-input-height-lg: 52px;
  
  /* Form Input Padding - Unified */
  --sm-input-padding-sm: 0.5rem 0.75rem;
  --sm-input-padding-md: 0.75rem 1rem;
  --sm-input-padding-lg: 1rem 1.25rem;
}

/* ===========================================================
   HEADER & SITE TITLE STYLES
   =========================================================== */

.homepage-header {
  padding: 1.2em 0 0.6em 0;
  text-align: center;
}

.site-title,
.site-title-glow {
  color: var(--sm-accent-primary);
  font-weight: 800;
  letter-spacing: 0.11em;
  text-shadow: 0 2px 26px #26d6e4, 0 1px 0 #23272f;
  filter: drop-shadow(0 2px 10px #26d6e4);
  margin: 0;
}

.site-title {
  font-size: 2.6rem;
}

.site-title-glow {
  font-size: 2.2rem;
  font-weight: 900;
  text-shadow: 0 2px 28px #41e0fd90, 0 2px 0 #23272f, 0 0 12px #41e0fd99;
  filter: drop-shadow(0 2px 18px #41e0fd);
  transition: color 0.18s, text-shadow 0.2s;
}

.subtitle {
  color: var(--sm-accent);
  opacity: 0.8;
  font-size: 1.1em;
  margin: 0.2em 0 0 0;
  text-align: center;
}

.site-title-link {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.site-title-link:hover .site-title-glow {
  color: var(--sm-accent-tertiary);
  text-shadow: 0 2px 38px #b26dffcc, 0 1px 0 #23272f;
}

/* ===========================================================
   MAIN WRAPPER
   =========================================================== */

.homepage-main,
.latest-posts {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--sm-spacing-xl);
}

/* ===========================================================
   UNIFIED BUTTON SYSTEM
   =========================================================== */

.homepage-actions {
  display: flex;
  justify-content: center;
  gap: var(--sm-spacing-xl);
  margin: var(--sm-spacing-xl) 0;
  flex-wrap: wrap;
}

/* Base Button Class - Unified */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sm-font-family);
  font-weight: var(--sm-font-semibold);
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 1.5px solid;
  transition: all 0.2s ease;
  cursor: pointer;
  text-align: center;
  box-sizing: border-box;
  line-height: 1.5;
}

/* Button Variants */
.btn--primary {
  background: var(--sm-accent-soft);
  color: var(--sm-accent-primary);
  border-color: var(--sm-accent-secondary);
  box-shadow: 0 2px 16px rgba(38, 214, 228, 0.23), 0 1px 0 #10131a;
}

.btn--primary:hover {
  background: var(--sm-accent-primary);
  color: var(--sm-text-dark);
  border-color: var(--sm-accent-primary);
  transform: translateY(-2px) scale(1.07);
  box-shadow: 0 8px 32px rgba(65, 224, 253, 0.27);
}

.btn--secondary {
  background: rgba(15, 30, 40, 0.65);
  color: var(--sm-text-light);
  border-color: var(--sm-accent-soft-strong);
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.2);
}

.btn--secondary:hover {
  background: var(--sm-accent-primary);
  color: var(--sm-text-dark);
  border-color: var(--sm-accent-primary);
  transform: translateY(-2px) scale(1.07);
  box-shadow: 0 8px 32px rgba(65, 224, 253, 0.27);
}

.btn--danger {
  background: var(--sm-bg-dark);
  color: var(--sm-accent-danger);
  border-color: var(--sm-accent-danger);
}

.btn--danger:hover {
  background: var(--sm-accent-danger);
  color: #fff;
  transform: scale(1.13) rotate(-7deg);
}

.btn--icon {
  background: var(--sm-bg-darker);
  border-color: var(--sm-accent-primary);
  color: var(--sm-accent-primary);
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 14px;
}

.btn--icon:hover {
  background: var(--sm-accent-primary);
  color: var(--sm-bg-darker);
}

/* Button Sizes - Unified Heights */
.btn--large {
  padding: var(--sm-btn-padding-lg);
  font-size: var(--sm-font-lg);
  font-weight: var(--sm-font-bold);
  border-radius: var(--sm-radius-md);
  min-height: var(--sm-btn-height-lg);
  letter-spacing: 0.05em;
}

.btn--medium {
  padding: var(--sm-btn-padding-md);
  font-size: var(--sm-font-base);
  font-weight: var(--sm-font-semibold);
  border-radius: var(--sm-radius-md);
  min-height: var(--sm-btn-height-md);
  letter-spacing: 0.03em;
}

.btn--small {
  padding: var(--sm-btn-padding-sm);
  font-size: var(--sm-font-sm);
  font-weight: var(--sm-font-semibold);
  border-radius: var(--sm-radius-sm);
  min-height: var(--sm-btn-height-sm);
  letter-spacing: 0.02em;
}

.btn--tiny {
  padding: var(--sm-btn-padding-xs);
  font-size: var(--sm-font-xs);
  font-weight: var(--sm-font-medium);
  border-radius: var(--sm-radius-sm);
  min-height: var(--sm-btn-height-xs);
  letter-spacing: 0.01em;
}

/* Legacy Button Class Mappings (for backward compatibility) */
.homepage-btn,
.add-filament-btn,
.add-spool-btn,
.filament-submit-btn,
.update-spool-btn,
.save-spools-btn,
.mark-bought-btn,
.add-part-btn,
.add-item-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-decoration: none;
  border: 1.5px solid;
  transition: all 0.2s ease;
  cursor: pointer;
  text-align: center;
}

.homepage-btn,
.add-filament-btn,
.add-spool-btn,
.filament-submit-btn,
.update-spool-btn,
.save-spools-btn,
.add-part-btn {
  background: var(--sm-accent-soft);
  color: var(--sm-accent-primary) !important;
  border-radius: var(--sm-radius-xl);
  border-color: var(--sm-accent-secondary);
  box-shadow: 0 2px 16px rgba(38, 214, 228, 0.23), 0 1px 0 #10131a;
  padding: var(--sm-spacing-md) 2.5em;
  font-size: 1.18em;
}

.mark-bought-btn {
  padding: var(--sm-spacing-md) 2.5em !important;
  font-size: 1em;
}

.homepage-btn:hover,
.add-filament-btn:hover,
.add-spool-btn:hover,
.filament-submit-btn:hover,
.update-spool-btn:hover,
.save-spools-btn:hover,
.add-part-btn:hover {
  background: var(--sm-accent-primary);
  color: var(--sm-text-dark) !important;
  border-color: var(--sm-accent-primary);
  transform: translateY(-2px) scale(1.07);
  box-shadow: 0 8px 32px rgba(65, 224, 253, 0.27);
}

.add-item-btn {
  padding: 0.55rem 1.2rem;
  border-radius: var(--sm-radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--sm-text-light);
  background: rgba(15, 30, 40, 0.65);
  border: 1px solid var(--sm-accent-soft-strong);
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.2);
}

.add-item-btn:hover {
  background: var(--sm-accent-primary);
  color: var(--sm-text-dark) !important;
  border: 1.5px solid var(--sm-accent-primary);
  transform: translateY(-2px) scale(1.07);
  box-shadow: 0 8px 32px rgba(65, 224, 253, 0.27);
}

.add-item-btn:active {
  transform: translateY(0);
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.25);
}

.icon-btn {
  background: var(--sm-bg-darker);
  border: 1px solid var(--sm-accent-primary);
  color: var(--sm-accent-primary);
  border-radius: var(--sm-radius-sm);
  width: 32px;
  height: 32px;
  font-size: 14px;
  padding: 0;
}

.icon-btn:hover {
  background: var(--sm-accent-primary);
  color: var(--sm-bg-darker);
}

/* ===========================================================
   LATEST POSTS SECTION & POST CARDS
   =========================================================== */

.latest-posts {
  max-width: 1350px;
  margin: 0 auto;
  padding: 1em 1em 3em 1em;
}

.latest-posts h2 {
  color: var(--sm-accent-primary);
  font-size: 2em;
  margin-bottom: 1.5em;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  position: relative;
  display: inline-block;
}

.latest-posts h2::after {
  content: '';
  display: block;
  width: 64%;
  margin: 0.3em auto 0 auto;
  border-bottom: 3px solid var(--sm-accent-primary);
  border-radius: 2px;
  box-shadow: 0 0 18px #41e0fd99;
  animation: h2glow 2.4s infinite alternate;
}

@keyframes h2glow {
  0% { box-shadow: 0 0 8px #41e0fd55; }
  100% { box-shadow: 0 0 20px #41e0fd; }
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--sm-spacing-xl);
}

.post-card {
  background: rgba(34, 40, 50, 0.85);
  border-radius: var(--sm-radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 24px #26d6e425, 0 1.5px 0 #0c1a24;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.22s, border 0.22s;
  border: 1.5px solid rgba(38,214,228,0.11);
  backdrop-filter: blur(7px);
  height: 100%;
}

.post-card:hover {
  box-shadow: 0 8px 38px #41e0fd55, 0 3px 0 #181a1b;
  border: 1.5px solid var(--sm-accent-primary);
}

.post-thumb {
  width: 100%;
  display: block;
  object-fit: cover;
  max-height: 185px;
  min-height: 110px;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 1px 12px #41e0fd21;
}

.post-info {
  padding: 1.1em 1em 1em 1em;
  flex: 1;
  background: rgba(20, 22, 28, 0.82);
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}

.post-info h3 {
  font-size: 1.18em;
  margin: 0 0 0.5em 0;
  color: var(--sm-accent);
  font-weight: 800;
  text-shadow: 0 2px 16px #41e0fd88, 0 1px 1px #10181c;
  letter-spacing: 0.06em;
}

.post-info h3 a,
.post-info h3 a:visited {
  color: var(--sm-accent);
  text-decoration: underline;
  text-underline-offset: 2.5px;
  text-decoration-thickness: 2px;
}

.post-info h3 a:hover {
  color: var(--sm-accent-tertiary);
  text-shadow: 0 2px 12px #b26dffcc;
}

.post-info p {
  font-size: 1.08em;
  color: #e8faff;
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.4;
  margin: 0;
  text-shadow: 0 1px 8px #161d28;
}

/* ===========================================================
   NAVIGATION BAR & MENU
   =========================================================== */

.main-header {
  width: 100%;
  background: transparent;
  backdrop-filter: blur(4px);
  position: relative;
  z-index: 30;
  padding: 0.7em 0 0.6em 0;
  margin-bottom: 2em;
}

.container-header {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.4em;
  gap: 1.5em;
}

.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--sm-spacing-lg);
  margin: 0 auto;
}

.nav-link,
.nav-links li a {
  font-weight: 600;
  color: var(--sm-accent-primary);
  font-size: 1.05em;
  letter-spacing: 0.06em;
  padding: 0.5rem 1rem;
  border-radius: var(--sm-radius-sm);
  text-decoration: none;
  transition: all 0.2s;
  background: transparent;
  display: block;
}

.nav-link:hover,
.nav-links li a:hover,
.nav-links li.current-menu-item > a {
  background: var(--sm-accent-primary);
  color: var(--sm-text-dark);
  text-shadow: 0 2px 16px #41e0fd99;
}

.nav-links {
  display: flex;
  gap: var(--sm-spacing-xl);
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2em;
  color: var(--sm-accent-primary);
  margin-left: 1.1em;
  cursor: pointer;
}

/* ===========================================================
   SPOOLMAN TABLE OVERRIDES
   =========================================================== */

span.select2-selection.select2-selection--multiple {
  background-color: #181a22 !important;
}

span.select2-dropdown.select2-dropdown--below {
  background-color: #181a22;
}

li.select2-selection__choice {
  background-color: #181a22 !important;
  color: #ffffff;
}

.spoolman-table-wrapper,
.spoolman-frontend {
  background: rgba(34,40,50,0.93);
  border-radius: 26px;
  box-shadow: 0 6px 38px #26d6e41c;
  margin: 0 auto;
  max-width: 95vw;
  min-width: 320px;
  padding: 2.2em 1em 2.2em 1em;
  width: 100%;
  overflow-x: auto;
  transition: box-shadow 0.18s;
  scrollbar-width: thin;
  scrollbar-color: #41e0fd #191c22;
}

.spoolman-table-wrapper:hover {
  box-shadow: 0 10px 40px #41e0fd2c;
}

.spoolman-table-wrapper table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  font-size: 1.08em;
  color: #f2f7ff;
  border-radius: var(--sm-radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 12px #41e0fd16;
}

/* Ensure all tables have consistent width like Spoolman table */
.sm-card .table-container table,
.table-container table,
#parts-table,
#gadgets-table,
#wishlist-items-table,
#price-comparison-table {
  width: 100% !important;
}

/* Ensure DataTables wrapper matches Spoolman table wrapper width */
.sm-card .dataTables_wrapper,
.table-container .dataTables_wrapper {
  width: 100% !important;
  max-width: 100% !important;
}

/* Ensure all table containers match Spoolman table wrapper width */
.sm-card,
.part-detail-wrap,
#spoolman-parts-inventory,
#spoolman-wishlist,
#sm-gadgets-wrap {
  max-width: 95vw;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.spoolman-table-wrapper th {
  color: var(--sm-accent-primary);
  background: #1a1e2a;
  font-weight: 700;
  font-size: 1.13em;
  letter-spacing: 0.04em;
  border-top: none;
  border-bottom: 2px solid #233f5a;
  padding: 1em 0.65em;
  text-shadow: none;
}

.spoolman-table-wrapper th,
.spoolman-table-wrapper td {
  padding: 0.75em 0.7em;
  text-align: left;
  border-bottom: 1px solid #23303b7a;
}

.spoolman-table-wrapper td {
  background: rgba(30,38,54,0.76);
  border-right: 1px solid #23283633;
  border-left: 1px solid #23283633;
}

.spoolman-table-wrapper tr:last-child td {
  border-bottom: none;
}

.spoolman-table-wrapper tr:hover td {
  background: #223444a8;
}

.spoolman-table-wrapper::-webkit-scrollbar {
  height: 8px;
  background: #181c22;
}

.spoolman-table-wrapper::-webkit-scrollbar-thumb {
  background: var(--sm-accent-primary);
  border-radius: 6px;
}

.spoolman-table-wrapper a.spoolman-add-filament,
.spoolman-table-wrapper a.spoolman-add-spool,
.spoolman-table-wrapper .spoolman-action-row a {
  background: var(--sm-accent-secondary);
  color: #16181d !important;
  border-radius: 17px;
  font-weight: 700;
  padding: 0.38em 1.3em;
  font-size: 1.05em;
  margin-right: 0.7em;
  margin-bottom: 0.4em;
  box-shadow: 0 2px 8px #26d6e428;
  text-decoration: none !important;
  transition: background 0.18s, color 0.18s, transform 0.13s;
  display: inline-block;
}

.spoolman-table-wrapper a.spoolman-add-filament:hover,
.spoolman-table-wrapper a.spoolman-add-spool:hover,
.spoolman-table-wrapper .spoolman-action-row a:hover {
  background: var(--sm-accent-danger);
  color: #fff !important;
  transform: translateY(-2px) scale(1.05);
}

.spoolman-table-wrapper .actions,
.spoolman-table-wrapper td .actions {
  color: var(--sm-accent-primary);
  font-size: 1.18em;
  vertical-align: middle;
  text-align: center;
}

.spoolman-table-wrapper .actions a,
.spoolman-table-wrapper td .actions a {
  color: var(--sm-accent-primary) !important;
  margin: 0 0.12em;
  transition: color 0.15s, transform 0.15s;
}

.spoolman-table-wrapper .actions a:hover {
  color: #de3263 !important;
  transform: scale(1.16);
}

.spoolman-table-wrapper .dataTables_filter,
.spoolman-table-wrapper .dataTables_length,
.spoolman-table-wrapper .spoolman-filters,
.spoolman-table-wrapper .spoolman-action-row {
  background: none;
  margin-bottom: 1.2em;
  color: var(--sm-accent-primary);
  font-size: 1em;
}

.spoolman-table-wrapper input[type="text"],
.spoolman-table-wrapper select {
  background: rgba(34,40,50,0.96);
  border: 1.5px solid var(--sm-accent-secondary);
  color: #e2e2fa;
  border-radius: var(--sm-radius-sm);
  padding: 0.2em 0.8em;
  font-size: 1em;
  margin: 0 0.18em 0 0;
  font-family: 'Inter', system-ui, sans-serif;
}

.spoolman-table-wrapper input[type="text"]:focus,
.spoolman-table-wrapper select:focus {
  border-color: var(--sm-accent-danger);
  outline: none;
}

td:last-child {
  white-space: nowrap;
  min-width: 118px;
}

/* ===========================================================
   UNIFIED FORM INPUT SYSTEM
   =========================================================== */

/* Base Form Input Styles */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--sm-bg-dark);
  color: #e0eefd;
  border: 1.5px solid rgba(65, 224, 253, 0.35);
  border-radius: var(--sm-radius-md);
  padding: 0.53em var(--sm-spacing-md);
  font-size: 1.02em;
  font-family: var(--sm-font);
  transition: border 0.19s, box-shadow 0.16s;
  outline: none;
  box-shadow: 0 0px 6px rgba(65, 224, 253, 0.09);
}

.form-textarea {
  resize: vertical;
  min-height: 110px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border: 1.5px solid var(--sm-accent-primary);
  box-shadow: 0 2px 18px rgba(65, 224, 253, 0.4);
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  color: #6cf6fa;
  font-size: 0.9rem;
}

/* ===========================================================
   FILAMENT FORM STYLES
   =========================================================== */

.filament-form-main,
.part-form-main {
  max-width: 700px;
  margin: 3em auto 2em auto;
  padding: 0 0.7em;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wishlist-form-main {
  max-width: 1600px;
  margin: 3em auto 2em auto;
  padding: 0 0.7em;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.filament-form-header {
  width: 100%;
  margin-bottom: 1.5em;
  text-align: left;
}

.neon-title {
  color: #f0e6fa;
  font-size: 2em;
  text-shadow: 0 2px 20px #41e0fd88, 0 1px 2px #10181c;
  margin: 0 0 0.7em 0;
  display: flex;
  align-items: center;
  gap: 0.36em;
  letter-spacing: 0.04em;
}

.form-feedback {
  background: #262d38cc;
  border-left: 4px solid var(--sm-accent-primary);
  color: #faf7f9;
  border-radius: 10px;
  font-size: 1em;
  padding: 0.8em 1.2em;
  margin-bottom: 1em;
  box-shadow: 0 3px 16px #41e0fd22;
}

/* ===========================================================
   FLASH MESSAGES (Success/Error Notifications)
   =========================================================== */

.sm-flash-message {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin: 1.5rem auto;
  max-width: 95vw;
  border-radius: var(--sm-radius-md);
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s ease-out;
  z-index: 1000;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sm-flash-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2);
}

.sm-flash-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

.sm-flash-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.sm-flash-text {
  flex: 1;
}

.sm-flash-close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
  opacity: 0.7;
}

.sm-flash-close:hover {
  background: rgba(255, 255, 255, 0.1);
  opacity: 1;
}

.sm-flash-close:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Auto-dismiss animation */
.sm-flash-message.auto-dismiss {
  animation: slideDown 0.3s ease-out, fadeOut 0.3s ease-in 4.7s forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* ===========================================================
   BREADCRUMB NAVIGATION
   =========================================================== */

.sm-breadcrumb {
  margin: 1.5rem 0 2rem;
  max-width: 95vw;
  padding: 0.75rem 1rem;
  background: rgba(34, 40, 50, 0.6);
  border: 1px solid rgba(65, 224, 253, 0.2);
  border-radius: var(--sm-radius-md);
  backdrop-filter: blur(10px);
}

.sm-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.75rem;
}

.sm-breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  position: relative;
}

.sm-breadcrumb-item a {
  color: var(--sm-accent-primary);
  text-decoration: none;
  transition: all 0.2s;
  padding: 0.25rem 0.5rem;
  border-radius: var(--sm-radius-sm);
  font-weight: 500;
}

.sm-breadcrumb-item a:hover {
  color: #6ee7b7;
  background: rgba(65, 224, 253, 0.1);
  text-shadow: 0 0 8px rgba(110, 231, 183, 0.5);
}

.sm-breadcrumb-item.sm-breadcrumb-current span {
  color: #e0eefd;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  background: rgba(65, 224, 253, 0.15);
  border-radius: var(--sm-radius-sm);
}

.sm-breadcrumb-separator {
  color: rgba(65, 224, 253, 0.5);
  font-size: 1.1rem;
  user-select: none;
}

/* ===========================================================
   BACK BUTTONS
   =========================================================== */

.sm-back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: rgba(34, 40, 50, 0.8);
  border: 1px solid rgba(65, 224, 253, 0.3);
  border-radius: var(--sm-radius-md);
  color: var(--sm-accent-primary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 1.5rem;
}

.sm-back-button:hover {
  background: rgba(34, 40, 50, 0.95);
  border-color: rgba(65, 224, 253, 0.5);
  color: #6ee7b7;
  transform: translateX(-2px);
  box-shadow: 0 2px 12px rgba(65, 224, 253, 0.2);
}

.sm-back-button:focus {
  outline: 2px solid var(--sm-accent-primary);
  outline-offset: 2px;
}

.sm-back-button::before {
  content: '←';
  font-size: 1.1rem;
}

.filament-glass-form,
.part-glass-form,
.wish-glass-form {
  width: 100%;
  background: var(--sm-card-alt);
  padding: 2em 1.1em 1.3em 1.1em;
  border-radius: var(--sm-radius-lg);
  box-shadow: 0 4px 18px #41e0fd21, 0 1px 0 #191f2a;
  display: flex;
  flex-direction: column;
  gap: 1.4em;
  border: 1.3px solid var(--sm-border-accent);
  backdrop-filter: blur(7px);
}

.filament-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9em;
}

.filament-fields > p:has(textarea),
.filament-fields > div:has(textarea),
.filament-fields > p:has(select[multiple]),
.filament-fields > div:has(select[multiple]),
.filament-fields > p:has(#wishlists-wrapper),
.filament-fields > div:has(#wishlists-wrapper),
.filament-fields > p:has(button[type="submit"]) {
  grid-column: 1 / -1;
}

.filament-fields label {
  color: #6cf6fa;
  font-size: 1.06em;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  flex-direction: column;
  gap: 0.18em;
}

/* Apply unified form styles to filament fields */
.filament-fields input,
.filament-fields select,
.filament-fields textarea {
  width: 100%;
  background: var(--sm-bg-dark);
  color: #e0eefd;
  border: 1.5px solid rgba(65, 224, 253, 0.35);
  border-radius: var(--sm-radius-md);
  padding: 0.53em var(--sm-spacing-md);
  margin-top: 0.1em;
  font-size: 1.02em;
  font-family: var(--sm-font);
  transition: border 0.19s, box-shadow 0.16s;
  outline: none;
  box-shadow: 0 0px 6px rgba(65, 224, 253, 0.09);
}

.filament-fields textarea {
  resize: vertical;
}

.filament-fields input:focus,
.filament-fields select:focus,
.filament-fields textarea:focus {
  border: 1.5px solid var(--sm-accent-primary);
  box-shadow: 0 2px 18px rgba(65, 224, 253, 0.4);
}

.filter-wrap {
  padding-top: 30px;
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
}

.filter-wrap label {
  margin-right: 0.4rem;
  font-weight: 500;
  color: #a0aec0;
}

.filter-wrap select {
  min-width: 140px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #333;
  background: #1f242d;
  color: #e2e2fa;
}

.table-container {
  padding-top: 30px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

/* All tables should have the same minimum width for consistency */
#spoolman-table,
#spoolman-archived-table,
#spool-usage-table,
#wishlist-items-table,
#gadgets-table,
#parts-table,
#price-comparison-table {
  min-width: 1200px;
}

/* Table cells should wrap to 2 lines max */
.sm-table tbody td,
#spoolman-table tbody td,
#spoolman-archived-table tbody td,
#spool-usage-table tbody td,
#wishlist-items-table tbody td,
#gadgets-table tbody td,
#parts-table tbody td,
#price-comparison-table tbody td {
  white-space: normal;
  word-wrap: break-word;
  max-width: 200px;
  line-height: 1.4;
}


.filament-submit-btn .add-filament-bttn {
  margin-top: 1.2em;
  font-size: 1.15em;
  padding: 0.7em 0;
  width: 100%;
  background: var(--sm-accent-primary);
  color: #181a22 !important;
  font-weight: 800;
  border-radius: 14px;
  border: none;
  box-shadow: 0 6px 28px #41e0fd48, 0 1.5px 0 #181a22;
  transition: background 0.22s, color 0.22s, transform 0.17s;
}

.filament-submit-btn:hover {
  background: #1bdebe;
  color: #fafbfc !important;
  transform: scale(1.03);
}

.filament-form-actions {
  display: flex;
  gap: var(--sm-spacing-md);
  margin-top: 1.2em;
  justify-content: flex-start;
}

.filament-cancel-btn {
  background: #232533 !important;
  color: var(--sm-accent-primary) !important;
  border: 1.3px solid #2df4ff55;
  font-weight: 700;
  transition: background 0.2s, color 0.2s;
}

.filament-cancel-btn:hover {
  background: #41e0fd !important;
  color: #232533 !important;
}

/* ===========================================================
   MODERN ACTION BUTTONS IN TABLE
   =========================================================== */

.button-small-edit,
.button-small-delete,
.button-small-archive {
  background: var(--sm-bg-dark);
  color: var(--sm-accent-primary) !important;
  border-radius: 10px;
  border: none;
  padding: 0.38em 0.7em;
  font-size: 1.04em;
  margin-right: 0.17em;
  margin-bottom: 0.13em;
  box-shadow: 0 1px 6px rgba(65, 224, 253, 0.09);
  transition: background 0.15s, color 0.14s, transform 0.13s;
  display: inline-block;
  vertical-align: middle;
}

.button-small-edit:hover {
  background: var(--sm-accent-primary);
  color: var(--sm-bg-dark) !important;
  transform: scale(1.09);
}

.button-small-delete:hover {
  background: var(--sm-accent-danger);
  color: #fff !important;
  transform: scale(1.13) rotate(-7deg);
}

.button-small-archive:hover {
  background: var(--sm-accent-tertiary);
  color: #fff !important;
  transform: scale(1.12) rotate(7deg);
}

/* ===========================================================
   PRINT POST PAGE (3 COLUMNS)
   =========================================================== */

.print-post-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.6em 0 2.3em 0;
  min-height: 65vh;
}

.print-post-header {
  width: 100%;
  max-width: 1650px;
  margin: 0 auto 1.6em auto;
  text-align: center;
  padding: 0 1em;
}

.print-post-header .site-title {
  font-size: 2.2rem;
  line-height: 1.13;
  max-width: 98vw;
  margin: 0 auto 0.38em auto;
  word-break: break-word;
  text-shadow: 0 2px 28px #41e0fd90, 0 2px 0 #23272f, 0 0 12px #41e0fd99;
}

.print-post-header p {
  font-size: 1.11em;
  color: #41e0fd99;
  margin: 0;
}

.print-3col-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 2.6em;
  width: 96vw;
  max-width: 1650px;
  margin: 0 auto 2em auto;
  padding: 0 2vw;
}

.print-col,
.print-img-col,
.print-summary-col,
.print-spoolman-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  flex: 1 1 0;
  box-sizing: border-box;
}

.print-col {
  max-width: 500px;
}

.print-img-col {
  max-width: 500px;
  min-width: 200px;
  justify-content: flex-start;
  width: 100%;
}

.print-img-col img {
  width: 100%;
  border-radius: var(--sm-radius-lg);
  box-shadow: 0 3px 28px #41e0fd33;
  max-width: 500px;
}

.print-summary-col {
  max-width: 500px;
  min-width: 200px;
  width: 100%;
  justify-content: flex-start;
}

.print-summary {
  background: rgba(28,38,55,0.88);
  border-radius: var(--sm-radius-lg);
  box-shadow: 0 6px 36px #41e0fd29, 0 1.5px 0 #121522;
  padding: 1.2em 1em;
  margin-bottom: 0;
  width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
}

.print-summary h3 {
  color: var(--sm-accent);
  font-size: 1.22em;
  font-weight: 800;
  margin: 0 0 1.2em 0;
  letter-spacing: 0.05em;
  text-align: center;
  text-shadow: 0 2px 16px #41e0fd77;
}

.print-stats-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 auto;
  font-family: 'Inter', system-ui, sans-serif;
}

.print-stats-table th,
.print-stats-table td {
  padding: 0.5em 0.7em;
  font-size: 1.08em;
  text-align: left;
  border-bottom: 1px solid #222b39;
}

.print-stats-table th {
  color: var(--sm-accent);
  font-weight: 700;
  width: 44%;
  background: transparent;
}

.print-stats-table td {
  color: #eaf7ff;
  font-weight: 400;
  background: transparent;
  white-space: normal !important;
  word-break: break-word;
  max-width: 80vw;
}

.print-spoolman-col {
  background: rgba(34, 40, 50, 0.88);
  border-radius: var(--sm-radius-lg);
  box-shadow: 0 4px 18px #41e0fd15;
  padding: 1.2em 1em 1.5em 1em;
  max-width: 410px;
  min-width: 210px;
  width: 100%;
  margin: 0 0.1em;
  align-items: flex-start;
  justify-content: flex-start;
}

/* ===========================================================
   SELECT2 PLUGIN INTEGRATION (NEON/GLASS)
   =========================================================== */

.select2-container--default .select2-selection--single,
.print-spoolman-col .select2-container--default .select2-selection--single {
  background: #181a22 !important;
  border-radius: 10px !important;
  border: 1.5px solid #41e0fd77 !important;
  padding: 0.53em 1em !important;
  font-size: 1.02em !important;
  font-family: 'Inter', system-ui, sans-serif !important;
  box-shadow: 0 0px 6px #41e0fd17 !important;
  height: 48px !important;
  display: flex !important;
  align-items: center !important;
  transition: border 0.19s, box-shadow 0.16s;
}

.select2-container--default .select2-selection--single:focus,
.print-spoolman-col .select2-container--default .select2-selection--single:focus {
  border: 1.5px solid #41e0fd !important;
  box-shadow: 0 2px 18px #41e0fd66 !important;
  outline: none !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #fff !important;
}

.print-spoolman-col .select2-selection__rendered {
  color: #e0eefd !important;
  font-size: 1.06em !important;
  line-height: 1.6 !important;
  font-family: 'Inter', system-ui, sans-serif !important;
  padding-left: 0 !important;
}

.print-spoolman-col .select2-selection__placeholder {
  color: #89eafc !important;
  opacity: 1 !important;
}

.print-spoolman-col .select2-selection__arrow {
  height: 100% !important;
  right: 10px !important;
  top: 0 !important;
  width: 32px !important;
}

.print-spoolman-col .select2-selection__arrow b {
  border-color: #41e0fd transparent transparent transparent !important;
  border-style: solid;
  border-width: 7px 7px 0 7px !important;
  margin-top: 18px !important;
  width: 0;
  height: 0;
  display: block;
  position: absolute;
  left: 50%;
  top: 0 !important;
  transform: translateX(-50%);
}

.print-spoolman-col .select2-selection__clear {
  color: #de3263 !important;
  font-size: 1.1em !important;
  margin-top: 0 !important;
  margin-left: 8px !important;
  position: relative !important;
  top: 0 !important;
  transform: none !important;
}

.print-spoolman-col .select2-dropdown {
  background: #181a22 !important;
  border: 1.5px solid #41e0fd !important;
  color: #e0eefd !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 18px #41e0fd33 !important;
  font-family: 'Inter', system-ui, sans-serif !important;
}

.print-spoolman-col .select2-results__option {
  color: #e0eefd !important;
  background: transparent !important;
  font-size: 1.08em !important;
  border-radius: 7px !important;
  transition: background 0.16s;
  padding: 0.48em 1em !important;
}

.select2-container--default .select2-results__option {
  color: #fff;
  background: #1a1a1f;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: #00ffff;
  color: #000;
}

.print-spoolman-col .select2-results__option--highlighted,
.print-spoolman-col .select2-results__option--selected {
  background: #223d47a8 !important;
  color: var(--sm-accent-primary) !important;
}

.print-spoolman-col .select2-container {
  width: 100% !important;
  min-width: 0 !important;
  margin-bottom: 1em;
  max-width: 340px;
}

/* ===========================================================
   WISHLIST BUTTONS
   =========================================================== */

.wishlist-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.add-wishlist-btn,
.wishlist-items-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .9rem 1.6rem;
  border-radius: var(--sm-radius-full);
  font-weight: 600;
  letter-spacing: .3px;
  text-decoration: none;
  color: var(--sm-text-light);
  background: rgba(15, 30, 40, 0.6);
  border: 1px solid var(--sm-accent-soft-strong);
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.add-wishlist-btn:hover,
.wishlist-items-btn:hover {
  background: rgba(20, 40, 50, 0.85);
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.4);
  transform: translateY(-2px);
}

.add-wishlist-btn:active,
.wishlist-items-btn:active {
  transform: translateY(0);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.25);
}

/* ===========================================================
   FIELDSETS & FORM ELEMENTS
   =========================================================== */

.filament-fields fieldset {
  background: var(--sm-bg-dark);
  border: 1.5px solid #41e0fd77;
  border-radius: 10px;
  padding: 0.8em 1em 1em;
  margin: 0;
  box-shadow: 0 0 6px #41e0fd17;
}

.filament-fields fieldset > legend {
  color: #6cf6fa;
  font-weight: 700;
  padding: 0 0.4em;
}

.filament-fields fieldset button {
  background: rgba(38,214,228,0.10);
  color: var(--sm-accent-primary);
  border: 1.5px solid var(--sm-accent-secondary);
  border-radius: var(--sm-radius-md);
  padding: 0.5em 0.9em;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 12px #26d6e425;
  transition: background .18s, color .18s, border-color .18s, transform .12s;
}

.filament-fields .remove-print,
.filament-fields .remove-part {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-left: 8px;
}

.filament-fields fieldset button:hover {
  background: var(--sm-accent-primary);
  color: var(--sm-text-dark);
  border-color: var(--sm-accent-primary);
  transform: translateY(-1px) scale(1.03);
}

.add a {
  margin-right: 1rem;
}

.add a:last-child {
  margin-right: 0;
}

/* ===========================================================
   SPOOL USAGE TABLE
   =========================================================== */

table.dataTable thead th {
  cursor: pointer;
  position: relative;
  padding-right: 30px !important;
}

#spool-usage-table {
  font-family: 'Roboto', sans-serif;
  color: #ccc;
  background: transparent;
  border-collapse: collapse;
}

#spool-usage-table thead th,
#spool-usage-table thead th.sorting,
#spool-usage-table thead th.sorting_asc,
#spool-usage-table thead th.sorting_desc {
  background-color: #111827;
  color: #79d8ff;
  text-transform: uppercase;
  font-weight: 600;
  padding: 12px 30px 12px 10px;
  border-bottom: 1px solid #333;
  position: relative;
}

#spool-usage-table tbody td {
  padding: 10px;
  border-bottom: 1px solid #222;
  font-size: 14px;
}

#spool-usage-table tbody tr:hover {
  background-color: #1f2937;
}

#spool-usage-table a {
  color: #a78bfa;
  text-decoration: underline;
}

table.dataTable thead th.sorting::after {
  content: "\25B2";
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  font-size: 0.8em;
  color: #00cfff;
  opacity: 0.5;
}

table.dataTable thead th.sorting_asc::after {
  content: "\25B2";
  opacity: 1;
}

table.dataTable thead th.sorting_desc::after {
  content: "\25BC";
  opacity: 1;
}

.dataTables_wrapper {
  color: #ccc;
  font-family: 'Roboto', sans-serif;
  margin-top: 1em;
  width: 100%;
  max-width: 95vw;
}

.dataTables_length label,
.dataTables_filter label {
  color: #ccc;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.dataTables_length select,
.dataTables_filter input {
  border-radius: 6px;
  border: 1px solid #333;
  background: #1f242d;
  color: #e2e2fa;
  padding: 4px 8px;
}

.dataTables_paginate .paginate_button {
  background: #0f172a;
  color: #94a3b8 !important;
  border: 1px solid #334155;
  margin: 2px;
  padding: 4px 10px;
  border-radius: 5px;
}

.dataTables_paginate .paginate_button.current {
  background: #1e293b;
  color: #7dd3fc !important;
  font-weight: bold;
}

.spoolman-box {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* ===========================================================
   GADGETS PAGE STYLES
   =========================================================== */

#sm-gadgets-wrap,
#sm-add-gadget,
#sm-edit-gadget,
.sm-wi-wrap,
.part-detail-wrap,
.sm-wishlist-overview {
  max-width: 100%;
  margin: 2rem auto;
  padding: 1.25rem;
  font-family: var(--sm-font);
  color: var(--sm-text);
}

#sm-gadgets-wrap,
#sm-add-gadget {
  background: linear-gradient(180deg, rgba(15,25,40,.75), rgba(10,18,30,.75));
  border: 1px solid rgba(77,238,234,.18);
  border-radius: 14px;
  padding: 18px 18px 12px;
  box-shadow: 0 6px 30px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.03);
  margin: 10px 0 18px;
}

#sm-gadgets-wrap h2,
#sm-add-gadget h2,
#sm-edit-gadget h2 {
  margin: 0 0 10px;
  font-weight: 800;
  letter-spacing: .2px;
  color: #8eefff;
  font-size: clamp(1.1rem, 2.3vw, 1.5rem);
  display: flex;
  align-items: center;
  gap: .6rem;
}

#sm-gadgets-wrap details.sm-fold {
  background: rgba(17, 24, 39, .65);
  border: 1px solid rgba(142, 239, 255, .15);
  border-radius: var(--sm-radius-md);
  padding: 6px 8px;
  margin-top: 1.5rem;
}

#sm-gadgets-wrap details.sm-fold summary {
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  padding: 4px 2px;
  color: #8eefff;
  list-style: none;
}

#sm-gadgets-wrap details.sm-fold[open] summary {
  border-bottom: 1px solid rgba(142, 239, 255, .15);
  margin-bottom: 10px;
}

#sm-gadgets-wrap details.sm-fold summary::-webkit-details-marker {
  display: none;
}

#sm-gadgets-wrap .filter-wrap {
  grid-template-columns: 120px 260px;
  gap: 6px 10px;
  margin-top: 8px;
  background: rgba(9,15,25,.6);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 12px;
}

#sm-gadgets-wrap .filter-wrap label {
  opacity: .75;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #a8c6c5;
}

#sm-gadgets-wrap .filter-wrap select,
#sm-gadgets-wrap .filter-wrap input[type="text"] {
  height: 34px;
  padding: 6px 10px;
  background: rgba(12,20,32,.9);
  border: 1px solid rgba(142, 239, 255, .18);
  color: #e8f6ff;
  border-radius: 10px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

#sm-gadgets-wrap .filter-wrap select:focus,
#sm-gadgets-wrap .filter-wrap input[type="text"]:focus {
  border-color: #8eefff;
  box-shadow: 0 0 0 3px rgba(142,239,255,.15);
}

/* Apply unified form styles to gadget forms */
#sm-add-gadget input[type="text"],
#sm-add-gadget input[type="number"],
#sm-add-gadget input[type="date"],
#sm-add-gadget input[type="url"],
#sm-add-gadget textarea,
#sm-add-gadget select,
#sm-edit-gadget input[type="text"],
#sm-edit-gadget input[type="number"],
#sm-edit-gadget input[type="date"],
#sm-edit-gadget textarea,
#sm-edit-gadget select {
  width: 100%;
  background: rgba(12,20,32,.9);
  border: 1px solid rgba(77,238,234,.18);
  color: #e9f8f7;
  border-radius: var(--sm-radius-md);
  padding: 8px 10px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-size: .78rem;
  font-family: var(--sm-font);
}

#sm-add-gadget input:focus,
#sm-add-gadget textarea:focus,
#sm-add-gadget select:focus,
#sm-edit-gadget input:focus,
#sm-edit-gadget textarea:focus,
#sm-edit-gadget select:focus {
  border-color: var(--sm-accent-primary);
  box-shadow: 0 0 0 3px rgba(65, 224, 253, 0.15);
}

#sm-add-gadget textarea,
#sm-edit-gadget textarea {
  min-height: 110px;
}

#sm-add-gadget label,
#sm-edit-gadget label {
  font-weight: 600;
  font-size: .78rem;
  color: #a8c6c5;
}

#sm-add-gadget .sm-grid,
#sm-edit-gadget .sm-grid {
  display: grid;
  gap: 10px 14px;
  max-width: 720px;
  background: rgba(9,15,25,.55);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--sm-radius-md);
  padding: 14px;
}

#sm-add-gadget .sm-two,
#sm-edit-gadget .sm-two {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 8px;
}

.select2-container .select2-selection--single {
  background: rgba(12,20,32,.9) !important;
  border: 1px solid rgba(77,238,234,.18) !important;
  border-radius: 10px !important;
  height: 38px !important;
}

.select2-container .select2-selection__rendered {
  color: #e7eaf3 !important;
  line-height: 38px !important;
  padding-left: 10px !important;
}

.select2-container .select2-selection__arrow {
  height: 38px !important;
}

.select2-dropdown {
  background: rgba(12,20,32,.9) !important;
  border: 1px solid rgba(77,238,234,.18) !important;
}

.select2-results__option--highlighted {
  background: #1b2533 !important;
}

.filament-submit-btn {
  display: inline-block;
  padding: 10px 16px;
  border-radius: var(--sm-radius-md);
  border: 1px solid rgba(142,239,255,.45);
  background: linear-gradient(180deg, #1dc7ff 0%, #0ea5e9 100%);
  color: #06202a !important;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(14,165,233,.25), inset 0 1px 0 rgba(255,255,255,.15);
  transition: transform .06s ease, box-shadow .15s ease, filter .15s ease;
  cursor: pointer;
}

.filament-submit-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 12px 24px rgba(2,132,199,0.32);
}

.filament-submit-btn:active {
  transform: translateY(1px);
}

/* Standardized Table Styles - Use for ALL tables */
.sm-table,
#sm-gadgets-table,
.sm-gadgets-table,
.spoolman-table-wrapper table,
.part-detail-wrap table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  font-size: 1.08em;
  color: var(--sm-text);
  border-radius: var(--sm-radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 12px rgba(65, 224, 253, 0.1);
}

.sm-table thead,
#sm-gadgets-table thead,
.sm-gadgets-table thead,
.spoolman-table-wrapper thead {
  background: linear-gradient(180deg, rgba(26, 30, 42, 0.95), rgba(20, 24, 34, 0.95));
}

.sm-table thead th,
#sm-gadgets-table thead th,
.sm-gadgets-table thead th,
.spoolman-table-wrapper thead th {
  color: var(--sm-accent-primary);
  background: #1a1e2a;
  font-weight: 700;
  font-size: 1.13em;
  letter-spacing: 0.04em;
  border-top: none;
  border-bottom: 2px solid rgba(35, 63, 90, 0.8);
  padding: 1em 0.65em;
  text-align: left;
  text-shadow: none;
}

.sm-table tbody td,
#sm-gadgets-table tbody td,
.sm-gadgets-table tbody td,
.spoolman-table-wrapper tbody td,
#spoolman-table tbody td,
#spoolman-archived-table tbody td,
#spool-usage-table tbody td,
#wishlist-items-table tbody td,
#gadgets-table tbody td,
#parts-table tbody td,
#price-comparison-table tbody td {
  padding: 0.75em 0.7em;
  background: rgba(30, 38, 54, 0.76);
  border-bottom: 1px solid rgba(35, 48, 59, 0.48);
  border-right: 1px solid rgba(35, 40, 54, 0.2);
  border-left: 1px solid rgba(35, 40, 54, 0.2);
}

.sm-table tbody tr:last-child td,
#sm-gadgets-table tbody tr:last-child td,
.sm-gadgets-table tbody tr:last-child td,
.spoolman-table-wrapper tbody tr:last-child td {
  border-bottom: none;
}

.sm-table tbody tr:hover td,
#sm-gadgets-table tbody tr:hover td,
.sm-gadgets-table tbody tr:hover td,
.spoolman-table-wrapper tbody tr:hover td {
  background: rgba(34, 52, 68, 0.66);
}

.sm-table a,
#sm-gadgets-table a,
.sm-gadgets-table a {
  color: var(--sm-accent-primary);
  text-decoration: none;
}

.sm-table a:hover,
#sm-gadgets-table a:hover,
.sm-gadgets-table a:hover {
  color: var(--sm-accent-secondary);
  text-decoration: underline;
}

.sm-pill {
  padding: 2px 10px;
  border-radius: var(--sm-radius-full);
  font-size: 12px;
  border: 1px solid rgba(142,239,255,.25);
  background: rgba(142,239,255,.06);
}

tr[data-sm_gadget_status*="active"] .sm-pill {
  border-color: #22c55e;
  background: rgba(34,197,94,.10);
  color: #c8ffd9;
}

tr[data-sm_gadget_status*="offline"] .sm-pill {
  border-color: #f59e0b;
  background: rgba(245,158,11,.10);
  color: #ffe8b5;
}

tr[data-sm_gadget_status*="broken"] .sm-pill {
  border-color: #ef4444;
  background: rgba(239,68,68,.10);
  color: #ffd0d0;
}

tr[data-sm_gadget_status*="spare"] .sm-pill {
  border-color: #64748b;
  background: rgba(100,116,139,.10);
  color: #dbe5ef;
}

.sm-actions {
  display: flex;
  gap: 6px;
  text-align: right;
  white-space: nowrap;
}

.sm-btn {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--sm-radius-sm);
  font-size: 12px;
  text-decoration: none;
  border: 1px solid rgba(142,239,255,.25);
  background: rgba(12,20,32,.9);
  color: #8eefff;
  transition: filter .2s ease;
}

.sm-btn:hover {
  filter: brightness(1.1);
}

.sm-btn.sm-danger {
  border-color: rgba(239,68,68,.45);
  color: #ffd0d0;
}

#sm-gadgets-table td.sm-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: 6px;
  border-radius: 9px;
  background: #0d2235 !important;
  border: 1px solid rgba(77,238,234,.22);
  color: #4deeea !important;
  transition: all .2s ease;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}

#sm-gadgets-table td.sm-actions .button:hover {
  border-color: #4deeea;
  box-shadow: 0 0 6px #4deeea;
}

#sm-gadgets-table td.sm-actions .delete-spool-btn {
  color: #ff6b6b !important;
  border-color: rgba(255,107,107,.25);
}

#sm-gadgets-table td.sm-actions .delete-spool-btn:hover {
  border-color: #ff6b6b;
  box-shadow: 0 0 6px #ff6b6b;
}

#sm-gadgets-wrap .sm-stats {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--sm-radius-sm);
  padding: 6px 10px;
}

.dataTables_info {
  opacity: .8;
  font-size: 12px;
  padding-top: 10px;
}

.dataTables_paginate {
  padding-top: 10px;
}

.dataTables_paginate .paginate_button {
  background: rgba(12,20,32,.9);
  border: 1px solid rgba(142,239,255,.20);
  color: #e8f6ff !important;
  border-radius: var(--sm-radius-sm);
  padding: 4px 8px;
  margin: 0 3px;
}

.dataTables_paginate .paginate_button.current {
  background: #0f1a2d;
  border-color: #8eefff;
  box-shadow: 0 0 0 3px rgba(142,239,255,.12) inset;
}

.dataTables_paginate .paginate_button:hover {
  background: #162233;
}

/* ===========================================================
   EDIT GADGET HEADER CARD
   =========================================================== */

#sm-edit-gadget .sm-head-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  background: rgba(9,15,25,.55);
  border: 1px solid rgba(77,238,234,.18);
  border-radius: var(--sm-radius-md);
  padding: 12px;
  margin: 8px 0 14px;
}

#sm-edit-gadget .sm-head-left {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

#sm-edit-gadget .sm-head-thumb {
  flex: 0 0 auto;
}

#sm-edit-gadget .sm-gad-ava {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  background: #0d2235;
  border: 1px solid rgba(77,238,234,.18);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}

#sm-edit-gadget .sm-ava-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4deeea;
  font-size: 22px;
}

#sm-edit-gadget .sm-head-main {
  min-width: 0;
}

#sm-edit-gadget .sm-head-title {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 18px;
  color: #e9f8f7;
  margin-bottom: 6px;
}

#sm-edit-gadget .sm-head-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#sm-edit-gadget .sm-kv {
  background: rgba(12,20,32,.9);
  border: 1px solid rgba(255,255,255,.06);
  color: #cfeeed;
  border-radius: var(--sm-radius-full);
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
}

#sm-edit-gadget .sm-kv em {
  opacity: .7;
  font-style: normal;
  margin-right: 6px;
}

#sm-edit-gadget .sm-kv b {
  font-weight: 600;
  color: #e7fbfa;
}

#sm-edit-gadget .sm-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

#sm-edit-gadget .sm-ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  background: #0d2235;
  color: #4deeea;
  border: 1px solid rgba(77,238,234,.22);
  transition: all .2s ease;
}

#sm-edit-gadget .sm-ghost-btn:hover {
  border-color: #4deeea;
  box-shadow: 0 0 6px #4deeea;
}

/* ===========================================================
   SPOOL DETAIL CARD
   =========================================================== */

.spool-card {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0 0 18px;
}

.spool-meta {
  font-size: 14px;
  color: #cfe7ff;
}

.spool-meta strong {
  font-weight: 700;
}

.spool-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--sm-radius-full);
  font-size: 12px;
  margin-left: 8px;
}

.spool-badge.ok {
  background: rgba(65, 224, 253, .12);
  color: var(--sm-accent-primary);
  border: 1px solid rgba(65, 224, 253, .3);
}

.spool-badge.arch {
  background: rgba(255, 99, 99, .12);
  color: #ff9c9c;
  border: 1px solid rgba(255, 99, 99, .3);
}

.spool-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 14px 0 10px;
}

.spool-stat {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  color: #e6f0ff;
}

.spool-stat b {
  font-size: 12px;
  color: #8fa3c7;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: .02em;
}

/* Spool Attribute Cards */
.spool-detail-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.spool-attribute-card {
  background: rgba(34, 40, 50, 0.6);
  border: 1px solid rgba(65, 224, 253, 0.2);
  border-radius: var(--sm-radius-md);
  padding: 1rem 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.spool-attribute-card:hover {
  border-color: rgba(65, 224, 253, 0.4);
  box-shadow: 0 6px 18px rgba(65, 224, 253, 0.15);
  transform: translateY(-2px);
}

.spool-attribute-card--full {
  grid-column: 1 / -1;
}

.spool-attribute-label {
  font-size: 0.85rem;
  color: #8fa3c7;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.spool-attribute-value {
  font-size: 1.1rem;
  color: #e6f0ff;
  font-weight: 500;
  line-height: 1.4;
}

.spool-color {
  width: 18px;
  height: 18px;
  border: 1px solid #354660;
  border-radius: 6px;
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}

.spool-comment {
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(65, 224, 253, .15);
  border-radius: var(--sm-radius-md);
  background: rgba(18, 22, 34, .6);
  box-shadow: 0 10px 30px rgba(65, 224, 253, .06) inset, 0 6px 18px rgba(0, 0, 0, .35);
  color: #eaf4ff;
  line-height: 1.55;
}

/* ===========================================================
   PARTS ADD PAGE
   =========================================================== */

.part-form-main {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
  padding: 0;
  margin: 0 auto 3rem;
}

#spoolman-part-add {
  width: 90vw;
  max-width: 1400px;
  margin: 2.5rem auto 3rem;
  padding: 0 1rem;
  text-align: left;
}

#spoolman-part-add h2 {
  margin-bottom: 1rem;
  font-size: 1.4rem;
  color: var(--sm-text-light);
}

#spoolman-part-add .sm-card {
  background: var(--sm-card);
  border: 1px solid var(--sm-border-light);
  border-radius: var(--sm-radius-lg);
  box-shadow: 0 18px 40px rgba(0,0,0,.20);
  backdrop-filter: blur(5px);
  padding: 1.4rem 1.5rem 1.7rem;
  margin: 0 auto;
}

#spoolman-part-add .sm-card.sm-card--wide {
  width: 100%;
  max-width: 100%;
}

#spoolman-part-add .part-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 1.1rem 1.4rem;
  align-items: start;
}

#spoolman-part-add .part-form-grid .full {
  grid-column: 1 / -1;
}

#spoolman-part-add label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-weight: 600;
  color: #6cf6fa;
  font-size: .9rem;
}

/* Apply unified form styles to part add form */
#spoolman-part-add input,
#spoolman-part-add select,
#spoolman-part-add textarea {
  width: 100%;
  background: var(--sm-bg-dark);
  border: 1.5px solid rgba(65, 224, 253, 0.35);
  border-radius: var(--sm-radius-md);
  padding: .5rem .7rem;
  color: #e0eefd;
  font-family: var(--sm-font);
  transition: border 0.19s, box-shadow 0.16s;
  outline: none;
  box-shadow: 0 0px 6px rgba(65, 224, 253, 0.09);
}

#spoolman-part-add input:focus,
#spoolman-part-add select:focus,
#spoolman-part-add textarea:focus {
  border: 1.5px solid var(--sm-accent-primary);
  box-shadow: 0 2px 18px rgba(65, 224, 253, 0.4);
}

#sm_part_scrape_url {
  width: 100%;
}

#sm_part_scrape_btn {
  border-radius: var(--sm-radius-full);
}

#spoolman-part-add .scrape-row .scrape-flex {
  display: flex;
  gap: .6rem;
  align-items: center;
}

#spoolman-part-add .scrape-row input[type="url"] {
  flex: 1;
}

#spoolman-part-add .sm-btn,
#spoolman-part-add button[type=submit] {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(0,255,255,.12);
  border: 1px solid rgba(73,244,255,.45);
  color: var(--sm-text-light);
  border-radius: var(--sm-radius-full);
  padding: .5rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: .6rem;
  transition: all .2s ease;
}

#spoolman-part-add .sm-btn:hover,
#spoolman-part-add button[type=submit]:hover {
  background: rgba(0,255,255,.22);
}

.part-image-preview {
  display: flex;
  justify-content: flex-end;
}

.part-image-preview-inner {
  background: rgba(0,0,0,0.12);
  border: 1px solid rgba(73, 244, 255, 0.28);
  border-radius: 14px;
  padding: .6rem;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  width: 100%;
}

.part-image-preview-inner img {
  width: 100%;
  max-height: 190px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 8px 26px rgba(0,0,0,.28);
}

.part-image-preview-inner .preview-label {
  font-size: .75rem;
  color: rgba(226,232,240,.8);
  letter-spacing: .04em;
}

.part-image-preview-inner .preview-placeholder {
  font-size: .8rem;
  opacity: .45;
}

/* ===========================================================
   PART DETAIL CARD
   =========================================================== */

.sm-part-detail-shell {
  width: min(90vw, 1100px);
  margin: 2.6rem auto 3.4rem;
  padding: 0 1rem;
}

.sm-part-card {
  background: var(--sm-card);
  border: 1px solid var(--sm-border-light);
  border-radius: var(--sm-radius-xl);
  box-shadow: 0 18px 40px rgba(0,0,0,.20);
  backdrop-filter: blur(5px);
  padding: 1.8rem 1.9rem 2rem;
}

.sm-part-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.3rem;
}

.sm-part-title {
  font-size: clamp(1.4rem, 2.7vw, 1.9rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: .02em;
  margin: 0;
}

/* Action Buttons (Icons) */
.sm-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--sm-border-accent);
  background: var(--sm-card);
  border-radius: var(--sm-radius-sm);
  color: var(--sm-accent-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-left: 0.5rem;
}

.sm-action-btn:hover {
  background: var(--sm-accent-soft);
  border-color: var(--sm-accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(65, 224, 253, 0.2);
}

.sm-action-btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.sm-action-btn--edit {
  color: var(--sm-accent-primary);
}

.sm-action-btn--delete {
  color: var(--sm-accent-danger);
  border-color: rgba(222, 50, 99, 0.3);
}

.sm-action-btn--delete:hover {
  background: rgba(222, 50, 99, 0.1);
  border-color: var(--sm-accent-danger);
}

.sm-action-link {
  color: var(--sm-accent-primary);
  text-decoration: none;
  margin-right: 0.5rem;
  transition: color 0.2s ease;
}

.sm-action-link:hover {
  color: var(--sm-accent-secondary);
  text-decoration: underline;
}

.sm-part-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--sm-accent-soft);
  border: 1px solid rgba(73, 244, 255, 0.55);
  border-radius: var(--sm-radius-full);
  color: var(--sm-text-light);
  padding: .5rem 1.2rem;
  font-weight: 600;
  transition: .15s ease;
  white-space: nowrap;
}

.sm-part-btn:hover {
  background: var(--sm-accent-soft-strong);
  transform: translateY(-1px);
}

.sm-part-desc {
  color: #d5e4ff;
  line-height: 1.5;
  margin-bottom: 1.7rem;
  font-size: .98rem;
}

.sm-part-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem 1.2rem;
}

.sm-meta-row {
  background: rgba(3, 7, 18, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.05);
  border-radius: var(--sm-radius-md);
  padding: .55rem .7rem .6rem;
}

.sm-meta-label {
  display: block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(226, 232, 240, 0.65);
  margin-bottom: .25rem;
}

.sm-meta-value {
  font-size: .92rem;
  color: #fff;
  font-weight: 500;
}

.sm-meta-value a {
  color: var(--sm-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===========================================================
   SHARED CARD STYLES
   =========================================================== */

.sm-card {
  background: var(--sm-card);
  border: 1px solid var(--sm-border-light);
  border-radius: var(--sm-radius);
  box-shadow: var(--sm-shadow);
  backdrop-filter: blur(6px);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
  width: 100%;
  max-width: 95vw;
  margin-left: auto;
  margin-right: auto;
}

.sm-gadgets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
  background: rgba(2,6,23,.05);
  border: 1px solid rgba(15,23,42,.3);
  border-radius: .9rem;
  overflow: hidden;
}

.sm-gadgets-table thead {
  background: rgba(2,6,23,.35);
}

.sm-gadgets-table th,
.sm-gadgets-table td {
  padding: .5rem .6rem;
  border-bottom: 1px solid rgba(15,23,42,.25);
}

.sm-gadgets-table th {
  text-align: left;
  font-weight: 600;
  color: var(--sm-text);
}

.sm-gadgets-table td a {
  color: var(--sm-accent);
  text-decoration: none;
}

.sm-error {
  background: rgba(248,113,113,.08);
  border: 1px solid rgba(248,113,113,.4);
  border-radius: .65rem;
  color: #fee2e2;
}

/* ===========================================================
   RESPONSIVE BREAKPOINTS
   =========================================================== */

@media (max-width: 1100px) {
  .homepage-main,
  .latest-posts {
    max-width: 99vw;
    padding: 0 0.5em;
  }
  .posts-grid {
    gap: 1.2em;
    grid-template-columns: 1fr 1fr;
  }
  .site-title,
  .site-title-glow {
    font-size: 2rem;
  }
  .homepage-btn,
  .add-filament-btn,
  .add-spool-btn {
    font-size: 1.06em;
    padding: 0.8em 1.1em;
  }
  .main-header,
  .container-header {
    padding: 0.6em 0.6em;
  }
}

@media (max-width: 900px) {
  .spoolman-table-wrapper {
    padding: 0.5em 0.15em 1.2em 0.15em;
    border-radius: 11px;
    max-width: 99vw;
  }
  .spoolman-table-wrapper table,
  .spoolman-table-wrapper th,
  .spoolman-table-wrapper td {
    font-size: 0.98em;
    padding: 0.5em 0.3em;
  }
  .homepage-header {
    padding: 0.6em 0 0.3em 0;
  }
  .print-3col-row {
    flex-direction: column;
    align-items: stretch;
    gap: 1.3em;
    max-width: 98vw;
    padding: 0 0.1em;
  }
  .print-col,
  .print-img-col,
  .print-summary-col,
  .print-spoolman-col {
    max-width: 100vw;
    width: 100%;
  }
  .print-img-col img {
    max-width: 99vw;
  }
  .print-post-header {
    max-width: 99vw;
    padding-left: 0.1em;
    padding-right: 0.1em;
  }
  .spoolman-frontend .filter-wrap,
  .spoolman-frontend .dataTables_length,
  .spoolman-frontend .dataTables_filter {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4em 0;
    margin-bottom: 0.9em;
    margin-right: 0;
    width: 100%;
    padding-left: 0;
  }
  .spoolman-frontend .filter-wrap select,
  .spoolman-frontend .filter-wrap input[type="text"],
  .spoolman-frontend .dataTables_length select,
  .spoolman-frontend .dataTables_filter input[type="search"] {
    width: 100%;
    margin-bottom: 0.4em;
    margin-right: 0;
  }
  #spoolman-part-add {
    width: 100%;
    max-width: 100%;
    padding: 0 .6rem;
  }
  #spoolman-part-add .part-form-grid {
    grid-template-columns: 1fr;
  }
  .part-image-preview {
    order: 99;
  }
}

@media (max-width: 850px) {
  .homepage-main,
  .latest-posts {
    max-width: 100vw;
    padding: 0 0.1em;
  }
  .posts-grid {
    gap: 0.6em;
    grid-template-columns: 1fr;
  }
  .homepage-btn {
    width: 98vw;
    font-size: 1em;
    padding: 1.1em 0;
    margin: 0.2em 0;
    border-radius: 14px;
    text-align: center;
  }
  .add-filament-btn,
  .add-spool-btn {
    font-size: 1em;
    padding: 1.1em 0;
    margin: 0.2em 0;
    border-radius: 14px;
    text-align: center;
  }
  .site-title,
  .site-title-glow {
    font-size: 1.25rem;
  }
  .latest-posts h2 {
    font-size: 1.1em;
  }
  .main-header,
  .container-header {
    padding: 0.5em 0.2em;
    gap: 0.5em;
  }
  .container-header {
    padding: 0 0.6em;
    gap: var(--sm-spacing-md);
    max-width: 98vw;
  }
  .main-nav {
    gap: var(--sm-spacing-md);
    margin-left: 0.4em;
  }
  .site-title-glow {
    font-size: 1.2rem;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 62px;
    right: 0;
    width: 95vw;
    max-width: 380px;
    min-width: 180px;
    background: #181a23f5;
    box-shadow: 0 12px 32px #41e0fd30;
    border-radius: 12px 0 0 12px;
    z-index: 150;
    padding: 1em 0.7em;
    text-align: right;
    box-sizing: border-box;
    overflow-x: auto;
  }
  .nav-links.open {
    display: flex !important;
  }
  .menu-toggle {
    display: block !important;
    position: static !important;
    margin-left: auto;
    margin-right: 0.3em;
    margin-top: 0.15em;
    color: var(--sm-accent-primary);
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    box-shadow: none;
    text-shadow: 0 0 12px #41e0fd77;
    z-index: 200;
  }
}

@media (max-width: 720px) {
  .filament-form-main {
    max-width: 99vw;
    padding: 0 0.09em;
  }
  .filament-glass-form {
    padding: 1.2em 0.3em 1.1em 0.3em;
  }
  .neon-title {
    font-size: 1.15em;
  }
  .print-summary-section,
  .print-summary {
    max-width: 99vw;
    padding-left: 0.2em;
    padding-right: 0.2em;
  }
  .print-featured-img {
    max-width: 99vw;
  }
  .print-stats-table th,
  .print-stats-table td {
    font-size: 0.96em;
  }
  .print-post-header .site-title {
    font-size: 1.19rem;
  }
  .print-spoolman-col {
    max-width: 99vw;
    padding: 0 0.1em;
  }
  .print-spoolman-col .select2-selection--single {
    font-size: 1em;
    padding: 0.5em 0.8em;
  }
  #sm-gadgets-wrap,
  #sm-add-gadget,
  #sm-edit-gadget,
  .sm-wi-wrap,
  .part-detail-wrap {
    padding: .6rem;
  }
  .sm-gadgets-table,
  .sm-gadgets-table thead,
  .sm-gadgets-table tbody,
  .sm-gadgets-table tr,
  .sm-gadgets-table td {
    display: block;
  }
  .sm-gadgets-table thead {
    display: none;
  }
  .sm-gadgets-table tr {
    margin-bottom: 16px;
    border: 1px solid rgba(15,23,42,.35);
    border-radius: .75rem;
    overflow: hidden;
  }
  .sm-gadgets-table td {
    border: none;
    border-bottom: 1px solid rgba(15,23,42,.15);
  }
  #sm-add-gadget .sm-two,
  #sm-edit-gadget .sm-two {
    grid-template-columns: 1fr;
  }
  .sm-part-card__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .sm-part-detail-shell {
    width: 100%;
    padding: 0 .6rem;
  }
}

@media (max-width: 500px) {
  .site-title,
  .site-title-glow {
    font-size: 1.08rem;
    line-height: 1.1;
  }
  .latest-posts {
    padding: 0.2em 0.1em 1.5em 0.1em;
  }
  .homepage-btn,
  .add-filament-btn,
  .add-spool-btn {
    font-size: 0.97em;
    padding: 0.9em 0.4em;
  }
  .container-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.7em;
    padding: 0 0.4em;
    max-width: 100vw;
  }
  .site-title-glow {
    font-size: 1rem;
  }
  .main-nav {
    flex-direction: column;
    width: 100%;
    gap: 0.2em;
    margin-left: 0;
  }
}

@media (max-width: 370px) {
  .site-title,
  .site-title-glow {
    font-size: 0.89rem;
  }
  .homepage-btn {
    font-size: 0.9em;
    padding: 0.7em 0.2em;
  }
  .add-filament-btn,
  .add-spool-btn {
    font-size: 0.9em;
    padding: 0.7em 0.2em;
    max-width: 200px;
  }
}

/* === Part detail shell/card ==================================== */
.sm-part-detail-shell {
  width: min(90vw, 1200px);
  margin: 2.5rem auto 3rem;
}

.sm-part-card {
  background: var(--sm-card);
  border: 1px solid var(--sm-border-light);
  border-radius: var(--sm-radius-lg);
  box-shadow: 0 18px 40px rgba(0,0,0,.20);
  backdrop-filter: blur(5px);
  padding: 1.5rem 1.5rem 1.8rem;
}

/* top bar */
.sm-part-card__header {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.sm-part-title {
  font-size: clamp(1.3rem, 2.3vw, 1.55rem);
  font-weight: 700;
  color: var(--sm-text-light);
  margin: 0;
}
.sm-part-btn {
  background: rgba(0,255,255,.14);
  border: 1px solid rgba(73,244,255,.5);
  color: var(--sm-text-light);
  border-radius: var(--sm-radius-full);
  padding: .45rem 1.15rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s ease;
}
.sm-part-btn:hover {
  background: rgba(0,255,255,.25);
  transform: translateY(-1px);
}

/* two-column core */
.sm-part-body {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.sm-part-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* left: media */
.sm-part-col--media {
  flex: 0 0 320px;           /* fixed-ish image column */
  max-width: 360px;
  min-width: 0; /* Allow shrinking on mobile */
}
.sm-part-image {
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(73, 244, 255, 0.12);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 240px;
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
}
.sm-part-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform .25s ease;
}
.sm-part-image img:hover {
  transform: scale(1.03);
}
.sm-part-image--empty {
  color: rgba(226,232,240,.55);
  font-size: .85rem;
}

/* right: content */
.sm-part-col--content {
  flex: 1 1 auto;
}
.sm-part-desc {
  line-height: 1.5;
  color: #d6e4ff;
  font-size: .95rem;
}

/* meta grid */
.sm-part-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .8rem;
  margin-top: .6rem;
}
.sm-meta-row {
  background: rgba(2,6,23,.16);
  border: 1px solid rgba(148,163,184,.08);
  border-radius: var(--sm-radius-md);
  padding: .55rem .75rem .6rem;
}
.sm-meta-label {
  display: block;
  font-size: .65rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(226,232,240,.55);
  margin-bottom: .25rem;
}
.sm-meta-value a {
  color: var(--sm-accent);
  text-decoration: none;
}
.sm-meta-value a:hover {
  text-decoration: underline;
}

/* responsive: stack on mobile */
@media (max-width: 900px) {
  .sm-part-body {
    flex-direction: column;
  }
  .sm-part-col--media {
    width: 100%;
    max-width: 100%;
  }
  .sm-part-image {
    max-height: 360px;
  }
  .sm-part-detail-shell {
    width: 100%;
    padding: 0 .6rem;
  }
  .sm-part-card {
    border-radius: 14px;
  }
  .sm-part-card__header {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* === Part Detail — visual upgrades =========================== */

/* 1) Make image a bit taller and allow badge overlay */
.sm-part-image {
  position: relative;
  min-height: 300px;
  max-height: 500px;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.sm-part-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform .25s ease;
}
.sm-part-image img:hover { transform: scale(1.04); }

/* Stock badge */
.sm-stock-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 14px;
  border-radius: var(--sm-radius-full);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #04161b;
  background: var(--sm-accent-primary);
  box-shadow: 0 0 14px #41e0fd55;
}
.sm-stock-badge.low {
  background: #f5c542;
  box-shadow: 0 0 14px #f5c54266;
}
.sm-stock-badge.out {
  background: var(--sm-accent-danger);
  box-shadow: 0 0 14px #de326377;
}

/* 2) Price pill under title */
.sm-price-pill {
  display: inline-block;
  background: rgba(73,244,255,.12);
  border: 1px solid rgba(73,244,255,.35);
  border-radius: var(--sm-radius-full);
  padding: .3rem .9rem;
  font-weight: 700;
  color: var(--sm-accent);
  font-size: .9rem;
  margin-top: .4rem;
  box-shadow: 0 0 8px rgba(73,244,255,.15);
}

/* Responsive tweaks */
@media (max-width: 720px) {
  .sm-part-image { min-height: 220px; }
  .sm-stock-badge { top: 8px; right: 8px; padding: 4px 10px; font-size: .7rem; }
  .sm-price-pill { font-size: .85rem; }
}
#sm-wi-global-add input[type="text"],
#sm-wi-global-add input[type="url"],
#sm-wi-global-add input[type="number"],
#sm-wi-global-add select,
#sm-wi-global-add textarea {
    width: 100%;
    background: rgba(3, 16, 26, 0.4);
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: var(--sm-radius-sm);
    padding: 6px 10px;
    color: #fff;
}
#sm-wi-global-add label {
    font-weight: 500;
    color: #dffcff;
}
#sm-wi-global-add textarea {
    min-height: 90px;
}
/* === Add Wishlist Item Form === */
.sm-wishlist-add-form {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1.1rem;
}

/* Top layout */
.sm-wishlist-add-form .sm-top-row {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 0.6fr;
  gap: 1rem;
  align-items: start;
}

/* Inputs and selects */
.sm-wishlist-add-form input[type="text"],
.sm-wishlist-add-form input[type="url"],
.sm-wishlist-add-form input[type="number"],
.sm-wishlist-add-form select,
.sm-wishlist-add-form textarea {
  width: 100%;
  background: rgba(3,16,26,0.35);
  border: 1px solid rgba(0,240,255,0.4);
  border-radius: var(--sm-radius-sm);
  padding: 6px 10px;
  color: #fff;
}

/* Labels */
.sm-wishlist-add-form label {
  color: #dffcff;
  font-weight: 500;
}

/* Fetch button */
.sm-fetch-btn {
  background: #00b8ff;
  border: none;
  color: #03101a;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s ease-in-out;
}
.sm-fetch-btn:hover {
  background: #4ce3ff;
}

/* Overwrite checkbox */
.sm-overwrite {
  display: inline-flex;
  gap: .4rem;
  align-items: center;
  font-size: .8em;
  opacity: .75;
  margin-top: .35rem;
}
.sm-overwrite input {
  accent-color: #00b8ff;
}

/* URL status text */
.sm-url-status {
  margin-top: .25rem;
  font-size: .75em;
  opacity: .7;
}

/* Image preview */
.sm-img-wrap {
  margin: 0;
  display: none;
  justify-self: end;
}
.sm-img-wrap img {
  max-width: 140px;
  border-radius: var(--sm-radius-sm);
  display: block;
}

/* Main field grid */
.sm-main-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.sm-main-fields .full {
  grid-column: 1 / -1;
}

/* Submit button row */
.sm-submit-row {
  margin-top: 1.1rem;
  text-align: left;
}
/* make sure all fields in this form use our dark style */
form.sm-wishlist-add-form input[type="text"],
form.sm-wishlist-add-form input[type="url"],
form.sm-wishlist-add-form input[type="number"],
form.sm-wishlist-add-form select,
form.sm-wishlist-add-form textarea {
    background: rgba(3,16,26,0.35) !important;
    border: 1px solid rgba(0,240,255,0.4);
    color: #fff;
    border-radius: var(--sm-radius-sm);
}
/* === Add Wishlist Item Form (uses #sm-wishlist-add-form from shortcode) === */
#sm-wishlist-add-form {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1.1rem;
}

/* top row: wishlist | product url | preview */
#sm-wishlist-add-form .sm-top-row {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 0.6fr;
  gap: 1rem;
  align-items: start;
}

/* inputs */
#sm-wishlist-add-form input[type="text"],
#sm-wishlist-add-form input[type="url"],
#sm-wishlist-add-form input[type="number"],
#sm-wishlist-add-form select,
#sm-wishlist-add-form textarea {
  width: 100%;
  background: rgba(3,16,26,0.35) !important;
  border: 1px solid rgba(0,240,255,0.4);
  border-radius: var(--sm-radius-sm);
  padding: 6px 10px;
  color: #fff;
}

/* labels */
#sm-wishlist-add-form label {
  color: #dffcff;
  font-weight: 500;
}

/* fetch button */
#sm-wishlist-add-form .sm-fetch-btn {
  background: #00b8ff;
  border: none;
  color: #03101a;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}
#sm-wishlist-add-form .sm-fetch-btn:hover {
  background: #4ce3ff;
}

/* overwrite checkbox */
#sm-wishlist-add-form .sm-overwrite {
  display: inline-flex;
  gap: .4rem;
  align-items: center;
  font-size: .8em;
  opacity: .75;
  margin-top: .35rem;
}
#sm-wishlist-add-form .sm-overwrite input {
  accent-color: #00b8ff;
}

/* image preview on the right */
#sm-wishlist-add-form .sm-img-wrap {
  display: none;              /* JS will show it */
  justify-self: end;
}
#sm-wishlist-add-form .sm-img-wrap img {
  max-width: 140px;
  border-radius: var(--sm-radius-sm);
  display: block;
}

/* two-column body */
#sm-wishlist-add-form .sm-main-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
#sm-wishlist-add-form .sm-main-fields .full {
  grid-column: 1 / -1;
}

/* ===========================================================
   PRICE COMPARISON SECTION
   =========================================================== */

.sm-price-comparison {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--sm-card);
  border-radius: var(--sm-radius-md);
  border: 1px solid var(--sm-border);
}

.sm-price-comparison__title {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--sm-accent-primary);
  font-size: 1.3rem;
  font-weight: 700;
}

.sm-price-comparison__best {
  background: var(--sm-accent-soft);
  padding: 1rem;
  border-radius: var(--sm-radius-sm);
  margin-bottom: 1rem;
  border: 1px solid var(--sm-accent-secondary);
}

.sm-price-comparison__best strong {
  color: var(--sm-accent-primary);
  font-size: 1.1rem;
}

.sm-price-comparison__empty {
  padding: 1.5rem;
  text-align: center;
  background: var(--sm-bg-dark);
  border-radius: var(--sm-radius-sm);
  border: 1px dashed var(--sm-border);
}

.sm-price-comparison__empty p {
  margin: 0.5rem 0;
  color: var(--sm-text);
}

.sm-price-comparison__empty small {
  color: var(--sm-text-muted);
}

.sm-price-comparison__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Desktop: Ensure price watch admin stays horizontal */
.sm-price-watch-admin > form > div:last-of-type {
  display: flex !important;
  flex-direction: row !important;
  gap: 0.5rem !important;
  align-items: center !important;
}

.sm-price-watch-admin > form > div:last-of-type button {
  margin-left: 0.5rem;
  width: auto;
}

.sm-price-watch-admin label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

/* Desktop: Price URL rows stay horizontal */
.sm-price-url-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.5rem !important;
}

.sm-price-url-row input[type="url"] {
  flex: 1;
  min-width: 0;
}

.sm-price-url-row input[type="text"] {
  width: 150px;
  min-width: 0;
}

.sm-price-url-row button {
  width: auto;
  flex-shrink: 0;
}

.sm-price-comparison__item {
  padding: 1rem;
  background: var(--sm-bg-dark);
  border-radius: var(--sm-radius-sm);
  border: 1px solid var(--sm-border-light);
  transition: all 0.2s ease;
}

.sm-price-comparison__item:hover {
  border-color: var(--sm-accent-secondary);
  box-shadow: 0 2px 8px rgba(38, 214, 228, 0.15);
}

.sm-price-comparison__item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.sm-price-comparison__store-name {
  color: var(--sm-text-light);
  font-weight: 600;
}

.sm-price-comparison__price {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--sm-accent-primary);
}

.sm-price-comparison__price-empty {
  color: var(--sm-text-muted);
  font-style: italic;
}

.sm-price-comparison__checked {
  display: block;
  color: var(--sm-text-muted);
  font-size: 0.85em;
  margin-top: 0.25rem;
}

.sm-price-comparison__link {
  margin-top: 0.5rem;
}

.sm-price-comparison__link a {
  color: var(--sm-accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.sm-price-comparison__link a:hover {
  color: var(--sm-accent-secondary);
  text-decoration: underline;
}

.sm-price-comparison__last-check {
  margin-top: 1rem;
  margin-bottom: 0;
  font-size: 0.9em;
  color: var(--sm-text-muted);
}

.sm-price-comparison__actions {
  margin-top: 1rem;
}

.sm-price-check-btn {
  padding: 0.5rem 1rem;
  background: var(--sm-accent-soft);
  color: var(--sm-accent-primary);
  border: 1px solid var(--sm-accent-secondary);
  border-radius: var(--sm-radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.sm-price-check-btn:hover {
  background: var(--sm-accent-soft-strong);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(38, 214, 228, 0.25);
}

.sm-price-check-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.sm-price-check-status {
  margin-top: 0.5rem;
  font-size: 0.9em;
  min-height: 1.2em;
}

@media (max-width: 600px) {
  .sm-price-comparison {
    padding: 1rem;
  }
  
  .sm-price-comparison__item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .sm-price-comparison__price {
    font-size: 1.1em;
  }
}

/* submit row */
#sm-wishlist-add-form .sm-submit-row {
  margin-top: 1.1rem;
  text-align: left;
}

/* mobile */
@media (max-width: 820px) {
  #sm-wishlist-add-form .sm-top-row {
    grid-template-columns: 1fr;
  }
  #sm-wishlist-add-form .sm-main-fields {
    grid-template-columns: 1fr;
  }
}
#sm-gadgets-wrap,
#sm-add-gadget {
  max-width: 100%;
  margin: 2rem auto;
}

/* =========================================================
   Add Gadget – styled like Add Part / Add Wishlist
   ========================================================= */

#sm-add-gadget {
  max-width: 1050px;
  margin: 2.5rem auto 4rem;
  font-family: 'Inter', 'Orbitron', sans-serif;
  color: #d6faff;
}

/* Title */
#sm-add-gadget > h2 {
  color: var(--sm-accent);
  font-family: 'Orbitron', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.03em;
}

/* Card background */
#sm-add-gadget .sm-card {
  background: radial-gradient(circle at top left, rgba(10, 25, 40, 0.95) 0%, rgba(3, 10, 18, 0.85) 55%, rgba(3, 10, 18, 0.5) 100%);
  border: 1px solid rgba(73, 244, 255, 0.08);
  border-radius: 1.4rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  padding: 2rem 2.2rem 1.5rem;
}

/* 2-column form grid */
#sm-add-gadget form.sm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem 1.8rem;
}

#sm-add-gadget .sm-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* Force full-width fields */
#sm-add-gadget textarea,
#sm-add-gadget p,
#sm-add-gadget .sm-error {
  grid-column: 1 / -1;
}

/* Labels */
#sm-add-gadget label {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #bfeaff;
}

/* Inputs, selects, textarea */
#sm-add-gadget input[type="text"],
#sm-add-gadget input[type="number"],
#sm-add-gadget input[type="date"],
#sm-add-gadget input[type="url"],
#sm-add-gadget select,
#sm-add-gadget textarea {
  width: 100%;
  background: rgba(2, 7, 13, 0.55);
  border: 1px solid rgba(73, 244, 255, 0.08);
  border-radius: 0.8rem;
  padding: 0.55rem 0.9rem;
  color: #ecfdff;
  font-size: 0.9rem;
  line-height: 1.5;
  outline: none;
  transition: all 0.2s ease;
}

#sm-add-gadget input::placeholder,
#sm-add-gadget textarea::placeholder {
  color: rgba(236, 253, 255, 0.35);
}

#sm-add-gadget input:focus,
#sm-add-gadget select:focus,
#sm-add-gadget textarea:focus {
  border-color: rgba(73, 244, 255, 0.4);
  box-shadow: 0 0 0 2px rgba(73, 244, 255, 0.08);
}

/* Select + add new */
#sm-add-gadget .sm-two {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 0.6rem;
}

/* Buttons */
#sm-add-gadget .button.button-primary,
#sm-add-gadget #sm_gadget_scrape_btn {
  background: linear-gradient(135deg, #49f4ff 0%, #18b9ff 45%, #0e7fff 100%);
  border: none;
  border-radius: var(--sm-radius-full);
  color: #021016;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 0.55rem 1.35rem;
  cursor: pointer;
  transition: 0.15s ease;
  box-shadow: 0 10px 30px rgba(72, 244, 255, 0.25);
}

#sm-add-gadget #sm_gadget_scrape_btn {
  background: rgba(73, 244, 255, 0.08);
  border: 1px solid rgba(73, 244, 255, 0.3);
  color: #c2f9ff;
  border-radius: 0.8rem;
  box-shadow: none;
}

#sm-add-gadget .button.button-primary:hover,
#sm-add-gadget #sm_gadget_scrape_btn:hover {
  transform: translateY(-1px);
}

/* Error message */
#sm-add-gadget .sm-error {
  background: rgba(254, 44, 84, 0.08);
  border: 1px solid rgba(254, 44, 84, 0.3);
  border-radius: 0.7rem;
  color: #ffe3e8;
  font-size: 0.82rem;
  padding: 0.75rem 1rem;
  line-height: 1.4;
}

/* Responsive: single column */
@media (max-width: 900px) {
  #sm-add-gadget form.sm-grid {
    grid-template-columns: 1fr;
  }
  #sm-add-gadget .sm-card {
    padding: 1.4rem 1.2rem;
  }
}
/* widen add-gadget a bit */
#sm-add-gadget {
  max-width: 100%;
}

/* make the two columns use the space better */
#sm-add-gadget form.sm-grid {
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.3rem 2rem;
}

/* slightly less inner padding on the inner panel */
#sm-add-gadget .sm-card {
  padding: 1.9rem 2.1rem 1.4rem;
}
#sm-add-gadget form.sm-grid {
  max-width: none;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.3rem 2rem;
}

/* ===========================================================
   COMPREHENSIVE MOBILE RESPONSIVE STYLES
   =========================================================== */

/* Tablet and below (768px) */
@media (max-width: 768px) {
  /* Forms - switch from 2 columns to 1 column */
  .filament-fields {
    grid-template-columns: 1fr !important;
  }
  
  /* Part form main container */
  .part-form-main {
    padding: 1rem 0.5rem;
    max-width: 100vw;
  }
  
  /* Part glass form */
  .part-glass-form {
    padding: 1rem 0.5rem;
  }
  
  /* Part meta grid - already single column but ensure it */
  .sm-part-meta-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }
  
  /* Homepage actions - stack buttons */
  .homepage-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .homepage-actions .btn {
    width: 100%;
  }
  
  /* Wishlist buttons */
  .wishlist-btns {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .wishlist-btns .add-wishlist-btn,
  .wishlist-btns .btn {
    width: 100%;
  }
  
  /* Cards - reduce padding */
  .sm-card,
  .sm-part-card {
    padding: 1rem 0.75rem;
  }
  
  /* Part detail shell */
  .sm-part-detail-shell {
    width: 100%;
    padding: 0 0.5rem;
    margin: 1.5rem auto 2rem;
  }
  
  /* Part card header - stack on mobile */
  .sm-part-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  /* Action buttons in tables - make them stack */
  .sm-action-btn {
    margin: 0.25rem 0.25rem 0.25rem 0;
  }
  
  /* DataTables wrapper - ensure horizontal scroll works */
  .dataTables_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Table container */
  .table-container,
  .spoolman-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0.25rem;
  }
  
  /* Ensure tables can scroll horizontally */
  #spoolman-table,
  #spoolman-archived-table,
  #spool-usage-table,
  #wishlist-items-table,
  #gadgets-table,
  #parts-table,
  #price-comparison-table {
    min-width: 1000px; /* Slightly reduced for mobile */
  }
  
  /* Reduce table cell padding on mobile */
  .sm-table tbody td,
  #spoolman-table tbody td,
  #spoolman-archived-table tbody td,
  #spool-usage-table tbody td,
  #wishlist-items-table tbody td,
  #gadgets-table tbody td,
  #parts-table tbody td,
  #price-comparison-table tbody td {
    padding: 0.5em 0.5em;
    font-size: 0.9em;
  }
  
  /* DataTables controls - stack on mobile */
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    margin-bottom: 0.75rem;
  }
  
  .dataTables_wrapper .dataTables_length select,
  .dataTables_wrapper .dataTables_filter input {
    width: 100%;
    max-width: 100%;
  }
  
  /* Filter wrap - stack on mobile */
  .filter-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .filter-wrap select,
  .filter-wrap input {
    width: 100%;
  }
  
  /* Site title - reduce size */
  .site-title {
    font-size: 1.8rem;
  }
  
  .site-title-glow {
    font-size: 1.6rem;
  }
  
  /* Subtitle */
  .subtitle {
    font-size: 1em;
  }
  
  /* Button sizes - make them full width on mobile */
  .btn--large {
    width: 100%;
    padding: 0.9em 1em;
  }
  
  .btn--medium {
    width: 100%;
    padding: 0.8em 0.9em;
  }
  
  /* Form inputs - full width */
  .filament-fields input,
  .filament-fields select,
  .filament-fields textarea {
    width: 100%;
  }
  
  /* Posts grid - single column */
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Post card */
  .post-card {
    width: 100%;
  }
  
  /* Gadget form - single column */
  #sm-add-gadget form.sm-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Mobile phones (480px and below) */
@media (max-width: 480px) {
  /* Further reduce font sizes */
  .site-title {
    font-size: 1.5rem;
  }
  
  .site-title-glow {
    font-size: 1.3rem;
  }
  
  /* Reduce padding everywhere */
  .homepage-main,
  .latest-posts {
    padding: 0 0.5rem;
  }
  
  .homepage-header {
    padding: 0.8em 0.5em 0.4em;
  }
  
  /* Cards - minimal padding */
  .sm-card,
  .sm-part-card {
    padding: 0.75rem 0.5rem;
  }
  
  /* Part detail shell */
  .sm-part-detail-shell {
    margin: 1rem auto 1.5rem;
    padding: 0 0.25rem;
  }
  
  /* Buttons - smaller text */
  .btn {
    font-size: 0.9em;
    padding: 0.75em 0.8em;
  }
  
  /* Table cells - even smaller */
  .sm-table tbody td,
  #spoolman-table tbody td,
  #spoolman-archived-table tbody td,
  #spool-usage-table tbody td,
  #wishlist-items-table tbody td,
  #gadgets-table tbody td,
  #parts-table tbody td,
  #price-comparison-table tbody td {
    padding: 0.4em 0.4em;
    font-size: 0.85em;
    max-width: 150px;
  }
  
  /* Table minimum width - further reduced */
  #spoolman-table,
  #spoolman-archived-table,
  #spool-usage-table,
  #wishlist-items-table,
  #gadgets-table,
  #parts-table,
  #price-comparison-table {
    min-width: 800px;
  }
  
  /* Form labels - smaller */
  .filament-fields label {
    font-size: 0.9em;
  }
  
  /* Price comparison items */
  .sm-price-comparison__item {
    padding: 0.75rem;
  }
  
  /* Action buttons - smaller */
  .sm-action-btn {
    width: 32px;
    height: 32px;
    font-size: 0.85em;
  }
  
  /* Part title */
  .sm-part-title {
    font-size: 1.2rem;
  }
  
  /* DataTables info and pagination - stack */
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    margin-top: 0.5rem;
    text-align: center;
  }
  
  /* Hide less important elements on very small screens */
  .dataTables_wrapper .dataTables_length {
    font-size: 0.85em;
  }
}

/* Very small phones (360px and below) */
@media (max-width: 360px) {
  .site-title {
    font-size: 1.2rem;
  }
  
  .site-title-glow {
    font-size: 1rem;
  }
  
  /* Tables - minimum width for very small screens */
  #spoolman-table,
  #spoolman-archived-table,
  #spool-usage-table,
  #wishlist-items-table,
  #gadgets-table,
  #parts-table,
  #price-comparison-table {
    min-width: 700px;
  }
  
  /* Table cells - minimal padding */
  .sm-table tbody td,
  #spoolman-table tbody td,
  #spoolman-archived-table tbody td,
  #spool-usage-table tbody td,
  #wishlist-items-table tbody td,
  #gadgets-table tbody td,
  #parts-table tbody td,
  #price-comparison-table tbody td {
    padding: 0.3em 0.3em;
    font-size: 0.8em;
  }
  
  /* Buttons - minimal padding */
  .btn {
    padding: 0.6em 0.6em;
    font-size: 0.85em;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  /* Slightly more space in landscape */
  .homepage-header {
    padding: 0.5em 0;
  }
  
  .site-title {
    font-size: 1.6rem;
  }
}

/* Touch-friendly improvements for mobile */
@media (max-width: 768px) {
  /* Increase touch target sizes */
  .btn,
  .sm-action-btn,
  a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Form inputs - larger touch targets */
  .filament-fields input,
  .filament-fields select,
  .filament-fields textarea {
    min-height: 44px;
    padding: 0.75em;
  }
  
  /* Links in tables - ensure they're tappable */
  .sm-table a,
  .spoolman-table-wrapper a {
    padding: 0.5em;
    display: inline-block;
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Menu toggle - larger */
  .menu-toggle {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.8em;
  }
}

/* ===========================================================
   WISHLIST ITEM PAGE SPECIFIC RESPONSIVE STYLES
   =========================================================== */

/* Tablet and below (768px) - Wishlist Item Page */
@media (max-width: 768px) {
  /* Part body - ensure it stacks */
  .sm-part-body {
    flex-direction: column !important;
    gap: 1rem;
  }
  
  /* Media column - full width on mobile */
  .sm-part-col--media {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Image - responsive sizing */
  .sm-part-image {
    min-height: 200px !important;
    max-height: 400px;
    width: 100%;
  }
  
  .sm-part-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
  }
  
  /* Content column - full width */
  .sm-part-col--content {
    flex: 1 1 100% !important;
    width: 100%;
  }
  
  /* Meta grid - single column on mobile */
  .sm-part-meta-grid {
    grid-template-columns: 1fr !important;
    gap: 0.5rem;
  }
  
  /* Meta row - full width */
  .sm-meta-row {
    width: 100%;
    padding: 0.5rem 0.75rem;
  }
  
  /* Price comparison - single column on mobile */
  .sm-price-comparison {
    padding: 1rem 0.75rem;
    margin-top: 1.5rem;
  }
  
  /* Only change grid to single column if it's the grid layout (not the table) */
  .sm-price-comparison__grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }
  
  .sm-price-comparison__item {
    padding: 0.75rem;
  }
  
  .sm-price-comparison__item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  /* Admin actions section - responsive */
  .sm-admin-actions {
    padding: 1rem 0.75rem !important;
    margin-top: 1.5rem !important;
  }
  
  .sm-admin-actions h3 {
    font-size: 1.1rem;
  }
  
  /* Admin form - stack on mobile */
  #sm-assign-wishlist-form {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }
  
  #sm-assign-wishlist-form select {
    width: 100% !important;
    flex: none !important;
  }
  
  #sm-assign-wishlist-form button {
    width: 100%;
  }
  
  /* Convert buttons - stack on mobile */
  .sm-admin-actions > div:last-child > div {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }
  
  .sm-admin-actions > div:last-child > div button {
    width: 100%;
  }
  
  /* Header buttons - stack on mobile */
  .sm-part-card__header > div:last-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    width: 100%;
  }
  
  .sm-part-btn {
    width: 100%;
    text-align: center;
    padding: 0.75em 1em;
  }
  
  /* Price pill - smaller on mobile */
  .sm-price-pill {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    display: block;
    width: fit-content;
    margin-top: 0.5rem;
  }
  
  /* Description - better spacing */
  .sm-part-desc {
    font-size: 0.9rem;
    line-height: 1.6;
  }
  
  /* Stock badge - smaller on mobile */
  .sm-stock-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    top: 8px;
    right: 8px;
  }
  
  /* Price watch admin section - responsive */
  .sm-price-watch-admin {
    padding: 0.75rem !important;
    margin-bottom: 1rem !important;
  }
  
  .sm-price-watch-admin h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
  
  /* Price URL rows - stack on mobile */
  .sm-price-url-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
    padding: 0.75rem !important;
  }
  
  .sm-price-url-row input[type="url"],
  .sm-price-url-row input[type="text"] {
    width: 100% !important;
    flex: none !important;
    min-width: 0 !important;
  }
  
  .sm-price-url-row button {
    width: 100%;
    align-self: stretch;
  }
  
  /* Price watch form buttons container - stack on mobile (override desktop) */
  .sm-price-watch-admin > form > div:last-of-type {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  
  .sm-price-watch-admin > form > div:last-of-type button {
    width: 100% !important;
    margin-left: 0 !important;
  }
  
  /* Price watch labels - stack on mobile (override desktop) */
  .sm-price-watch-admin label {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  
  .sm-price-watch-admin label input[type="number"] {
    width: 100% !important;
    max-width: 200px;
  }
  
  /* Price comparison table container - ensure scrolling on mobile */
  .sm-price-comparison .table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin-top: 1rem !important;
    width: 100%;
  }
  
  /* Ensure price comparison table scrolls horizontally */
  #price-comparison-table {
    min-width: 600px !important;
  }
  
  /* DataTables wrapper for price comparison - mobile */
  .sm-price-comparison .dataTables_wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .sm-price-comparison .dataTables_wrapper .dataTables_length,
  .sm-price-comparison .dataTables_wrapper .dataTables_filter {
    margin-bottom: 0.75rem;
  }
  
  .sm-price-comparison .dataTables_wrapper .dataTables_length select,
  .sm-price-comparison .dataTables_wrapper .dataTables_filter input {
    width: 100%;
    max-width: 100%;
  }
}

/* Mobile phones (480px and below) - Wishlist Item Page */
@media (max-width: 480px) {
  /* Part detail shell - minimal padding */
  .sm-part-detail-shell {
    padding: 0 0.25rem !important;
    margin: 1rem auto 1.5rem !important;
  }
  
  /* Part card - minimal padding */
  .sm-part-card {
    padding: 0.75rem 0.5rem !important;
  }
  
  /* Part title - smaller */
  .sm-part-title {
    font-size: 1.3rem !important;
  }
  
  /* Image - smaller on very small screens */
  .sm-part-image {
    min-height: 180px !important;
    max-height: 300px;
  }
  
  /* Meta grid - tighter spacing */
  .sm-part-meta-grid {
    gap: 0.4rem;
  }
  
  .sm-meta-row {
    padding: 0.4rem 0.6rem;
  }
  
  .sm-meta-label {
    font-size: 0.6rem;
  }
  
  .sm-meta-value {
    font-size: 0.9rem;
  }
  
  /* Price comparison - minimal padding */
  .sm-price-comparison {
    padding: 0.75rem 0.5rem;
    margin-top: 1rem;
  }
  
  .sm-price-comparison__title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  .sm-price-comparison__item {
    padding: 0.6rem;
  }
  
  .sm-price-comparison__price {
    font-size: 1.1em;
  }
  
  /* Admin actions - minimal padding */
  .sm-admin-actions {
    padding: 0.75rem 0.5rem !important;
  }
  
  .sm-admin-actions h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }
  
  /* Description - smaller font */
  .sm-part-desc {
    font-size: 0.85rem;
  }
  
  /* Price pill - even smaller */
  .sm-price-pill {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
  }
  
  /* Price watch admin - smaller padding */
  .sm-price-watch-admin {
    padding: 0.5rem !important;
  }
  
  .sm-price-watch-admin h4 {
    font-size: 0.95rem;
  }
  
  /* Price URL rows - smaller padding */
  .sm-price-url-row {
    padding: 0.5rem !important;
  }
  
  /* Price comparison table - smaller min-width */
  #price-comparison-table {
    min-width: 500px !important;
  }
  
  /* Price watch admin - smaller padding */
  .sm-price-watch-admin {
    padding: 0.5rem !important;
  }
  
  .sm-price-watch-admin h4 {
    font-size: 0.95rem;
  }
  
  /* Price URL rows - smaller padding */
  .sm-price-url-row {
    padding: 0.5rem !important;
  }
}

/* Very small phones (360px and below) - Wishlist Item Page */
@media (max-width: 360px) {
  /* Part title - minimal size */
  .sm-part-title {
    font-size: 1.1rem !important;
  }
  
  /* Image - minimal height */
  .sm-part-image {
    min-height: 150px !important;
    max-height: 250px;
  }
  
  /* Meta rows - minimal padding */
  .sm-meta-row {
    padding: 0.35rem 0.5rem;
  }
  
  .sm-meta-label {
    font-size: 0.55rem;
  }
  
  .sm-meta-value {
    font-size: 0.85rem;
  }
  
  /* Price comparison - minimal */
  .sm-price-comparison {
    padding: 0.5rem 0.4rem;
  }
  
  .sm-price-comparison__item {
    padding: 0.5rem;
  }
  
  /* Admin actions - minimal */
  .sm-admin-actions {
    padding: 0.5rem 0.4rem !important;
  }
  
  /* Price watch admin - minimal */
  .sm-price-watch-admin {
    padding: 0.4rem !important;
  }
  
  /* Price URL rows - minimal */
  .sm-price-url-row {
    padding: 0.4rem !important;
  }
  
  /* Price comparison table - minimal width */
  #price-comparison-table {
    min-width: 400px;
  }
}

/* Print styles - hide on print */
@media print {
  .menu-toggle,
  .main-nav,
  .homepage-actions,
  .wishlist-btns,
  .sm-action-btn,
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter,
  .dataTables_wrapper .dataTables_paginate {
    display: none !important;
  }
  
  .sm-table,
  #spoolman-table,
  #wishlist-items-table,
  #gadgets-table,
  #parts-table {
    min-width: 100% !important;
  }
}
/* Fix horizontal scroll on wishlist item page */
#price-comparison-table {
  min-width: 100% !important;   /* was 1200px, which pushed the card wider */
  table-layout: auto;
}
/* Price table (left) + Manage URLs (right) on desktop; stack on mobile with prices first */
.sm-price-comparison {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.sm-price-comparison > * {            /* default: each block full width */
  flex: 1 1 100%;
}

/* keep logical order: prices first, then URLs */
.sm-price-comparison .table-container { order: 1; min-width: 0; }
.sm-price-comparison .sm-price-watch-admin { order: 2; min-width: 0; }

/* desktop: two columns */
@media (min-width: 992px) {
  .sm-price-comparison .table-container { flex: 1 1 55%; }
  .sm-price-comparison .sm-price-watch-admin { flex: 1 1 45%; }
}
/* Make Price Comparison section match main card width */
.sm-price-comparison {
  width: calc(100% - 3rem); /* aligns with padding of .sm-part-card */
  margin: 0 auto;
  max-width: 1200px;        /* keeps it centered and balanced */
  box-sizing: border-box;
}

/* ===========================================================
   GLOBAL SEARCH BAR
   =========================================================== */

.header-search {
  flex: 1;
  max-width: 400px;
  margin: 0 1rem;
}

.sm-global-search-container {
  position: relative;
  width: 100%;
}

.sm-global-search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.sm-global-search-input {
  flex: 1;
  padding: 0.6rem 1rem;
  background: rgba(34, 40, 50, 0.8);
  border: 1px solid rgba(65, 224, 253, 0.3);
  border-radius: var(--sm-radius-md);
  color: #e0eefd;
  font-size: 0.95rem;
  transition: all 0.2s;
  outline: none;
}

.sm-global-search-input:focus {
  border-color: var(--sm-accent-primary);
  box-shadow: 0 0 0 3px rgba(65, 224, 253, 0.1);
  background: rgba(34, 40, 50, 0.95);
}

.sm-global-search-submit {
  padding: 0.6rem 1rem;
  background: var(--sm-accent-primary);
  border: none;
  border-radius: var(--sm-radius-md);
  color: #04161b;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sm-global-search-submit:hover {
  background: #6ee7b7;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(65, 224, 253, 0.3);
}

.sm-global-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(24, 28, 34, 0.98);
  border: 1px solid rgba(65, 224, 253, 0.3);
  border-radius: var(--sm-radius-md);
  margin-top: 0.5rem;
  max-height: 500px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: none;
  backdrop-filter: blur(10px);
}

.sm-global-search-results.active {
  display: block;
}

.sm-search-group {
  padding: 1rem;
  border-bottom: 1px solid rgba(65, 224, 253, 0.1);
}

.sm-search-group:last-child {
  border-bottom: none;
}

.sm-search-group h4 {
  margin: 0 0 0.75rem 0;
  color: var(--sm-accent-primary);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sm-search-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sm-search-group li {
  margin: 0;
  padding: 0;
}

.sm-search-group a {
  display: block;
  padding: 0.75rem;
  color: #e0eefd;
  text-decoration: none;
  border-radius: var(--sm-radius-sm);
  transition: all 0.2s;
}

.sm-search-group a:hover {
  background: rgba(65, 224, 253, 0.1);
  color: var(--sm-accent-primary);
}

.sm-search-group a span {
  display: block;
  font-size: 0.85rem;
  color: rgba(224, 238, 253, 0.6);
  margin-top: 0.25rem;
}

.sm-search-no-results {
  padding: 2rem;
  text-align: center;
  color: rgba(224, 238, 253, 0.6);
}

.sm-search-more {
  padding: 1rem;
  text-align: center;
  border-top: 1px solid rgba(65, 224, 253, 0.1);
}

.sm-search-more a {
  color: var(--sm-accent-primary);
  font-weight: 600;
  text-decoration: none;
}

.sm-search-more a:hover {
  text-decoration: underline;
}

/* ===========================================================
   QUICK STATS DASHBOARD
   =========================================================== */

.sm-quick-stats-dashboard {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.sm-stats-title {
  color: var(--sm-accent-primary);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  text-shadow: 0 2px 12px rgba(65, 224, 253, 0.3);
}

.sm-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
}

.sm-stat-card {
  background: rgba(34, 40, 50, 0.93);
  border: 1px solid rgba(65, 224, 253, 0.2);
  border-radius: var(--sm-radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(38, 214, 228, 0.1);
  min-height: 100px;
}

.sm-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(65, 224, 253, 0.2);
  border-color: rgba(65, 224, 253, 0.4);
}

.sm-stat-card.sm-stat-warning {
  border-color: rgba(245, 197, 66, 0.4);
  background: rgba(245, 197, 66, 0.05);
}

.sm-stat-icon {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
  width: 3rem;
  text-align: center;
}

.sm-stat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
}

.sm-stat-value {
  font-size: 2rem;
  font-weight: var(--sm-font-bold);
  color: var(--sm-accent-primary);
  line-height: 1.2;
  margin-bottom: 0.25rem;
  width: 100%;
  text-align: left;
  font-family: var(--sm-font-family);
}

.sm-stat-label {
  font-size: var(--sm-font-sm);
  font-weight: var(--sm-font-medium);
  color: rgba(224, 238, 253, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 100%;
  text-align: left;
  font-family: var(--sm-font-family);
}

/* ===========================================================
   MOBILE BOTTOM NAVIGATION
   =========================================================== */

.sm-mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(24, 28, 34, 0.98);
  border-top: 1px solid rgba(65, 224, 253, 0.3);
  padding: 0.5rem 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.sm-mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem;
  color: rgba(224, 238, 253, 0.6);
  text-decoration: none;
  font-size: 0.75rem;
  transition: all 0.2s;
  border: none;
  background: none;
  cursor: pointer;
}

.sm-mobile-nav-item:hover,
.sm-mobile-nav-item:focus {
  color: var(--sm-accent-primary);
  background: rgba(65, 224, 253, 0.1);
}

.sm-mobile-nav-item svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.sm-mobile-nav-item span {
  font-weight: 500;
}

/* Show mobile nav only on mobile - HIDE ON DESKTOP */
.sm-mobile-bottom-nav {
  display: none !important;
}

@media (max-width: 768px) {
  .sm-mobile-bottom-nav {
    display: flex !important;
  }
  
  /* Add padding to main content to account for bottom nav */
  main {
    padding-bottom: 70px;
  }
}

/* ===========================================================
   MOBILE FORM OPTIMIZATIONS
   =========================================================== */

@media (max-width: 768px) {
  .filament-fields {
    grid-template-columns: 1fr !important;
  }
  
  .filament-form-main,
  .part-form-main {
    padding: 0 0.5rem;
  }
  
  .filament-glass-form {
    padding: 1.5rem 1rem;
  }
  
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="url"],
  select,
  textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 0.75rem !important;
  }
  
  button[type="submit"],
  .btn {
    min-height: 44px; /* Touch target size */
    padding: 0.75rem 1.5rem;
  }
}

/* ===========================================================
   HEADER SEARCH RESPONSIVE
   =========================================================== */

@media (max-width: 850px) {
  .header-search {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin: 0.5rem 0 0 0;
  }
  
  .container-header {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .sm-global-search-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .sm-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .sm-stat-card {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
  }
  
  .sm-stat-icon {
    font-size: 2rem;
  }
  
  .sm-stat-value {
    font-size: 1.5rem;
  }
}

/* ===========================================================
   NOTIFICATION CENTER
   =========================================================== */

.header-notifications {
  position: relative;
  margin-left: 0.5rem;
}

.sm-notification-center {
  position: relative;
}

.sm-notification-bell {
  position: relative;
  background: transparent;
  border: none;
  color: var(--sm-accent-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--sm-radius-md);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sm-notification-bell:hover {
  background: rgba(65, 224, 253, 0.1);
  transform: scale(1.1);
}

.sm-notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--sm-accent-danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
}

.sm-notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: rgba(24, 28, 34, 0.98);
  border: 1px solid rgba(65, 224, 253, 0.3);
  border-radius: var(--sm-radius-md);
  width: 350px;
  max-width: 90vw;
  max-height: 500px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: none;
  backdrop-filter: blur(10px);
  flex-direction: column;
}

.sm-notification-dropdown.active {
  display: flex;
}

.sm-notification-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(65, 224, 253, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sm-notification-header h3 {
  margin: 0;
  color: var(--sm-accent-primary);
  font-size: 1.1rem;
}

.sm-mark-all-read {
  background: transparent;
  border: none;
  color: var(--sm-accent-primary);
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: underline;
  padding: 0.25rem 0.5rem;
}

.sm-notification-list {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.sm-notification-item {
  padding: 1rem;
  border-bottom: 1px solid rgba(65, 224, 253, 0.05);
  display: flex;
  gap: 0.75rem;
  position: relative;
  transition: background 0.2s;
}

.sm-notification-item:hover {
  background: rgba(65, 224, 253, 0.05);
}

.sm-notification-item.unread {
  background: rgba(65, 224, 253, 0.08);
  border-left: 3px solid var(--sm-accent-primary);
}

.sm-notification-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.sm-notification-content {
  flex: 1;
}

.sm-notification-title {
  font-weight: 600;
  color: #e0eefd;
  margin-bottom: 0.25rem;
}

.sm-notification-message {
  font-size: 0.9rem;
  color: rgba(224, 238, 253, 0.7);
  margin-bottom: 0.25rem;
}

.sm-notification-time {
  font-size: 0.75rem;
  color: rgba(224, 238, 253, 0.5);
}

.sm-notification-link {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.sm-notification-empty {
  padding: 2rem;
  text-align: center;
  color: rgba(224, 238, 253, 0.6);
}

.sm-notification-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(65, 224, 253, 0.1);
  text-align: center;
}

.sm-notification-footer a {
  color: var(--sm-accent-primary);
  text-decoration: none;
  font-size: 0.9rem;
}

/* ===========================================================
   SPOOL RECOMMENDATIONS
   =========================================================== */

.sm-spool-recommendations {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.sm-recommendations-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.sm-recommendation-card {
  background: rgba(34, 40, 50, 0.93);
  border: 1px solid rgba(65, 224, 253, 0.2);
  border-radius: var(--sm-radius-lg);
  padding: 1.5rem;
  position: relative;
  transition: all 0.3s;
}

.sm-recommendation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(65, 224, 253, 0.2);
  border-color: rgba(65, 224, 253, 0.4);
}

.sm-recommendation-card.sm-best-match {
  border-color: rgba(110, 231, 183, 0.5);
  background: rgba(110, 231, 183, 0.05);
}

.sm-best-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(110, 231, 183, 0.2);
  color: #6ee7b7;
  padding: 0.25rem 0.75rem;
  border-radius: var(--sm-radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.sm-rec-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.sm-rec-header h4 {
  margin: 0;
  flex: 1;
}

.sm-rec-header h4 a {
  color: var(--sm-accent-primary);
  text-decoration: none;
}

.sm-rec-score {
  font-size: 0.85rem;
  color: rgba(224, 238, 253, 0.6);
  background: rgba(65, 224, 253, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: var(--sm-radius-sm);
}

.sm-rec-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.sm-rec-detail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sm-rec-label {
  font-size: 0.75rem;
  color: rgba(224, 238, 253, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sm-rec-value {
  font-size: 0.95rem;
  color: #e0eefd;
  font-weight: 600;
}

.sm-rec-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* ===========================================================
   PRINT TEMPLATES
   =========================================================== */

.sm-print-templates {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.sm-templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.sm-template-card {
  background: rgba(34, 40, 50, 0.93);
  border: 1px solid rgba(65, 224, 253, 0.2);
  border-radius: var(--sm-radius-lg);
  padding: 1.5rem;
  transition: all 0.3s;
}

.sm-template-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(65, 224, 253, 0.2);
}

.sm-template-card h3 {
  margin: 0 0 1rem 0;
  color: var(--sm-accent-primary);
}

.sm-template-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: rgba(224, 238, 253, 0.7);
}

.sm-template-actions {
  display: flex;
  gap: 0.5rem;
}

.sm-templates-empty {
  padding: 2rem;
  text-align: center;
  background: rgba(34, 40, 50, 0.93);
  border-radius: var(--sm-radius-md);
  color: rgba(224, 238, 253, 0.7);
}

/* ===========================================================
   INVENTORY MANAGEMENT
   =========================================================== */

.sm-inventory-dashboard {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.sm-reorder-list {
  margin-top: 1.5rem;
}

.sm-reorder-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(34, 40, 50, 0.93);
  border-radius: var(--sm-radius-md);
  overflow: hidden;
}

.sm-reorder-table th {
  background: rgba(65, 224, 253, 0.1);
  color: var(--sm-accent-primary);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.sm-reorder-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(65, 224, 253, 0.1);
  color: #e0eefd;
}

.sm-reorder-table tr:hover {
  background: rgba(65, 224, 253, 0.05);
}

.sm-reorder-table .sm-critical {
  color: var(--sm-accent-danger);
  font-weight: 700;
}

.sm-reorder-table .sm-warning {
  color: #f5c542;
  font-weight: 600;
}

.sm-reorder-list-empty {
  padding: 2rem;
  text-align: center;
  background: rgba(34, 40, 50, 0.93);
  border-radius: var(--sm-radius-md);
  color: rgba(224, 238, 253, 0.7);
}


/* ===========================================================
   RESPONSIVE: NOTIFICATIONS & NEW FEATURES
   =========================================================== */

@media (max-width: 850px) {
  .header-notifications {
    order: 2;
  }
  
  .sm-notification-dropdown {
    right: -1rem;
    width: calc(100vw - 2rem);
    max-width: 350px;
  }
  
  .sm-recommendations-list {
    grid-template-columns: 1fr;
  }
  
  .sm-templates-grid {
    grid-template-columns: 1fr;
  }
  
  .sm-reorder-table {
    font-size: 0.85rem;
  }
  
  .sm-reorder-table th,
  .sm-reorder-table td {
    padding: 0.5rem;
  }
}

/* ===========================================================
   UNIFIED DESIGN SYSTEM - ENFORCE CONSISTENCY
   =========================================================== */

/* Unified Container Widths */
.homepage-main,
.latest-posts,
.spoolman-main-page,
.sm-quick-stats-dashboard,
.sm-spool-recommendations,
.sm-print-templates,
.sm-inventory-dashboard,
.filament-form-main,
.part-form-main,
.print-statistics-dashboard {
  max-width: var(--sm-container-xl);
  margin-left: auto;
  margin-right: auto;
}

/* Unified Table Row Heights */
.spoolman-table-wrapper tbody tr,
.sm-table tbody tr,
#spoolman-table tbody tr,
#spoolman-archived-table tbody tr,
#gadgets-table tbody tr,
#parts-table tbody tr,
#spool-usage-table tbody tr,
.sm-reorder-table tbody tr {
  min-height: var(--sm-table-row-height);
  height: var(--sm-table-row-height);
}

/* Wishlist items table rows - now handled by unified rule above */

/* Note: Table cell padding and styling is now handled by the unified rule above */
.spoolman-table-wrapper tbody td,
.sm-reorder-table tbody td {
  padding: var(--sm-spacing-sm) var(--sm-spacing-md);
  vertical-align: middle;
  font-size: var(--sm-font-base);
  line-height: 1.5;
}

/* Wishlist items table cells - unified height with truncation */
#wishlist-items-table tbody td {
  overflow: hidden !important;
}

/* Action column: icons aligned horizontally to row height */
#wishlist-items-table tbody td:last-child {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  overflow: visible !important;
}

/* Action buttons/icons - align to row height */
#wishlist-items-table tbody td:last-child .btn,
#wishlist-items-table tbody td:last-child a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

.spoolman-table-wrapper thead th,
.sm-table thead th,
#spoolman-table thead th,
#spoolman-archived-table thead th,
#wishlist-items-table thead th,
#gadgets-table thead th,
#parts-table thead th,
#spool-usage-table thead th,
.sm-reorder-table thead th {
  padding: var(--sm-spacing-md);
  font-size: var(--sm-font-md);
  font-weight: var(--sm-font-bold);
  min-height: var(--sm-table-row-height);
  height: var(--sm-table-row-height);
}

/* Unified Form Input Heights and Padding */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="date"],
input[type="time"],
select,
textarea {
  font-family: var(--sm-font-family);
  font-size: var(--sm-font-base);
  min-height: var(--sm-input-height-md);
  padding: var(--sm-input-padding-md);
  border-radius: var(--sm-radius-sm);
  box-sizing: border-box;
  line-height: 1.5;
}

/* Small inputs */
input[type="text"].input-sm,
input[type="number"].input-sm,
select.input-sm {
  min-height: var(--sm-input-height-sm);
  padding: var(--sm-input-padding-sm);
  font-size: var(--sm-font-sm);
}

/* Large inputs */
input[type="text"].input-lg,
input[type="number"].input-lg,
select.input-lg {
  min-height: var(--sm-input-height-lg);
  padding: var(--sm-input-padding-lg);
  font-size: var(--sm-font-lg);
}

/* Unified Font Sizes - Headings */
h1, .h1 {
  font-size: var(--sm-font-4xl);
  font-weight: var(--sm-font-extrabold);
  font-family: var(--sm-font-family);
  line-height: 1.2;
}

h2, .h2 {
  font-size: var(--sm-font-3xl);
  font-weight: var(--sm-font-bold);
  font-family: var(--sm-font-family);
  line-height: 1.3;
}

h3, .h3 {
  font-size: var(--sm-font-2xl);
  font-weight: var(--sm-font-bold);
  font-family: var(--sm-font-family);
  line-height: 1.4;
}

h4, .h4 {
  font-size: var(--sm-font-xl);
  font-weight: var(--sm-font-semibold);
  font-family: var(--sm-font-family);
  line-height: 1.4;
}

h5, .h5 {
  font-size: var(--sm-font-lg);
  font-weight: var(--sm-font-semibold);
  font-family: var(--sm-font-family);
  line-height: 1.5;
}

h6, .h6 {
  font-size: var(--sm-font-base);
  font-weight: var(--sm-font-semibold);
  font-family: var(--sm-font-family);
  line-height: 1.5;
}

/* Unified Body Text */
body,
p,
li,
td,
span {
  font-family: var(--sm-font-family);
  font-size: var(--sm-font-base);
  font-weight: var(--sm-font-normal);
  line-height: 1.6;
}

/* Unified Button System - Ensure all buttons use consistent sizing */
button,
a.btn,
input[type="submit"],
input[type="button"] {
  font-family: var(--sm-font-family);
  box-sizing: border-box;
}

/* Legacy buttons - map to unified system */
.homepage-btn,
.add-filament-btn,
.add-spool-btn,
.filament-submit-btn,
.update-spool-btn,
.save-spools-btn,
.add-part-btn,
.mark-bought-btn {
  min-height: var(--sm-btn-height-lg);
  padding: var(--sm-btn-padding-lg);
  font-size: var(--sm-font-lg);
  font-weight: var(--sm-font-bold);
  border-radius: var(--sm-radius-md);
}

.add-item-btn {
  min-height: var(--sm-btn-height-md);
  padding: var(--sm-btn-padding-md);
  font-size: var(--sm-font-base);
  font-weight: var(--sm-font-semibold);
  border-radius: var(--sm-radius-md);
}

/* Unified Card Padding */
.sm-card,
.sm-part-card,
.sm-stat-card,
.sm-recommendation-card,
.sm-template-card,
.print-stats-card {
  padding: var(--sm-spacing-lg);
  border-radius: var(--sm-radius-md);
}

/* Unified Section Spacing */
section,
.section {
  margin-bottom: var(--sm-spacing-xl);
}

/* Unified Gap Spacing */
.grid,
.flex,
.homepage-actions,
.sm-stats-grid,
.sm-recommendations-list,
.sm-templates-grid {
  gap: var(--sm-spacing-lg);
}

/* Ensure common elements use unified font family */
body,
button,
input,
select,
textarea,
table,
.nav-link,
.nav-links li a,
.btn,
.sm-card,
.sm-part-card {
  font-family: var(--sm-font-family);
}

/* Override any hardcoded font sizes to use variables */
.site-title,
.site-title-glow {
  font-family: var(--sm-font-family);
}

.nav-link,
.nav-links li a {
  font-family: var(--sm-font-family);
  font-size: var(--sm-font-md);
  font-weight: var(--sm-font-semibold);
}

/* Unified Back Button */
.sm-back-button {
  display: inline-flex;
  align-items: center;
  gap: var(--sm-spacing-sm);
  padding: var(--sm-btn-padding-sm);
  min-height: var(--sm-btn-height-sm);
  font-size: var(--sm-font-sm);
  font-weight: var(--sm-font-semibold);
  border-radius: var(--sm-radius-sm);
  margin-top: var(--sm-spacing-md);
}

/* Print Price Display */
.print-price-display {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(65, 224, 253, 0.1);
  border: 1px solid rgba(65, 224, 253, 0.3);
  border-radius: var(--sm-radius-md);
  font-family: var(--sm-font-family);
}

.print-price-display h3 {
  margin: 0 0 0.5rem 0;
  color: var(--sm-accent-primary);
  font-size: var(--sm-font-lg);
  font-weight: var(--sm-font-semibold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.print-price-display .price-value {
  font-size: var(--sm-font-2xl);
  font-weight: var(--sm-font-bold);
  color: var(--sm-accent-primary);
  font-family: var(--sm-font-family);
}

.print-price-display .price-description {
  margin: 0.5rem 0 0 0;
  font-size: var(--sm-font-sm);
  color: rgba(224, 238, 253, 0.6);
  font-family: var(--sm-font-family);
}
