/* ============================================================
   KCH Web Design System
   KopdesChain — Platform B2B Supply Chain Pengadaan Kolektif
   Primary: #1B3A6B (Navy) | Theme: Navy Professional B2B
   Font: Inter
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   1. CSS Custom Properties — :root (Navy Professional B2B)
   ============================================================ */
:root {
  /* Brand */
  --color-primary:        #1B3A6B;
  --color-primary-hover:  #142D56;
  --color-primary-light:  color-mix(in srgb, #1B3A6B 15%, transparent);
  --color-secondary:      #1A7F5A;
  --color-secondary-light: color-mix(in srgb, #1A7F5A 15%, transparent);
  --color-accent:         #F5A623;
  --color-accent-light:   color-mix(in srgb, #F5A623 15%, transparent);

  /* Semantic */
  --color-success:        #10B981;  --color-success-light: #D1FAE5;
  --color-warning:        #F59E0B;  --color-warning-light: #FEF3C7;
  --color-danger:         #EF4444;  --color-danger-light:  #FEE2E2;
  --color-info:           #3B82F6;  --color-info-light:    #DBEAFE;
  --color-purple:         #8B5CF6;  --color-purple-light:  #EDE9FE;

  /* Surface — navy-tinted light mode */
  --bg-page:     #F8FAFC;
  --bg-surface:  #FFFFFF;
  --bg-elevated: #F1F5F9;
  --bg-sidebar:  #0F1E35;
  --bg-hover:    #F1F5F9;

  /* Text */
  --text-primary:   #0F172A;
  --text-secondary: #334155;
  --text-muted:     #94A3B8;

  /* Border */
  --border-default: #E2E8F0;
  --border-strong:  #CBD5E1;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(15,30,53,0.05);
  --shadow-sm: 0 1px 3px rgba(15,30,53,0.1);
  --shadow-md: 0 4px 6px rgba(15,30,53,0.07);
  --shadow-lg: 0 10px 15px rgba(15,30,53,0.1);

  /* Layout */
  --header-height: 60px;
  --sidebar-width: 240px;

  /* Z-index */
  --z-sidebar:       100;
  --z-dropdown:      150;
  --z-modal:         200;
  --z-modal-content: 201;
  --z-toast:         500;

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

  /* Transition */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
}

[data-theme="dark"] {
  --bg-page:        #0F172A;
  --bg-surface:     #1E293B;
  --bg-elevated:    #293548;
  --bg-sidebar:     #080F1C;
  --bg-hover:       #1E293B;
  --text-primary:   #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted:     #64748B;
  --border-default: rgba(255,255,255,0.08);
  --border-strong:  rgba(255,255,255,0.16);
  --color-primary-light: rgba(27,58,107,0.25);
  --color-secondary-light: rgba(26,127,90,0.25);
  --color-accent-light: rgba(245,166,35,0.2);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
}

/* ============================================================
   2. CSS Reset
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

button {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
}

/* ============================================================
   3. Layout & App Shell
   ============================================================ */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.app-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: width var(--transition-base);
  border-right: 1px solid var(--border-default);
  position: relative;
}
.app-sidebar.collapsed { width: 60px; overflow: visible; z-index: 1000; }

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.app-header {
  height: var(--header-height);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
}

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

@media (max-width: 640px) {
  .app-content { padding: 16px; }
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  display: none;
}
.sidebar-overlay.open { display: block; }

/* ============================================================
   4. Sidebar Components
   ============================================================ */
.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  /* TANPA border-bottom */
}

.brand-logo {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}

/* Portal-specific brand colors */
.portal-kopdes .brand-logo { background: var(--color-secondary); }
.portal-supplier .brand-logo { background: var(--color-primary); }
.portal-admin .brand-logo { background: var(--color-accent); color: #1B3A6B; }

.brand-info { flex: 1; min-width: 0; }
.brand-name { font-size: 14px; font-weight: 700; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.nav-section { margin-bottom: 4px; }

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 8px 16px 4px;
  display: block;
}

.nav-section-divider {
  display: none;
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 4px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-item.active {
  color: white;
  background: var(--color-primary-light);
  border-left: 3px solid var(--color-primary);
}

/* Portal-specific active colors */
.portal-kopdes .nav-item.active { border-left-color: var(--color-secondary); background: var(--color-secondary-light); }
.portal-admin .nav-item.active { border-left-color: var(--color-accent); background: var(--color-accent-light); }

.nav-icon  { width: 18px; flex-shrink: 0; text-align: center; }
.nav-label { flex: 1; }
.nav-arrow { font-size: 11px; transition: transform var(--transition-fast); }

.nav-badge {
  font-size: 11px;
  background: var(--color-danger);
  color: white;
  border-radius: var(--radius-full);
  padding: 1px 6px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); }

.btn-logout {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.btn-logout:hover { color: var(--color-danger); background: rgba(239,68,68,0.1); }

/* Collapsed state */
.app-sidebar.collapsed .brand-info,
.app-sidebar.collapsed .nav-label,
.app-sidebar.collapsed .nav-arrow,
.app-sidebar.collapsed .nav-badge,
.app-sidebar.collapsed .nav-section-label,
.app-sidebar.collapsed .user-info,
.app-sidebar.collapsed .btn-logout { display: none !important; }

.app-sidebar.collapsed .sidebar-brand { justify-content: center; padding: 0; gap: 0; }
.app-sidebar.collapsed .nav-item { justify-content: center; padding: 12px 0; gap: 0; position: relative; }
.app-sidebar.collapsed .nav-item.active {
  border-left: 3px solid var(--color-primary);
  background: var(--color-primary-light);
}
.app-sidebar.collapsed .nav-section-divider { display: block; }
.app-sidebar.collapsed .nav-sub-item { display: none; }
.app-sidebar.collapsed .sidebar-footer { justify-content: center; padding: 12px 0; gap: 0; }
.app-sidebar.collapsed .sidebar-nav { overflow: visible; }

/* Tooltip via CSS */
.app-sidebar.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  font-size: 13px; white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
  box-shadow: var(--shadow-md);
  z-index: var(--z-dropdown);
}
.app-sidebar.collapsed .nav-item:hover::after { opacity: 1; visibility: visible; }

/* ============================================================
   5. Header Bar
   ============================================================ */
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}
.breadcrumb-sep     { color: var(--text-muted); }
.breadcrumb-current { font-weight: 600; color: var(--text-primary); }

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

.bell-wrapper { position: relative; }
.bell-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--color-danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg-surface);
}

