/* BC Development Dashboard - COMPLETE Premium Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   HEADER - IBM-style gradient
======================================== */
header {
  background: linear-gradient(135deg, var(--color-navy-900) 0%, var(--color-navy-700) 100%);
  border-bottom: 1px solid rgba(184, 151, 90, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

header .max-w-7xl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
}

header p {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

/* ========================================
   PROJECT CARDS - Premium Grid
======================================== */
#projectsOverview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.project-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-navy-900), var(--color-gold-500));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  border-color: var(--color-gold-500);
}

.project-card:hover::before {
  opacity: 1;
}

/* ========================================
   CATEGORY CARDS - IBM-style grid met icons
======================================== */
#categoriesGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.category-card {
  background: var(--category-bg);
  border: 2px solid var(--category-border);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subtle gradient overlay */
.category-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--color-gold-500) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--category-hover-border);
  background: var(--category-hover-bg);
}

.category-card:hover::after {
  opacity: 0.05;
}

/* Category icon */
.category-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--color-navy-900), var(--color-navy-700));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
  transform: scale(1.1) rotate(5deg);
}

.category-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--category-text);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
  line-height: 1.4;
}

.category-card:hover .category-title {
  color: var(--category-text-hover);
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: white;
  border: 1px solid var(--border-light);
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.category-card:hover .category-badge {
  background: var(--color-gold-500);
  color: white;
  border-color: var(--color-gold-500);
}

/* Subfolders list */
.category-items {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.category-items ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Subfolder item - BASE STYLING */
.category-subfolder-item {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  transition: all 0.2s ease;
  cursor: default;
}

/* GOUD = Heeft bestanden */
.category-subfolder-item.has-files {
  border-left: 3px solid var(--color-gold-500);
  background: rgba(184, 151, 90, 0.05);
}

/* GRIJS = Leeg */
.category-subfolder-item.empty {
  border-left: 3px solid #d1d5db;
  opacity: 0.7;
}

.category-subfolder-item:active {
  background: white;
  transform: translateX(2px);
}

/* ========================================
   FILE MODAL - Premium overlay
======================================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal > div {
  background: var(--bg-primary);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   FILE ITEMS - style list
======================================== */
.file-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 1rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.file-item:hover {
  background: var(--bg-tertiary);
  border-color: var(--color-gold-500);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateX(4px);
}

/* ========================================
   BUTTONS - Premium style
======================================== */
button, .btn {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:active {
  transform: translateY(0);
}

/* Primary button */
.btn-primary {
  background: linear-gradient(135deg, var(--color-navy-900), var(--color-navy-700));
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-navy-800), var(--color-navy-600));
}

/* ========================================
   LOADING SPINNER - NO ROTATION!
======================================== */
.loading {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--color-navy-900);
  border-radius: 50%;
  /* GEEN animation: spin! */
}

/* Pulse effect instead of spinning */
.loading.pulse {
  animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.95);
  }
}

/* ========================================
   PULSE DOT - Live indicator
======================================== */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
}

/* ========================================
   GAMMA-INSPIRED MODERN UI
   Glassmorphism, smooth animations, depth
======================================== */

/* === ENHANCED PROJECT CARDS === */
.project-card-gamma {
  position: relative;
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.98) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(209, 213, 219, 0.3);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 
    0 4px 6px rgba(0, 0, 0, 0.02),
    0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

/* Subtle gradient overlay on hover */
.project-card-gamma::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    rgba(59, 130, 246, 0.08) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.project-card-gamma:hover::before {
  opacity: 1;
}

.project-card-gamma:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.08),
    0 8px 16px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(184, 151, 90, 0.2);
  border-color: rgba(184, 151, 90, 0.4);
}

/* Loading state - NO SPINNING! */
.project-card-gamma.loading {
  opacity: 0.6;
  pointer-events: none;
}

.project-card-gamma.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  to { left: 100%; }
}

/* === CIRCULAR PROGRESS (Gamma-style) === */
.progress-container {
  position: relative;
  width: 80px;
  height: 80px;
}

.progress-ring {
  transform: rotate(-90deg);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.progress-ring-circle {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-ring-bg {
  stroke: #e5e7eb;
}

.progress-ring-fill {
  stroke: url(#progressGradient);
}

.progress-ring-fill.loading {
  animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.progress-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.progress-sublabel {
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* === STAT BADGES === */
.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2563eb;
  transition: all 0.2s ease;
}

.stat-badge:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  transform: scale(1.05);
}

.stat-badge-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 6px;
  font-size: 0.75rem;
}

/* === QUICK ACTION CHIPS === */
.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 1rem;
}

.action-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  background: white;
  border: 1.5px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  max-width: calc(50% - 0.25rem);
}

