/* ============ THEMES ============ */
:root, .theme-light {
  --color-primary: #0f8f5f;
  --color-primary-dark: #0d7a52;
  --color-primary-light: #d1fae5;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-alt: #f1f5f9;
  --color-text: #0f172a;
  --color-text-secondary: #64748b;
  --color-border: #e2e8f0;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --color-success: #22c55e;
  --color-info: #3b82f6;
  --sidebar-bg: #0f172a;
  --sidebar-text: #e2e8f0;
}

.theme-dark {
  --color-primary: #60d394;
  --color-primary-dark: #4bbe80;
  --color-primary-light: #1a3a2a;
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-surface-alt: #334155;
  --color-text: #e2e8f0;
  --color-text-secondary: #94a3b8;
  --color-border: #334155;
  --sidebar-bg: #020617;
  --sidebar-text: #e2e8f0;
}

.theme-emerald {
  --color-primary: #059669;
  --color-primary-dark: #047857;
  --color-primary-light: #d1fae5;
  --color-bg: #ecfdf5;
  --color-surface: #ffffff;
  --color-surface-alt: #f0fdf4;
  --color-text: #064e3b;
  --color-text-secondary: #6b7280;
  --color-border: #a7f3d0;
  --sidebar-bg: #064e3b;
  --sidebar-text: #d1fae5;
}

.theme-royal {
  --color-primary: #5b4df5;
  --color-primary-dark: #4c3fd6;
  --color-primary-light: #ede9fe;
  --color-bg: #faf5ff;
  --color-surface: #ffffff;
  --color-surface-alt: #f5f3ff;
  --color-text: #1e1b4b;
  --color-text-secondary: #6b7280;
  --color-border: #c4b5fd;
  --sidebar-bg: #1e1b4b;
  --sidebar-text: #e0e7ff;
}

.theme-amber {
  --color-primary: #d97706;
  --color-primary-dark: #b45309;
  --color-primary-light: #fef3c7;
  --color-bg: #fffbeb;
  --color-surface: #ffffff;
  --color-surface-alt: #fefce8;
  --color-text: #451a03;
  --color-text-secondary: #6b7280;
  --color-border: #fbbf24;
  --sidebar-bg: #451a03;
  --sidebar-text: #fef3c7;
}

/* ============ BASE ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============ LAYOUT ============ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  overflow-y: auto;
}

@media (min-width: 1024px) {
  .sidebar { display: flex; }
  .main-content { margin-left: 260px; }
}

.sidebar-brand {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.sidebar-brand p {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-link:hover, .sidebar-link.active {
  background: rgba(255,255,255,0.1);
  border-left-color: var(--color-primary);
}

.sidebar-link.active {
  color: var(--color-primary);
  font-weight: 600;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ============ HEADER ============ */
.app-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
  min-width: 0;
  gap: 0.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.header-user {
  display: flex;
  flex-direction: column;
}

.header-user-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}

