/* =============================================================
   JERSEY DESIGNER ERP — Premium Design System
   Theme: Dark glassmorphism with vibrant sport-brand accents
   ============================================================= */

/* ---- Google Fonts already linked in HTML ---- */

/* ==========================
   1. CSS CUSTOM PROPERTIES
   ========================== */
:root {
  /* Brand Colors */
  --accent-1: #6c63ff; /* electric violet */
  --accent-2: #00d4aa; /* emerald teal    */
  --accent-3: #ff6b6b; /* coral red       */
  --accent-4: #ffc947; /* amber            */
  --accent-blue: #4ea8de;
  --danger: #ff4d6d;
  --success: #2ec4b6;
  --warning: #ffb703;

  /* Backgrounds */
  --bg-body: #0d0f1a;
  --bg-surface: #141624;
  --bg-card: #1a1d2e;
  --bg-card-hover: #1f2338;
  --bg-modal: #1a1d2e;
  --bg-input: #0f1220;
  --bg-sidebar: #11131f;
  --sidebar-width: 240px;
  --sidebar-collapsed: 72px;

  /* Text */
  --text-primary: #e8eaff;
  --text-secondary: #8b8fa8;
  --text-muted: #525672;
  --text-on-accent: #ffffff;

  /* Borders */
  --border: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(108, 99, 255, 0.35);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 8px 32px rgba(108, 99, 255, 0.25);
  --shadow-teal: 0 8px 32px rgba(0, 212, 170, 0.2);

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition: 0.22s var(--ease);

  /* Fonts */
  --font-heading: "Outfit", sans-serif;
  --font-body: "Inter", sans-serif;
}

/* Light theme */
body.light-theme {
  --bg-body: #f0f2ff;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f7ff;
  --bg-input: #f0f2ff;
  --bg-sidebar: #1a1d2e;
  --text-primary: #1a1d2e;
  --text-secondary: #555880;
  --text-muted: #9498b8;
  --border: rgba(100, 100, 160, 0.12);
  --shadow-sm: 0 2px 8px rgba(100, 100, 160, 0.1);
  --shadow-md: 0 8px 24px rgba(100, 100, 160, 0.15);
}

/* ==========================
   2. RESET & BASE
   ========================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 15px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition:
    background var(--transition),
    color var(--transition);
}

a {
  text-decoration: none;
  color: inherit;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}
.btn-ghost i, .btn-icon i, .action-btn i {
  color: var(--text-secondary);
}
.btn-ghost:hover i, .btn-icon:hover i, .action-btn:hover i {
  color: var(--text-primary);
}
input,
select,
tarea {
  font: inherit;
  color: var(--text-primary); /* For inputs */
  background: transparent;
}
ul,
ol {
  list-style: none;
}
img,
svg {
  display: block;
  max-width: 100%;
}

/* ==========================
   3. SCROLLBAR
   ========================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-1);
}

/* ==========================
   4. SPLASH SCREEN
   ========================== */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.3s var(--ease),
    visibility 0.3s;
}
#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-logo {
  text-align: center;
}
.splash-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  font-size: 36px;
  color: white;
  box-shadow: var(--shadow-accent);
  animation: float 2s ease-in-out infinite;
}
.splash-logo h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.splash-logo p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}
.splash-loader {
  margin-top: var(--space-lg);
  height: 3px;
  width: 200px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.loader-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  border-radius: 99px;
  animation: loadProgress 1.0s var(--ease) forwards;
}
@keyframes loadProgress {
  to {
    width: 100%;
  }
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* New animations for enhanced splash */
@keyframes spin-slow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.animate-spin-slow {
  animation: spin-slow 3s linear infinite;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-fade-in {
  animation: fade-in 0.8s ease-out 0.5s both;
}
.animate-fade-in-delay {
  animation: fade-in 0.8s ease-out 1s both;
}
.animate-fade-in-late {
  animation: fade-in 0.8s ease-out 2s both;
}

@keyframes progress {
  0% { width: 0%; }
  50% { width: 60%; }
  100% { width: 100%; }
}
.animate-progress {
  animation: progress 2.5s ease-in-out forwards;
}

/* ==========================
   5. APP LAYOUT
   ========================== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.app-wrapper.visible {
  opacity: 1;
}

/* ==========================
   6. SIDEBAR
   ========================== */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  transition: width var(--transition);
  overflow: hidden;
  z-index: 100;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .user-info,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .brand span,
.sidebar.collapsed .sidebar-toggle-btn {
  display: none !important;
}
.sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 16px 8px;
}
.sidebar.collapsed .brand {
  align-items: center;
  justify-content: center;
}
.sidebar.collapsed .brand img {
  max-height: 36px !important;
}
.sidebar.collapsed .logo-icon {
  margin: 0 auto;
}
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
  position: relative;
}
/* Tooltip on hover for collapsed sidebar */
.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  white-space: nowrap;
  z-index: 200;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}
.sidebar.collapsed .nav-icon {
  width: auto;
  font-size: 16px;
}
.sidebar.collapsed .sidebar-footer {
  justify-content: center;
  padding: 12px 8px;
}
.sidebar.collapsed .logout-btn,
.sidebar.collapsed .theme-toggle-btn {
  display: none;
}

/* Sidebar toggle button */
.sidebar-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  z-index: 10;
}
.sidebar-toggle-btn:hover {
  color: var(--text-primary);
  background: var(--border);
}
.sidebar.collapsed .sidebar-toggle-btn {
  display: none !important;
}

