/* Modern Professional UI Theme */
:root {
  --primary: #6366f1; /* Indigo */
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #06b6d4; /* Cyan */
  --secondary-dark: #0891b2;
  --accent: #f59e0b; /* Amber */
  --success: #10b981; /* Emerald */
  --warning: #f59e0b; /* Amber */
  --danger: #ef4444; /* Red */
  --info: #3b82f6; /* Blue */
  
  --bg: #fafbfc; /* Light background */
  --bg-2: #f8fafc; /* Slightly darker background */
  --bg-3: #f1f5f9; /* Card background */
  --card: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #1e293b; /* Dark text */
  --text-muted: #64748b; /* Muted text */
  --text-light: #94a3b8; /* Light text */
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  --gradient-secondary: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent) 0%, #f97316 100%);
}

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

html, body, #root { 
  height: 100%; 
  font-size: 14px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.app {
  display: flex;
  height: 100vh;
  background: var(--bg);
}

.sidebar {
  width: 280px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  z-index: 10;
}

.brand {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--gradient-primary);
  color: white;
}

.brand h1 {
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.5px;
  margin: 0;
}

.brand p {
  font-size: 12px;
  opacity: 0.9;
  margin: 4px 0 0 0;
  font-weight: 500;
}

.nav {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-weight: 500;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-2);
  color: var(--primary);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.05));
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

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

.nav-item .lock {
  color: var(--warning);
  font-size: 12px;
  margin-left: auto;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.header {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-left h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.header-left .subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 2px;
}

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

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--bg-2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-menu:hover {
  background: var(--bg-3);
}

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

.content {
  flex: 1;
  padding: 24px;
  background: var(--bg);
  overflow-y: auto;
}

.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 0;
}

.page-description {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0;
}
/* Cards and Components */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.card-description {
  color: var(--text-muted);
  font-size: 14px;
  margin: 4px 0 0 0;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.stat-card.secondary::before {
  background: var(--gradient-secondary);
}

.stat-card.accent::before {
  background: var(--gradient-accent);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin: 8px 0 0 0;
  line-height: 1;
}

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

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

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

/* Modern Table Styles */
.table-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.table-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-2);
}

.table-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.table-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 4px 0 0 0;
}

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

.modern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.modern-table thead th {
  background: var(--bg-2);
  color: var(--text);
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.modern-table tbody td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  font-size: 14px;
  vertical-align: middle;
}

.modern-table tbody tr {
  transition: all 0.2s ease;
}

.modern-table tbody tr:hover {
  background: var(--bg-2);
}

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

.serial-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  font-size: 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.status-badge.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.status-badge.danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.status-badge.info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
}

.amount-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.count-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.cell-strong {
  font-weight: 600;
  color: var(--text);
}

/* Enhanced Table Cell Styles */
.datetime-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.date-part {
  font-weight: 600;
  color: var(--text);
}

.time-part {
  font-size: 11px;
  color: var(--text-muted);
}

.bank-cell, .supplier-cell, .product-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cell-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.reference-cell {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.balance-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.amount-badge.positive {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.amount-badge.negative {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.product-code {
  font-family: monospace;
  font-size: 12px;
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

.brand-text, .model-text {
  color: var(--text-muted);
  font-size: 13px;
}

.date-cell {
  font-size: 12px;
  color: var(--text-muted);
}

/* WhatsApp Inventory Enhancements */
.toggle-section {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.toggle-pill {
  display: flex;
  background: var(--bg-2);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.toggle-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.toggle-btn:hover:not(.active) {
  background: var(--border-light);
  color: var(--text);
}

.mode-description {
  margin-top: 16px;
}

.info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-2);
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.info-icon {
  font-size: 24px;
}

.info-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.info-text {
  font-size: 13px;
  color: var(--text-muted);
}

.content-wrapper {
  margin-top: 20px;
}

.loading-card {
  background: var(--card);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  box-shadow: var(--shadow);
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
}

/* Enhanced Form Elements for Product Price */
.pricing-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 120px;
}

.supply-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;
}

.calculated-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  padding: 4px 8px;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 4px;
  text-align: center;
}

.input-group {
  display: flex;
  align-items: center;
}

.input-suffix {
  margin-left: 4px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.form-input-sm {
  padding: 6px 8px;
  font-size: 12px;
  height: auto;
}

.form-input.error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.05);
}

.error-text {
  font-size: 10px;
  color: var(--danger);
  margin-top: 2px;
}

.text-right {
  text-align: right;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}

.table-info {
  font-size: 14px;
  color: var(--text-muted);
}

.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pagination-btn {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.pagination-info {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 16px;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

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

.empty-description {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 24px;
}

.empty-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.empty-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Forms */
.form-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

.form-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.form-grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
  color: var(--text-light);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-error {
  color: var(--danger);
  font-size: 14px;
  margin-top: 4px;
}

.form-help {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

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

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

.btn-secondary {
  background: var(--gradient-secondary);
  color: white;
}

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

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

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

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-2);
  color: var(--text);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Authentication */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border-radius: 20px;
  padding: 40px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  background: var(--gradient-primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
}

.auth-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 0;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.auth-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-link:hover {
  text-decoration: underline;
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
}

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

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Loading */
.loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
  backdrop-filter: blur(4px);
}

.modal {
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-2);
  color: var(--text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: 60vh;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}

/* Utility Classes */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; }

.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 260px;
    position: fixed;
    left: -260px;
    z-index: 40;
    transition: left 0.3s ease;
  }
  
  .sidebar.open {
    left: 0;
  }
  
  .main {
    margin-left: 0;
  }
  
  .content {
    padding: 16px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
  
  .auth-card {
    padding: 24px;
  }
  
  .table-scroll {
    font-size: 13px;
  }
}

