/* ============================================================
   KATALOG SOFIA - GROSIR (ADMIN / DISTRIBUTOR) DASHBOARD STYLES
   Fully Responsive for Desktop, Tablet, and Mobile Smartphones
   ============================================================ */

/* Top level container spacing fix for admin */
.app-container:has(.admin-layout) {
  padding-bottom: 2rem;
}

/* ============================================================
   1. MAIN LAYOUT & VIEWPORT
   ============================================================ */
.admin-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

.admin-viewport {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ============================================================
   2. ADMIN SIDEBAR & NAVIGATION (DESKTOP & MOBILE RESPONSIVE)
   ============================================================ */
.admin-mobile-navbar {
  display: none;
}

.admin-sidebar-overlay {
  display: none;
}

.admin-sidebar-close-btn {
  display: none;
}

.admin-sidebar {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  padding: 1.25rem 0.85rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: fit-content;
  position: sticky;
  top: 75px;
  z-index: 50;
}

.admin-sidebar-header {
  padding: 0.5rem 0.75rem 1rem 0.75rem;
  border-bottom: 1px solid var(--slate-100);
  margin-bottom: 0.5rem;
}

.admin-sidebar-header .title-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary-700);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-sidebar-header .store-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--slate-900);
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--slate-600);
  font-weight: 600;
  font-size: 0.875rem;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
}

.admin-nav-item:hover {
  background: var(--slate-50);
  color: var(--slate-900);
}

.admin-nav-item.active {
  background: var(--primary-50);
  color: var(--primary-800);
  border-color: var(--primary-200);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.08);
}

.admin-nav-item.active svg {
  color: var(--primary-700);
}

.admin-nav-badge {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

/* ============================================================
   3. STATS METRIC CARDS (RESPONSIVE GRID)
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.stat-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

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

.stat-value {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--slate-900);
  margin-top: 0.25rem;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-500);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-100); color: var(--primary-700); }
.stat-icon.warning { background: #fef3c7; color: #d97706; }
.stat-icon.danger { background: #fee2e2; color: #dc2626; }
.stat-icon.success { background: #dcfce7; color: #16a34a; }

/* ============================================================
   4. CONTENT CARDS, HEADERS & TABLES
   ============================================================ */
.admin-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--slate-900);
}

/* Header Action Toolbar */
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Data Table Component */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  background: #ffffff;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.02);
}

.custom-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.custom-table th {
  background: var(--slate-50);
  padding: 0.85rem 1rem;
  font-weight: 700;
  color: var(--slate-600);
  border-bottom: 1px solid var(--slate-200);
  text-transform: uppercase;
  font-size: 0.725rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.custom-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-800);
  vertical-align: middle;
}

.custom-table tr:hover td {
  background: var(--slate-50);
}

/* Low Stock Alert Banner */
.low-stock-alert-bar {
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
  border: 1px solid #fecdd3;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-sizing: border-box;
}

.low-stock-alert-text {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #9f1239;
  font-weight: 700;
  font-size: 0.875rem;
}

/* ============================================================
   5. TAB-SPECIFIC GRIDS (PROMO & SETTINGS)
   ============================================================ */
.admin-promo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  width: 100%;
}

.admin-settings-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: start;
  width: 100%;
}

.admin-subtabs-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

/* ============================================================
   6. ADMIN CHAT SPLIT LAYOUT (DESKTOP & MOBILE SLIDER)
   ============================================================ */
.admin-chat-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  height: 620px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}

.chat-rooms-list {
  border-right: 1px solid var(--slate-200);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #ffffff;
}

.admin-chat-viewport-pane {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  height: 100%;
  min-height: 0;
}

.chat-room-item {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--slate-100);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.chat-room-item:hover {
  background: var(--slate-50);
}

.chat-room-item.active {
  background: var(--primary-50);
  border-left: 3px solid var(--primary-700);
}

.chat-room-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary-800);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.chat-room-info {
  flex: 1;
  min-width: 0;
}