.sidebar-header {
  padding: 20px var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: var(--shadow-accent);
}
.logo-text {
  flex: 1;
}
.logo-main {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.logo-sub {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-toggle {
  color: var(--text-muted);
  font-size: 14px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition:
    color var(--transition),
    background var(--transition);
}
.sidebar-toggle:hover {
  color: var(--text-primary);
  background: var(--border);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-sm) 4px;
  margin-top: var(--space-sm);
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px var(--space-sm);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition:
    background var(--transition),
    color var(--transition);
  position: relative;
  white-space: nowrap;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}
.nav-item.active {
  background: linear-gradient(
    135deg,
    rgba(108, 99, 255, 0.2),
    rgba(0, 212, 170, 0.1)
  );
  color: var(--accent-1);
  border: 1px solid rgba(108, 99, 255, 0.25);
}
.nav-item.active .nav-icon {
  color: var(--accent-1);
}

.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}
.nav-label {
  font-size: 13.5px;
  font-weight: 500;
  flex: 1;
}
.nav-badge {
  font-size: 10px;
  font-weight: 700;
  background: var(--accent-1);
  color: white;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.nav-badge:empty {
  display: none;
}
.nav-badge.urgent {
  background: var(--danger);
}

.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
}
.user-info {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
}
.user-name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}
.user-role {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}
.theme-toggle-btn {
  color: var(--text-muted);
  font-size: 14px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition:
    color var(--transition),
    background var(--transition);
}
.theme-toggle-btn:hover {
  color: var(--accent-4);
  background: var(--border);
}

/* Sidebar expand button (visible when collapsed) */
.sidebar-expand-btn {
  display: none;
  position: fixed;
  left: calc(var(--sidebar-collapsed) - 1px);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 101;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: color var(--transition), background var(--transition);
}
.sidebar-expand-btn:hover {
  color: var(--accent-1);
  background: var(--bg-card-hover);
}
.sidebar.collapsed ~ .sidebar-expand-btn,
.sidebar.collapsed + * .sidebar-expand-btn {
  display: flex;
}

/* Top bar clean layout */
.top-bar {
  height: 60px;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(13, 15, 26, 0.85);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
  gap: var(--space-md);
}
.light-theme .top-bar {
  background: rgba(240, 242, 255, 0.9);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.mobile-menu-btn {
  color: var(--text-secondary);
  font-size: 16px;
  padding: 8px;
  display: none;
  border-radius: var(--radius-sm);
}
.mobile-menu-btn:hover {
  background: var(--border);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.breadcrumb i {
  color: var(--accent-1);
  font-size: 14px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.search-bar:focus-within {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}
.search-bar i {
  color: var(--text-muted);
  font-size: 13px;
}
.search-bar input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  width: 200px;
  font-size: 13px;
  outline: none;
}
.search-bar input::placeholder {
  color: var(--text-muted);
}

.topbar-action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-1), var(--accent-blue));
  color: white;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-accent);
  transition:
    opacity var(--transition),
    transform var(--transition);
}
.topbar-action-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.topbar-action-btn:active {
  transform: translateY(0);
}

.notification-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  position: relative;
  cursor: pointer;
  transition:
    background var(--transition),
    color var(--transition);
}
.notification-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}
.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid var(--bg-body);
}

/* ==========================
   9. VIEW CONTAINER
   ========================== */
