/* ============================================
   VakeelPro Design System - Mockup Styles
   ============================================ */

/* CSS Variables - Color Palette */
:root {
  /* Primary Color Shades (Navy Blue) */
  --primary-50: #E8EDF2;
  --primary-100: #C5D3E0;
  --primary-200: #9FB5CC;
  --primary-300: #7997B8;
  --primary-400: #5379A4;
  --primary-500: #2D5B90;
  --primary-600: #1E4A7C;
  --primary-700: #103968;
  --primary-800: #052854;
  --primary-900: #031D3A;

  /* Accent Colors (Gold) */
  --accent-gold: #D4A84B;
  --accent-gold-light: #F5E6C8;
  --accent-gold-dark: #B8923F;

  /* Status Colors */
  --success: #22C55E;
  --success-light: #DCFCE7;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --error: #EF4444;
  --error-light: #FEE2E2;
  --info: #3B82F6;
  --info-light: #DBEAFE;

  /* Neutral Colors */
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-card-hover: 0 12px 24px rgba(3, 29, 58, 0.15);

  /* Animation Timing */
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;

  /* Spacing */
  --sidebar-width-expanded: 260px;
  --sidebar-width-collapsed: 80px;
  --header-height: 64px;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
}

/* ============================================
   Layout
   ============================================ */

.app-container {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width-expanded);
  transition: margin-left var(--duration-normal) var(--ease-smooth);
}

.main-content.sidebar-collapsed {
  margin-left: var(--sidebar-width-collapsed);
}

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

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width-expanded);
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width var(--duration-normal) var(--ease-smooth);
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-width-collapsed);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary-900), var(--primary-700));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-900);
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--duration-fast);
}

.sidebar.collapsed .sidebar-brand {
  opacity: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

/* Menu Groups */
.menu-group {
  margin-bottom: 8px;
}

.menu-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-400);
  padding: 12px 12px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-group-label svg {
  width: 14px;
  height: 14px;
}

.sidebar.collapsed .menu-group-label span {
  display: none;
}

.menu-group-divider {
  height: 1px;
  background: var(--gray-100);
  margin: 8px 12px;
}

/* Nav Items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--gray-600);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--duration-fast) var(--ease-smooth);
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--primary-50);
  color: var(--primary-900);
  transform: translateX(4px);
}

.nav-item.active {
  background: var(--primary-900);
  color: var(--white);
}

.nav-item.active:hover {
  background: var(--primary-800);
  transform: none;
}

.nav-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item-label {
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--duration-fast);
}

.sidebar.collapsed .nav-item-label {
  opacity: 0;
}

/* Drafting - Main Feature Highlight */
.nav-item.highlight {
  background: var(--accent-gold-light);
  border-left: 3px solid var(--accent-gold);
  color: var(--primary-900);
}

.nav-item.highlight:hover {
  background: var(--accent-gold-light);
  border-left-color: var(--accent-gold-dark);
}

.nav-item.highlight .feature-badge {
  background: var(--accent-gold);
  color: var(--white);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
  font-weight: 600;
}

/* Role Badge in Sidebar Menu Group Label */
.menu-group-label .role-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.menu-group-label .org-admin-badge {
  background: rgba(212, 168, 75, 0.2);
  color: var(--accent-gold);
  border: 1px solid rgba(212, 168, 75, 0.3);
}

/* SuperAdmin Portal Link Styling */
.nav-item.admin-portal-item {
  background: rgba(0, 0, 0, 0.15);
  border-left: 2px solid var(--accent-gold);
  margin: 4px 8px;
  border-radius: 6px;
  padding-left: 10px;
}

.nav-item.admin-portal-item:hover {
  background: rgba(0, 0, 0, 0.25);
}

.nav-item .super-admin-badge {
  font-size: 8px;
  padding: 2px 5px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, rgba(212, 168, 75, 0.3), rgba(212, 168, 75, 0.15));
  color: var(--accent-gold);
  border: 1px solid rgba(212, 168, 75, 0.4);
  margin-left: auto;
  white-space: nowrap;
}

/* Collapsible Settings Group */
.settings-group {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--duration-normal) var(--ease-smooth);
}

.settings-group.expanded {
  max-height: 300px;
}

