/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  border: none;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-sm {
  padding: 3px 8px;
  font-size: 11px;
}

.btn-primary {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-secondary {
  background-color: white;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover {
  background-color: #f9fafb;
  transform: translateY(-1px);
}

.btn-reset {
  border: none;
  background: transparent;
  box-shadow: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 13px;
}
.btn-reset:hover {
  color: #6b7280;
}

/* ===== FORMS & FILTERS ===== */
.form-control {
  width: 100%;
  padding: 11px 14px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #111827;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-control:focus {
  outline: none;
  border-color: #ef4444;
}

.date-picker-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  white-space: nowrap;
}

.date-input-wrapper {
  position: relative;
}

.date-input {
  padding: 3px 24px 3px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 11px;
  font-family: inherit;
  width: 170px;
  cursor: pointer;
  background: white;
  color: #111827;
}

.calendar-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.filter-divider {
  width: 1px;
  height: 24px;
  background: #e5e7eb;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== DEVISE LOGIN ===== */
.login-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.login-logo {
  text-align: center;
  font-size: 40px;
  margin-bottom: 8px;
}

.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 4px;
}

.login-subtitle {
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  margin: 0 0 32px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.login-card .form-control {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
}
.login-card .form-control:focus {
  background: rgba(255, 255, 255, 0.1);
}

.btn-login {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  margin-top: 8px;
}
.btn-login:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

.flash-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 20px;
}

.flash-notice {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 20px;
}

/* ===== FLASH ALERTS / TOASTS ===== */
.alert {
  padding: 14px 44px 14px 20px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 14px;
  animation: slideDown 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.10);
  min-width: 320px;
  max-width: 520px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert.hiding {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
}

.alert-success {
  background-color: rgba(209, 250, 229, 0.85);
  color: #065f46;
  border: 1px solid rgba(167, 243, 208, 0.6);
}

.alert-error {
  background-color: rgba(254, 226, 226, 0.85);
  color: #991b1b;
  border: 1px solid rgba(254, 202, 202, 0.6);
}

.alert-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: inherit;
  opacity: 0.5;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity 0.15s, background 0.15s;
}

.alert-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.08);
}

/* ===== STATUS BADGES ===== */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  background-color: #e2e8f0;
  color: #475569;
}
.status-badge.received { background-color: #d1fae5; color: #065f46; }
.status-badge.process { background-color: #dbeafe; color: #1e40af; }
.status-badge.refused { background-color: #fee2e2; color: #991b1b; }
.status-badge.arrived { background-color: #fef3c7; color: #92400e; }
.status-badge.changed { background-color: #ffedd5; color: #c2410c; }

/* ===== UTILITIES ===== */
.copy-text-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: #64748b;
  display: flex;
  align-items: center;
  border-radius: 4px;
}
.copy-btn:hover { background: #f1f5f9; }

.font-medium { font-weight: 500; }
.font-mono { font-family: monospace; }
.text-dark { color: #0f172a; }
.text-muted { color: #64748b; }
.text-secondary { color: #475569; font-size: 13px; }
.text-danger { color: #ef4444; }
.text-nowrap { white-space: nowrap; }
.text-sm { font-size: 13px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: #64748b;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ===== STUB PAGE ===== */
.stub-box {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 60px 80px;
  text-align: center;
  max-width: 480px;
}

.stub-icon {
  font-size: 56px;
  margin-bottom: 20px;
}

/* ===== GLOBAL LOADER ===== */
#global-loader {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(5px);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#global-loader .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #ef4444;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

#global-loader .loader-text {
  font-size: 18px;
  font-weight: 500;
  color: #1f2937;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.hidden { display: none !important; }

/* ===== COLUMNS DROPDOWN ===== */
.columns-dropdown {
  padding: 10px;
  min-width: 220px;
}
.column-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  cursor: pointer;
  font-size: 14px;
  color: #f1f5f9;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .login-card {
    padding: 32px 20px;
    margin: 0 16px;
  }
  
  .date-input {
    width: 100%;
  }
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  align-items: center;
}

.pagination span.page a, 
.pagination span.first a, 
.pagination span.last a, 
.pagination span.prev a, 
.pagination span.next a,
.pagination span.current,
.pagination span.gap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: white;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pagination span a:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
}

.pagination span.current {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: #ef4444;
  color: white;
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}

.pagination span.gap {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  padding: 0 4px;
  min-width: 20px;
}

/* ===== BTN INFO (Light Blue) ===== */
.btn-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}
.btn-info:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.btn-info:disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ===== CUSTOM MODAL ===== */
.custom-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.custom-modal {
  background: white;
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  text-align: center;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.custom-modal-icon {
  font-size: 48px;
  margin-bottom: 16px;
  line-height: 1;
}

.custom-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 12px;
}

.custom-modal-text {
  font-size: 15px;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 24px;
}

.custom-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.custom-modal-actions .btn {
  flex: 1;
}