.view-container {
  flex: 1;
  padding: var(--space-lg);
  overflow-y: auto;
  animation: viewIn 0.3s var(--ease);
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Kanban Priority & Glow ---- */
.kanban-card.urgent {
  border: 1px solid var(--danger);
  box-shadow: 0 0 10px rgba(255, 107, 107, 0.15);
  animation: urgent-pulse 2s infinite ease-in-out;
}

@keyframes urgent-pulse {
  0% { border-color: var(--danger); box-shadow: 0 0 5px rgba(255, 107, 107, 0.2); }
  50% { border-color: #ff8e9e; box-shadow: 0 0 15px rgba(255, 107, 107, 0.4); }
  100% { border-color: var(--danger); box-shadow: 0 0 5px rgba(255, 107, 107, 0.2); }
}

.btn-bulk-action {
  background: rgba(108, 99, 255, 0.1);
  color: var(--accent-1);
  border: 1px dashed var(--accent-1);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  margin-top: 8px;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-bulk-action:hover {
  background: var(--accent-1);
  color: white;
  border-style: solid;
}

/* ==========================
   10. UTILITY CLASSES
   ========================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
}
.section-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}
.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-blue));
  color: white;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-secondary:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}
.btn-success {
  background: var(--success);
  color: white;
}
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-ghost {
  color: var(--text-muted);
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--border);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
}

/* ==========================
   11. CARDS
   ========================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}
.card:hover {
  background: var(--bg-card-hover);
}
.card-sm {
  padding: var(--space-md);
}

/* ==========================
   12. METRIC CARDS (DASHBOARD)
   ========================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  position: relative;
  overflow: hidden;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}
.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.metric-card.violet::before {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-blue));
}
.metric-card.teal::before {
  background: linear-gradient(90deg, var(--accent-2), var(--accent-blue));
}
.metric-card.red::before {
  background: linear-gradient(90deg, var(--accent-3), var(--accent-4));
}
.metric-card.amber::before {
  background: linear-gradient(90deg, var(--accent-4), var(--accent-3));
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-accent);
}
.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}
.metric-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
}
.metric-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.metric-icon.violet {
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent-1);
}
.metric-icon.teal {
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent-2);
}
.metric-icon.red {
  background: rgba(255, 107, 107, 0.15);
  color: var(--accent-3);
}
.metric-icon.amber {
  background: rgba(255, 201, 71, 0.15);
  color: var(--accent-4);
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.metric-change {
  font-size: 12px;
  color: var(--text-muted);
}
.metric-change .up {
  color: var(--success);
}
.metric-change .down {
  color: var(--danger);
}

/* ==========================
   13. CHARTS
   ========================== */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.chart-wrapper {
  position: relative;
  height: 260px;
}

/* ==========================
   14. DATA TABLE
   ========================== */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  gap: var(--space-md);
  flex-wrap: wrap;
}
.table-search {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  flex: 1;
  max-width: 320px;
  transition: border-color var(--transition);
}
.table-search:focus-within {
  border-color: var(--accent-1);
}
.table-search i {
  color: var(--text-muted);
  font-size: 12px;
}
.table-search input {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  padding: 12px var(--space-lg);
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:last-child {
  border-bottom: none;
}
tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}
tbody td {
  padding: 14px var(--space-lg);
  font-size: 13.5px;
  vertical-align: middle;
}
.td-light {
  color: var(--text-secondary);
}

/* ==========================
   15. STATUS BADGES
   ========================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-design {
  background: rgba(139, 139, 168, 0.15);
  color: #8b8fa8;
}
.status-design::before {
  background: #8b8fa8;
}
.status-art {
  background: rgba(78, 168, 222, 0.15);
  color: var(--accent-blue);
}
.status-art::before {
  background: var(--accent-blue);
}
.status-printing {
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent-1);
}
.status-printing::before {
  background: var(--accent-1);
}
.status-pressing {
  background: rgba(255, 201, 71, 0.15);
  color: var(--accent-4);
}
.status-pressing::before {
  background: var(--accent-4);
}
.status-sew {
  background: rgba(255, 107, 107, 0.15);
  color: var(--accent-3);
}
.status-sew::before {
  background: var(--accent-3);
}
.status-ship {
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent-2);
}
.status-ship::before {
  background: var(--accent-2);
}
.status-default {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* ==========================
   16. KANBAN BOARD
   ========================== */
.kanban-board {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-md);
  align-items: flex-start;
}
.kanban-col {
  flex: 0 0 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.kanban-col-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.kanban-col-header .col-title {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
}
.kanban-count {
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.kanban-col-body {
  padding: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-height: 200px;
}

.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  cursor: grab;
  transition:
    box-shadow var(--transition),
    transform var(--transition);
}
.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-accent);
}
.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}
.kanban-card-team {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.kanban-card-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}
.kanban-card-footer {
  margin-top: var(--space-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-due {
  font-size: 11px;
}
.kanban-due.overdue {
  color: var(--danger);
}
.kanban-due.soon {
  color: var(--warning);
}
.kanban-due.ok {
  color: var(--success);
}
.kanban-qty {
  font-size: 11px;
  color: var(--text-muted);
}

/* Stage ring colors */
.ring-design {
  border-top: 3px solid #8b8fa8;
}
.ring-art {
  border-top: 3px solid var(--accent-blue);
}
.ring-printing {
  border-top: 3px solid var(--accent-1);
}
.ring-pressing {
  border-top: 3px solid var(--accent-4);
}
.ring-sew {
  border-top: 3px solid var(--accent-3);
}
.ring-ship {
  border-top: 3px solid var(--accent-2);
}

/* ==========================
   17. INVENTORY
   ========================== */
.inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-md);
}
.inventory-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.inventory-card.low-stock {
  border-color: rgba(255, 77, 109, 0.4);
}
.inventory-card.low-stock:hover {
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.15);
}

.inv-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-md);
}
.inv-cat-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}
.cat-fabric {
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent-1);
}
.cat-ink {
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent-2);
}
.cat-consumable {
  background: rgba(255, 201, 71, 0.15);
  color: var(--accent-4);
}
.cat-thread {
  background: rgba(78, 168, 222, 0.15);
  color: var(--accent-blue);
}

.inv-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
}
.inv-sku {
  font-size: 11px;
  color: var(--text-muted);
}
.inv-stock-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 99px;
  overflow: hidden;
  margin: var(--space-sm) 0;
}
.inv-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-blue));
  transition: width 0.6s var(--ease);
}
.inv-bar-fill.low {
  background: linear-gradient(90deg, var(--danger), var(--warning));
}
.inv-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.inv-count {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-heading);
}
.inv-count.low {
  color: var(--danger);
}
.inv-threshold {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================
   18. CUSTOMER CARDS
   ========================== */
.customers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}
.customer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: var(--transition);
}
.customer-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-sm);
}
.cust-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.cust-info {
  flex: 1;
  min-width: 0;
}
.cust-name {
  font-weight: 600;
  font-size: 14px;
}
.cust-phone {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.cust-location {
  font-size: 11px;
  color: var(--text-muted);
}
.cust-stats {
  text-align: right;
}
.cust-orders {
  font-size: 12px;
  color: var(--text-muted);
}
.cust-spent {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-2);
}