.settings-toggle {
  cursor: pointer;
}

.settings-toggle .chevron {
  transition: transform var(--duration-fast);
  margin-left: auto;
}

.settings-toggle.expanded .chevron {
  transform: rotate(180deg);
}

/* ============================================
   Header
   ============================================ */

.header {
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.notification-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: var(--gray-50);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
}

.notification-btn:hover {
  background: var(--gray-100);
  transform: scale(1.05);
}

.notification-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--error);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 6px;
  border-radius: 24px;
  background: var(--gray-50);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.user-profile:hover {
  background: var(--gray-100);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-900));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 600;
  font-size: 14px;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
}

/* ============================================
   Page Header with Guidance
   ============================================ */

.page-header {
  padding: 24px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
  animation: slideDown var(--duration-normal) var(--ease-smooth);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header-content {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.page-title-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-900);
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--gray-500);
  margin-top: 4px;
}

.help-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast);
  color: var(--gray-500);
  font-size: 14px;
  font-weight: 600;
}

.help-icon:hover {
  background: var(--primary-100);
  color: var(--primary-900);
  transform: scale(1.1);
}

.page-actions {
  display: flex;
  gap: 12px;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary-900);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-800);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.btn-gold {
  background: var(--accent-gold);
  color: var(--white);
}

.btn-gold:hover {
  background: var(--accent-gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 168, 75, 0.3);
}

.btn-danger {
  background: var(--error);
  color: var(--white);
}

.btn-danger:hover {
  background: #DC2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Button Loading State */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin-left: -9px;
  margin-top: -9px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btn-spin 0.8s linear infinite;
}

.btn-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Loading spinner colors based on button type */
.btn-primary.btn-loading::after {
  border-top-color: var(--white);
}

.btn-secondary.btn-loading::after {
  border-top-color: var(--gray-600);
}

.btn-gold.btn-loading::after {
  border-top-color: var(--primary-900);
}

.btn-danger.btn-loading::after {
  border-top-color: var(--white);
}

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

/* Button Disabled State */
.btn-disabled,
.btn:disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--gray-300) !important;
  color: var(--gray-500) !important;
  border-color: var(--gray-300) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ============================================
   Cards
   ============================================ */

.page-content {
  padding: 24px 32px;
}

.card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-smooth);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--gray-300);
}

.card-gradient-border {
  height: 3px;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-900));
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}

.card-description {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 4px;
}

.card-content {
  padding: 24px;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--gray-200);
  transition: all var(--duration-normal) var(--ease-smooth);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-card-icon.primary {
  background: var(--primary-50);
  color: var(--primary-600);
}

.stat-card-icon.gold {
  background: var(--accent-gold-light);
  color: var(--accent-gold-dark);
}

.stat-card-icon.success {
  background: var(--success-light);
  color: var(--success);
}

.stat-card-icon.info {
  background: var(--info-light);
  color: var(--info);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
}

.stat-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
}

.stat-change {
  font-size: 12px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.positive {
  color: var(--success);
}

.stat-change.negative {
  color: var(--error);
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  text-align: center;
  padding: 60px 40px;
  animation: fadeInUp var(--duration-slow) var(--ease-smooth);
}

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

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary-50);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  color: var(--primary-400);
}

.empty-state-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.empty-state-description {
  font-size: 15px;
  color: var(--gray-500);
  max-width: 400px;
  margin: 0 auto 24px;
}

.empty-state-tips {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 16px 24px;
  max-width: 400px;
  margin: 24px auto 0;
  text-align: left;
}

.empty-state-tips-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.empty-state-tips-list {
  list-style: none;
}

.empty-state-tips-list li {
  font-size: 13px;
  color: var(--gray-600);
  padding: 4px 0;
  padding-left: 20px;
  position: relative;
}

.empty-state-tips-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--primary-400);
}

/* ============================================
   Help Drawer
   ============================================ */

.help-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal);
  z-index: 200;
}

.help-drawer-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.help-drawer {
  position: fixed;
  right: -400px;
  top: 0;
  bottom: 0;
  width: 400px;
  background: var(--white);
  box-shadow: var(--shadow-xl);
  z-index: 201;
  transition: right var(--duration-normal) var(--ease-smooth);
  display: flex;
  flex-direction: column;
}