.chat-room-name {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--slate-900);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-room-preview {
  font-size: 0.775rem;
  color: var(--slate-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.2rem;
}

.mobile-chat-back-btn {
  display: none;
}

/* ============================================================
   7. THERMAL INVOICE / SURAT JALAN PRINT PREVIEW
   ============================================================ */
.printable-invoice {
  font-family: 'Courier New', Courier, monospace;
  background: #ffffff;
  color: #000000;
  padding: 1.25rem;
  max-width: 480px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  border: 1px dashed #94a3b8;
  border-radius: 8px;
}

.invoice-header {
  text-align: center;
  border-bottom: 2px dashed #000;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.invoice-header h2 {
  font-size: 1.2rem;
  font-weight: 900;
  margin-bottom: 0.25rem;
  color: #000;
}

.invoice-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.8rem;
}

.invoice-table th {
  border-top: 1px dashed #000;
  border-bottom: 1px dashed #000;
  padding: 0.35rem 0;
  text-align: left;
}

.invoice-table td {
  padding: 0.35rem 0;
}

.surat-jalan-check-cell {
  transition: all 0.15s ease;
  border-radius: 4px;
}

.surat-jalan-check-cell:hover {
  background-color: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.invoice-total-section {
  border-top: 2px dashed #000;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.invoice-items-list {
  border-top: 1px dashed #000;
  border-bottom: 2px dashed #000;
  padding: 0.6rem 0;
  margin: 0.75rem 0;
}

.invoice-item-entry {
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.invoice-item-entry:not(:first-child) {
  border-top: 1px dashed #cbd5e1;
  padding-top: 0.45rem;
}

.invoice-item-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: #000000;
  word-break: break-word;
}

.invoice-item-calc {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.78rem;
  color: #1e293b;
  margin-top: 2px;
}

.invoice-payment-status-row {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed #94a3b8;
  font-weight: bold;
}

.status-unpaid {
  color: #dc2626 !important;
  font-weight: 800;
}

.status-paid {
  color: #166534 !important;
  font-weight: 800;
}

.invoice-footer-note {
  text-align: center;
  font-size: 0.75rem;
  margin-top: 1.25rem;
  border-top: 1px dashed #000;
  padding-top: 0.5rem;
}


/* ============================================================
   8. MEDIA QUERIES & BREAKPOINTS (TABLETS & SMARTPHONES)
   ============================================================ */

/* TABLET BREAKPOINT (< 992px) */
@media (max-width: 992px) {
  .admin-layout {
    display: block;
    width: 100%;
  }

  /* Admin Mobile Navbar (Top bar dengan tombol toggle menu di layar kecil) */
  .admin-mobile-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    position: sticky;
    top: 58px;
    z-index: 95;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 0.65rem 0.95rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--slate-200);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
    margin-bottom: 1.25rem;
  }

  .admin-menu-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.48rem 0.9rem;
    background: #0f766e;
    color: #ffffff;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.28);
    cursor: pointer;
    position: relative;
    border: none;
    transition: var(--transition);
  }

  .admin-menu-toggle-btn:hover {
    background: #0d9488;
    transform: translateY(-1px);
  }

  .admin-menu-toggle-btn:active {
    transform: translateY(0);
  }

  .admin-mobile-nav-indicator {
    width: 9px;
    height: 9px;
    background: #ef4444;
    border: 2px solid #ffffff;
    border-radius: var(--radius-full);
    position: absolute;
    top: -3px;
    right: -3px;
    animation: pulse 2s infinite;
  }

  .admin-mobile-tab-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
    min-width: 0;
  }

  .admin-mobile-tab-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--slate-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .admin-mobile-tab-name {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--slate-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 175px;
  }

  /* Backdrop Overlay saat Sidebar Terbuka */
  .admin-sidebar-overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }

  .admin-sidebar-overlay.mobile-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Admin Sidebar Drawer di Sebelah Kiri (Off-Canvas) */
  .admin-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 285px !important;
    max-width: 86vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #ffffff !important;
    z-index: 1050 !important;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0 !important;
    border: none !important;
    border-right: 1px solid var(--slate-200) !important;
    box-shadow: 10px 0 35px rgba(15, 23, 42, 0.28) !important;
    padding: 1.25rem 1rem !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.35rem !important;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }

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

  .admin-sidebar-header {
    display: block !important;
    padding: 0.25rem 0.25rem 0.85rem 0.25rem !important;
    border-bottom: 1px solid var(--slate-100) !important;
    margin-bottom: 0.65rem !important;
  }

  .admin-sidebar-close-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--slate-100);
    color: var(--slate-600);
    cursor: pointer;
    transition: var(--transition);
    border: none;
  }

  .admin-sidebar-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
  }

  .admin-nav-item {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
  }

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

  .admin-settings-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* SMARTPHONE & PHABLET BREAKPOINT (< 768px) */