/* ==========================
   19. MODAL
   ========================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s var(--ease),
    visibility 0.25s;
  padding: var(--space-md);
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}
.modal-box {
  background: var(--bg-modal);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md), var(--shadow-accent);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s var(--ease);
  overflow: hidden;
}
.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}
.modal-box.modal-wide {
  max-width: 880px;
}

.modal-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}
.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
  transition:
    background var(--transition),
    color var(--transition);
}
.modal-close-btn:hover {
  background: rgba(255, 77, 109, 0.15);
  color: var(--danger);
}
.modal-body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1;
}

/* ==========================
   20. FORMS
   ========================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
.form-grid.single {
  grid-template-columns: 1fr;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.full-width {
  grid-column: 1 / -1;
}
.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13.5px;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}
.form-control::placeholder {
  color: var(--text-muted);
}
select.form-control {
  cursor: pointer;
}
textarea.form-control {
  resize: vertical;
  min-height: 80px;
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

/* Roster Table in modal */
.roster-table-wrap {
  overflow-x: auto;
  margin-top: var(--space-md);
}
.roster-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 500px;
}
.roster-table th,
.roster-table td {
  padding: 8px 10px;
  text-align: left;
}
.roster-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.roster-table td {
  border-bottom: 1px solid var(--border);
}
.roster-table td input,
.roster-table td select {
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text-primary);
  font-size: 12.5px;
  width: 100%;
  padding: 4px 0;
  transition: border-color var(--transition);
}
.roster-table td input:focus,
.roster-table td select:focus {
  outline: none;
  border-bottom-color: var(--accent-1);
}
.roster-table select option {
  background: var(--bg-card);
}

/* ---- ADD ROW BUTTON ---- */
.add-row-btn {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: var(--space-sm);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  transition:
    border-color var(--transition),
    color var(--transition);
}
.add-row-btn:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}

/* ==========================
   21. REPORTS VIEW
   ========================== */
.reports-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
.report-chart-wrapper {
  position: relative;
  height: 280px;
}

/* ==========================
   22. EMPTY STATE
   ========================== */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
  color: var(--text-muted);
}
.empty-state i {
  font-size: 48px;
  margin-bottom: var(--space-md);
}
.empty-state h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

/* ==========================
   23. TOAST NOTIFICATIONS
   ========================== */
.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  z-index: 2000;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  min-width: 240px;
  max-width: 340px;
  pointer-events: all;
  animation:
    toastIn 0.3s var(--ease),
    toastOut 0.3s var(--ease) forwards;
  animation-delay: 0s, 3s;
}
.toast i {
  font-size: 16px;
  flex-shrink: 0;
}
.toast.success {
  border-left: 3px solid var(--success);
}
.toast.success i {
  color: var(--success);
}
.toast.error {
  border-left: 3px solid var(--danger);
}
.toast.error i {
  color: var(--danger);
}
.toast.info {
  border-left: 3px solid var(--accent-1);
}
.toast.info i {
  color: var(--accent-1);
}
.toast-msg {
  font-size: 13px;
  flex: 1;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(30px);
  }
}

/* ==========================
   24. ROSTER VIEW STYLES
   ========================== */
.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.roster-card {
  transition:
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.roster-card:hover {
  transform: translateY(-4px);
  box-shadow:
    var(--shadow-md),
    0 10px 30px rgba(108, 99, 255, 0.1);
  border-color: var(--border-accent);
}

.btn-block {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* ==========================
   25. RESPONSIVE UTILS
   ========================== */
@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    transform: translateX(-100%);
    width: 260px;
    height: 100vh;
    z-index: 1000;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .mobile-menu-btn {
    display: flex;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .view-container {
    padding: var(--space-md);
  }
  .top-bar {
    padding: 0 var(--space-md);
  }
}

/* ==========================
   25. ACTIVITY FEED
   ========================== */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.activity-item {
  display: flex;
  gap: var(--space-md);
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.activity-item:last-child {
  border-bottom: none;
}
.activity-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
}
.activity-dot.order {
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent-1);
}
.activity-dot.prod {
  background: rgba(255, 201, 71, 0.15);
  color: var(--accent-4);
}
.activity-dot.inv {
  background: rgba(255, 77, 109, 0.15);
  color: var(--danger);
}
.activity-dot.ship {
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent-2);
}
.activity-content {
  flex: 1;
}
.activity-text {
  font-size: 13px;
  line-height: 1.5;
}
.activity-text strong {
  color: var(--text-primary);
}
.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================
   26. TAG / CHIP
   ========================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.chip.sport {
  background: rgba(78, 168, 222, 0.12);
  color: var(--accent-blue);
  border-color: rgba(78, 168, 222, 0.25);
}

/* ==========================
   27. DETAIL PANEL (Order Detail)
   ========================== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.detail-item {
  margin-bottom: 4px;
}
.detail-key {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 3px;
}
.detail-val {
  font-size: 14px;
  font-weight: 500;
}

/* ==========================
   28. OVERDUE WARNING BANNER
   ========================== */
.warning-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: rgba(255, 77, 109, 0.1);
  border: 1px solid rgba(255, 77, 109, 0.3);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-lg);
  font-size: 13px;
  color: var(--danger);
}
.warning-banner i {
  flex-shrink: 0;
}