.help-drawer.visible {
  right: 0;
}

.help-drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.help-drawer-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
}

.help-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--gray-100);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
}

.help-drawer-close:hover {
  background: var(--gray-200);
}

.help-drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.help-section {
  margin-bottom: 24px;
}

.help-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-section-content {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.6;
}

.help-steps {
  list-style: none;
  counter-reset: step;
}

.help-steps li {
  counter-increment: step;
  padding: 8px 0 8px 32px;
  position: relative;
  font-size: 14px;
  color: var(--gray-600);
}

.help-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-50);
  color: var(--primary-700);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   Guided Tour
   ============================================ */

.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-normal);
}

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

.tour-spotlight {
  position: absolute;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  animation: spotlightPulse 2s infinite;
}

@keyframes spotlightPulse {
  0%, 100% {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(212, 168, 75, 0.4);
  }
  50% {
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5), 0 0 0 8px rgba(212, 168, 75, 0.2);
  }
}

.tour-tooltip {
  position: absolute;
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  width: 320px;
  box-shadow: var(--shadow-xl);
  animation: tooltipEnter var(--duration-normal) var(--ease-smooth);
}

@keyframes tooltipEnter {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tour-tooltip-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--white);
  transform: rotate(45deg);
}

.tour-step-indicator {
  font-size: 12px;
  color: var(--gray-400);
  margin-bottom: 8px;
}

.tour-tooltip-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.tour-tooltip-content {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 16px;
}

.tour-tooltip-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.tour-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.tour-btn-skip {
  background: transparent;
  border: none;
  color: var(--gray-500);
}

.tour-btn-skip:hover {
  color: var(--gray-700);
}

.tour-btn-next {
  background: var(--primary-900);
  color: var(--white);
  border: none;
}

.tour-btn-next:hover {
  background: var(--primary-800);
}

/* ============================================
   Loading Skeleton
   ============================================ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-100) 25%,
    var(--gray-200) 50%,
    var(--gray-100) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
}

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

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-title {
  height: 24px;
  width: 40%;
  margin-bottom: 12px;
}

.skeleton-card {
  height: 120px;
  border-radius: 12px;
}

/* ============================================
   Form Elements
   ============================================ */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  transition: all var(--duration-fast);
  background: var(--white);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(3, 29, 58, 0.1);
}

.form-input::placeholder {
  color: var(--gray-400);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* ============================================
   Form Input with Icon
   ============================================ */

.form-input-icon {
  position: relative;
}

.form-input-icon .form-input {
  padding-left: 44px;
}

.form-input-icon .form-input.has-toggle {
  padding-right: 44px;
}

.form-input-icon > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--gray-400);
  pointer-events: none;
}

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
  z-index: 1;
}

.password-toggle:hover {
  color: var(--gray-600);
}

/* ============================================
   Form Validation States
   ============================================ */

/* Error State */
.form-group.error .form-input,
.form-group.error .form-select {
  border-color: var(--error);
  background-color: rgba(239, 68, 68, 0.02);
}

.form-group.error .form-input:focus,
.form-group.error .form-select:focus {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-group.error .form-label {
  color: var(--error);
}

.form-error-message {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--error);
  animation: errorShake 0.3s ease-out;
}

.form-error-message svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

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

/* Success State */
.form-group.success .form-input,
.form-group.success .form-select {
  border-color: var(--success);
  background-color: rgba(34, 197, 94, 0.02);
  padding-right: 44px;
}

.form-group.success .form-input:focus,
.form-group.success .form-select:focus {
  border-color: var(--success);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.form-group.success .form-label {
  color: var(--success);
}

/* Success checkmark icon - positioned inside input */
.form-group.success .form-input-wrapper {
  position: relative;
}

.form-group.success .form-input-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-color: var(--success);
  border-radius: 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4L19 7'%3E%3C/path%3E%3C/svg%3E");
  background-size: 12px;
  background-repeat: no-repeat;
  background-position: center;
  animation: successPop 0.3s var(--ease-bounce);
}