/* Legacy compatibility */
.row { display: flex; align-items: center; gap: 12px; }

input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  background: var(--gradient-primary);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

button.btn.secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.text-danger { color: var(--danger); }

.pretty-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.serial-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  font-size: 12px;
}

.pager {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pager-btn {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.empty-sub {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 24px;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
======================================== */

/* Mobile Layout Variables */
:root {
  --mobile-header-height: 56px;
  --mobile-sidebar-width: 320px;
  --mobile-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile App Container */
.mobile-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg);
}

/* ========================================
   MOBILE HEADER STYLES
======================================== */

.mobile-header {
  height: var(--mobile-header-height);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 100;
}

.mobile-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.mobile-menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all var(--mobile-transition);
  position: relative;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
}

.mobile-menu-toggle:hover {
  background: var(--bg-2);
}

.hamburger-line {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all var(--mobile-transition);
  transform-origin: center;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scale(0);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

.mobile-header-content {
  flex: 1;
  min-width: 0;
}

.mobile-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.mobile-user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.mobile-logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
  color: var(--text-muted);
  font-size: 16px;
}

.mobile-logout-btn:hover {
  background: var(--bg-2);
  color: var(--danger);
}

/* ========================================
   MOBILE NAV HEADER STYLES
======================================== */

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--gradient-primary);
  color: white;
  border-radius: 0 0 16px 16px;
  margin-bottom: 16px;
}

.mobile-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-brand-icon {
  font-size: 24px;
}

.mobile-brand-text {
  display: flex;
  flex-direction: column;
}

.mobile-brand-title {
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
}

.mobile-brand-subtitle {
  font-size: 12px;
  opacity: 0.9;
  font-weight: 500;
}

.mobile-nav-stats {
  display: flex;
  align-items: center;
}

.mobile-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  opacity: 0.9;
}

.mobile-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

.mobile-branch-count {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.mobile-branch-icon {
  font-size: 14px;
}

/* ========================================
   MOBILE SIDEBAR STYLES
======================================== */

.mobile-sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all var(--mobile-transition);
}

.mobile-sidebar-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--mobile-sidebar-width);
  height: 100%;
  background: var(--card);
  box-shadow: var(--shadow-xl);
  z-index: 300;
  transform: translateX(-100%);
  transition: transform var(--mobile-transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.mobile-sidebar-header {
  position: relative;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.mobile-sidebar-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  color: white;
  font-size: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10;
}

.mobile-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.mobile-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
}

.mobile-nav-section {
  margin-bottom: 24px;
}

.mobile-nav-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 12px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  position: relative;
  overflow: hidden;
}

.mobile-nav-item:hover {
  background: var(--bg-2);
  color: var(--primary);
  transform: translateX(4px);
}

.mobile-nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.05));
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.mobile-nav-item.locked {
  opacity: 0.6;
  cursor: not-allowed;
}

.mobile-nav-item.locked:hover {
  transform: none;
  color: var(--text-muted);
  background: transparent;
}

