/* =========================================================
   SALES LIST MODULE STYLES
   File: assets/css/sale-list.css
   Scoped to: .sales-list-page
   ========================================================= */

.sales-list-page .sales-card-subtitle { color: #64748b; font-size: 12px; font-weight: 600; }
.sales-list-page .top-selling-empty { width: 100%; min-height: 92px; display: grid; place-items: center; gap: 8px; color: #64748b; border: 1px dashed #d8e7dd; border-radius: 18px; background: #f8fffb; }
.sales-list-page .top-selling-empty i { color: #059669; font-size: 28px; }
.sales-list-page .row-action-group { display: inline-flex; align-items: center; gap: 8px; position: relative; }
.sales-list-page .row-dots-btn { width: 34px; padding-inline: 0; }
.sales-list-page .row-action-menu { position: absolute; top: 40px; right: 0; z-index: 50; min-width: 196px; display: none; padding: 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 18px 45px rgba(15, 23, 42, .16); text-align: left; }
.sales-list-page .row-action-menu.open { display: grid; gap: 4px; }
.sales-list-page .row-action-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; color: #0f172a; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; text-align: left; cursor: pointer; }
.sales-list-page .row-action-menu button:hover { background: #f1f5f9; }
.sales-list-page .row-action-menu button.danger { color: #dc2626; }
.sales-list-page .sales-filter-field input[type="date"] { min-width: 150px; }


/* =========================================================
   SALES LIST FINAL POLISH / FIXES
   ========================================================= */
.sales-list-page.premium-sales-dashboard {
  padding-top: 8px !important;
}

.sales-list-page .sales-dash-header {
  margin-bottom: 16px !important;
}

.sales-list-page .sales-mode-card {
  min-width: 0;
  overflow: hidden;
}

.sales-list-page .sales-mode-head {
  display: grid !important;
  grid-template-columns: minmax(128px, 1fr) minmax(150px, 168px);
  align-items: start !important;
  gap: 14px !important;
}

.sales-list-page .sales-mode-head h3 {
  line-height: 1.15;
  white-space: normal;
}

.sales-list-page .sales-mode-head p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.sales-list-page .sales-mode-head select {
  width: 100% !important;
  min-width: 150px;
  height: 42px !important;
  padding: 0 38px 0 14px !important;
  color: #0f172a !important;
  background-color: #fff !important;
  border: 1px solid #dbe3ef !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  line-height: 42px;
  appearance: auto;
  -webkit-appearance: menulist;
}

.sales-list-page .sales-mode-body {
  align-items: center !important;
  gap: 18px !important;
}

.sales-list-page .sales-mode-legend {
  min-width: 0;
  gap: 10px !important;
}

.sales-list-page .mode-line {
  display: grid !important;
  grid-template-columns: minmax(72px, .7fr) minmax(122px, 1fr) 48px;
  align-items: center;
  gap: 10px !important;
  padding: 7px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px !important;
}

.sales-list-page .mode-line:last-child {
  border-bottom: 0;
}

.sales-list-page .mode-label {
  color: #334155;
  font-weight: 900;
}

.sales-list-page .mode-amount {
  color: #0f172a;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.sales-list-page .mode-percent {
  justify-self: end;
  min-width: 42px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.sales-list-page .row-action-menu button.warning {
  color: #d97706;
}

.alfaa-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .44);
  backdrop-filter: blur(5px);
}

.alfaa-confirm-backdrop.open {
  display: flex;
}

.alfaa-confirm-card {
  position: relative;
  width: min(460px, 100%);
  padding: 26px;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
  text-align: center;
}

.alfaa-confirm-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
}

.alfaa-confirm-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: #fff7ed;
  color: #ea580c;
  font-size: 22px;
}

.alfaa-confirm-card h3 {
  margin: 0;
  color: #0f172a;
  font-size: 20px;
  font-weight: 950;
}

.alfaa-confirm-card p {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.alfaa-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.alfaa-confirm-actions .btn-danger {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}

@media (max-width: 1500px) {
  .sales-list-page .sales-mode-body {
    flex-direction: column;
    align-items: stretch !important;
  }

  .sales-list-page .sales-donut {
    align-self: center;
  }
}

@media (max-width: 900px) {
  .sales-list-page.premium-sales-dashboard {
    padding-top: 4px !important;
  }

  .sales-list-page .sales-mode-head {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   FINAL SALES LIST UI POLISH
   Purpose: clean spacing, table readability and responsive stability
   ========================================================= */
.sales-list-page.premium-sales-dashboard {
  padding: 18px 22px 28px !important;
  background: #f8fafc;
}

.sales-list-page .sales-dash-header {
  margin-bottom: 18px !important;
}

.sales-list-page .sales-dash-header h1,
.sales-list-page .sales-card-head h2,
.sales-list-page .sales-search-card h2,
.sales-list-page .sales-mode-head h3 {
  letter-spacing: -0.025em;
}

.sales-list-page .sales-analytics-grid {
  align-items: stretch;
}

.sales-list-page .sales-mode-card {
  padding: 18px 20px !important;
}

.sales-list-page .sales-mode-head {
  grid-template-columns: minmax(150px, 1fr) 160px !important;
  align-items: center !important;
}

.sales-list-page .sales-mode-head select {
  max-width: 160px;
  overflow: visible;
  text-overflow: clip;
}

.sales-list-page .sales-mode-body {
  display: grid !important;
  grid-template-columns: 142px minmax(0, 1fr);
  align-items: center !important;
}

.sales-list-page .sales-donut {
  width: 132px !important;
  height: 132px !important;
}

.sales-list-page .sales-donut strong {
  display: block;
  max-width: 78px;
  margin: 0 auto;
  text-align: center;
  line-height: 1.25;
}

.sales-list-page .mode-line {
  grid-template-columns: minmax(80px, .78fr) minmax(136px, 1fr) 48px !important;
  min-width: 0;
}

.sales-list-page .mode-label,
.sales-list-page .mode-amount,
.sales-list-page .mode-percent {
  min-width: 0;
}

.sales-list-page .sales-modern-table {
  min-width: 1220px;
  table-layout: auto;
  font-size: 13px !important;
}

.sales-list-page .sales-modern-table th,
.sales-list-page .sales-modern-table td {
  padding: 12px 14px !important;
  font-size: 13px !important;
  line-height: 1.35;
  vertical-align: middle;
}

.sales-list-page .sales-modern-table th:nth-child(1),
.sales-list-page .sales-modern-table td:nth-child(1) { min-width: 92px; white-space: nowrap; }
.sales-list-page .sales-modern-table th:nth-child(2),
.sales-list-page .sales-modern-table td:nth-child(2) { min-width: 112px; white-space: nowrap; }
.sales-list-page .sales-modern-table th:nth-child(3),
.sales-list-page .sales-modern-table td:nth-child(3) { min-width: 190px; }
.sales-list-page .sales-modern-table th:nth-child(4),
.sales-list-page .sales-modern-table td:nth-child(4),
.sales-list-page .sales-modern-table th:nth-child(5),
.sales-list-page .sales-modern-table td:nth-child(5),
.sales-list-page .sales-modern-table th:nth-child(6),
.sales-list-page .sales-modern-table td:nth-child(6) { min-width: 120px; white-space: nowrap; }
.sales-list-page .sales-modern-table th:nth-child(7),
.sales-list-page .sales-modern-table td:nth-child(7),
.sales-list-page .sales-modern-table th:nth-child(8),
.sales-list-page .sales-modern-table td:nth-child(8),
.sales-list-page .sales-modern-table th:nth-child(9),
.sales-list-page .sales-modern-table td:nth-child(9),
.sales-list-page .sales-modern-table th:nth-child(10),
.sales-list-page .sales-modern-table td:nth-child(10) { min-width: 104px; white-space: nowrap; }
.sales-list-page .sales-modern-table th:nth-child(11),
.sales-list-page .sales-modern-table td:nth-child(11) { min-width: 120px; white-space: nowrap; }

.sales-list-page .table-title {
  font-size: 13px !important;
  font-weight: 850 !important;
  line-height: 1.35;
}

.sales-list-page .table-subtitle {
  font-size: 11px !important;
  font-weight: 700;
  color: #64748b;
}

.sales-list-page .status-badge {
  min-height: 24px;
  padding: 4px 11px;
  font-size: 12px !important;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 1500px) {
  .sales-list-page .sales-mode-body { grid-template-columns: 1fr !important; }
  .sales-list-page .sales-donut { justify-self: center; }
}


/* =========================================================
   UI VISIBILITY FIX ONLY
   Purpose: restore Sales table footer and prevent clipping
   ========================================================= */
.sales-list-page .sales-table-card { overflow: visible !important; }
.sales-list-page .sales-table-footer {
  min-height: 64px;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px 18px;
  border-top: 1px solid #eef2f7;
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
}
.sales-list-page .sales-table-footer .table-footer-size {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px;
  min-height: 44px;
  white-space: nowrap;
}
.sales-list-page .sales-table-footer select {
  width: 88px !important;
  min-width: 88px;
  height: 42px !important;
  min-height: 42px;
  padding: 0 34px 0 14px !important;
  line-height: 42px !important;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
  appearance: auto;
  -webkit-appearance: menulist;
}
.sales-list-page .sales-pagination {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end;
  gap: 8px;
  min-height: 44px;
  margin-left: auto;
}
.sales-list-page .sales-pagination button {
  min-width: 42px;
  width: 42px;
  min-height: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe3ef;
  border-radius: 11px;
  background: #fff;
  color: #0f172a;
  font-weight: 950;
  cursor: pointer;
}
.sales-list-page .sales-pagination .active {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.sales-list-page .sales-mode-card { overflow: visible !important; }
.sales-list-page .sales-mode-head select { min-width: 170px !important; max-width: none !important; }
.sales-list-page .sales-mode-body { grid-template-columns: 142px minmax(270px, 1fr) !important; }
.sales-list-page .sales-mode-legend { min-width: 270px !important; }
.sales-list-page .mode-line { grid-template-columns: minmax(82px, 1fr) minmax(136px, auto) minmax(48px, auto) !important; }
.sales-list-page .mode-amount,
.sales-list-page .mode-percent { white-space: nowrap !important; }
@media (max-width: 1100px) {
  .sales-list-page .sales-mode-body { grid-template-columns: 1fr !important; }
  .sales-list-page .sales-mode-legend { min-width: 0 !important; width: 100%; }
}
@media (max-width: 640px) {
  .sales-list-page .sales-table-footer { align-items: flex-start !important; }
  .sales-list-page .sales-pagination { width: 100%; justify-content: flex-end; }
}


/* =========================================================
   PROFESSIONAL ROW ACTION MENU FIX V14
   - Prevents clipping/overflow inside scrollable tables
   - Keeps ERP/SaaS styled menu instead of browser default buttons
   ========================================================= */
.row-action-menu,
.sales-list-page .row-action-menu,
.purchase-list-page .row-action-menu,
.expense-list-page .row-action-menu {
  min-width: 230px !important;
  display: none !important;
  padding: 8px !important;
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 16px !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22) !important;
  text-align: left !important;
  overflow: visible !important;
}

.row-action-menu.open,
.row-action-menu.alfaa-floating-action-menu.open,
.sales-list-page .row-action-menu.open,
.purchase-list-page .row-action-menu.open,
.expense-list-page .row-action-menu.open {
  display: grid !important;
  gap: 4px !important;
}

.row-action-menu button,
.sales-list-page .row-action-menu button,
.purchase-list-page .row-action-menu button,
.expense-list-page .row-action-menu button {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 100% !important;
  min-height: 42px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  border: 0 !important;
  background: transparent !important;
  color: #0f172a !important;
  padding: 10px 12px !important;
  border-radius: 12px !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  cursor: pointer !important;
  text-align: left !important;
  white-space: nowrap !important;
}

.row-action-menu button:hover,
.sales-list-page .row-action-menu button:hover,
.purchase-list-page .row-action-menu button:hover,
.expense-list-page .row-action-menu button:hover {
  background: #f8fafc !important;
}

.row-action-menu button.danger,
.row-action-menu button.warning,
.sales-list-page .row-action-menu button.danger,
.sales-list-page .row-action-menu button.warning,
.purchase-list-page .row-action-menu button.danger,
.expense-list-page .row-action-menu button.danger {
  color: #dc2626 !important;
}

.row-action-menu button i,
.sales-list-page .row-action-menu button i,
.purchase-list-page .row-action-menu button i,
.expense-list-page .row-action-menu button i {
  width: 18px !important;
  text-align: center !important;
  font-size: 14px !important;
}