@keyframes successPop {
  0% { transform: translateY(-50%) scale(0); opacity: 0; }
  60% { transform: translateY(-50%) scale(1.2); }
  100% { transform: translateY(-50%) scale(1); opacity: 1; }
}

.form-success-message {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--success);
}

.form-success-message svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Loading State */
.form-group.loading .form-input,
.form-group.loading .form-select {
  border-color: var(--info);
  background-color: rgba(59, 130, 246, 0.02);
  padding-right: 44px;
}

.form-group.loading .form-input-wrapper {
  position: relative;
}

.form-group.loading .form-input-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  margin-top: -10px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--info);
  border-radius: 50%;
  animation: formSpin 0.8s linear infinite;
}

@keyframes formSpin {
  to { transform: rotate(360deg); }
}

.form-loading-message {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--info);
}

/* Form hint (neutral helper text) */
.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--gray-500);
}

/* Input group wrapper for icon + input combinations */
.form-input-wrapper {
  position: relative;
}

.form-input-wrapper .form-input {
  width: 100%;
}

/* ============================================
   Overflow Prevention Utilities
   ============================================ */

/* Single-line text overflow with ellipsis */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Multi-line text overflow (2 lines) */
.text-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Multi-line text overflow (3 lines) */
.text-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Prevent text from breaking layout */
.text-nowrap {
  white-space: nowrap;
}

/* Force text to break words if needed */
.text-break {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Global text overflow defaults for common elements */
.card-title,
.stat-label,
.nav-item-label,
.upcoming-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Allow multi-line for descriptions */
.card-description,
.page-subtitle,
.empty-state-description {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* ============================================
   Table
   ============================================ */

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

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

thead {
  background: var(--gray-50);
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-200);
}

td {
  padding: 16px;
  font-size: 14px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Allow wrapping in specific table columns */
td.wrap {
  white-space: normal;
  word-wrap: break-word;
}

tbody tr {
  transition: background var(--duration-fast);
}

tbody tr:hover {
  background: var(--gray-50);
}

/* Status Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-error {
  background: var(--error-light);
  color: var(--error);
}

.badge-info {
  background: var(--info-light);
  color: var(--info);
}

/* ============================================
   Drafting Feature - Wizard Steps
   ============================================ */

.wizard-container {
  max-width: 800px;
  margin: 0 auto;
}

.wizard-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
  position: relative;
}

.wizard-progress::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 40px;
  right: 40px;
  height: 2px;
  background: var(--gray-200);
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.wizard-step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--gray-400);
  margin-bottom: 8px;
  transition: all var(--duration-normal);
}

.wizard-step.active .wizard-step-number {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: var(--white);
  transform: scale(1.1);
}

.wizard-step.completed .wizard-step-number {
  background: var(--success);
  border-color: var(--success);
  color: var(--white);
}

.wizard-step-label {
  font-size: 13px;
  color: var(--gray-500);
  transition: color var(--duration-fast);
}

.wizard-step.active .wizard-step-label {
  color: var(--primary-900);
  font-weight: 500;
}

.wizard-content {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  padding: 32px;
  min-height: 300px;
}

.wizard-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}

/* ============================================
   Animations - Utility Classes
   ============================================ */

.fade-in {
  animation: fadeIn var(--duration-normal) var(--ease-smooth);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-in-right {
  animation: slideInRight var(--duration-normal) var(--ease-smooth);
}

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

.slide-in-up {
  animation: slideInUp var(--duration-normal) var(--ease-smooth);
}

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

.scale-in {
  animation: scaleIn var(--duration-normal) var(--ease-bounce);
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Stagger Animation Delays */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
.stagger-6 { animation-delay: 300ms; }

/* ============================================
   Responsive
   ============================================ */

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

/* ============================================
   Mobile Navigation - Styles for screens <= 768px
   ============================================ */

/* Mobile Header Bar */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  z-index: 90;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu-btn,
.mobile-notification-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: transparent;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-700);
  transition: all var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn:hover,
.mobile-notification-btn:hover {
  background: var(--gray-100);
}

.mobile-menu-btn:active,
.mobile-notification-btn:active {
  background: var(--gray-200);
  transform: scale(0.95);
}

.mobile-header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-900), var(--primary-700));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
}

.mobile-brand-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-900);
}