.mobile-nav-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-3);
  position: relative;
  flex-shrink: 0;
}

.mobile-nav-item.active .mobile-nav-item-icon {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.mobile-icon {
  font-size: 18px;
}

.mobile-nav-item.active .mobile-icon {
  filter: grayscale(1) brightness(0) invert(1);
}

.mobile-lock {
  position: absolute;
  top: -2px;
  right: -2px;
  font-size: 10px;
  background: var(--warning);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-nav-item-content {
  flex: 1;
  min-width: 0;
}

.mobile-nav-item-label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  margin-bottom: 2px;
}

.mobile-nav-item-desc {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.2;
}

.mobile-nav-item.active .mobile-nav-item-desc {
  color: var(--primary-light);
}

.mobile-nav-item-arrow {
  color: var(--text-light);
  font-size: 18px;
  font-weight: 300;
  transition: all 0.2s ease;
}

.mobile-nav-item:hover .mobile-nav-item-arrow {
  color: var(--primary);
  transform: translateX(2px);
}

.mobile-nav-footer {
  padding: 16px 4px;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.mobile-plan-info {
  text-align: center;
}

.mobile-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gradient-accent);
  color: white;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.mobile-plan-icon {
  font-size: 14px;
}

.mobile-branch-limit {
  color: var(--text-muted);
  font-size: 11px;
}

/* ========================================
   MOBILE MAIN CONTENT STYLES
======================================== */

.mobile-main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.mobile-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg);
}

/* ========================================
   RESPONSIVE UTILITIES
======================================== */

/* Ensure mobile components are completely hidden on desktop */
@media (min-width: 769px) {
  .mobile-app,
  .mobile-header,
  .mobile-sidebar,
  .mobile-nav,
  .mobile-layout,
  .mobile-auth-container,
  .mobile-dashboard,
  .mobile-quick-actions,
  .mobile-stats-grid {
    display: none !important;
  }
}

/* Hide desktop components on mobile */
@media (max-width: 768px) {
  .app {
    display: none !important;
  }
  
  .sidebar,
  .header,
  .auth-container {
    display: none !important;
  }
}

/* ========================================
   MOBILE FORM ADAPTATIONS
======================================== */

@media (max-width: 768px) {
  /* Make cards stack better on mobile */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-value {
    font-size: 24px;
  }
  
  /* Better form layouts on mobile */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-group {
    margin-bottom: 16px;
  }
  
  .form-input,
  .form-textarea,
  .form-select {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 12px;
  }
  
  .btn {
    padding: 12px 16px;
    font-size: 16px;
  }
  
  /* Table adaptations */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table {
    min-width: 600px;
  }
  
  /* Modal adaptations */
  .modal {
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
  }
  
  .modal-content {
    max-height: none;
    overflow-y: auto;
  }
  
  /* Pagination on mobile */
  .pager {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .pager-info {
    order: 3;
    width: 100%;
    text-align: center;
    margin-top: 8px;
  }
}

/* ========================================
   MOBILE CARD LAYOUTS
======================================== */

@media (max-width: 768px) {
  .mobile-card {
    background: var(--card);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    border: 1px solid var(--border);
  }
  
  .mobile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
  }
  
  .mobile-card-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
  }
  
  .mobile-card-action {
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--bg-2);
    border: none;
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
  }
  
  .mobile-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
  }
  
  .mobile-list-item:last-child {
    border-bottom: none;
  }
  
  .mobile-list-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
  }
  
  .mobile-list-content {
    flex: 1;
    min-width: 0;
  }
  
  .mobile-list-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 2px;
  }
  
  .mobile-list-subtitle {
    font-size: 12px;
    color: var(--text-muted);
  }
  
  .mobile-list-action {
    flex-shrink: 0;
  }
}

/* ========================================
   MOBILE DASHBOARD STYLES
======================================== */

.mobile-dashboard {
  padding: 0;
}

.mobile-welcome-section {
  background: var(--gradient-primary);
  color: white;
  padding: 24px 20px;
  border-radius: 0 0 24px 24px;
  margin: -16px -16px 24px -16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-welcome-text {
  flex: 1;
}

.mobile-welcome-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.mobile-welcome-subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;
  line-height: 1.3;
}

.mobile-welcome-icon {
  font-size: 32px;
  margin-left: 16px;
}

.mobile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.mobile-stat-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.mobile-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.mobile-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.mobile-stat-change {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}

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

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