@media (max-width: 768px) {
  .admin-card {
    padding: 1.15rem 0.95rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
  }

  .admin-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .admin-card-header > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .admin-card-header select {
    flex: 1 1 100%;
    width: 100% !important;
  }

  .admin-header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .admin-header-actions .btn {
    flex: 1 1 auto;
    font-size: 0.8rem;
    padding: 0.45rem 0.65rem;
  }

  /* Stats Grid 2x2 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
  }

  .stat-card {
    padding: 0.85rem 0.95rem;
    border-radius: var(--radius-md);
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .stat-label {
    font-size: 0.72rem;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
  }

  .stat-icon svg {
    width: 18px;
    height: 18px;
  }

  /* Promo 1-col */
  .admin-promo-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Low stock bar */
  .low-stock-alert-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
  }

  .low-stock-alert-bar button {
    width: 100%;
    justify-content: center;
  }

  /* Chat Mobile Sliding Experience */
  .admin-chat-grid {
    display: block;
    height: 580px;
    position: relative;
    border-radius: var(--radius-md);
  }

  .chat-rooms-list {
    width: 100%;
    height: 100%;
    border-right: none;
  }

  .admin-chat-viewport-pane {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .admin-chat-grid.mobile-conversation-active .admin-chat-viewport-pane {
    transform: translateX(0);
  }

  .mobile-chat-back-btn {
    display: inline-flex !important;
  }

  /* Table styling */
  .custom-table th {
    padding: 0.65rem 0.75rem;
    font-size: 0.68rem;
  }

  .custom-table td {
    padding: 0.7rem 0.75rem;
    font-size: 0.8rem;
  }

  .custom-table .btn-sm {
    padding: 0.35rem 0.55rem !important;
    font-size: 0.725rem !important;
  }

  /* Universal Inline Grid collapsing on mobile */
  .admin-viewport [style*="grid-template-columns: 1fr 1fr"],
  .admin-viewport [style*="grid-template-columns: 1.2fr 0.8fr"],
  .admin-viewport [style*="grid-template-columns: 2fr 1fr"],
  .admin-viewport [style*="grid-template-columns: 2fr 1fr 1fr auto"],
  .modal-content [style*="grid-template-columns: 1fr 1fr"],
  .modal-content [style*="grid-template-columns: 2fr 1fr"],
  .modal-content [style*="grid-template-columns: 1.2fr 0.8fr"],
  .modal-content [style*="grid-template-columns: 1fr 1fr auto"],
  .modal-content [style*="grid-template-columns: 2fr 1fr 1fr auto"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
}

/* SMALL SMARTPHONES (< 480px) */
@media (max-width: 480px) {
  .stat-card {
    padding: 0.75rem 0.8rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .stat-icon {
    align-self: flex-end;
    margin-top: -24px;
    width: 32px;
    height: 32px;
  }

  .stat-icon svg {
    width: 16px;
    height: 16px;
  }

  .stat-value {
    font-size: 1.05rem;
  }

  .admin-subtab-btn {
    width: 100%;
    justify-content: flex-start;
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }

  .admin-card {
    padding: 1rem 0.75rem;
  }
}

/* ============================================================
   ADMIN PRODUCT SEARCH & PAGINATION TOOLBAR
   ============================================================ */
.admin-product-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.admin-product-search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 260px;
}

.admin-product-search-box .search-box-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--slate-400);
  pointer-events: none;
}

.admin-search-input {
  width: 100%;
  height: 38px;
  padding: 0 2rem 0 2.35rem;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background: #ffffff;
  color: var(--slate-800);
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
}

.admin-search-input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.admin-search-clear-btn {
  position: absolute;
  right: 0.5rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--slate-200);
  color: var(--slate-600);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: var(--transition);
}

.admin-search-clear-btn:hover {
  background: var(--slate-300);
  color: var(--slate-900);
}

.admin-product-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-filter-select {
  height: 38px;
  padding: 0 0.85rem;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--slate-200);
  background: #ffffff;
  font-size: 0.85rem;
  color: var(--slate-700);
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.admin-filter-select:focus,
.admin-filter-select:hover {
  border-color: var(--primary-500);
}

