/* =========================
   FILE: pending-orders.css
   FULL ERP STYLE
========================= */

:root {
  --primary: #108082;
  --primary-dark: #0b6668;
  --secondary: #323232;

  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #2563eb;

  --bg: #f4f7fb;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;

  --shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* RESET */

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
}

.main-content {
  padding: 25px;
}

/* TOPBAR */

.topbar {
  background: var(--card);
  padding: 22px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  margin-bottom: 22px;
}

.topbar h1 {
  font-size: 26px;
  margin-bottom: 6px;
  color: var(--text);
}

.topbar p {
  color: var(--muted);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* BUTTONS */

.btn {
  border: none;
  outline: none;
  cursor: pointer;

  padding: 10px 14px;
  border-radius: 10px;

  font-size: 13px;
  font-weight: 700;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;

  transition: 0.25s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

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

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.secondary {
  background: #f3f4f6;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn.secondary:hover {
  background: #e5e7eb;
}

.btn.light {
  background: #eef2f7;
  color: var(--text);
  border: 1px solid var(--border);
}

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

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

.btn.danger,
.btn.delete {
  background: var(--danger);
  color: #fff;
}

/* STATS */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  box-shadow: var(--shadow);
  transition: 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
}

.stat-card h3 {
  font-size: 30px;
  color: var(--primary);
  margin-bottom: 5px;
}

.stat-card p {
  color: var(--muted);
  font-size: 14px;
}

/* SECTION */

.section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.section-header h2 {
  font-size: 20px;
  margin-bottom: 5px;
}

.section-header p {
  color: var(--muted);
  font-size: 13px;
}

/* FILTERS */

.order-filters {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;

  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 12px;
}

.filter-input,
.filter-select {
  width: 100%;
  height: 42px;

  padding: 10px 13px;
  border: 1px solid #d1d5db;
  border-radius: 10px;

  background: #fff;
  color: var(--text);

  font-size: 14px;
  outline: none;

  transition: 0.2s ease;
}

.filter-input:focus,
.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 128, 130, 0.12);
}

.filter-input::placeholder {
  color: #9ca3af;
}

/* TABLE */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  background: #fff;
}

thead {
  background: #f1f5f9;
}

th {
  padding: 15px 14px;
  text-align: left;
  color: #374151;

  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;

  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover {
  background: #f9fafb;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 35px !important;
  font-size: 14px;
}

/* ACTION BUTTONS */

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* BADGES */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 6px 13px;
  border-radius: 50px;

  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.pending,
.badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.badge.success {
  background: #dcfce7;
  color: #166534;
}

.badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge.info {
  background: #dbeafe;
  color: #1e40af;
}

/* MOBILE CARDS */

.mobile-orders {
  display: none;
}

.mobile-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.mobile-card h3 {
  color: var(--primary);
  font-size: 17px;
  margin-bottom: 12px;
}

.mobile-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;

  padding: 8px 0;
  border-bottom: 1px dashed var(--border);

  font-size: 14px;
}

.mobile-row span {
  color: var(--muted);
}

.mobile-row b {
  text-align: right;
}

/* MODAL */

.modal-overlay {
  position: fixed;
  inset: 0;

  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(8px);

  display: none;
  align-items: center;
  justify-content: center;

  padding: 20px;
  z-index: 9999;
}

.modal-modern {
  width: min(900px, 100%);
  max-height: 92vh;
  overflow-y: auto;

  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;

  padding: 24px;

  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);

  animation: modalFade 0.25s ease;
}

.large-modal {
  width: min(1200px, 100%);
}

.small-modal {
  width: min(460px, 100%);
}

@keyframes modalFade {
  from {
    transform: translateY(12px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;

  padding-bottom: 16px;
  margin-bottom: 18px;

  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
}

.modal-title span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;
  color: var(--muted);
}

.modal-close {
  width: 42px;
  height: 42px;

  border-radius: 12px;
  border: 1px solid #d1d5db;

  background: #fff;
  color: var(--text);

  font-size: 20px;
  cursor: pointer;

  transition: 0.2s;
}

.modal-close:hover {
  background: #f3f4f6;
}

/* MODAL BODY */

.modal-body {
  padding-top: 4px;
}

.modal-section-title {
  margin: 18px 0 12px;
  padding: 10px 12px;

  border-radius: 10px;

  background: #f1f5f9;
  color: var(--primary);

  font-size: 15px;
  font-weight: 800;

  display: flex;
  align-items: center;
  gap: 8px;
}

/* MODAL GRID */

.modal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.field {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px;
  transition: 0.2s;
}

.field:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
}

.field.wide {
  grid-column: span 2;
}