.mobile-stat-change-icon {
  font-size: 12px;
}

/* ========================================
   MOBILE QUICK ACTIONS STYLES
======================================== */

.mobile-quick-actions {
  margin-bottom: 24px;
}

.mobile-quick-actions-header {
  margin-bottom: 16px;
}

.mobile-quick-actions-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px 0;
}

.mobile-quick-actions-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.mobile-quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.mobile-quick-action {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.mobile-quick-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--action-color, var(--primary));
}

.mobile-quick-action:active {
  transform: translateY(0);
}

.mobile-quick-action-icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--action-color, var(--primary)), var(--action-color, var(--primary-dark)));
  filter: grayscale(1) brightness(0) invert(1);
}

.mobile-quick-action:hover .mobile-quick-action-icon {
  filter: none;
}

.mobile-quick-action-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

/* ========================================
   MOBILE RECENT ACTIVITY STYLES
======================================== */

.mobile-recent-activity {
  margin-bottom: 24px;
}

.mobile-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.mobile-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.mobile-section-action {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.mobile-section-action:hover {
  background: var(--bg-2);
}

.mobile-activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-activity-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.mobile-activity-content {
  flex: 1;
  min-width: 0;
}

.mobile-activity-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.mobile-activity-time {
  font-size: 12px;
  color: var(--text-muted);
}

.mobile-activity-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  flex-shrink: 0;
}

/* ========================================
   MOBILE AUTH STYLES
======================================== */

.mobile-auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.mobile-auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 20px;
  padding: 32px 24px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}

.mobile-auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.mobile-auth-logo {
  font-size: 48px;
  margin-bottom: 16px;
}

.mobile-auth-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 0;
}

.mobile-auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.mobile-auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mobile-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-form-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.mobile-form-input {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 16px;
  background: var(--card);
  color: var(--text);
  transition: all 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.mobile-form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.mobile-btn {
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  min-height: 50px;
}

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

.mobile-btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow);
}

.mobile-btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.mobile-btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.mobile-btn-outline:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

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

.mobile-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
}

.mobile-alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.mobile-alert-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.mobile-auth-footer {
  text-align: center;
  margin-top: 24px;
}

.mobile-auth-footer-text {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.mobile-auth-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.mobile-auth-link:hover {
  text-decoration: underline;
}

/* ========================================
   MOBILE TOUCH OPTIMIZATIONS
======================================== */

/* Ensure minimum touch target size (44px) */
@media (max-width: 768px) {
  button, .btn, .mobile-btn, .nav-item, .mobile-nav-item {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Improve tap targets */
  input, select, textarea {
    min-height: 44px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  /* Smooth scrolling */
  * {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Remove tap highlights */
  * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
  }
  
  /* Custom tap feedback */
  .mobile-nav-item:active,
  .mobile-quick-action:active,
  .mobile-btn:active,
  .mobile-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  /* Improved scrollbars for mobile */
  ::-webkit-scrollbar {
    width: 2px;
  }
  
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  
  ::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 1px;
  }
  
  /* Swipe indicators */
  .mobile-swipe-indicator {
    position: relative;
  }
  
  .mobile-swipe-indicator::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
  }
  
  /* Floating action button */
  .mobile-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 1000;
    transition: all 0.3s ease;
  }
  
  .mobile-fab:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
  }
  
  .mobile-fab:active {
    transform: scale(0.95);
  }
  
  /* Pull to refresh indicator */
  .mobile-pull-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 14px;
  }
  
  /* Loading states optimized for mobile */
  .mobile-skeleton {
    background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-2) 50%, var(--bg-3) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
  }
  
  @keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
  }
  
  /* Safe area for notched devices */
  .mobile-app {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  
  .mobile-header {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  
  /* Dark mode support */
  @media (prefers-color-scheme: dark) {
    .mobile-auth-container {
      background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    }
    
    .mobile-welcome-section {
      background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    }
  }
  
  /* High contrast mode support */
  @media (prefers-contrast: high) {
    .mobile-nav-item,
    .mobile-quick-action,
    .mobile-stat-card {
      border-width: 2px;
    }
  }
  
  /* Reduced motion support */
  @media (prefers-reduced-motion: reduce) {
    * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}

/* ========================================
   ANIMATIONS
======================================== */

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

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

@keyframes slideOutRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

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

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