/* Tab Nav */
.tab-nav {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  padding: 10px var(--space-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition:
    color var(--transition),
    border-color var(--transition);
}
.tab-btn:hover {
  color: var(--text-primary);
}
.tab-btn.active {
  color: var(--accent-1);
  border-bottom-color: var(--accent-1);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
  animation: viewIn 0.25s var(--ease);
}

/* Progress Stage Bar */
.stage-progress {
  display: flex;
  gap: 0;
  margin: var(--space-lg) 0;
}
.stage-step {
  flex: 1;
  text-align: center;
  position: relative;
  padding: var(--space-sm) var(--space-xs) 0;
}
.stage-step::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border);
}
.stage-step:first-child::before {
  left: 50%;
}
.stage-step:last-child::before {
  right: 50%;
}
.stage-step.done::before {
  background: var(--accent-2);
}
.stage-step.active::before {
  background: linear-gradient(90deg, var(--accent-2), var(--border));
}
.stage-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin: 0 auto var(--space-xs);
  background: var(--bg-input);
  border: 2px solid var(--border);
  position: relative;
  z-index: 1;
  transition: all var(--transition);
}
.stage-step.done .stage-dot {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: white;
}
.stage-step.active .stage-dot {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: white;
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.2);
}
.stage-label {
  font-size: 10px;
  color: var(--text-muted);
}
.stage-step.active .stage-label {
  color: var(--accent-1);
  font-weight: 600;
}
.stage-step.done .stage-label {
  color: var(--accent-2);
}

/* ==========================
   29. DESIGN STUDIO STYLES
   ========================== */

/* ---- Stat summary row ---- */
.design-stats-row {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}
.design-stat-card {
  flex: 1;
  min-width: 100px;
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  text-align: center;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition:
    transform var(--transition),
    box-shadow var(--transition);
}
.design-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.design-stat-card.violet {
  border-top: 3px solid var(--accent-1);
}
.design-stat-card.teal {
  border-top: 3px solid var(--accent-2);
}
.design-stat-card.amber {
  border-top: 3px solid var(--accent-4);
}
.design-stat-card.red {
  border-top: 3px solid var(--danger);
}
.design-stat-card.inprog {
  border-top: 3px solid var(--accent-blue);
}
.ds-num {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
}
.ds-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- Design Cards Grid ---- */
.design-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-md);
}

.design-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}
.design-card:hover {
  transform: translateY(-4px);
  box-shadow:
    var(--shadow-md),
    0 16px 40px rgba(108, 99, 255, 0.12);
  border-color: var(--border-accent);
}

/* ---- Jersey Preview ---- */
.jersey-preview-wrap {
  position: relative;
  background: linear-gradient(135deg, #0e1020, #151829);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border);
  min-height: 160px;
}
.jersey-canvas {
  border-radius: var(--radius-sm);
  display: block;
}
.jersey-preview-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* ---- Design Card Body ---- */
.design-card-body {
  padding: var(--space-md);
}
.design-team-name {
  font-size: 16px;
  font-weight: 700;
  margin: 2px 0;
}

.design-colors-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}
.color-dot-group {
  display: flex;
  gap: 6px;
  align-items: center;
}
.color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s;
}
.color-dot:hover {
  transform: scale(1.25);
}

.design-meta-chip {
  font-size: 10px;
  font-weight: 700;
  background: rgba(108, 99, 255, 0.12);
  color: var(--accent-1);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(108, 99, 255, 0.2);
}

.design-info-rows {
  margin-bottom: var(--space-md);
}
.design-info-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.design-info-row i {
  margin-top: 2px;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}

.design-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

/* ==========================
   30. ACTIVITY DOT COLOR MAP
   ========================== */
.activity-dot.design {
  background: rgba(108, 99, 255, 0.2);
  color: var(--accent-1);
}
.activity-dot.ship {
  background: rgba(0, 212, 170, 0.2);
  color: var(--accent-2);
}
.activity-dot.production {
  background: rgba(255, 201, 71, 0.2);
  color: var(--accent-4);
}
.activity-dot.inventory {
  background: rgba(255, 77, 109, 0.2);
  color: var(--danger);
}
.activity-dot.order {
  background: rgba(78, 168, 222, 0.2);
  color: var(--accent-blue);
}

/* New Order Form Styles */
.comprehensive-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-section-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}
.form-section-box.border-accent {
  border-left: 4px solid var(--accent-1);
}
.form-section-box.border-accent-2 {
  border-left: 4px solid var(--accent-2);
}
.form-section-box.fin-box {
  background: #fdfdfd;
  border: 1px solid #dcdce6;
}
.form-section-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.radio-group-boxes {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.radio-box {
  cursor: pointer;
}
.radio-box input {
  display: none;
}
.radio-box span {
  display: block;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}
.radio-box input:checked + span {
  background: var(--accent-1-light);
  border-color: var(--accent-1);
  color: var(--accent-1);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.2);
}

.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-picker-wrap input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.size-qty-container {
  overflow-x: auto;
}
.size-qty-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}
.size-qty-table th {
  font-size: 11px;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.size-qty-table td {
  padding: 8px;
  border: 1px solid var(--border);
}
.size-qty-input {
  width: 100%;
  text-align: center;
  min-width: 40px;
}
.total-col {
  background: rgba(108, 99, 255, 0.05);
}
.qty-total-display {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-1);
  font-family: var(--font-heading);
}

.roster-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  background: var(--bg-card);
}
.roster-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.roster-table th {
  font-size: 11px;
  padding: 8px;
  color: var(--text-secondary);
}
.roster-table td {
  padding: 4px 8px;
  border-bottom: 1px dashed var(--border);
}
.roster-table tr:last-child td {
  border-bottom: none;
}