.header-user-store {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.online {
  background: #d1fae5;
  color: #065f46;
}

.status-badge.offline {
  background: #fee2e2;
  color: #991b1b;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.online { background: #22c55e; }
.status-dot.offline { background: #ef4444; }

.pending-badge {
  background: var(--color-warning);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.theme-select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.8rem;
}

/* Header responsive — compact on mobile */
@media (max-width: 767px) {
  .header-right { gap: 0.4rem; }
  .theme-select { display: none; }
  .btn-logout .btn-text { display: none; }
  .status-badge .status-text { display: none; }
  .status-badge { padding: 0.25rem 0.4rem; }
  .header-user-store { max-width: 120px; }
}

.btn-logout {
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* ============ BOTTOM NAV ============ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
  z-index: 30;
}

@media (min-width: 1024px) {
  .bottom-nav { display: none; }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.25rem 0.5rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.65rem;
  transition: color 0.2s;
  cursor: pointer;
  background: none;
  border: none;
  position: relative;
}

.bottom-nav-item svg { width: 22px; height: 22px; }

.bottom-nav-item.active {
  color: var(--color-primary);
  font-weight: 600;
}

.bottom-nav-item .nav-badge {
  position: absolute;
  top: -2px;
  right: 2px;
  background: var(--color-danger);
  color: white;
  font-size: 0.6rem;
  padding: 0.1rem 0.3rem;
  border-radius: 9999px;
  font-weight: 700;
}

/* ============ MAIN CONTENT ============ */
.main-content {
  flex: 1;
  padding-bottom: 4.5rem;
}

@media (min-width: 1024px) {
  .main-content { padding-bottom: 0; }
}

.page-content {
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 480px) {
  .page-content { padding: 0.75rem; }
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

/* ============ CARDS ============ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.card-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-secondary {
  background: var(--color-surface-alt);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-border);
}

.btn-danger {
  background: var(--color-danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-success {
  background: var(--color-success);
  color: white;
}

.btn-warning {
  background: var(--color-warning);
  color: white;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============ FORMS ============ */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--color-text);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

/* ============ PROGRESS BAR ============ */
.progress-bar {
  width: 100%;
  height: 10px;
  background: var(--color-surface-alt);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
  background: var(--color-primary);
}

.progress-fill.warning { background: var(--color-warning); }
.progress-fill.danger { background: var(--color-danger); }
.progress-fill.success { background: var(--color-success); }

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-primary { background: var(--color-primary-light); color: var(--color-primary-dark); }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* ============ GRID ============ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }

@media (max-width: 640px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 360px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ============ LOGIN PAGE ============ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 1rem;
}

.login-card {
  background: var(--color-surface);
  border-radius: 1rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}

.login-brand h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.login-brand p {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: var(--color-text-secondary);
  font-size: 0.8rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.login-demo {
  text-align: center;
  margin-top: 1.5rem;
  padding: 0.75rem;
  background: var(--color-surface-alt);
  border-radius: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

.btn-microsoft {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem;
  background: #2f2f2f;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-microsoft:hover { background: #404040; }

/* ============ QUICK ACTIONS ============ */
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  color: var(--color-text);
  text-align: center;
}

.quick-action:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.quick-action svg {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.quick-action span {
  font-size: 0.8rem;
  font-weight: 500;
}

/* ============ PRODUCT CARD ============ */
.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.product-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: var(--color-surface-alt);
}

.product-info {
  padding: 0.75rem;
}

.product-name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-sku {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.35rem;
}

.product-price {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1rem;
}

/* Product card responsive */
@media (max-width: 640px) {
  .product-card img { height: 110px; }
  .product-info { padding: 0.5rem; }
  .product-name { font-size: 0.8rem; }
  .product-price { font-size: 0.875rem; }
  .product-info > div:last-child { flex-wrap: wrap; gap: 0.25rem; }
}

/* ============ CART ============ */
.cart-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 2px solid var(--color-primary);
  border-radius: 1rem 1rem 0 0;
  padding: 1rem;
  z-index: 25;
  transform: translateY(100%);
  transition: transform 0.3s;
  max-height: 60vh;
  overflow-y: auto;
}

.cart-panel.open { transform: translateY(0); z-index: 35; }

@media (min-width: 1024px) {
  .cart-panel {
    position: sticky;
    top: 60px;
    transform: none;
    border-radius: 0.75rem;
    border: 1px solid var(--color-border);
    border-top: 2px solid var(--color-primary);
    max-height: calc(100vh - 80px);
  }
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-item-info { flex: 1; }
.cart-item-name { font-size: 0.85rem; font-weight: 500; }
.cart-item-price { font-size: 0.75rem; color: var(--color-text-secondary); }

.cart-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-qty button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  font-size: 1.1rem;
  font-weight: 700;
}

/* ============ CHECKLIST ============ */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.checklist-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
}

.checklist-item label {
  flex: 1;
  cursor: pointer;
  font-size: 0.9rem;
}

/* ============ MESSAGE CARD ============ */
.message-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-left: 4px solid var(--color-info);
}

.message-card.priority-high { border-left-color: var(--color-danger); }
.message-card.priority-medium { border-left-color: var(--color-warning); }
.message-card.priority-low { border-left-color: var(--color-success); }

.message-card.unread { background: var(--color-primary-light); }

/* ============ SYNC STATUS ============ */
.sync-event-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
}

.sync-event-row:last-child { border-bottom: none; }

/* ============ TOGGLE ============ */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-border);
  border-radius: 9999px;
  transition: 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
  background: var(--color-primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ============ TABLE ============ */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  background: var(--color-surface-alt);
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border);
}

.data-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--color-border);
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td {
  background: var(--color-surface-alt);
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}

.modal {
  background: var(--color-surface);
  border-radius: 1rem;
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

/* ============ TOAST ============ */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: 0.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  font-size: 0.85rem;
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast.success { border-left: 4px solid var(--color-success); }
.toast.error { border-left: 4px solid var(--color-danger); }
.toast.warning { border-left: 4px solid var(--color-warning); }
.toast.info { border-left: 4px solid var(--color-info); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* ============ SEARCH ============ */
.search-box {
  position: relative;
  margin-bottom: 1rem;
}

.search-box input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  background: var(--color-surface);
  color: var(--color-text);
}

.search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-secondary);
}

/* ============ TABS/FILTER ============ */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-tabs::-webkit-scrollbar { display: none; }

.filter-tab {
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--color-surface-alt);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-tab:hover { border-color: var(--color-primary); }

.filter-tab.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-secondary);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  opacity: 0.4;
}

/* ============ TRAINING CARD ============ */
.training-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  overflow: hidden;
}

.training-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.training-card-body {
  padding: 1rem;
}

.training-card-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.training-card-desc {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
}

/* ============ ANIMATIONS ============ */
.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-secondary);
}

/* ============ PHOTO GRID ============ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}

.photo-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 2px solid var(--color-border);
}

.photo-add {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 2px dashed var(--color-border);
  border-radius: 0.5rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all 0.2s;
}

.photo-add:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ============ DEBUG ============ */
.debug-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.debug-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--color-primary);
}

/* ============ UTILS ============ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--color-text-secondary); }
.text-primary { color: var(--color-primary); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