/* Admin Pagination Layout */
.admin-pagination-container {
  width: 100%;
}

.admin-pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--slate-100);
}

.admin-pagination-info {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--slate-600);
  flex-wrap: wrap;
}

.admin-pagination-info strong {
  color: var(--slate-900);
  font-weight: 700;
}

.admin-pagination-limit {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.825rem;
  color: var(--slate-500);
}

.admin-pagination-select {
  padding: 0.25rem 0.5rem;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--slate-800);
  background: #ffffff;
  cursor: pointer;
  outline: none;
}

.admin-pagination-select:focus {
  border-color: var(--primary-500);
}

.admin-pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.admin-pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

@media (max-width: 640px) {
  .admin-product-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .admin-product-search-box {
    min-width: 100%;
  }

  .admin-product-filter-group {
    justify-content: space-between;
  }

  .admin-filter-select {
    flex: 1;
  }

  .admin-pagination-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .admin-pagination-controls {
    justify-content: space-between;
    width: 100%;
  }
}

/* Voucher Scope Cards & Specific Products Selector */
.voucher-scope-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.voucher-scope-card:hover {
  border-color: var(--primary-300);
  background: var(--slate-50);
}

.voucher-scope-card.active {
  border-color: var(--primary-600);
  background: #f0fdf4;
  box-shadow: 0 0 0 1px var(--primary-600);
}

.voucher-product-check-row {
  transition: background-color 0.15s ease;
}

.voucher-product-check-row:hover {
  background: var(--slate-50);
}

.voucher-product-check-row.selected {
  background: #f0fdf4;
}

/* ============================================================
   10. DAFTAR TRANSAKSI & PENGIRIMAN STYLES
   ============================================================ */
.tx-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.tx-period-pills-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--slate-100);
  padding: 0.3rem;
  border-radius: var(--radius-full);
  overflow-x: auto;
  max-width: 100%;
}

.tx-period-pill {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--slate-600);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tx-period-pill:hover {
  color: var(--slate-900);
  background: rgba(255, 255, 255, 0.6);
}

.tx-period-pill.active {
  background: #ffffff;
  color: var(--primary-800);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  font-weight: 800;
}

.tx-filter-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  background: #ffffff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
}

.tx-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tx-summary-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tx-summary-card.primary {
  border-left: 4px solid var(--primary-600);
  background: linear-gradient(to right, #f0fdf4, #ffffff);
}

.tx-summary-card.info {
  border-left: 4px solid #0284c7;
  background: linear-gradient(to right, #f0f9ff, #ffffff);
}

.tx-summary-card.purple {
  border-left: 4px solid #7c3aed;
  background: linear-gradient(to right, #faf5ff, #ffffff);
}

.tx-summary-card.amber {
  border-left: 4px solid #d97706;
  background: linear-gradient(to right, #fffbeb, #ffffff);
}

.tx-group-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.tx-group-header {
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tx-group-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--slate-800);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tx-group-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tx-order-item-card {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--slate-100);
  transition: background 0.15s ease;
}

.tx-order-item-card:last-child {
  border-bottom: none;
}

.tx-order-item-card:hover {
  background: #fbfcfe;
}

.tx-order-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.tx-goods-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.8rem;
}

.tx-goods-table th {
  background: var(--slate-50);
  color: var(--slate-600);
  font-weight: 700;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--slate-200);
}

.tx-goods-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
}

.tx-goods-table tr:last-child td {
  border-bottom: none;
}

.tx-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.tx-action-btn.edit {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

.tx-action-btn.edit:hover {
  background: #0284c7;
  color: #ffffff;
}

.tx-action-btn.delete {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fecaca;
}

.tx-action-btn.delete:hover {
  background: #dc2626;
  color: #ffffff;
}

@media (max-width: 768px) {
  .tx-header-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .tx-filter-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================================================
   11. LAPORAN PENJUALAN & 4 KELOMPOK BISNIS STYLES
   ============================================================ */
.report-group-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--slate-100);
  padding: 0.35rem;
  border-radius: var(--radius-full);
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.report-group-pill {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--slate-600);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.report-group-pill:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--slate-900);
}

.report-group-pill.active {
  background: #ffffff;
  color: var(--primary-800);
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.report-section-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.report-section-header {
  padding: 1rem 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--slate-200);
}

