:root {
  --primary: #121212;
  --accent: #45c0b6;
  --bg-light: #fafaf9;
  --bg-muted: #f5f5f5;
  --text-dark: #000000;
  --text-muted: #6b6b6b;
  --radius: 8px;
  --shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

/* Reset + Base */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Typography */
h1,
h2,
h3 {
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text-dark);
}

.panel-title,
.sidebar-title {
  font-size: 1.2rem;
  color: var(--text-dark);
}

/* Layout */
.dashboard-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.sidebar {
  flex: 1 1 280px;
  max-width: 320px;
}

.main-panel {
  flex: 2 1 640px;
}

.header-section,
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
}

.dashboard-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* Selected Order Card */
.selected-order-card {
  background: #fff;
  padding: 1.2rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.95rem;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem 2rem;
  margin-bottom: 1.5rem;
}

.order-info-row {
  display: flex;
  flex-direction: column;
}

.order-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.order-info-row span:last-child {
  font-weight: 500;
  color: var(--text-dark);
}
.order-info-row.status-ok span:last-child {
  color: green;
}
.order-info-row.status-pending span:last-child {
  color: #e67e22;
}
.order-info-row.status-failed span:last-child {
  color: red;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.6;
  border: 1px solid transparent;
}

/* Payment status colors */
.badge--success {
  background: #e8f7ee;
  color: #106c3a;
  border-color: #bfe8cf;
}
.badge--warn {
  background: #fff6e6;
  color: #8a5200;
  border-color: #ffe3b3;
}
.badge--info {
  background: #eaf3ff;
  color: #0b4a8b;
  border-color: #c9e0ff;
}
.badge--danger {
  background: #fdeaea;
  color: #8b1a1a;
  border-color: #f7c8c8;
}
.badge--neutral {
  background: #efefef;
  color: #444;
  border-color: #e0e0e0;
}

/* Optional tiny dot */
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
/* Sidebar */
.search {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  width: 100%;
  margin-bottom: 1rem;
}

.order-list .order {
  padding: 0.75rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s;
}

.order:hover {
  background: #f1f1f1;
}

.order.selected {
  background: #e6f5f3;
  border-left: 4px solid var(--accent);
}

/* Upload Form */
.upload-form input[type="file"] {
  margin: 0.5rem 0;
}

.dropzone {
  border: 2px dashed #ccc;
  padding: 2rem;
  text-align: center;
  border-radius: var(--radius);
  background: var(--bg-light);
  margin-bottom: 1rem;
  cursor: pointer;
}

.dropzone:hover {
  background: #f0f0f0;
}

.upload-status {
  color: green;
  font-size: 0.85rem;
}

/* Document List */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.file-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.file-thumb img {
  max-width: 100%;
  max-height: 100px;
  object-fit: contain;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.file-info {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.delete-link {
  color: #c0392b;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: block;
}

/* Buttons */
button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.3s ease;
}

button:hover {
  background: #000;
}

.actions {
  display: flex;
  gap: 1rem;
}

/* Panel Box */
.panel {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3); /* translucent overlay */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
}

.modal-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #333;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 999;
  max-width: 300px;
  font-size: 0.9rem;
}

.toast.show {
  opacity: 1;
  pointer-events: auto;
}

/* Loader */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 998;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 6px solid #ddd;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none;
}

@media (max-width: 768px) {
  .dashboard-wrapper {
    flex-direction: column;
  }

  .selected-order-card {
    width: 100%;
  }

  .header-section {
    flex-direction: column;
    align-items: flex-start;
  }
}
.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 12px;
  margin-top: 12px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 14px;
  gap: 8px;
}
.pagination-controls {
  font-size: 0.875rem; /* smaller readable size */
  font-weight: 500;
}

.pagination-controls select,
.pagination-controls button {
  font-size: 0.85rem;
}

.pagination-left,
.pagination-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-controls button {
  padding: 6px 12px;
  border: none;
  background-color: #333;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.pagination-controls button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.pagination-controls select {
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

@media (max-width: 600px) {
  .pagination-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .pagination-left,
  .pagination-right {
    width: 100%;
    justify-content: space-between;
  }
}
.settings-toggle {
  margin-top: 8px;
  padding: 6px 12px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
}

.settings-toggle:hover {
  background-color: #0056b3;
}

.hidden {
  display: none !important;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Global Settings Modal Styles */
#globalSettingsModal .modal-content {
  position: relative;
  padding: 24px;
  background-color: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-family: "Helvetica", sans-serif;
}

#globalSettingsModal h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

#globalSettingsModal p {
  font-size: 14px;
  margin-bottom: 16px;
  color: #555;
}

.config-form .checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  margin-bottom: 20px;
}

.config-form label {
  display: flex;
  align-items: center;
  background: #f9f9f9;
  padding: 10px;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.config-form label:hover {
  background: #f0f0f0;
}

.config-form input[type="checkbox"] {
  accent-color: #007aff;
  width: 18px;
  height: 18px;
  margin-right: 8px;
}

.config-form button[type="submit"],
.config-form button[type="button"] {
  background-color: #007aff;
  color: #fff;
  border: none;
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 10px;
  transition: background-color 0.3s ease;
}

.config-form button[type="button"] {
  background-color: #888;
}

.config-form button:hover {
  background-color: #005bb5;
}

.config-form .upload-status {
  margin-top: 10px;
  font-size: 13px;
  color: green;
}
.config-form button:hover:not(:disabled) {
  background-color: #005bb5;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
}

.modal-close:hover {
  color: #000;
}

.tabs {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 12px;
  border-bottom: 2px solid #ddd;
}

.tab {
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  background-color: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  transition: all 0.3s;
  color: #555;
}

.tab:hover {
  color: #007aff;
  background-color: #f5f5f5;
}

.tab.active {
  color: #007aff;
  font-weight: 600;
  border-bottom: 3px solid #007aff;
}

.tab-content {
  opacity: 0;
  visibility: hidden;
  height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, height 0.3s ease;
}

.tab-content.active {
  opacity: 1;
  visibility: visible;
  height: auto;
  overflow: visible;
}

.tab:hover ~ .tab-content {
  opacity: 1;
  visibility: visible;
  height: auto;
  overflow: visible;
}
button:disabled,
button[disabled] {
  background-color: #ccc !important;
  color: #666 !important;
  cursor: not-allowed !important;
}

.file-icon i {
  font-size: 36px;
  color: #e03e2d; /* red for PDF, or change dynamically */
}

/* Hide the Order ID field + its label in the upload form */
#uploadForm #orderId,
#uploadForm label[for="orderId"] {
  display: none !important;
}

.modal .modal-content {
  position: relative;
}
.modal .modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