.field.highlight {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.field.highlight .value {
  color: #065f46;
  font-size: 18px;
}

.field label {
  display: block;

  font-size: 11px;
  font-weight: 800;

  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;

  margin-bottom: 7px;
}

.value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

/* PDF */

.field.pdf {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.pdf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;
  flex-wrap: wrap;
}

.pdf-row span {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
}

.btn-view {
  background: var(--info);
  color: #fff;

  border: none;
  border-radius: 9px;

  padding: 10px 14px;

  font-size: 13px;
  font-weight: 700;

  cursor: pointer;

  display: inline-flex;
  align-items: center;
  gap: 6px;

  transition: 0.2s;
}

.btn-view:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
}

/* SEND MODAL */

.send-body {
  padding: 10px 2px 2px;
}

.send-body p {
  color: #374151;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* FOOTER */

.footer {
  margin-top: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* SCROLLBAR */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 50px;
}

/* RESPONSIVE */

@media (max-width: 1200px) {
  .order-filters {
    grid-template-columns: 1fr 1fr;
  }

  .modal-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
  }

  .topbar-actions .btn {
    flex: 1;
  }
}

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

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .section-card {
    padding: 16px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .order-filters {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    display: none;
  }

  .mobile-orders {
    display: block;
  }

  .modal-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .field.wide {
    grid-column: span 2;
  }
}

@media (max-width: 540px) {
  .topbar h1 {
    font-size: 22px;
  }

  .topbar-actions {
    flex-direction: column;
  }

  .topbar-actions .btn,
  .btn {
    width: 100%;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-modern {
    padding: 18px;
    border-radius: 14px;
  }

  .modal-title {
    font-size: 20px;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .field.wide {
    grid-column: span 1;
  }

  .pdf-row {
    align-items: flex-start;
  }

  .btn-view {
    width: 100%;
    justify-content: center;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
  }
}
/* =========================
   TOAST NOTIFICATION
========================= */

#toastNotification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    max-width: 400px;
    animation: slideInToast 0.3s ease;
}

/* Success - Green */
#toastNotification.success {
    background: #16a34a;
}

/* Error - Red */
#toastNotification.error {
    background: #dc2626;
}

/* Info - Blue */
#toastNotification.info {
    background: #2563eb;
}

/* Warning - Orange */
#toastNotification.warning {
    background: #d97706;
}

/* Slide in animation */
@keyframes slideInToast {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade out */
#toastNotification.hide {
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.4s ease;
}

/* =========================
   CUSTOM ALERT MODAL
========================= */

.custom-alert-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
    animation: fadeInOverlay 0.2s ease;
}

.custom-alert-overlay.show {
    display: flex;
}

.custom-alert-box {
    background: #ffffff;
    border-radius: 14px;
    padding: 32px 28px 24px;
    min-width: 320px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    text-align: center;
    animation: popInBox 0.25s ease;
}

/* Header - Icon + Title */
.custom-alert-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.custom-alert-header i {
    font-size: 42px;
}

.custom-alert-header span {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

/* Message */
.custom-alert-message {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* OK Button */
.custom-alert-btn {
    padding: 10px 36px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: white;
    background: #0f766e;
    transition: background 0.2s ease;
}

.custom-alert-btn:hover {
    background: #0d6460;
}

/* Icon Colors per type */
.custom-alert-overlay.success #alertIcon { color: #16a34a; }
.custom-alert-overlay.error   #alertIcon { color: #dc2626; }
.custom-alert-overlay.warning #alertIcon { color: #d97706; }
.custom-alert-overlay.info    #alertIcon { color: #2563eb; }

/* Button Colors per type */
.custom-alert-overlay.success .custom-alert-btn { background: #16a34a; }
.custom-alert-overlay.success .custom-alert-btn:hover { background: #15803d; }

.custom-alert-overlay.error .custom-alert-btn { background: #dc2626; }
.custom-alert-overlay.error .custom-alert-btn:hover { background: #b91c1c; }

.custom-alert-overlay.warning .custom-alert-btn { background: #d97706; }
.custom-alert-overlay.warning .custom-alert-btn:hover { background: #b45309; }

.custom-alert-overlay.info .custom-alert-btn { background: #2563eb; }
.custom-alert-overlay.info .custom-alert-btn:hover { background: #1d4ed8; }

/* Animations */
@keyframes fadeInOverlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes popInBox {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* Mobile */
@media (max-width: 480px) {
    .custom-alert-box {
        padding: 24px 18px 20px;
        min-width: unset;
    }

    .custom-alert-header i {
        font-size: 34px;
    }

    .custom-alert-header span {
        font-size: 16px;
    }
}