.mobile-notification-btn {
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: var(--error);
  border-radius: 50%;
  border: 2px solid var(--white);
}

/* Sidebar Overlay (Backdrop) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal), visibility var(--duration-normal);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

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

/* Sidebar Close Button */
.sidebar-close-btn {
  display: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border: none;
  background: var(--gray-100);
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-600);
  margin-left: auto;
  transition: all var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}

.sidebar-close-btn:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

.sidebar-close-btn:active {
  transform: scale(0.95);
}

/* Bottom Navigation Bar */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  z-index: 90;
  padding: 8px 8px env(safe-area-inset-bottom, 8px);
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  min-width: 64px;
  min-height: 48px;
  border: none;
  background: transparent;
  border-radius: 12px;
  color: var(--gray-500);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast);
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.bottom-nav-item:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.bottom-nav-item:active {
  background: var(--gray-200);
  transform: scale(0.95);
}

.bottom-nav-item.active {
  color: var(--primary-900);
  background: var(--primary-50);
}

.bottom-nav-item.highlight {
  color: var(--accent-gold-dark);
  background: var(--accent-gold-light);
}

.bottom-nav-item.highlight.active {
  background: var(--accent-gold);
  color: var(--white);
}

/* Mobile Breakpoint - 768px and below */
@media (max-width: 768px) {
  /* Show mobile elements */
  .mobile-header {
    display: flex;
  }

  .sidebar-overlay {
    display: block;
  }

  .sidebar-close-btn {
    display: flex;
  }

  .bottom-nav {
    display: flex;
  }

  /* Sidebar transforms to slide-out drawer */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
    width: 280px;
    max-width: 85vw;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Main content adjustments */
  .main-content {
    margin-left: 0;
    padding-top: 56px; /* Mobile header height */
    padding-bottom: 72px; /* Bottom nav height + safe area */
  }

  /* Prevent body scroll when sidebar is open */
  body.sidebar-open {
    overflow: hidden;
  }

  /* Touch-friendly nav items */
  .nav-item {
    padding: 14px 16px;
    min-height: 48px;
    margin-bottom: 4px;
  }

  .menu-group-label {
    padding: 14px 16px 10px;
    min-height: 44px;
  }

  /* Stats grid single column */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  /* Page header adjustments */
  .page-header {
    padding: 16px;
  }

  .page-header-content {
    flex-direction: column;
    gap: 16px;
  }

  .page-title {
    font-size: 24px;
  }

  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .page-actions .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  /* Page content padding */
  .page-content {
    padding: 16px;
  }

  /* Card adjustments */
  .card-content {
    padding: 16px;
  }

  .card-header {
    padding: 16px;
  }

  /* Wizard adjustments */
  .wizard-progress {
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .wizard-step-label {
    font-size: 11px;
  }

  .wizard-content {
    padding: 20px;
  }

  .wizard-actions {
    flex-direction: column;
    gap: 12px;
  }

  .wizard-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Form adjustments */
  .form-group {
    margin-bottom: 16px;
  }

  .form-input,
  .form-select {
    min-height: 48px;
    font-size: 16px; /* Prevents iOS zoom on focus */
  }

  /* Button touch targets */
  .btn {
    min-height: 48px;
    padding: 12px 20px;
  }

  /* Header adjustments */
  .header {
    display: none; /* Hide desktop header on mobile */
  }

  /* Help drawer adjustments */
  .help-drawer {
    width: 100%;
    max-width: 100%;
    right: -100%;
  }

  .help-drawer.visible {
    right: 0;
  }

  /* Table responsiveness */
  .table-container {
    margin: 0 -16px;
    padding: 0 16px;
  }

  td, th {
    padding: 12px;
  }
}

/* Extra small screens - 375px and below */
@media (max-width: 375px) {
  .mobile-brand-text {
    display: none;
  }

  .bottom-nav-item {
    min-width: 56px;
    padding: 8px 6px;
    font-size: 10px;
  }

  .bottom-nav-item svg {
    width: 20px;
    height: 20px;
  }

  .page-title {
    font-size: 20px;
  }

  .stat-value {
    font-size: 24px;
  }
}

/* ============================================
   Reduced Motion
   ============================================ */

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