.action-chip:hover {
  background: linear-gradient(135deg, var(--color-navy-900), var(--color-navy-700));
  color: white;
  border-color: var(--color-navy-900);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30, 58, 82, 0.2);
}

.action-chip-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.action-chip:hover .action-chip-number {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.action-chip-more {
  background: var(--bg-tertiary);
  border-style: dashed;
  cursor: default;
  opacity: 0.7;
}

.action-chip-more:hover {
  transform: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-color: var(--border-light);
}

/* === ICON BUTTONS === */
.icon-btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.icon-btn-modern:hover {
  background: var(--color-gold-500);
  color: white;
  border-color: var(--color-gold-500);
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 4px 12px rgba(184, 151, 90, 0.3);
}

.icon-btn-modern svg {
  width: 20px;
  height: 20px;
}

/* === LOADING SKELETON === */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 0%,
    var(--bg-tertiary) 50%,
    var(--bg-secondary) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 320px;
  border-radius: 20px;
}

.skeleton-line {
  height: 16px;
  margin-bottom: 8px;
}

.skeleton-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

/* === EMPTY STATES === */
.empty-state-modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
  filter: grayscale(100%);
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-state-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 400px;
  line-height: 1.6;
}

/* === SMOOTH TRANSITIONS === */
.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.slide-up {
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   ENHANCED CATEGORY CARDS (Gamma-style)
======================================== */

.category-card-gamma {
  position: relative;
  background: white;
  border: 2px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 240px;
}

/* Gold left border for cards with files */
.category-card-gamma.has-files {
  border-left: 4px solid var(--color-gold-500);
  background: linear-gradient(
    135deg, 
    rgba(184, 151, 90, 0.02) 0%, 
    white 50%
  );
}

.category-card-gamma:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.08),
    0 4px 8px rgba(0, 0, 0, 0.04);
  border-color: var(--color-gold-500);
}

.category-card-gamma.empty {
  opacity: 0.85;
  border-style: dashed;
  border-color: var(--border-medium);
}

.category-card-gamma.empty:hover {
  opacity: 1;
  border-style: solid;
}

/* === STATUS DOT (top-right indicator) === */
.category-status-dot {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 
    0 0 0 3px rgba(0, 200, 117, 0.2),
    0 0 8px rgba(0, 200, 117, 0.4);
  animation: pulse-dot 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    box-shadow: 
      0 0 0 0 rgba(0, 200, 117, 0.4),
      0 0 8px rgba(0, 200, 117, 0.4);
  }
  50% {
    box-shadow: 
      0 0 0 6px rgba(0, 200, 117, 0),
      0 0 12px rgba(0, 200, 117, 0.2);
  }
}

/* === CATEGORY NUMBER BADGE === */
.category-number-badge {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border: 2px solid var(--border-light);
  border-radius: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.category-number-badge.active {
  background: linear-gradient(135deg, var(--color-navy-900), var(--color-navy-700));
  color: white;
  border-color: var(--color-navy-900);
  box-shadow: 0 4px 12px rgba(30, 58, 82, 0.2);
}

.category-card-gamma:hover .category-number-badge {
  transform: scale(1.1) rotate(-5deg);
}

/* === CATEGORY HEADER === */
.category-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-title-modern {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
  transition: color 0.2s ease;
}

.category-card-gamma:hover .category-title-modern {
  color: var(--color-navy-900);
}

.category-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
}

.category-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.category-meta-item svg {
  flex-shrink: 0;
}

.category-meta-item.highlight {
  color: var(--color-gold-600);
  font-weight: 600;
}

.category-meta-item.warning {
  color: var(--color-error);
}

/* === SUBFOLDERS LIST === */
.category-subfolders {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  flex: 1;
  overflow: hidden;
}

.category-subfolders.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-medium);
}

.subfolder-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 0.8125rem;
  transition: all 0.2s ease;
  position: relative;
}

/* Gold left border for subfolders with files */
.subfolder-item.has-files {
  border-left: 3px solid var(--color-gold-500);
  background: linear-gradient(
    90deg,
    rgba(184, 151, 90, 0.05) 0%,
    white 30%
  );
}

.subfolder-item.empty {
  opacity: 0.7;
  border-left: 3px solid var(--border-medium);
}

