/* ==========================================================================
   ROKOK AGENT DISTRIBUTION MANAGEMENT SYSTEM (AGEL STORE)
   iOS-Inspired Compact Enterprise UI Design System
   ========================================================================== */

:root {
  --primary: #007AFF;
  --primary-hover: #0066D6;
  --primary-light: #EAF3FF;
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --text-primary: #1C1C1E;
  --text-secondary: #8E8E93;
  --border: #E5E5EA;
  --success: #34C759;
  --success-light: #EBF9EE;
  --warning: #FF9F0A;
  --warning-light: #FFF5E6;
  --danger: #FF3B30;
  --danger-light: #FFECEB;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 14px;

  --sidebar-w: 224px;
  --sidebar-collapsed-w: 64px;
  --topbar-h: 60px;
  --bottom-nav-h: 62px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.1);
  --shadow-sheet: 0 -4px 24px rgba(0, 0, 0, 0.12);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-primary);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: var(--primary-hover);
}

/* --------------------------------------------------------------------------
   App Layout
   -------------------------------------------------------------------------- */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar (Desktop) */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-x: hidden;
}

.sidebar-header {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

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

.brand-info {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.brand-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 10px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  margin-bottom: 2px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 13.5px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

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

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

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

/* Collapsed Sidebar */
body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-w);
}
body.sidebar-collapsed .brand-info,
body.sidebar-collapsed .nav-section-title,
body.sidebar-collapsed .nav-item span {
  display: none;
}
body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}
body.sidebar-collapsed .main-wrapper {
  margin-left: var(--sidebar-collapsed-w);
}

/* Main Wrapper */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: 40px;
}

/* Mobile Header (Hidden on Desktop, Visible on Mobile) */
.mobile-header {
  display: none;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 40;
}

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

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

/* Topbar (Desktop) */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}

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

.btn-sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.btn-sidebar-toggle:hover {
  background: var(--bg);
}

.topbar-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 380px;
}

.topbar-search-input {
  width: 100%;
  height: 38px;
  background: #F4F5F7;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 0 44px 0 38px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s ease;
}

.topbar-search-input:focus {
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

.topbar-search-input::placeholder {
  color: #9CA3AF;
  font-size: 12.5px;
}

.topbar-search .search-icon {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  color: #9CA3AF;
  pointer-events: none;
}

.topbar-search .search-shortcut {
  position: absolute;
  right: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #6B7280;
  background: #E5E7EB;
  border-radius: 4px;
  padding: 2px 6px;
  pointer-events: none;
  letter-spacing: 0.3px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

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

.topbar-icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  background: transparent;
  border: none;
  transition: background 0.15s ease;
}

.topbar-icon-btn:hover {
  background: var(--bg);
}

.topbar-icon-btn svg {
  width: 20px;
  height: 20px;
  color: #4B5563;
}

.topbar-icon-btn .badge-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--surface);
  line-height: 1;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-md);
  transition: background 0.15s ease;
}

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

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2563EB;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13.5px;
}

.user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
}

/* Content Area */
.content-area {
  padding: 20px 24px;
  flex: 1;
}

/* --------------------------------------------------------------------------
   Buttons & Interactive
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: var(--bg);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #E0352B;
}

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

.btn-light-primary {
  background: var(--primary-light);
  color: var(--primary);
}
.btn-light-primary:hover {
  background: #D9EBFF;
}

/* --------------------------------------------------------------------------
   Cards & Surfaces
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 18px;
}

/* --------------------------------------------------------------------------
   KPI Metric Tiles
   -------------------------------------------------------------------------- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.metric-subtext {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Tables (Compact Enterprise Style)
   -------------------------------------------------------------------------- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-compact {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.table-compact th {
  background: #FAFBFD;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table-compact td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
}

.table-compact tbody tr:hover {
  background-color: #F8FAFC;
}

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

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-light);
  color: var(--success);
}
.badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}
.badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}
.badge-primary {
  background: var(--primary-light);
  color: var(--primary);
}
.badge-neutral {
  background: #EFEFF4;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Forms & Inputs
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: 14px;
}

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

.form-control, .form-select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

textarea.form-control {
  height: auto;
  padding: 10px 12px;
  min-height: 80px;
}

/* --------------------------------------------------------------------------
   Bottom Sheet (Mobile-First / Modal)
   -------------------------------------------------------------------------- */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sheet-overlay.active {
  display: block;
  opacity: 1;
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-sheet);
  z-index: 101;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.bottom-sheet.active {
  transform: translateY(0);
}