.report-section-header.emerald {
  background: linear-gradient(to right, #f0fdf4, #ffffff);
  border-left: 5px solid var(--primary-600);
}

.report-section-header.blue {
  background: linear-gradient(to right, #f0f9ff, #ffffff);
  border-left: 5px solid #0284c7;
}

.report-section-header.amber {
  background: linear-gradient(to right, #fffbeb, #ffffff);
  border-left: 5px solid #d97706;
}

.report-section-header.purple {
  background: linear-gradient(to right, #faf5ff, #ffffff);
  border-left: 5px solid #7c3aed;
}

.report-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--slate-800);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.report-section-subtitle {
  font-size: 0.75rem;
  color: var(--slate-500);
  margin-top: 2px;
}

.report-section-body {
  padding: 1.25rem 1.35rem;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.report-table th {
  background: var(--slate-50);
  color: var(--slate-700);
  font-weight: 700;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--slate-200);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.report-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
}

.report-table tr:hover td {
  background: #fbfcfe;
}

.report-table tfoot td {
  background: var(--slate-50);
  font-weight: 800;
  border-top: 2px solid var(--slate-200);
  border-bottom: none;
}

/* Visual Bar Chart Styles */
.chart-wrapper {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.bar-chart-canvas {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 220px;
  padding: 1.5rem 0.5rem 0.5rem 0.5rem;
  border-bottom: 2px solid var(--slate-300);
  position: relative;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  min-width: 28px;
}

.bar-fill-track {
  width: 100%;
  max-width: 44px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.bar-fill {
  width: 100%;
  background: linear-gradient(to top, var(--primary-700), var(--primary-500));
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(15, 118, 110, 0.2);
  cursor: pointer;
}

.bar-fill:hover {
  background: linear-gradient(to top, #047857, #10b981);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.35);
}

.bar-label {
  font-size: 0.72rem;
  color: var(--slate-600);
  font-weight: 700;
  margin-top: 0.5rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.bar-val-badge {
  position: absolute;
  top: -26px;
  background: var(--slate-800);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  transform: translateY(4px);
  z-index: 10;
}

.bar-col:hover .bar-val-badge {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   MULTI-SATUAN ROW RESPONSIVENESS
   ============================================================ */
.satuan-option-row {
  transition: all 0.2s ease;
}

.satuan-option-row:hover {
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

/* ============================================================
   PURCHASE ORDER (PO) SEARCHABLE DROPDOWN & ITEM ROWS
   ============================================================ */
.po-item-row {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.po-item-row:focus-within {
  border-color: #0f766e !important;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.2);
}

.po-prod-dropdown::-webkit-scrollbar {
  width: 6px;
}

.po-prod-dropdown::-webkit-scrollbar-track {
  background: #f8fafc;
}

.po-prod-dropdown::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.po-prod-dropdown::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.po-prod-option.active-option {
  background: #f0fdfa !important;
}

@media (max-width: 680px) {
  .po-item-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.65rem !important;
    padding: 0.75rem !important;
  }
  .po-item-row .po-prod-col {
    grid-column: 1 / -1 !important;
  }
  .po-item-row > div:nth-child(5) {
    grid-column: 1 / -1 !important;
    display: flex;
    justify-content: flex-end;
  }
}

/* ============================================================
   PENGATURAN URUTAN PRODUK KATALOG (PANEL DISTRIBUTOR)
   ============================================================ */
.catalog-order-card {
  border: 2px solid var(--slate-200);
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  cursor: pointer;
  transition: all 0.22s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.catalog-order-card:hover {
  border-color: #0d9488;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.12);
}

.catalog-order-card.selected {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.18);
}

.catalog-order-card.selected::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: #0f766e;
}

.catalog-order-check-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: #ffffff;
  flex-shrink: 0;
}

.catalog-order-card.selected .catalog-order-check-indicator {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

.preview-product-chip {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.preview-product-chip:hover {
  transform: translateY(-2px);
  border-color: #99f6e4;
}

/* Voucher Scope Cards & Specific Products Selector */
.voucher-scope-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.voucher-scope-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.voucher-scope-card.active {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: 0 0 0 1px #0f766e;
}

.voucher-product-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.voucher-product-item:hover {
  background: #f8fafc;
}

.voucher-product-item.selected {
  background: #f0fdfa;
}