.subfolder-item.more {
  border-style: dashed;
  opacity: 0.6;
  cursor: default;
  justify-content: center;
}

.subfolder-item:not(.more):hover {
  background: var(--bg-tertiary);
  border-color: var(--color-gold-500);
  transform: translateX(4px);
}

.subfolder-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.subfolder-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-weight: 500;
}

.subfolder-badge {
  width: 8px;
  height: 8px;
  background: var(--color-gold-500);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(184, 151, 90, 0.5);
}

/* === CATEGORY FOOTER === */
.category-footer {
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.category-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-action-btn:hover {
  background: linear-gradient(135deg, var(--color-navy-900), var(--color-navy-700));
  color: white;
  border-color: var(--color-navy-900);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(30, 58, 82, 0.2);
}

.category-action-btn svg {
  transition: transform 0.2s ease;
}

.category-action-btn:hover svg {
  transform: scale(1.1);
}

/* ========================================
   MODERN FILE MODAL (Gamma-inspired)
======================================== */

.modal {
  backdrop-filter: blur(12px);
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal > div {
  animation: modalSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Modal Header */
.modal-category-badge {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-navy-900), var(--color-navy-700));
  border-radius: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 12px rgba(30, 58, 82, 0.3);
}

/* Modal Stats Bar */
.modal-stats-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}

.refresh-btn:hover {
  background: var(--color-navy-900);
  color: white;
  border-color: var(--color-navy-900);
  transform: scale(1.05);
}

.refresh-btn:hover svg {
  animation: spin 0.6s ease-in-out;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* File Section */
.file-section {
  margin-bottom: 2rem;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.file-section.empty {
  opacity: 0.7;
}

.file-section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 100%;
}

.file-section-title:hover {
  background: var(--bg-tertiary);
  border-color: var(--color-gold-500);
}

.file-section-title > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 0.625rem;
  background: var(--color-gold-500);
  color: white;
  border-radius: 14px;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: auto;
}

.file-count-badge.empty {
  background: var(--color-gray-300);
  color: var(--text-tertiary);
}

/* File Grid */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
  overflow: visible;
}

/* File Card */
.file-card-modern {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem;
  background: white;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.file-card-modern.new {
  border-color: #fbbf24;
  background: linear-gradient(135deg, #fffbeb 0%, white 50%);
}

.file-card-modern:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--color-gold-500);
}

.new-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: #fbbf24;
  color: #78350f;
  border-radius: 6px;
  font-size: 0.625rem;
  font-weight: 700;
  z-index: 1;
}

.file-icon-large {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  transition: transform 0.3s ease;
}

.file-card-modern:hover .file-icon-large {
  transform: scale(1.15) rotate(5deg);
}

.file-info {
  text-align: center;
  width: 100%;
}

.file-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  line-height: 1.3;
}

.file-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* File Action Overlay */
.file-action-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 58, 82, 0.95);
  color: white;
  opacity: 0;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(4px);
}

.file-card-modern:hover .file-action-overlay {
  opacity: 1;
}

/* Empty Folder State */
.empty-folder-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-medium);
  border-radius: 10px;
  text-align: center;
}

/* Modal Footer */
.modal-footer-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: center;
}

/* ========================================
   DASHBOARD WIDGETS (Gamma-inspired)
======================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Widget Card Base */
.dashboard-widget {
  position: relative;
  padding: 2rem;
  border-radius: 24px;
  color: white;
  overflow: hidden;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dashboard-widget::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.15) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.dashboard-widget:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
}

.dashboard-widget:hover::before {
  opacity: 1;
}