/* Dropdown header for avatar */
.dropdown-header {
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ============================================================
   6. Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: filter var(--transition-fast), transform var(--transition-fast);
}
.btn:hover   { filter: brightness(0.92); }
.btn:active  { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-xs { height: 24px; padding: 0 8px;  font-size: 11px; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 16px; }
.btn-xl { height: 52px; padding: 0 24px; font-size: 16px; }

.btn-icon {
  width: 36px; height: 36px; padding: 0;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon.btn-xs { width: 24px; height: 24px; border-radius: var(--radius-sm); }
.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn-icon.btn-lg { width: 44px; height: 44px; }

.btn-primary   { background: var(--color-primary); color: white; }
.btn-secondary-portal { background: var(--color-secondary); color: white; }
.btn-accent    { background: var(--color-accent); color: white; }
.btn-secondary { background: transparent; border: 1px solid var(--border-default); color: var(--text-primary); }
.btn-outline   { background: transparent; border: 1px solid var(--color-primary); color: var(--color-primary); }
.btn-ghost     { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger    { background: var(--color-danger); color: white; }
.btn-danger-outline { background: transparent; border: 1px solid var(--color-danger); color: var(--color-danger); }
.btn-success   { background: var(--color-success); color: white; }
.btn-link      { background: transparent; color: var(--color-primary); padding: 0; height: auto; text-decoration: underline; }

/* Loading state */
.btn.loading { position: relative; color: transparent; pointer-events: none; }
.btn.loading::after {
  content: '';
  position: absolute; inset: 0; margin: auto;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.btn-secondary.loading::after,
.btn-ghost.loading::after,
.btn-outline.loading::after {
  border-color: rgba(0,0,0,0.15);
  border-top-color: var(--text-primary);
}

/* ============================================================
   7. Cards
   ============================================================ */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  overflow: hidden;
}

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

.card-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.card-sub   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.card-body   { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-default);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Stat Card */
.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  border-top: 3px solid transparent;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.stat-primary { border-top-color: var(--color-primary); }
.stat-success { border-top-color: var(--color-success); }
.stat-warning { border-top-color: var(--color-warning); }
.stat-danger  { border-top-color: var(--color-danger);  }
.stat-info    { border-top-color: var(--color-info);    }
.stat-secondary { border-top-color: var(--color-secondary); }
.stat-accent  { border-top-color: var(--color-accent); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-body  { flex: 1; min-width: 0; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-trend { font-size: 12px; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.trend-up   { color: var(--color-success); }
.trend-down { color: var(--color-danger);  }
.trend-flat { color: var(--text-muted);    }

/* ============================================================
   8. Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}

.badge-primary   { background: var(--color-primary-light); color: var(--color-primary); }
.badge-success   { background: var(--color-success-light); color: var(--color-success); }
.badge-warning   { background: var(--color-warning-light); color: #92400E; }
.badge-danger    { background: var(--color-danger-light);  color: var(--color-danger);  }
.badge-info      { background: var(--color-info-light);    color: var(--color-info);    }
.badge-purple    { background: var(--color-purple-light);  color: var(--color-purple);  }
.badge-gray      { background: var(--bg-elevated);         color: var(--text-muted);    }
.badge-secondary { background: var(--color-secondary-light); color: var(--color-secondary); }
.badge-accent    { background: var(--color-accent-light);  color: #92400E; }

.badge-outline { background: transparent; border: 1px solid currentColor; }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Role badges */
.badge-role-admin   { background: #FEE2E2; color: #991B1B; }
.badge-role-manager { background: #DBEAFE; color: #1E40AF; }
.badge-role-user    { background: #D1FAE5; color: #065F46; }

/* Status domain-spesifik KCH */
.badge-dibuat          { background: var(--color-info-light);    color: var(--color-info); }
.badge-dikonfirmasi    { background: var(--color-primary-light); color: var(--color-primary); }
.badge-dikirim         { background: #DBEAFE; color: #1E40AF; }
.badge-diterima        { background: var(--color-success-light); color: var(--color-success); }
.badge-selesai         { background: var(--color-success-light); color: var(--color-success); }
.badge-dibatalkan      { background: var(--color-danger-light);  color: var(--color-danger); }
.badge-menunggu-bayar  { background: var(--color-warning-light); color: #92400E; }
.badge-lunas           { background: var(--color-success-light); color: var(--color-success); }
.badge-jatuh-tempo     { background: var(--color-danger-light);  color: var(--color-danger); }
.badge-aktif           { background: var(--color-success-light); color: var(--color-success); }
.badge-nonaktif        { background: var(--color-danger-light);  color: var(--color-danger); }
.badge-pending-verifikasi { background: var(--color-warning-light); color: #92400E; }

/* Supplier badges */
.badge-bulog    { background: #FFF3CD; color: #856404; }
.badge-kimia-farma { background: #D1ECF1; color: #0C5460; }
.badge-agrinas  { background: var(--color-secondary-light); color: var(--color-secondary); }

/* ============================================================
   9. Icon Color Helpers
   ============================================================ */
.icon-primary   { background: var(--color-primary-light);   color: var(--color-primary); }
.icon-success   { background: var(--color-success-light);   color: var(--color-success); }
.icon-warning   { background: var(--color-warning-light);   color: var(--color-warning); }
.icon-danger    { background: var(--color-danger-light);    color: var(--color-danger);  }
.icon-info      { background: var(--color-info-light);      color: var(--color-info);    }
.icon-muted     { background: var(--bg-elevated);           color: var(--text-muted);    }
.icon-secondary { background: var(--color-secondary-light); color: var(--color-secondary); }
.icon-accent    { background: var(--color-accent-light);    color: #92400E; }

[data-theme="dark"] .icon-success   { background: rgba(16,185,129,0.15);  color: #34D399; }
[data-theme="dark"] .icon-warning   { background: rgba(245,158,11,0.15);  color: #FCD34D; }
[data-theme="dark"] .icon-danger    { background: rgba(239,68,68,0.15);   color: #FCA5A5; }
[data-theme="dark"] .icon-info      { background: rgba(59,130,246,0.15);  color: #93C5FD; }
[data-theme="dark"] .icon-primary   { background: rgba(27,58,107,0.25);   color: #93B4E8; }
[data-theme="dark"] .icon-secondary { background: rgba(26,127,90,0.25);   color: #34D399; }
[data-theme="dark"] .icon-accent    { background: rgba(245,166,35,0.2);   color: #FCD34D; }

/* ============================================================
   10. Avatar
   ============================================================ */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 72px; height: 72px; font-size: 24px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* Portal-specific avatar colors */
.portal-kopdes .avatar    { background: var(--color-secondary); }
.portal-admin .avatar     { background: var(--color-accent); color: #1B3A6B; }

/* ============================================================
   11. Page Header
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-sub   { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.page-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: transparent;
  text-decoration: none;
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.btn-back:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

@media (max-width: 640px) {
  .page-header { flex-direction: column; gap: 12px; }
  .page-header-actions { width: 100%; justify-content: flex-end; }
}

/* ============================================================
   12. Tables
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: var(--bg-surface);
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }
tbody tr.selected { background: var(--color-primary-light); }

.col-no     { width: 48px; text-align: center; }
.col-action { width: 80px; }
.sortable   { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--text-primary); }
.sort-icon  { font-size: 10px; color: var(--text-muted); margin-left: 4px; }

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  flex-wrap: wrap;
}
.table-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }

.empty-row td { padding: 0; border: none; }
.table-empty  { text-align: center; padding: 48px 24px; }
.table-empty-icon  { font-size: 36px; color: var(--text-muted); margin-bottom: 12px; }
.table-empty-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.table-empty-sub   { font-size: 13px; color: var(--text-muted); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 32px;
  padding: 0 6px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-surface);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.pagination-btn:hover   { background: var(--bg-elevated); }
.pagination-btn.active  { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.pagination-ellipsis    { padding: 0 6px; color: var(--text-muted); }
.pagination-info        { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   13. Forms
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.form-label .required { color: var(--color-danger); margin-left: 2px; }
.required { color: var(--color-danger); }

.form-control {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-page);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.form-control.error { border-color: var(--color-danger); }
.form-control:disabled { opacity: 0.5; background: var(--bg-surface); cursor: not-allowed; }
.form-control-lg { height: 44px; font-size: 15px; }

textarea.form-control { height: auto; padding: 10px 12px; resize: vertical; }

.form-select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0 36px 0 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-page);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394A3B8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}
.form-select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-light); outline: none; }
.form-select-sm { height: 30px; font-size: 13px; }

.form-error { font-size: 12px; color: var(--color-danger); }
.form-hint  { font-size: 12px; color: var(--text-muted); }

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check-label { font-size: 14px; cursor: pointer; }

.form-row   { display: flex; gap: 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

@media (max-width: 640px) {
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
}

.input-group { display: flex; position: relative; align-items: center; }
.input-prefix {
  position: absolute; left: 12px;
  color: var(--text-muted); font-size: 14px;
  pointer-events: none;
}
.input-suffix {
  position: absolute; right: 12px;
  color: var(--text-muted); font-size: 14px;
}
.input-group .form-control { padding-left: 36px; }
.input-group .form-control.has-suffix { padding-right: 36px; }

.search-box { position: relative; display: flex; align-items: center; }
.search-icon {
  position: absolute; left: 10px;
  color: var(--text-muted); font-size: 13px;
  pointer-events: none;
}
.search-box .form-control { padding-left: 32px; }

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: 12px;
  transition: background var(--transition-base);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-base);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--color-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ============================================================
   14. Modal
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
  position: relative;
  z-index: var(--z-modal-content);
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
  max-width: 560px;
  animation: modal-in 0.2s ease;
}
.modal-sm { max-width: 400px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.modal-close { color: var(--text-muted); }
.modal-close:hover { color: var(--text-primary); }

.modal-body   { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-height: 95vh; }
}

/* ============================================================
   15. Dropdown
   ============================================================ */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  display: none;
  position: absolute;
  right: 0; top: calc(100% + 4px);
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  overflow: hidden;
}
.dropdown-menu.open { display: block; }

[data-theme="dark"] .dropdown-menu { background: var(--bg-elevated); }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  width: 100%;
  white-space: nowrap;
}
.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.danger { color: var(--color-danger); }
.dropdown-item.text-danger { color: var(--color-danger); }

.dropdown-divider { height: 1px; background: var(--border-default); margin: 4px 0; }

/* ============================================================
   16. Toast
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  width: calc(100vw - 48px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  border-left: 4px solid transparent;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-in 0.25s ease;
}
.toast-success { border-left-color: var(--color-success); }
.toast-error   { border-left-color: var(--color-danger);  }
.toast-warning { border-left-color: var(--color-warning); }
.toast-info    { border-left-color: var(--color-info);    }

.toast-icon    { flex-shrink: 0; font-size: 16px; margin-top: 1px; }
.toast-body    { flex: 1; min-width: 0; }
.toast-title   { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.toast-message { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.toast-close   { color: var(--text-muted); margin-left: auto; flex-shrink: 0; }
.toast-close:hover { color: var(--text-primary); }

/* ============================================================
   17. Tabs
   ============================================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 20px;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.tab-item:hover  { color: var(--text-primary); }
.tab-item.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 500; }

.tab-count {
  font-size: 11px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  padding: 1px 6px;
  margin-left: 4px;
  color: var(--text-muted);
}
.tab-item.active .tab-count { background: var(--color-primary-light); color: var(--color-primary); }

.tab-content { }
.tab-pane         { display: none; }
.tab-pane.active  { display: block; }

/* ============================================================
   18. Alerts
   ============================================================ */
.alert {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border-left: 4px solid transparent;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.alert-icon  { flex-shrink: 0; margin-top: 1px; }
.alert-body  { flex: 1; }
.alert-title { font-weight: 600; margin-bottom: 2px; }

.alert-info    { background: var(--color-info-light);    border-left-color: var(--color-info);    color: #1E40AF; }
.alert-success { background: var(--color-success-light); border-left-color: var(--color-success); color: #065F46; }
.alert-warning { background: var(--color-warning-light); border-left-color: var(--color-warning); color: #92400E; }
.alert-danger  { background: var(--color-danger-light);  border-left-color: var(--color-danger);  color: #991B1B; }

/* ============================================================
   19. Progress Bar
   ============================================================ */
.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}
.progress-fill.success { background: var(--color-success); }
.progress-fill.warning { background: var(--color-warning); }
.progress-fill.danger  { background: var(--color-danger);  }

/* ============================================================
   20. Empty State, Skeleton, Timeline, Filter Bar
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.empty-icon  { font-size: 48px; color: var(--text-muted); margin-bottom: 16px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.empty-sub   { font-size: 14px; color: var(--text-muted); }

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

.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text   { height: 14px; border-radius: var(--radius-sm); }
.skeleton-title  { height: 20px; width: 60%; border-radius: var(--radius-sm); }
.skeleton-avatar { width: 36px; height: 36px; border-radius: 50%; }
.skeleton-line   { height: 14px; }
.skeleton-line-sm { width: 80px; }
.skeleton-line-md { width: 160px; }
.skeleton-line-lg { width: 240px; }

/* Timeline (generic) */
.timeline {
  position: relative;
  padding-left: 24px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border-default);
}
.timeline-item {
  position: relative;
  padding-bottom: 20px;
}
.timeline-dot {
  position: absolute;
  left: -21px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  top: 2px;
}
.timeline-dot.active { background: var(--color-primary); border-color: var(--color-primary); }
.timeline-dot.done   { background: var(--color-success); border-color: var(--color-success); }
.timeline-title   { font-weight: 600; font-size: 14px; }
.timeline-time    { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.timeline-desc    { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  font-size: 13px;
  cursor: pointer;
  color: var(--text-secondary);
  background: var(--bg-surface);
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.filter-chip:hover  { background: var(--bg-elevated); }
.filter-chip.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }

.chart-container { position: relative; width: 100%; }

/* ============================================================
   21. Interactive States
   ============================================================ */
.nav-item:hover       { background: rgba(255,255,255,0.06); }
table tbody tr:hover  { background: var(--bg-hover); }
.dropdown-item:hover  { background: var(--bg-hover); }
.btn:active           { transform: scale(0.98); }

.btn:focus-visible,
.form-control:focus,
.form-select:focus,
.nav-item:focus-visible,
.tab-item:focus-visible,
.pagination-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

table tbody tr.selected { background: var(--color-primary-light); }

.btn:disabled,
.form-control:disabled,
.form-select:disabled,
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   22. Animations & Keyframes
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fade   { animation: fade-in 0.2s ease; }
.animate-spin   { animation: spin 1s linear infinite; }
.animate-pulse  { animation: pulse 2s ease-in-out infinite; }

/* ============================================================
   23. Scrollbar
   ============================================================ */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ============================================================
   24. Utility Classes
   ============================================================ */
/* Flex */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-1        { flex: 1; }
.flex-wrap     { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }

/* Grid */
.grid         { display: grid; gap: 20px; }
.grid-cols-2  { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3  { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4  { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .app-sidebar { position: fixed; left: -240px; z-index: var(--z-sidebar); }
  .app-sidebar.open { left: 0; }
  .sidebar-overlay.open { display: block; }
}
@media (max-width: 640px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
  .modal { margin: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; align-self: flex-end; }
  .page-header { flex-direction: column; gap: 12px; }
  .page-header-actions { width: 100%; justify-content: flex-end; }
}

/* Gap */
.gap-1 { gap: 4px;  } .gap-2 { gap: 8px;  } .gap-3 { gap: 12px; }
.gap-4 { gap: 16px; } .gap-5 { gap: 20px; } .gap-6 { gap: 24px; }

/* Margin */
.mt-1 { margin-top: 4px;  } .mt-2 { margin-top: 8px;  } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px;  } .mb-2 { margin-bottom: 8px;  } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }

/* Padding */
.p-2 { padding: 8px;  } .p-3 { padding: 12px; }
.p-4 { padding: 16px; } .p-5 { padding: 20px; } .p-6 { padding: 24px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }

/* Typography */
.text-xs   { font-size: 11px; } .text-sm   { font-size: 12px; }
.text-base { font-size: 14px; } .text-lg   { font-size: 16px; }
.text-xl   { font-size: 18px; } .text-2xl  { font-size: 20px; }
.text-3xl  { font-size: 24px; }

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

.text-primary-color { color: var(--text-primary);   }
.text-secondary-color { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted);     }
.text-success   { color: var(--color-success);  }
.text-warning   { color: var(--color-warning);  }
.text-danger    { color: var(--color-danger);   }
.text-primary   { color: var(--color-primary);  }
.text-center    { text-align: center; }
.text-right     { text-align: right;  }
.truncate       { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uppercase      { text-transform: uppercase; }
.capitalize     { text-transform: capitalize; }
.link           { color: var(--color-primary); cursor: pointer; }
.link:hover     { text-decoration: underline; }

/* Visual */
.w-full  { width: 100%;  }
.h-full  { height: 100%; }
.min-w-0 { min-width: 0; }

.rounded      { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.border        { border: 1px solid var(--border-default); }
.border-top    { border-top: 1px solid var(--border-default); }
.border-bottom { border-bottom: 1px solid var(--border-default); }

.bg-surface { background: var(--bg-surface); }
.bg-page    { background: var(--bg-page);    }

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

.overflow-hidden { overflow: hidden; }
.hidden  { display: none !important; }
.block   { display: block; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Cursor & interaction helpers */
.cursor-pointer { cursor: pointer; }
.no-wrap        { white-space: nowrap; }
.flex-shrink-0  { flex-shrink: 0; }
.flex-col       { display: flex; flex-direction: column; }
.items-start    { align-items: flex-start; }

/* Width helpers (form filters, table columns) */
.w-40   { width: 40px;  }
.w-50   { width: 50px;  }
.w-80   { width: 80px;  }
.w-110  { width: 110px; }
.w-120  { width: 120px; }
.w-160  { width: 160px; }
.w-180  { width: 180px; }
.w-200  { width: 200px; }
.w-300  { width: 300px; }
.max-w-520 { max-width: 520px; }
.max-w-560 { max-width: 560px; }

/* Height helpers (image placeholders) */
.h-180 { height: 180px; }
.h-200 { height: 200px; }
.h-220 { height: 220px; }
.h-240 { height: 240px; }

/* Padding helpers used in dense cards/filters */
.p-compact       { padding: 12px 16px; }
.p-cell          { padding: 10px 12px; }
.p-row           { padding: 8px 0;     }
.p-section       { padding: 16px;      }
.pl-44           { padding-left: 44px; }
.pl-20-line      { padding-left: 20px; line-height: 1.8; }

/* Layout grids reused across detail pages */
.grid-detail-2-1   { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.grid-detail-wide  { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.grid-detail-side  { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.grid-2-1          { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

/* Color text accents */
.text-accent     { color: var(--color-accent);    }
.text-secondary  { color: var(--color-secondary); }
.text-gold       { color: #F5A623; }
.text-border     { color: var(--border-default); }

/* Border accent helper */
.border-accent   { border-color: var(--color-accent); }

@media (max-width: 768px) {
  .grid-detail-2-1,
  .grid-detail-wide,
  .grid-detail-side,
  .grid-2-1 { grid-template-columns: 1fr; }
}

/* Compound layout helpers (column flex + gap) */
.col-gap-8 { display: flex; flex-direction: column; gap: 8px; }

/* Side nav vertical link variants used in profil/settings */
.side-link {
  display: flex;
  gap: 10px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 2px;
}
.side-link.active,
.side-link:hover { background: var(--bg-elevated); color: var(--color-primary); }

/* Font-size helpers (used by emoji thumbnails & big numbers) */
.fs-8   { font-size: 8px;  }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.fs-16  { font-size: 16px; }
.fs-18  { font-size: 18px; }
.fs-20  { font-size: 20px; }
.fs-22  { font-size: 22px; }
.fs-24  { font-size: 24px; }
.fs-28  { font-size: 28px; }
.fs-32  { font-size: 32px; }
.fs-36  { font-size: 36px; }
.fs-48  { font-size: 48px; }
.fs-64  { font-size: 64px; }
.fs-80  { font-size: 80px; }

/* Margin helpers */
.mb-2  { margin-bottom: 2px; }
.mb-4-px { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px;  }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mt-4-px { margin-top: 4px; }
.ml-4  { margin-left: 4px; }
.m-auto-12 { margin: 0 auto 12px; }

/* Opacity helpers */
.opacity-75 { opacity: 0.75; }
.opacity-80 { opacity: 0.80; }
.opacity-85 { opacity: 0.85; }

/* Thumbnail tile (emoji icon containers) */
.thumb-80 { width: 80px; height: 80px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.thumb-72 { width: 72px; height: 72px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }

/* Misc backgrounds */
.bg-primary-light   { background: var(--color-primary-light);   }
.bg-secondary-light { background: var(--color-secondary-light); }
.bg-accent          { background: var(--color-accent); }
.bg-white-20        { background: rgba(255,255,255,0.2); }
.bg-white           { background: #ffffff; }

/* ============================================================
   25. Login Page (tanpa sidebar)
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-page) 0%, var(--bg-elevated) 100%);
  padding: 24px;
}

.login-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.login-logo-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  background: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: white;
  flex-shrink: 0;
}
.portal-kopdes .login-logo-icon    { background: var(--color-secondary); }
.portal-supplier .login-logo-icon  { background: var(--color-primary); }
.portal-admin .login-logo-icon     { background: var(--color-accent); color: #1B3A6B; }

.login-logo-text { font-size: 20px; font-weight: 800; color: var(--text-primary); }
.login-logo-sub  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.login-title { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.login-sub   { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }

/* ============================================================
   26. Onboarding Wizard
   ============================================================ */
.onboarding-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}
.onboarding-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  flex: 1;
}
.onboarding-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border-default);
  z-index: 0;
}
.onboarding-step.done:not(:last-child)::after { background: var(--color-primary); }

.onboarding-step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border-default);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--text-muted);
  position: relative; z-index: 1;
  transition: all var(--transition-base);
}
.onboarding-step.active .onboarding-step-num {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}
.onboarding-step.done .onboarding-step-num {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}
.onboarding-step-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}
.onboarding-step.active .onboarding-step-label { color: var(--color-primary); font-weight: 600; }
.onboarding-step.done .onboarding-step-label   { color: var(--color-success); }

.onboarding-content { animation: fade-in 0.3s ease; }

/* ============================================================
   27. Product Card (Katalog)
   ============================================================ */
.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  cursor: pointer;
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.product-image {
  width: 100%;
  height: 160px;
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-size: 40px;
  color: var(--text-muted);
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }

.product-body { padding: 16px; }
.product-name {
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-supplier { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.product-price {
  font-size: 16px; font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 2px;
}
.product-price-bulk {
  font-size: 12px;
  color: var(--color-secondary);
  font-weight: 600;
}
.product-price-label { font-size: 11px; color: var(--text-muted); }
.product-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.product-unit { font-size: 12px; color: var(--text-muted); }

/* Supplier badge (inside product card or standalone) */
.supplier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
}

/* Price tier badge */
.price-tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid currentColor;
}
.price-tier-satuan    { color: var(--color-info); background: var(--color-info-light); }
.price-tier-grosir    { color: var(--color-secondary); background: var(--color-secondary-light); }
.price-tier-kolektif  { color: var(--color-accent); background: var(--color-accent-light); }

/* ============================================================
   28. Collective Order Banner
   ============================================================ */
.collective-order-banner {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  color: white;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.collective-order-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.collective-order-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
}
.collective-order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.collective-order-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.collective-progress {
  margin-top: 8px;
}
.collective-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.collective-progress-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
}

/* ============================================================
   29. Delivery Timeline
   ============================================================ */
.delivery-timeline {
  position: relative;
  padding-left: 36px;
}
.delivery-timeline::before {
  content: '';
  position: absolute;
  left: 15px; top: 16px; bottom: 16px;
  width: 2px;
  background: var(--border-default);
}
.delivery-step {
  position: relative;
  padding-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.delivery-step-icon {
  position: absolute;
  left: -36px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  z-index: 1;
}
.delivery-step.done .delivery-step-icon {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}
.delivery-step.active .delivery-step-icon {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}
.delivery-step-body { flex: 1; padding-top: 4px; }
.delivery-step-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.delivery-step-time  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.delivery-step-desc  { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ============================================================
   30. Invoice
   ============================================================ */
.invoice-summary {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.invoice-line {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-default);
  font-size: 14px;
}
.invoice-line:last-child { border-bottom: none; }
.invoice-line-label { color: var(--text-secondary); }
.invoice-line-value { font-weight: 600; color: var(--text-primary); }
.invoice-total {
  display: flex;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-elevated);
  border-top: 2px solid var(--border-strong);
  font-size: 16px; font-weight: 700;
}
.invoice-total-value { color: var(--color-primary); font-size: 20px; }

/* Payment method card */
.payment-method-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  margin-bottom: 12px;
}
.payment-method-card:hover { border-color: var(--color-primary); }
.payment-method-card.selected { border-color: var(--color-primary); background: var(--color-primary-light); }
.payment-method-icon {
  width: 48px; height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  color: var(--color-primary);
}
.payment-method-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.payment-method-desc { font-size: 12px; color: var(--text-muted); }

.virtual-account-box {
  background: var(--bg-elevated);
  border: 2px dashed var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  margin: 16px 0;
}
.virtual-account-number {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--color-primary);
  font-family: monospace;
}
.virtual-account-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   31. Order Status Timeline
   ============================================================ */
.order-timeline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  padding: 0 8px;
}
.order-timeline::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: var(--border-default);
  z-index: 0;
}
.order-timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
  z-index: 1;
}
.order-timeline-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-default);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
}
.order-timeline-step.done .order-timeline-icon  { background: var(--color-success); border-color: var(--color-success); color: white; }
.order-timeline-step.active .order-timeline-icon { background: var(--color-primary); border-color: var(--color-primary); color: white; }
.order-timeline-label { font-size: 11px; color: var(--text-muted); text-align: center; }
.order-timeline-step.done .order-timeline-label  { color: var(--color-success); }
.order-timeline-step.active .order-timeline-label { color: var(--color-primary); font-weight: 600; }

/* ============================================================
   32. Cart & Checkout
   ============================================================ */
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border-default);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-image {
  width: 72px; height: 72px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: var(--text-muted);
  flex-shrink: 0;
  overflow: hidden;
}
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-name { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.cart-item-supplier { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.cart-item-price { font-size: 16px; font-weight: 700; color: var(--color-primary); }

.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.qty-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  border: none;
  transition: background var(--transition-fast);
}
.qty-btn:hover { background: var(--bg-elevated); }
.qty-input {
  width: 44px;
  height: 32px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border-default);
  border-right: 1px solid var(--border-default);
  background: var(--bg-page);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
}

/* ============================================================
   33. Responsive (already covered in grid section above)
   ============================================================ */
@media (max-width: 768px) {
  .login-card { padding: 28px 24px; }
  .virtual-account-number { font-size: 22px; letter-spacing: 2px; }
  .order-timeline-label { font-size: 10px; }
}