.fin-card-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.fin-card {
  padding: 16px;
  border-radius: 8px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.fc-label {
  font-size: 12px;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 4px;
}
.fc-val {
  font-size: 24px;
  font-weight: 800;
  font-family: var(--font-heading);
}
.fin-violet {
  background: linear-gradient(135deg, #6c63ff, #8b85ff);
}
.fin-teal {
  background: linear-gradient(135deg, #00d4aa, #2de3be);
}
.fin-amber {
  background: linear-gradient(135deg, #ffc947, #ffd670);
}
.fin-red {
  background: linear-gradient(135deg, #ff6b6b, #ff8787);
}

.wallet-badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  border-left-width: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 200px;
}
.wallet-badge strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text-main);
  margin-top: 4px;
  text-transform: none;
  letter-spacing: normal;
}
.badge-total {
  border-left-color: var(--accent-1);
}
.badge-advance {
  border-left-color: var(--success);
}
.badge-due {
  border-left-color: var(--danger);
}

/* Print Header Styles */
.print-header { display: none; margin-bottom: 30px; border-bottom: 2px solid #000; padding-bottom: 10px; }
.ph-logo { font-size: 24px; font-weight: 800; }
.ph-title { font-size: 18px; font-weight: 600; margin-top: 4px; }
.ph-meta { font-size: 12px; color: #555; margin-top: 4px; }
@media print { .print-header { display: block; } .no-print, .sidebar, .top-header, .form-actions, .metrics-grid .metric-card { display: none !important; } .main-content { margin-left: 0; padding: 20px; background: white; color: black; } body { background: white; } .card, .table-card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; } table { font-size: 10px !important; } }

/* Globals */
.global-user-name { margin-bottom: 4px; }
.role-switcher-select {
  font-family: 'Inter', sans-serif;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 11px;
  width: 100px;
  cursor: pointer;
  outline: none;
}
.role-option { color: #000; }

.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 1500;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.mobile-overlay.active {
  display: block;
  opacity: 1;
}

/* =============================================================
   31. RESPONSIVE MOBILE STYLES (Phase 13)
   ============================================================= */
@media (max-width: 1024px) {
  :root { --sidebar-width: 200px; --space-lg: 16px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; --space-lg: 12px; }
  
  .sidebar {
    width: 280px;
    position: fixed;
    left: -280px;
    height: 100vh;
    z-index: 2000;
    transition: left 0.3s ease;
  }
  .sidebar.mobile-open {
    left: 0;
    box-shadow: 10px 0 50px rgba(0,0,0,0.5);
  }
  
  .main-content { margin-left: 0 !important; }
  .mobile-menu-btn { display: flex !important; }
  .sidebar-toggle { display: none !important; }
  
  .top-bar { padding: 0 var(--space-md); }
  .breadcrumb span { display: none; }
  
  .metrics-grid { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .fin-card-row { grid-template-columns: 1fr; }
  
  /* Tables: Horizontal Scroll */
  .table-wrapper, .view-container table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  /* Forms */
  .form-row, .grid-3 { grid-template-columns: 1fr !important; }
  .modal-box { width: 95% !important; max-height: 90vh; }
  
  .topbar-right .topbar-action-btn span { display: none; }
  .topbar-right .topbar-action-btn { padding: 10px; border-radius: 50%; width: 40px; height: 40px; justify-content: center; }
  .search-bar { width: 40px; border: none; background: none; }
  .search-bar input { display: none; }
}

@media (max-width: 480px) {
  .metric-card { padding: var(--space-md); }
  .metric-value { font-size: 20px; }
  .section-title { font-size: 18px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .btn:not(.btn-icon):not(.btn-sm) { width: 100%; justify-content: center; }
  .wallet-badge { min-width: 100%; }
}

/* =============================================================
   32. LOGIN PAGE STYLES (Phase 14)
   ============================================================= */
.login-page {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(108,99,255,0.05), transparent),
              radial-gradient(circle at bottom left, rgba(0,212,170,0.05), transparent),
              var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}
.login-card {
  background: var(--bg-card);
  width: 100%;
  max-width: 400px;
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 40px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  text-align: center;
  transition: all 0.4s var(--ease);
}
.login-header h1 { font-size: 24px; margin-bottom: 8px; color: var(--text-main); }
.login-header p { font-size: 14px; color: var(--text-muted); margin-bottom: 30px; }
.login-logo {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  font-size: 24px; color: #fff;
}
.login-form { text-align: left; }
.login-error {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,107,107,0.1);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,107,107,0.2);
}
.login-btn {
  padding: 14px; font-weight: 700; font-size: 16px;
  margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}

.logout-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #8b8fa8;
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: auto;
}
.logout-btn:hover {
  background: rgba(255,107,107,0.15);
  color: #ff6b6b;
  border-color: rgba(255,107,107,0.3);
}
.user-role {
  display: block;
  font-size: 11px;
  color: #8b8fa8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* =============================================================
   33. INLINE STYLE REPLACEMENTS (Phase 15)
   ============================================================= */
.nav-icon-notifications { color: var(--accent-4); }
.nav-badge-danger { background: var(--danger) !important; }
.nav-icon-tasks { color: var(--accent-2); }
.nav-item-help { color: var(--accent-2) !important; }

.btn-gradient-zahra {
  background: linear-gradient(135deg, #6c63ff, #00d4aa) !important;
}
.btn-help-guide {
  margin-left: 8px;
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent-2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}
.cursor-pointer {
  cursor: pointer !important;
}

/* =============================================================
   IMPROVEMENTS — Validation, UX, Architecture Enhancements
   ============================================================= */

/* --- Form Validation States --- */
.form-control.input-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.15);
  animation: shake 0.3s ease;
}

.field-error {
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.field-error::before {
  content: '\f071';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 10px;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-4px); }
  60%       { transform: translateX(4px); }
}

/* --- Sync Status Indicator --- */
.sync-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.sync-indicator.synced   { color: var(--success); border-color: rgba(46,196,182,0.3); }
.sync-indicator.syncing  { color: var(--warning); border-color: rgba(255,183,3,0.3); }
.sync-indicator.offline  { color: var(--danger);  border-color: rgba(255,77,109,0.3); }

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sync-indicator.syncing .sync-dot {
  animation: pulse-dot 1s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* --- Audit Log Badge --- */
.audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.audit-create { background: rgba(46,196,182,0.12); color: var(--success); }
.audit-update { background: rgba(108,99,255,0.12); color: var(--accent-1); }
.audit-delete { background: rgba(255,77,109,0.12); color: var(--danger); }

/* --- Empty State Improvements --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
  text-align: center;
  gap: var(--space-md);
}

.empty-state i {
  font-size: 48px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 13px;
  max-width: 300px;
  line-height: 1.6;
}

/* --- Loading Skeleton --- */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-card) 25%,
    var(--bg-card-hover) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Confirmation Dialog --- */
.confirm-dialog {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}

.confirm-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.confirm-box .confirm-icon {
  font-size: 40px;
  margin-bottom: var(--space-md);
}

.confirm-box h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: var(--space-sm);
}