/* Gradient Variants */
.gradient-purple {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-blue {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-pink {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-yellow {
  background: linear-gradient(135deg, #fad961 0%, #f76b1c 100%);
}

.gradient-navy {
  background: linear-gradient(135deg, #1e3a52 0%, #2e5266 100%);
}

.gradient-gold {
  background: linear-gradient(135deg, #b8975a 0%, #d4af37 100%);
}

.gradient-green {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

/* Widget Content */
.widget-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.9;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.widget-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.widget-big-number {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  margin: 1rem 0;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.widget-label {
  font-size: 0.9375rem;
  font-weight: 500;
  opacity: 0.95;
}

.widget-sublabel {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 0.25rem;
}

/* Widget with Progress Circle */
.widget-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

.progress-circle-large {
  position: relative;
  width: 120px;
  height: 120px;
}

.progress-circle-large svg {
  transform: rotate(-90deg);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.progress-circle-large circle {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-circle-bg {
  stroke: rgba(255, 255, 255, 0.2);
}

.progress-circle-fill {
  stroke: white;
}

.progress-circle-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Widget List Items */
.widget-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.widget-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.widget-list-item:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(4px);
}

.widget-list-item-icon {
  font-size: 1.25rem;
}

.widget-list-item-text {
  flex: 1;
  margin: 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.widget-list-item-badge {
  padding: 0.25rem 0.625rem;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* View Toggle Buttons */
.view-toggle-buttons {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-btn.active {
  background: white;
  color: var(--text-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.view-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.5);
}

/* ========================================
   MODAL CONTENT - PREVENT OVERFLOW
======================================== */

.modal > div {
  max-width: 900px;
  width: 95%;
  max-height: 85vh;
}

#modalContent {
  padding: 1.5rem;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(85vh - 80px);
  width: 100%;
}

#filesContainer {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* ========================================
   MODAL STATS BAR - WRAP ON MOBILE
======================================== */

.modal-stats-bar {
  width: 100%;
}

.stat-pill {
  flex-shrink: 0;
}

.refresh-btn {
  flex-shrink: 0;
}

/* ========================================
   USER INFO BADGE - Desktop & Mobile
======================================== */
#userInfo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#userInfo:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.user-email {
  font-weight: 500;
  color: white;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.user-badge.admin {
  background: rgba(59, 130, 246, 0.2);
  color: #dbeafe;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.user-badge.user {
  background: rgba(34, 197, 94, 0.2);
  color: #d1fae5;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

#userInfo::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
  animation: pulse-online 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-online {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
  }
}

/* ========================================
   RESPONSIVE - Mobile first
======================================== */
@media (max-width: 768px) {
  #projectsOverview,
  #categoriesGrid {
    grid-template-columns: 1fr;
  }
  
  header h1 {
    font-size: 1.25rem;
  }
  
  .category-card {
    padding: 1.25rem;
  }
  
  .project-card-gamma {
    padding: 1.5rem;
    min-height: 280px;
  }
  
  .progress-container {
    width: 64px;
    height: 64px;
  }
  
  .progress-label {
    font-size: 1.25rem;
  }
  
  .action-chip {
    max-width: 100%;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
  
  .dashboard-widget {
    min-height: 160px;
    padding: 1.5rem;
  }
  
  .widget-big-number {
    font-size: 2.5rem;
  }
  
  .widget-progress {
    flex-direction: column;
    gap: 1rem;
  }
  
  .progress-circle-large {
    width: 100px;
    height: 100px;
  }
  
  .file-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }
  
  .file-card-modern {
    padding: 1rem 0.75rem;
  }
  
  .file-icon-large {
    font-size: 2.5rem;
  }
  
  .modal-stats-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .refresh-btn {
    width: 100%;
    margin-left: 0 !important;
    justify-content: center;
  }
  
  /* Mobile: Clean circle for user badge */
  #userInfo {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.2) !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
  }
  
  #userInfo::before {
    display: none !important;
  }
  
  .user-badge {
    display: none !important;
  }
  
  .user-email {
    display: none !important;
  }
}

/* ================================
   MOBILE FIXES
   ================================ */

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

main {
  overflow-x: hidden;
  max-width: 100vw;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (max-width: 768px) {
  .project-card-gamma {
    margin: 0;
    padding: 1rem;
    overflow: hidden;
  }
  
  .project-card-gamma h3 {
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  
  .chip-container {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .action-chip {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    max-width: calc(50% - 0.25rem);
  }
  
  .action-chip-number {
    font-size: 0.875rem;
  }
}

.icon-btn-modern {
  flex-shrink: 0;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.5rem;
}

@media (max-width: 768px) {
  .icon-btn-modern {
    min-width: 1.75rem;
    min-height: 1.75rem;
    padding: 0.375rem;
  }
  
  .icon-btn-modern svg {
    width: 1rem;
    height: 1rem;
  }
  
  .mb-6.max-w-2xl.mx-auto {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  
  #projectSelector {
    font-size: 0.875rem;
    padding: 0.75rem;
  }
  
  .category-card-gamma {
    padding: 1rem;
  }
  
  .category-title-modern {
    font-size: 1rem;
  }
  
  .category-meta {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  
  .category-meta-item {
    font-size: 0.75rem;
  }
  
  .category-footer {
    margin-top: 0.75rem;
  }
  
  .category-action-btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
  }
  
  #fileModal .bg-white {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
    border-radius: 1rem;
  }
  
  #modalTitle {
    font-size: 1.125rem;
    padding: 1rem;
  }
  
  #modalContent {
    padding: 1rem;
  }
  
  .modal-category-badge {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
  }
  
  header .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  header h1 {
    font-size: 1.25rem;
  }
  
  header p {
    font-size: 0.75rem;
  }
  
  header img {
    height: 2.5rem;
  }
  
  .view-toggle-buttons {
    gap: 0.5rem;
  }
  
  .view-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
  
  .view-btn svg {
    width: 1rem;
    height: 1rem;
  }
}

* {
  -webkit-tap-highlight-color: transparent;
}

/* ========================================
   iOS Safari specific fixes
======================================== */
@supports (-webkit-touch-callout: none) {
  input, select, textarea {
    font-size: 16px !important;
  }
  
  body {
    position: fixed;
    overflow: hidden;
    width: 100%;
  }
  
  main {
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  button {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }
  
  @media (max-width: 768px) {
    #userInfo {
      width: 36px !important;
      height: 36px !important;
      max-width: 36px !important;
      min-width: 36px !important;
    }
  }
}

/* ================================================================
   SAFARI iOS NUCLEAR FIX
   ================================================================ */

@supports (-webkit-touch-callout: none) {
  * {
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  
  html {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative !important;
  }
  
  body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  main {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
  }
  
  .max-w-7xl,
  .max-w-4xl,
  .max-w-2xl {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  header {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  header .max-w-7xl {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  header h1 {
    font-size: 1.125rem !important;
    line-height: 1.2 !important;
  }
  
  header p {
    font-size: 0.75rem !important;
    display: none !important;
  }
  
  header img {
    height: 2rem !important;
    width: auto !important;
  }
  
  .project-card-gamma {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 1rem 0 !important;
    padding: 1rem !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  
  .project-card-gamma > div:first-child {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    gap: 0.75rem !important;
    align-items: flex-start !important;
  }
  
  .project-card-gamma h3 {
    font-size: 0.9375rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .icon-btn-modern {
    flex-shrink: 0 !important;
    width: 2rem !important;
    min-width: 2rem !important;
    max-width: 2rem !important;
    height: 2rem !important;
    min-height: 2rem !important;
    max-height: 2rem !important;
    padding: 0.375rem !important;
    overflow: hidden !important;
  }
  
  .icon-btn-modern svg {
    width: 1rem !important;
    height: 1rem !important;
  }
  
  .chip-container {
    width: 100% !important;
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }
  
  .action-chip {
    font-size: 0.75rem !important;
    padding: 0.375rem 0.625rem !important;
    max-width: calc(50% - 0.25rem) !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  
  .progress-container {
    flex-shrink: 0 !important;
    width: 60px !important;
    height: 60px !important;
  }
  
  .category-card-gamma {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 1rem 0 !important;
    padding: 1rem !important;
    overflow: hidden !important;
  }
  
  .category-title-modern {
    font-size: 0.9375rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  
  #fileModal > div {
    margin: 0.5rem !important;
    max-width: calc(100vw - 1rem) !important;
    max-height: calc(100vh - 1rem) !important;
    width: calc(100vw - 1rem) !important;
  }
  
  #modalContent {
    padding: 1rem !important;
    overflow-x: hidden !important;
  }
  
  #projectsOverview,
  #categoriesGrid {
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    width: 100% !important;
  }
  
  .dashboard-widget {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.25rem !important;
  }
  
  .file-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
  
  .file-card-modern {
    padding: 1rem 0.75rem !important;
  }
  
  .file-icon-large {
    font-size: 2.5rem !important;
  }
  
  section,
  div[class*="grid"],
  div[class*="flex"] {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  
  * {
    outline: none !important;
  }
  
  h1, h2, h3, h4, h5, h6, p, span {
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
  }
  
  button {
    max-width: 100% !important;
  }
  
  .flex,
  [class*="flex"] {
    min-width: 0 !important;
  }
  
  .project-card-gamma > *,
  .category-card-gamma > * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 374px) {
  @supports (-webkit-touch-callout: none) {
    body {
      font-size: 14px !important;
    }
    
    .project-card-gamma h3,
    .category-title-modern {
      font-size: 0.875rem !important;
    }
    
    .action-chip {
      font-size: 0.6875rem !important;
      padding: 0.25rem 0.5rem !important;
    }
    
    .file-grid {
      grid-template-columns: 1fr !important;
    }
  }
}