.sheet-handle-bar {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
  cursor: grab;
}
.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #D1D1D6;
}

.sheet-header {
  padding: 8px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.sheet-title {
  font-size: 16px;
  font-weight: 600;
}

.sheet-body {
  padding: 18px;
  overflow-y: auto;
  flex: 1;
}

/* Desktop Modal Mode for larger screens */
@media (min-width: 768px) {
  .bottom-sheet.modal-mode {
    left: 50%;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: 90%;
    max-width: 560px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
  }
  .bottom-sheet.modal-mode.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
  .bottom-sheet.modal-mode .sheet-handle-bar {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   3D Alert & Confirmation Dialogs (Requirement 4)
   -------------------------------------------------------------------------- */
.alert-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.alert-overlay.active {
  display: flex;
}

.alert-dialog {
  width: 100%;
  max-width: 380px;
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 28px 24px 20px;
  text-align: center;
  animation: alert3DPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

@keyframes alert3DPop {
  from { transform: scale(0.88) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.alert-3d-icon-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  position: relative;
}

.alert-3d-icon {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.15));
  animation: float3DIcon 3s ease-in-out infinite;
}

@keyframes float3DIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.alert-title {
  font-size: 18px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.alert-desc {
  font-size: 13.5px;
  color: #64748B;
  margin-bottom: 22px;
  line-height: 1.5;
}

.alert-actions {
  display: flex;
  gap: 10px;
}
.alert-actions .btn {
  flex: 1;
  height: 42px;
  font-weight: 600;
  border-radius: 12px;
  font-size: 13.5px;
}

/* --------------------------------------------------------------------------
   Image Upload Dropzone & Preview (Requirement 2)
   -------------------------------------------------------------------------- */
.image-upload-wrapper {
  position: relative;
  width: 100%;
}
.upload-dropzone {
  border: 2px dashed #CBD5E1;
  border-radius: 14px;
  background: #F8FAFC;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: #2563EB;
  background: #EFF6FF;
}
.upload-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563EB;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.upload-icon-box svg {
  width: 22px;
  height: 22px;
}
.upload-text-primary {
  font-size: 13px;
  font-weight: 600;
  color: #1E293B;
}
.upload-text-secondary {
  font-size: 11.5px;
  color: #64748B;
}

/* Upload Preview */
.upload-preview-box {
  position: relative;
  width: 100%;
  height: 140px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #E2E8F0;
  background: #0F172A;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.upload-preview-box:hover .preview-overlay {
  opacity: 1;
}
.btn-preview-change, .btn-preview-remove {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.btn-preview-change {
  background: #FFFFFF;
  color: #1E293B;
}
.btn-preview-remove {
  background: #DC2626;
  color: #FFFFFF;
}
.preview-badge-size {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.6);
  color: #FFFFFF;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

/* Real Image Thumbnails in Tables and Cards */
.product-real-thumb {
  width: 32px;
  height: 42px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.product-card-real-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Searchable Dropdowns with Add, Edit, Delete (Requirement 3)
   -------------------------------------------------------------------------- */
.input-with-addon {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.input-with-addon .searchable-dropdown {
  flex: 1;
  min-width: 0;
}
.btn-addon-plus {
  width: 38px;
  height: 38px;
  min-width: 38px;
  max-width: 38px;
  border-radius: var(--radius-md);
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #2563EB;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}
.btn-addon-plus:hover {
  background: #2563EB;
  color: #FFFFFF;
  border-color: #2563EB;
}
.btn-addon-plus svg {
  width: 17px;
  height: 17px;
}

.searchable-dropdown {
  position: relative;
  width: 100%;
  min-width: 0;
}
.dropdown-trigger {
  width: 100%;
  height: 38px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 13px;
  color: #1E293B;
  user-select: none;
  box-sizing: border-box;
  min-width: 0;
  gap: 6px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dropdown-trigger:focus, .dropdown-trigger.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.dropdown-selected-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}
.dropdown-chevron {
  width: 15px;
  height: 15px;
  color: #94A3B8;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.dropdown-trigger.active .dropdown-chevron {
  transform: rotate(180deg);
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  z-index: 150;
  padding: 8px;
  display: none;
  min-width: 290px;
  width: 310px;
  max-width: min(340px, calc(100vw - 32px));
  box-sizing: border-box;
  animation: dropdownFadeIn 0.15s ease;
  overflow: visible;
}
@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.dropdown-panel.active {
  display: block;
}

/* Jika di kiri: melebar ke kanan */
.dropdown-panel.expand-right,
.dropdown-panel:not(.expand-left) {
  left: 0;
  right: auto;
}

/* Jika di kanan: melebar ke kiri */
.dropdown-panel.expand-left {
  right: 0;
  left: auto;
}

.dropdown-search-box {
  position: relative;
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
}
.dropdown-search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #94A3B8;
  pointer-events: none;
}
.dropdown-search-input {
  width: 100%;
  height: 35px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  padding: 0 10px 0 32px;
  font-size: 12.5px;
  color: #1E293B;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}
.dropdown-search-input:focus {
  border-color: #2563EB;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dropdown-items-list {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 2px;
}
.dropdown-items-list::-webkit-scrollbar {
  width: 5px;
}
.dropdown-items-list::-webkit-scrollbar-track {
  background: transparent;
}
.dropdown-items-list::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
.dropdown-items-list::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.12s ease;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
}
.dropdown-item:hover {
  background: #F1F5F9;
  color: #0F172A;
}
.dropdown-item.selected {
  background: #EFF6FF;
  color: #2563EB;
  font-weight: 600;
}
.dropdown-item .item-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.btn-item-action {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748B;
  transition: all 0.12s ease;
  padding: 0;
  flex-shrink: 0;
}
.btn-item-action:hover.edit {
  background: #EFF6FF;
  color: #2563EB;
  border-color: #BFDBFE;
}
.btn-item-action:hover.delete {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
}
.btn-item-action svg {
  width: 13px;
  height: 13px;
}

/* --------------------------------------------------------------------------
   Desktop Table Sticky Header, Scroll & Sort (Requirement 1, 2 & 3)
   -------------------------------------------------------------------------- */
.catalog-table-scroll-container {
  width: 100%;
  max-height: calc(100vh - 280px);
  min-height: 420px;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.catalog-table-scroll-container table thead th {
  position: sticky;
  top: 0;
  z-index: 15;
  background: #F8FAFC !important;
  box-shadow: inset 0 -1px 0 #E2E8F0, 0 2px 4px rgba(0, 0, 0, 0.02);
}

.th-sortable {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.th-sortable:hover {
  background: #EEF2F6 !important;
  color: #0F172A;
}
.th-sort-inner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 100%;
}
.th-sort-inner.justify-end {
  justify-content: flex-end;
}
.th-sort-inner.justify-center {
  justify-content: center;
}
.sort-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.sort-icon-box svg {
  width: 13px;
  height: 13px;
  color: #94A3B8;
  transition: color 0.15s ease;
}
.th-sortable.active-sort {
  background: #EFF6FF !important;
  color: #1D4ED8;
}
.th-sortable.active-sort .sort-icon-box svg {
  color: #2563EB;
}

/* Catalog Total Counter Bar (Replacing Pagination on Desktop) */
.catalog-table-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #FAFBFD;
  border-top: 1px solid #E2E8F0;
  font-size: 13px;
  color: #64748B;
}
.catalog-total-counter {
  font-size: 13px;
  color: #334155;
  font-weight: 500;
}
.catalog-total-counter strong {
  color: #0F172A;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Desktop Floating Action Dropdown Menu (Requirement 4)
   -------------------------------------------------------------------------- */
.desktop-action-dropdown {
  position: fixed;
  min-width: 175px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
  z-index: 999;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: desktopDropdownPop 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes desktopDropdownPop {
  from { opacity: 0; transform: scale(0.96) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.desktop-action-dropdown .dropdown-header-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94A3B8;
  letter-spacing: 0.5px;
  padding: 6px 10px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.desktop-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #1E293B;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
}
.desktop-dropdown-item:hover {
  background: #F1F5F9;
  color: #0F172A;
}
.desktop-dropdown-item.danger {
  color: #DC2626;
}
.desktop-dropdown-item.danger:hover {
  background: #FEF2F2;
  color: #B91C1C;
}

/* --------------------------------------------------------------------------
   Toast Notifications
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  min-width: 240px;
  max-width: 360px;
  animation: toastIn 0.25s ease forwards;
}

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

.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info    { border-left: 4px solid var(--primary); }

/* --------------------------------------------------------------------------
   Dashboard Components (iOS & Modern Enterprise Design System)
   -------------------------------------------------------------------------- */

/* Dashboard Header */
.dashboard-header-desktop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.dash-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  margin: 0;
}
.dash-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 2px 0 0 0;
}
.dash-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}
.dash-btn-pill:hover {
  background: var(--bg);
  border-color: #D1D5DB;
}
.dash-btn-pill svg {
  width: 15px;
  height: 15px;
  color: #6B7280;
}
.dash-btn-pill .pill-chev {
  width: 13px;
  height: 13px;
  color: #9CA3AF;
  margin-left: 2px;
}
.dash-btn-pill-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
}

/* Mobile Greeting Header */
.dashboard-header-mobile {
  display: none;
  margin-bottom: 18px;
}
.greeting-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.user-greeting-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-top: 2px;
}
.mobile-date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.mobile-date-text {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}
.mobile-pill {
  padding: 4px 10px !important;
  font-size: 11.5px !important;
}

/* Section Header (Mobile & Shared) */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.section-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.section-link:hover {
  text-decoration: underline;
}

/* Quick Action Grid (Desktop: 4 columns) */
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.quick-action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary);
}
.quick-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--text-primary);
}
.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.quick-action-card:hover .quick-action-icon {
  transform: scale(1.05);
}
.quick-action-icon.blue-solid {
  background: #2563EB;
  color: #FFFFFF;
}
.quick-action-icon.blue-soft {
  background: #EFF6FF;
  color: #2563EB;
}
.quick-action-icon.cyan-soft {
  background: #F0F9FF;
  color: #0284C7;
}
.quick-action-icon svg {
  width: 22px;
  height: 22px;
}
.quick-action-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.quick-action-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.quick-action-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 8 KPI Metric Cards Grid */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.kpi-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 118px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.kpi-stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.kpi-stat-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.kpi-stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
}
.kpi-stat-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #F4F5F7;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #6B7280;
}
.kpi-stat-icon-box svg {
  width: 16px;
  height: 16px;
}
.kpi-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  margin-top: 4px;
  line-height: 1.2;
}
.kpi-stat-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11.5px;
  flex-wrap: wrap;
}
.trend-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  font-size: 11.5px;
  line-height: 1;
}
.trend-pill.up { color: #16A34A; }
.trend-pill.down { color: #DC2626; }
.trend-pill.warning { color: #D97706; }
.trend-pill.neutral { color: #6B7280; }
.trend-subtext {
  color: var(--text-secondary);
  font-size: 11.5px;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}
.chart-custom-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.legend-dot.blue { background: #2563EB; }
.legend-dot.orange { background: #F97316; }

/* Dashboard Lists Grid */
.dash-lists-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

/* Cigarette Pack Thumbnail Icons */
.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pack-thumb {
  width: 26px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
  font-weight: 800;
  font-size: 7.5px;
  color: #FFFFFF;
  text-align: center;
  letter-spacing: -0.3px;
  padding: 2px;
}
.pack-thumb-mild {
  background: linear-gradient(145deg, #DC2626, #991B1B);
}
.pack-thumb-surya {
  background: linear-gradient(145deg, #1E40AF, #1E3A8A);
}
.pack-thumb-djarum {
  background: linear-gradient(145deg, #78350F, #451A03);
}
.pack-thumb-marlboro {
  background: linear-gradient(145deg, #B91C1C, #7F1D1D);
}
.pack-thumb-default {
  background: linear-gradient(145deg, #4B5563, #1F2937);
}
.pack-stripe {
  position: absolute;
  top: 5px;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.4);
}

.badge-menipis {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 12px;
  background: #FFF7ED;
  color: #C2410C;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #FFEDD5;
}

/* Activity Badge & Rows */
.badge-activity-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-activity-incoming {
  background: #EFF6FF;
  color: #2563EB;
}
.badge-activity-pickup {
  background: #FEF2F2;
  color: #DC2626;
}
.badge-activity-settlement {
  background: #F0FDF4;
  color: #16A34A;
}
.badge-activity-sale {
  background: #F5F3FF;
  color: #7C3AED;
}
.badge-activity-payment {
  background: #EFF6FF;
  color: #0284C7;
}

.text-val-green {
  color: #16A34A;
  font-weight: 600;
}
.text-val-red {
  color: #DC2626;
  font-weight: 600;
}
.text-val-primary {
  color: var(--text-primary);
  font-weight: 600;
}

/* Mobile Activity List */
.activity-list-mobile {
  display: none;
  flex-direction: column;
}
.activity-item-mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item-mobile:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.activity-left-mobile {
  display: flex;
  align-items: center;
  gap: 12px;
}
.activity-icon-mobile {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.activity-icon-mobile svg {
  width: 18px;
  height: 18px;
}
.activity-info-mobile {
  display: flex;
  flex-direction: column;
}
.activity-title-mobile {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.activity-sub-mobile {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.activity-right-mobile {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.activity-val-mobile {
  font-size: 13px;
  font-weight: 600;
}
.activity-time-mobile {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Katalog Produk (Product Catalog - Enterprise & iOS Design System)
   -------------------------------------------------------------------------- */

/* Breadcrumb Trail */
.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748B;
  margin-bottom: 6px;
}
.breadcrumb-trail a {
  color: #64748B;
  text-decoration: none;
  transition: color 0.15s ease;
}
.breadcrumb-trail a:hover {
  color: var(--primary);
}
.breadcrumb-trail svg {
  width: 14px;
  height: 14px;
  color: #94A3B8;
}

/* Page Header Desktop */
.page-header-desktop {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.page-main-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.4px;
  margin: 0;
}
.page-main-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 3px 0 0 0;
}
.btn-add-desktop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #2563EB;
  color: #FFFFFF;
  font-weight: 600;
  border-radius: var(--radius-md);
  padding: 8px 18px;
  font-size: 13.5px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-add-desktop:hover {
  background: #1D4ED8;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.btn-add-desktop-bar {
  height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-md);
}

@media (min-width: 768px) {
  .filter-pills-row.d-md-none {
    display: none !important;
  }
}

/* Filter Pills / Tabs */
.filter-pills-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-pills-row::-webkit-scrollbar {
  display: none;
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: #FFFFFF;
  border: 1px solid var(--border);
  color: #334155;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s ease;
  cursor: pointer;
}
.filter-pill:hover:not(.active) {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #1E293B;
}
.filter-pill.active {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.filter-pill .pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  background: #F1F5F9;
  color: #64748B;
}
.filter-pill.active .pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

/* Catalog Filter Bar */
.catalog-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.catalog-search-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.catalog-search-wrapper .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94A3B8;
  pointer-events: none;
}
.catalog-search-input {
  width: 100%;
  height: 38px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 0 14px 0 36px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.15s ease;
}
.catalog-search-input:focus {
  background: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.catalog-select {
  height: 38px;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 13px;
  color: #334155;
  background: #FFFFFF;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}
.catalog-select:focus {
  border-color: var(--primary);
}
.btn-filter-icon {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  background: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-filter-icon:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}
.btn-filter-icon svg {
  width: 15px;
  height: 15px;
  color: #64748B;
}

/* Pack Thumbnails & Badges */
.pack-box-thumb {
  width: 32px;
  height: 42px;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  font-weight: 800;
  font-size: 7.5px;
  text-align: center;
  letter-spacing: -0.3px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.pack-sampoerna-mild {
  background: #FFFFFF;
  color: #DC2626;
  border-color: #E2E8F0;
}
.pack-sampoerna-mild::before {
  content: '';
  position: absolute;
  top: 4px; left: 0; right: 0; height: 3px;
  background: #DC2626;
}
.pack-sampoerna-amild {
  background: #FFFFFF;
  color: #DC2626;
  border-color: #FECACA;
}
.pack-sampoerna-amild::after {
  content: 'A';
  font-size: 13px;
  font-weight: 900;
  color: #DC2626;
}
.pack-gg-filter {
  background: linear-gradient(145deg, #7F1D1D, #450A0A);
  color: #FEF08A;
}
.pack-gg-merah {
  background: linear-gradient(145deg, #991B1B, #5F0E0E);
  color: #FEF08A;
}
.pack-djarum-coklat {
  background: linear-gradient(145deg, #B45309, #78350F);
  color: #FEF3C7;
}
.pack-djarum-super {
  background: linear-gradient(145deg, #DC2626, #991B1B);
  color: #FFFFFF;
}
.pack-marlboro-red {
  background: #FFFFFF;
  color: #991B1B;
  border-color: #E2E8F0;
}
.pack-marlboro-red::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 14px;
  background: #DC2626;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
}
.pack-marlboro-gold {
  background: #FFFFFF;
  color: #B45309;
  border-color: #E2E8F0;
}
.pack-marlboro-gold::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 14px;
  background: #D97706;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
}
.pack-la-bold {
  background: #090D16;
  color: #EF4444;
}
.pack-la-bold::before {
  content: '';
  position: absolute;
  left: 6px; right: 6px; top: 0; bottom: 0;
  border-left: 2px solid #DC2626;
  border-right: 2px solid #DC2626;
  opacity: 0.8;
}
.pack-la-lights {
  background: #F8FAFC;
  color: #0F172A;
  border-color: #CBD5E1;
}
.pack-default {
  background: linear-gradient(145deg, #475569, #1E293B);
  color: #FFFFFF;
}

/* Status Badges */
.badge-status-aman {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 12px;
  background: #DCFCE7;
  color: #15803D;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-status-menipis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 12px;
  background: #FEF3C7;
  color: #B45309;
  font-size: 11.5px;
  font-weight: 600;
}
.badge-status-habis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 12px;
  background: #FEE2E2;
  color: #B91C1C;
  font-size: 11.5px;
  font-weight: 600;
}

/* Custom Checkbox */
.custom-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid #CBD5E1;
  cursor: pointer;
  accent-color: #2563EB;
}

/* Row Action Dropdown Button */
.btn-dots-action {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn-dots-action:hover {
  background: #F1F5F9;
  color: #1E293B;
}

/* Pagination Bar */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: #FFFFFF;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  font-size: 12.5px;
  color: #64748B;
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-number-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  text-decoration: none;
  padding: 0 6px;
  transition: all 0.15s ease;
}
.page-number-box:hover:not(.active) {
  background: #F1F5F9;
}
.page-number-box.active {
  background: #2563EB;
  color: #FFFFFF;
  font-weight: 700;
}

/* Subpage Header (Mobile) */
.mobile-subpage-header {
  display: none;
  height: 56px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.btn-subpage-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563EB;
  text-decoration: none;
  background: transparent;
  border: none;
}
.btn-subpage-back svg {
  width: 22px;
  height: 22px;
}
.subpage-title-box {
  text-align: center;
}
.subpage-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.subpage-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary);
}
.subpage-action-right {
  width: 36px;
  display: flex;
  justify-content: flex-end;
}
.btn-subpage-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #2563EB;
  cursor: pointer;
}
.btn-subpage-icon svg {
  width: 20px;
  height: 20px;
}

/* Mobile Product Card (Image 2) */
.mobile-product-list {
  display: none;
  flex-direction: column;
  padding-bottom: 70px;
}
.mobile-product-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.mobile-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.mobile-card-product {
  display: flex;
  align-items: center;
  gap: 12px;
}
.mobile-card-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  font-weight: 800;
  font-size: 9px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.mobile-card-info {
  display: flex;
  flex-direction: column;
}
.mobile-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.mobile-card-sku {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.mobile-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-card-bottom {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #F1F5F9;
}
.mobile-card-col {
  display: flex;
  flex-direction: column;
}
.mobile-col-val {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}
.mobile-col-val.text-danger {
  color: #DC2626 !important;
}
.mobile-col-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Mobile Filter Bar & Search */
.mobile-search-filter-row {
  display: none;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}
.mobile-filter-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #2563EB;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.mobile-floating-action-bar {
  display: none;
}

/* Responsive Visibility Helpers */
.d-mobile-only {
  display: none !important;
}
.d-none-mobile {
  display: flex !important;
}

/* --------------------------------------------------------------------------
   Mobile Bottom Navigation & Media Queries
   -------------------------------------------------------------------------- */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 767px) {
  .sidebar {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
    padding-bottom: calc(var(--bottom-nav-h) + 24px) !important;
  }
  .content-area {
    padding: 14px 16px !important;
  }

  .topbar {
    display: none !important;
  }
  .mobile-header {
    display: flex !important;
  }

  .d-mobile-only {
    display: flex !important;
  }
  .d-none-mobile {
    display: none !important;
  }

  /* Header Mobile */
  .dashboard-header-desktop {
    display: none !important;
  }
  .dashboard-header-mobile {
    display: block !important;
  }

  /* Quick Actions: 4 Compact Columns */
  .quick-action-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
  }
  .quick-action-card {
    flex-direction: column !important;
    padding: 10px 4px !important;
    gap: 6px !important;
    text-align: center !important;
    border-radius: 14px !important;
  }
  .quick-action-icon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
  }
  .quick-action-icon svg {
    width: 20px !important;
    height: 20px !important;
  }
  .quick-action-info {
    align-items: center !important;
  }
  .quick-action-title {
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    text-align: center !important;
  }
  .quick-action-sub {
    display: none !important;
  }

  /* KPI Grid: 2 Columns */
  .kpi-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 20px !important;
  }
  .kpi-stat-card {
    padding: 12px 14px !important;
    min-height: 94px !important;
    border-radius: 14px !important;
  }
  .kpi-stat-icon-box {
    display: none !important;
  }
  .kpi-stat-label {
    font-size: 11px !important;
  }
  .kpi-stat-value {
    font-size: 17px !important;
    margin-top: 2px !important;
  }
  .kpi-stat-bottom {
    margin-top: 6px !important;
    font-size: 10px !important;
  }
  .trend-pill {
    font-size: 10px !important;
  }
  .trend-subtext {
    font-size: 10px !important;
  }
  /* On mobile hide secondary KPI cards 5-8 unless toggled */
  .kpi-stat-card.kpi-secondary {
    display: none;
  }
  .kpi-stat-card.kpi-secondary.show-mobile {
    display: flex !important;
  }

  /* Charts: 1 Column (Stock chart hidden on mobile) */
  .charts-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    margin-bottom: 20px !important;
  }
  .stock-chart-card {
    display: none !important;
  }

  /* Lists Grid: 1 Column */
  .dash-lists-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .low-stock-card {
    display: none !important;
  }

  /* Activity table hidden, list visible */
  .activity-table-wrapper {
    display: none !important;
  }
  .activity-list-mobile {
    display: flex !important;
  }

  /* Katalog Produk Mobile Overrides */
  .mobile-subpage-header {
    display: flex !important;
  }
  .page-header-desktop {
    display: none !important;
  }
  .breadcrumb-trail {
    display: none !important;
  }
  .catalog-filter-bar {
    display: none !important;
  }
  .catalog-desktop-table-card {
    display: none !important;
  }
  .mobile-product-list {
    display: flex !important;
  }
  .mobile-search-filter-row {
    display: flex !important;
  }
  .mobile-floating-action-bar {
    display: flex !important;
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + 12px);
    left: 16px;
    right: 16px;
    z-index: 45;
  }
  .btn-mobile-floating-add {
    width: 100%;
    height: 48px;
    background: #2563EB;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 700;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    border: none;
    cursor: pointer;
    text-decoration: none;
  }
  .btn-mobile-floating-add:active {
    transform: scale(0.98);
  }

  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-h);
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
    justify-content: space-around;
    align-items: center;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 10.5px;
    font-weight: 500;
    gap: 3px;
    flex: 1;
    height: 100%;
  }
  .bottom-nav-item svg {
    width: 20px;
    height: 20px;
  }
  .bottom-nav-item.active {
    color: var(--primary);
    font-weight: 600;
  }
}

/* --------------------------------------------------------------------------
   Searchable Dropdown with Image / Thumbnail Support for Modals
   -------------------------------------------------------------------------- */
.searchable-dropdown-wrapper {
  position: relative;
  width: 100%;
}
.searchable-select-trigger {
  width: 100%;
  min-height: 38px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 13px;
  color: #1E293B;
  user-select: none;
  box-sizing: border-box;
  gap: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.searchable-select-trigger:focus,
.searchable-select-trigger.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.searchable-trigger-content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.searchable-trigger-thumb {
  width: 24px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #E2E8F0;
}
.searchable-trigger-badge {
  width: 24px;
  height: 28px;
  border-radius: 4px;
  background: #F1F5F9;
  color: #475569;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #E2E8F0;
}
.searchable-trigger-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #EFF6FF;
  color: #2563EB;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #BFDBFE;
}
.searchable-trigger-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 500;
  color: #1E293B;
}
.searchable-trigger-placeholder {
  color: #94A3B8;
  font-weight: 400;
}

.searchable-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  z-index: 10050;
  padding: 8px;
  display: none;
  width: 100%;
  min-width: 320px;
  max-width: min(440px, 92vw);
  box-sizing: border-box;
  animation: dropdownFadeIn 0.12s ease;
}
.searchable-dropdown-menu.active {
  display: block;
}
.searchable-dropdown-menu.align-right {
  left: auto;
  right: 0;
}
.searchable-menu-search {
  position: relative;
  margin-bottom: 8px;
}
.searchable-menu-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #94A3B8;
  pointer-events: none;
}
.searchable-menu-input {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  padding: 0 10px 0 32px;
  font-size: 12.5px;
  color: #1E293B;
  outline: none;
  box-sizing: border-box;
  transition: all 0.15s ease;
}
.searchable-menu-input:focus {
  border-color: #2563EB;
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.searchable-menu-list {
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-right: 2px;
}
.searchable-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}
.searchable-menu-item:hover {
  background: #F1F5F9;
}
.searchable-menu-item.selected {
  background: #EFF6FF;
}
.searchable-item-thumb {
  width: 32px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
}
.searchable-item-badge {
  width: 32px;
  height: 40px;
  border-radius: 6px;
  background: linear-gradient(135deg, #F1F5F9, #E2E8F0);
  color: #334155;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #CBD5E1;
  text-align: center;
  padding: 2px;
  line-height: 1.1;
}
.searchable-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #EFF6FF;
  color: #2563EB;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #BFDBFE;
}
.searchable-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.searchable-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1E293B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.searchable-item-subtitle {
  font-size: 11.5px;
  color: #64748B;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.searchable-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.searchable-item-price {
  font-size: 12.5px;
  font-weight: 700;
  color: #2563EB;
}
.searchable-item-tag {
  font-size: 10.5px;
  color: #64748B;
  background: #F1F5F9;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
}