.confirm-box p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.confirm-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

/* --- Toast Improvements --- */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  border: 1px solid transparent;
  animation: slideInRight 0.25s var(--ease);
  max-width: 360px;
  backdrop-filter: blur(12px);
}

.toast.success {
  background: rgba(46,196,182,0.15);
  border-color: rgba(46,196,182,0.3);
  color: var(--success);
}

.toast.error {
  background: rgba(255,77,109,0.15);
  border-color: rgba(255,77,109,0.3);
  color: var(--danger);
}

.toast.info {
  background: rgba(108,99,255,0.15);
  border-color: rgba(108,99,255,0.3);
  color: var(--accent-1);
}

.toast.warning {
  background: rgba(255,183,3,0.15);
  border-color: rgba(255,183,3,0.3);
  color: var(--warning);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* --- Improved Table Styles --- */
.table-wrapper table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-surface);
}

.table-wrapper {
  max-height: 70vh;
  overflow-y: auto;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
}

.page-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.page-btn:hover,
.page-btn.active {
  background: var(--accent-1);
  border-color: var(--accent-1);
  color: white;
}

.page-info {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Improved Modal --- */
.modal-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  animation: modalSlideUp 0.25s var(--ease);
}

@keyframes modalSlideUp {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);    opacity: 1; }
}

/* --- Improved Form Sections --- */
.form-section-box {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  transition: border-color var(--transition);
}

.form-section-box:focus-within {
  border-color: var(--border-accent);
}

.form-section-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Improved Metric Cards --- */
.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.04;
  pointer-events: none;
}

/* --- Status Badge Improvements --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* --- Improved Sidebar Active State --- */
.nav-item.active {
  position: relative;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent-1);
  border-radius: 0 3px 3px 0;
}

/* --- Keyboard Shortcut Hints --- */
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  font-size: 10px;
  font-family: monospace;
  color: var(--text-muted);
  font-weight: 700;
}

/* --- Improved Search Results --- */
#search-results-overlay {
  border: 1px solid var(--border-accent);
  box-shadow: var(--shadow-accent);
}

.search-res-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.search-res-item:hover {
  background: rgba(108,99,255,0.1);
}

.search-res-header {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 6px 10px 2px;
}

.search-res-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-primary);
}

.search-res-subtitle {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 1px;
}

.search-res-item.search-res-focused {
  background: rgba(108,99,255,0.18);
  outline: 2px solid var(--accent-1);
  outline-offset: -2px;
}

.search-res-empty {
  text-align: center;
  padding: 16px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

/* Highlight matching text in search results */
.search-res-item mark {
  background: rgba(108,99,255,0.35);
  color: var(--text-primary);
  border-radius: 2px;
  padding: 0 1px;
}

/* --- Offline Banner --- */
.offline-banner {
  position: fixed;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,183,3,0.15);
  border: 1px solid rgba(255,183,3,0.4);
  color: var(--warning);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9000;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

/* --- Improved Warning Banner --- */
.warning-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255,183,3,0.08);
  border: 1px solid rgba(255,183,3,0.25);
  border-radius: var(--radius-md);
  color: var(--warning);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

/* --- Improved Kanban Cards --- */
.kanban-card {
  transition: transform var(--transition), box-shadow var(--transition);
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kanban-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg) scale(1.02);
}

/* --- Print Styles --- */
@media print {
  .sidebar, .top-bar, .toast-container, .modal-overlay,
  .btn, #zahraTopBtn, #newOrderBtn { display: none !important; }
  .main-content { margin: 0 !important; }
  .view-container { padding: 0 !important; }
  body { background: white !important; color: black !important; }
}

/* ==========================
   ACCESSIBILITY (Task 7.10)
   Requirements: 34.1–34.6
   ========================== */

/* Skip navigation link — visually hidden until focused */
.skip-nav {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 10000;
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-1);
  color: var(--text-on-accent);
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 0.2s var(--ease);
  white-space: nowrap;
}
.skip-nav:focus {
  top: var(--space-md);
  outline: 2px solid var(--text-on-accent);
  outline-offset: 2px;
}

/* Enhanced focus indicators for keyboard navigation (Req 34.5) */
:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.25);
}
/* Suppress outline for mouse/pointer users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Ensure nav items show focus ring */
.nav-item:focus-visible,
.btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.25);
}

/* Light theme focus ring uses same accent (contrast maintained) */
body.light-theme :focus-visible,
body.light-theme .nav-item:focus-visible,
body.light-theme .btn:focus-visible,
body.light-theme button:focus-visible,
body.light-theme a:focus-visible {
  outline-color: var(--accent-1);
  box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.2);
}

/* Support browser zoom up to 200% — use relative units (Req 34.4) */
html {
  /* font-size already set to 15px; rem-based layout scales with zoom */
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

/* Ensure layout doesn't break at 200% zoom */
@media (max-width: 600px), (min-resolution: 2dppx) {
  .top-bar {
    flex-wrap: wrap;
    height: auto;
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-sm);
  }
  .search-bar {
    width: 100% !important;
    max-width: 100%;
  }
  .search-bar input {
    width: 100%;
  }
}

/* Visually hidden utility — accessible to screen readers (Req 34.2) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Export Dropdown (exportUI.js)
   ============================================================ */
.export-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.export-dropdown__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.export-dropdown__chevron {
  font-size: 11px;
  transition: transform 0.15s ease;
}

.export-dropdown__toggle[aria-expanded="true"] .export-dropdown__chevron {
  transform: rotate(180deg);
}

.export-dropdown__menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 200;
  min-width: 140px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.export-dropdown__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}

.export-dropdown__item:hover,
.export-dropdown__item:focus {
  background: var(--hover);
  outline: none;
}

.export-dropdown__progress {
  font-size: 13px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   Notification Dropdown (Task 8.34)
   ============================================================ */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-height: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(108, 99, 255, 0.08);
  z-index: 500;
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  overflow: hidden;
}
.notif-dropdown--open {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.notif-dropdown__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(108, 99, 255, 0.04);
}
.notif-dropdown__header-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}
.notif-dropdown__header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.notif-dropdown__action {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.notif-dropdown__action:hover {
  background: rgba(108, 99, 255, 0.12);
  color: var(--accent-1);
}

.notif-dropdown__count {
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  margin-left: 6px;
}

.notif-dropdown__list {
  max-height: 420px;
  overflow-y: auto;
}

.notif-dropdown__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}
.notif-dropdown__item:hover {
  background: rgba(255, 255, 255, 0.03);
}
.notif-dropdown__item:last-child {
  border-bottom: none;
}
.notif-dropdown__item--read {
  opacity: 0.55;
}
.notif-dropdown__item--read:hover {
  opacity: 0.8;
}

.notif-dropdown__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.notif-dropdown__content {
  flex: 1;
  min-width: 0;
}
.notif-dropdown__title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--text-primary);
}
.notif-dropdown__message {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-dropdown__time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
}

.notif-dropdown__mark-read {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
  transition: background var(--transition), color var(--transition);
}
.notif-dropdown__mark-read:hover {
  background: rgba(46, 196, 182, 0.15);
  color: var(--success);
}

.notif-dropdown__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

/* Make notification bell parent relative for dropdown positioning */
.notification-btn {
  position: relative;
}

/* Notification dot enhanced */
.notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid var(--bg-body);
  font-size: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  padding: 0;
  line-height: 1;
  animation: notif-pulse 2s infinite;
}
.notif-dot:not(:empty) {
  min-width: 16px;
  height: 16px;
  font-size: 9px;
  top: -2px;
  right: -4px;
  padding: 0 3px;
}
@keyframes notif-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(255, 77, 109, 0); }
}

/* ============================================================
   Import Button & File Upload UI (Task 8.26)
   ============================================================ */
.import-upload-wrapper {
  position: relative;
  display: inline-flex;
}
.import-upload-wrapper input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Import Preview Table Styles (overlay on existing) */
.import-preview {
  max-width: 100%;
}
.import-preview__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(108, 99, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.import-preview__stat {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}
.import-preview__stat--valid {
  color: var(--success);
  border-color: rgba(46, 196, 182, 0.3);
}
.import-preview__stat--error {
  color: var(--danger);
  border-color: rgba(255, 77, 109, 0.3);
}
.import-preview__stat--duplicate {
  color: var(--accent-4);
  border-color: rgba(255, 201, 71, 0.3);
}

.import-preview__table-wrapper {
  max-height: 400px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
}
.import-preview__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.import-preview__table th {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  padding: 8px 12px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
.import-preview__table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.import-preview__row--error {
  background: rgba(255, 77, 109, 0.06);
}
.import-preview__row--duplicate {
  background: rgba(255, 201, 71, 0.06);
}
.import-preview__row-num {
  width: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 10px;
}
.import-preview__badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.import-preview__badge--error {
  background: rgba(255, 77, 109, 0.15);
  color: var(--danger);
}
.import-preview__badge--duplicate {
  background: rgba(255, 201, 71, 0.15);
  color: var(--accent-4);
}
.import-preview__errors {
  font-size: 10px;
  color: var(--danger);
  line-height: 1.5;
  margin-top: 4px;
}
.import-preview__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.import-preview__empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Light theme overrides for notification dropdown */
body.light-theme .notif-dropdown {
  box-shadow: 0 16px 48px rgba(100, 100, 160, 0.2),
              0 0 0 1px rgba(108, 99, 255, 0.1);
}
body.light-theme .notif-dropdown__item:hover {
  background: rgba(0, 0, 0, 0.03);
}
