:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --success-color: #059669;
  --warning-color: #d97706;
  --danger-color: #dc2626;
  --light-bg: rgba(255, 255, 255, 0.95);
  --light-border: rgba(0, 0, 0, 0.1);
  --dark-bg: rgba(15, 23, 42, 0.95);
  --dark-border: rgba(255, 255, 255, 0.1);
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --border-radius: 12px;
  --transition: all 0.2s ease-in-out;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f1f5f9;
  margin: 0;
  color: #0f172a;
  min-height: 100vh;
  overflow-x: hidden;
  font-weight: 400;
  line-height: 1.6;
}

body.dark-mode {
  background: #0f172a;
  color: #f8fafc;
}

/* Layout container */
.app-container {
  display: flex;
  height: calc(100vh - 56px);
  overflow: hidden;
}

/* Sidebar */
#sidebar {
  width: 260px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  color: #0f172a;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  overflow-y: auto;
}

#sidebar.open {
  transform: translateX(0);
}

#sidebar .nav-link {
  font-weight: 500;
  color: #475569;
  padding: 0.875rem 1.25rem;
  border-radius: var(--border-radius);
  margin: 0.25rem 0.75rem;
  transition: var(--transition);
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

#sidebar .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--primary-color);
  border-radius: 2px;
  transition: var(--transition);
}

#sidebar .nav-link:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
  transform: translateX(4px);
}

#sidebar .nav-link:hover::before {
  height: 50%;
}

#sidebar .nav-link.active {
  background: var(--primary-color);
  color: white;
  transform: translateX(4px);
  font-weight: 600;
}

#sidebar .nav-link.active::before {
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
}

body.dark-mode #sidebar {
  background: rgba(15, 23, 42, 0.98);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

body.dark-mode #sidebar .nav-link {
  color: #cbd5e0;
}

body.dark-mode #sidebar .nav-link:hover {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
}

/* Responsive sidebar toggle */
@media (max-width: 768px) {
  #sidebar {
    position: absolute;
    top: 56px;
    left: 0;
    height: calc(100vh - 56px);
    transform: translateX(-100%);
    z-index: 1050;
  }
}

/* Main content */
#contentWrapper {
  overflow-y: auto;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top-left-radius: var(--border-radius);
  flex-grow: 1;
}

body.dark-mode #contentWrapper {
  background: rgba(15, 23, 42, 0.95);
}

/* Navbar styling */
.navbar {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: var(--shadow-soft);
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.025rem;
  color: var(--primary-color) !important;
  font-size: 1.3rem;
}

body.dark-mode .navbar {
  background: rgba(15, 23, 42, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .navbar-brand {
  color: #60a5fa !important;
}



.navbar .form-control {
  border-radius: 2rem;
  padding: 0.5rem 1rem;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.05);
}

.navbar .btn-outline-light {
  border-radius: 2rem;
}

/* Card Styling */
.card {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

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

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  font-weight: 600;
  color: #0f172a;
}

body.dark-mode .card {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

body.dark-mode .card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

/* Toasts */
#notification-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 2000;
}

.notification {
  padding: 1rem 1.25rem;
  margin-bottom: 10px;
  border-radius: var(--border-radius);
  font-weight: 500;
  color: #fff;
  box-shadow: var(--shadow-soft);
  animation: slideInRight 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-width: 280px;
}

.notification.success {
  background: var(--success-color);
}

.notification.error {
  background: var(--danger-color);
}

.notification.warning {
  background: var(--warning-color);
}

.notification.info {
  background: var(--primary-color);
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Modern Button Styling */
.btn {
  border-radius: var(--border-radius);
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  transition: var(--transition);
  border: none;
  text-transform: none;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn-success {
  background: var(--success-color);
  color: white;
  box-shadow: var(--shadow-soft);
}

.btn-success:hover {
  background: #047857;
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
  box-shadow: var(--shadow-soft);
}

.btn-danger:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn-warning {
  background: var(--warning-color);
  color: white;
  box-shadow: var(--shadow-soft);
}

.btn-warning:hover {
  background: #b45309;
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-1px);
}

/* Form Styling */
.form-control {
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 0.75rem 1rem;
  transition: var(--transition);
  font-weight: 400;
  color: #0f172a;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.1);
  background: rgba(255, 255, 255, 1);
}

.form-select {
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 0.75rem 1rem;
  transition: var(--transition);
  color: #0f172a;
}

.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.1);
}

body.dark-mode .form-control,
body.dark-mode .form-select {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc !important;
}

body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
  background: rgba(15, 23, 42, 1);
  border-color: #60a5fa;
  color: #f8fafc !important;
}

body.dark-mode .form-control::placeholder {
  color: #94a3b8 !important;
}

/* Utility */
.text-muted-sm {
  font-size: 0.85rem;
  color: #6c757d;
}

body.dark-mode .text-muted-sm {
  color: #94a3b8;
}

.navbar-brand {
  font-weight: bold;
  letter-spacing: 0.05rem;
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.navbar .form-control,
.navbar .btn-outline-light {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.navbar .form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.user-card {
  transition: transform 0.2s ease, box-shadow 0.2s;
  border: 1px solid #dee2e6;
  border-radius: 0.75rem;
}

.user-card:hover {
  transform: scale(1.01);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.05);
}

.user-info h6 {
  font-weight: 600;
}

.fade-out {
  opacity: 0.4;
  transition: opacity 0.2s ease-out;
}

.loc-card {
  transition: transform 0.2s ease, box-shadow 0.2s;
  border: 1px solid #dee2e6;
  border-radius: 0.75rem;
}

.loc-card:hover {
  transform: scale(1.01);
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.05);
}

.fade-out {
  opacity: 0.4;
  transition: opacity 0.2s ease-out;
}

.drop-zone {
  border: 2px dashed #6c757d;
  padding: 2.5rem;
  border-radius: 1rem;
  background: #f8f9fa;
  transition: all 0.3s ease;
  cursor: pointer;
}

.drop-zone.hover {
  border-color: #0d6efd;
  background-color: #e9f3ff;
  color: #0d6efd;
  box-shadow: 0 0 8px rgba(13, 110, 253, 0.2);
}

.order-preview input {
  font-size: 0.875rem;
}

.preview-table input {
  width: 100%;
  padding: 0.25rem;
  font-size: 0.875rem;
}

.order-card {
  transition: all 0.2s ease;
  border-radius: 0.75rem;
  cursor: pointer;
}

.order-card:hover {
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.07);
  background-color: #f8f9fa;
}

.order-card select {
  cursor: pointer;
}

.order-card .text-muted.loc-name {
  font-style: italic;
}

.order-card-actions .location-group {
  min-width: 200px;
}

/* Responsive layout for order actions */
.order-card-actions {
  min-width: 240px;
}

@media (max-width: 576px) {
  .order-card .card-body {
    flex-direction: column;
    align-items: flex-start;
  }
  .order-card-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .order-card-actions .location-group {
    min-width: 100%;
  }
  .order-card-actions .btn-group {
    margin-top: 0.5rem;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}
.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeOut {
  to { opacity: 0; height: 0; margin: 0; padding: 0; overflow: hidden; }
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}
.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Popover styling for item notes */
.popover-note .popover-header {
  background: linear-gradient(to right, #0d6efd, #6610f2);
  color: #fff;
  font-weight: 600;
}

.popover-note .popover-body {
  max-height: 250px;
  overflow-y: auto;
  font-size: 0.85rem;
}

#headerSearchResults {
  max-height: 300px;
  background: linear-gradient(to right, #0d6efd, #6610f2);
}

.login-wrapper {
  height: 100vh;
}

.login-card {
  min-width: 320px;
}

#loginArea {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);  z-index: 2000;

}
.order-duplicate {
  border: 2px solid #dc3545 !important;
}

.item-duplicate {
  background-color: #f8d7da !important;
}

.item-card {
  transition: all 0.2s ease;
  border-radius: 0.75rem;
}

.item-card:hover {
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.07);
  background-color: #f8f9fa;
}

@media (max-width: 767.98px) {
  .item-table { display: none; }
}

@media (min-width: 768px) {
  #itemCardList { display: none; }
}

/* Enhanced Animations and Effects */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(102, 126, 234, 0.5); }
  50% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.8); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Enhanced Drop Zone */
.drop-zone {
  border: 2px dashed rgba(0, 0, 0, 0.1);
  padding: 2.5rem;
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: var(--transition);
  cursor: pointer;
  color: #0f172a;
}

.drop-zone.hover {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
  color: var(--primary-color);
  box-shadow: var(--shadow-soft);
}

/* Enhanced Order Cards */
.order-card {
  transition: var(--transition);
  border-radius: var(--border-radius);
  cursor: pointer;
}

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

/* Enhanced Item Cards */
.item-card {
  transition: var(--transition);
  border-radius: var(--border-radius);
}

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

/* Enhanced User Cards */
.user-card {
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #0f172a;
}

.user-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-color);
}

/* Enhanced Location Cards */
.loc-card {
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #0f172a;
}

.loc-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-color);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 3px;
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

/* Enhanced Modal Styling */
.modal-content {
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  color: #0f172a;
}

.modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background: transparent;
}

.modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background: transparent;
}

body.dark-mode .modal-content {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer {
  border-color: rgba(255, 255, 255, 0.1);
}

/* Enhanced Table Styling */
.table {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.table th {
  background: rgba(37, 99, 235, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  font-weight: 600;
  color: #0f172a;
}

.table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  color: #334155;
}

body.dark-mode .table {
  background: rgba(15, 23, 42, 0.98);
}

body.dark-mode .table th {
  background: rgba(37, 99, 235, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

body.dark-mode .table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e0 !important;
}

/* Additional dark mode text fixes */
body.dark-mode {
  color: #f8fafc !important;
}

body.dark-mode p,
body.dark-mode div,
body.dark-mode span,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: #f8fafc !important;
}

body.dark-mode .text-muted {
  color: #94a3b8 !important;
}

body.dark-mode .text-secondary {
  color: #cbd5e0 !important;
}

/* Sidebar logout button styling */
#logoutLink {
  color: #f87171 !important;
  border: none !important;
  background: none !important;
  padding: 0.5rem 1rem !important;
  text-align: left !important;
  width: 100% !important;
}

#logoutLink:hover {
  background: rgba(248, 113, 113, 0.2) !important;
  color: #fca5a5 !important;
}

#logoutLink:focus {
  background: rgba(248, 113, 113, 0.2) !important;
  color: #fca5a5 !important;
  box-shadow: none !important;
}

/* Beautiful Login Screen Styling */
.login-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 9999;
}

.login-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

.login-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
}

.login-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  padding: 2rem;
}

.login-card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  box-shadow: 
    0 10px 25px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideUp 0.8s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo {
  margin-bottom: 1rem;
}

.logo-image {
  max-height: 80px;
  width: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  animation: logoFloat 3s ease-in-out infinite;
}

.login-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: #64748b;
  font-size: 1rem;
  margin-bottom: 0;
}

.login-form {
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: #94a3b8;
  font-size: 1.1rem;
  z-index: 2;
  transition: color 0.3s ease;
}

.login-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.95);
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.login-input:focus {
  outline: none;
  border-color: #667eea;
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
  transform: translateY(-1px);
}

.login-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  color: #667eea;
}

.login-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.login-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-loader {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.login-message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.login-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
  opacity: 1;
  transform: translateY(0);
}

.login-message.success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.2);
  opacity: 1;
  transform: translateY(0);
}

.login-footer {
  text-align: center;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(226, 232, 240, 0.5);
}

.footer-text {
  color: #94a3b8;
  font-size: 0.9rem;
  margin: 0;
}

/* Dark mode login styling */
body.dark-mode .login-card {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

body.dark-mode .login-title {
  color: #f8fafc;
}

body.dark-mode .login-subtitle {
  color: #cbd5e0;
}

body.dark-mode .login-input {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.15);
  color: #f8fafc;
}

body.dark-mode .login-input:focus {
  background: rgba(30, 41, 59, 1);
  border-color: #667eea;
}

body.dark-mode .input-icon {
  color: #64748b;
}

body.dark-mode .login-input:focus + .input-icon,
body.dark-mode .input-wrapper:focus-within .input-icon {
  color: #667eea;
}

body.dark-mode .footer-text {
  color: #64748b;
}

/* Animations */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(1deg); }
  66% { transform: translateY(10px) rotate(-1deg); }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

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

/* Responsive login */
@media (max-width: 480px) {
  .login-content {
    padding: 1rem;
    max-width: 100%;
  }
  
  .login-card {
    padding: 1.5rem 1.25rem;
  }
  
  .login-title {
    font-size: 1.75rem;
  }
}

/* Fix reports dark mode text contrast */
body.dark-mode .report-customer .text-dark,
body.dark-mode .report-location .text-dark,
body.dark-mode .report-status .text-dark,
body.dark-mode .report-itemloc .text-dark,
body.dark-mode .report-itemcust .text-dark {
  color: #f8fafc !important;
}

body.dark-mode .report-customer .text-muted,
body.dark-mode .report-location .text-muted,
body.dark-mode .report-status .text-muted,
body.dark-mode .report-itemloc .text-muted,
body.dark-mode .report-itemcust .text-muted {
  color: #cbd5e0 !important;
}

body.dark-mode .report-customer .badge,
body.dark-mode .report-location .badge,
body.dark-mode .report-status .badge,
body.dark-mode .report-itemloc .badge,
body.dark-mode .report-itemcust .badge {
  background-color: #3b82f6 !important;
  color: #ffffff !important;
}

body.dark-mode .report-customer,
body.dark-mode .report-location,
body.dark-mode .report-status,
body.dark-mode .report-itemloc,
body.dark-mode .report-itemcust {
  background-color: rgba(30, 41, 59, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.dark-mode .report-customer:hover,
body.dark-mode .report-location:hover,
body.dark-mode .report-status:hover,
body.dark-mode .report-itemloc:hover,
body.dark-mode .report-itemcust:hover {
  background-color: rgba(30, 41, 59, 1) !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

/* Responsive form improvements */
.row.g-3 {
  margin-left: -0.75rem;
  margin-right: -0.75rem;
}

.row.g-3 > * {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

/* Ensure proper spacing on mobile */
@media (max-width: 767.98px) {
  .row.g-3 {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }
  
  .row.g-3 > * {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
  }
  
  .btn {
    margin-top: 0.5rem;
  }
}

/* Prevent button floating on inputs */
.form-control, .form-select {
  margin-bottom: 0;
}

.btn {
  margin-top: 0;
  white-space: nowrap;
}

/* Better alignment for form elements */
.d-flex.align-items-end {
  align-items: flex-end !important;
}

/* Ensure proper button sizing on mobile */
@media (max-width: 575.98px) {
  .btn {
    width: 100% !important;
    margin-top: 0.75rem;
  }
  
  .form-control, .form-select {
    margin-bottom: 0.5rem;
  }
}

/* Fix any remaining dark text issues */
body.dark-mode .card-text,
body.dark-mode .card-title,
body.dark-mode .list-group-item,
body.dark-mode .nav-link,
body.dark-mode .btn-link {
  color: #f8fafc !important;
}

body.dark-mode .btn-outline-primary {
  color: #60a5fa !important;
  border-color: #60a5fa;
}

body.dark-mode .btn-outline-primary:hover {
  background: #60a5fa;
  color: #0f172a !important;
}

body.dark-mode .alert {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

body.dark-mode .badge {
  color: #0f172a !important;
}

body.dark-mode .popover {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

body.dark-mode .popover-header {
  background: rgba(37, 99, 235, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

body.dark-mode .popover-body {
  color: #f8fafc;
}

/* Fix upload proof of delivery section */
body.dark-mode .drop-zone {
  background: rgba(15, 23, 42, 0.98);
  border: 2px dashed rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

body.dark-mode .drop-zone.hover {
  border-color: #60a5fa;
  background: rgba(37, 99, 235, 0.1);
  color: #60a5fa;
}

body.dark-mode .drop-zone p,
body.dark-mode .drop-zone small {
  color: #f8fafc !important;
}

body.dark-mode .drop-zone .text-muted {
  color: #94a3b8 !important;
}

/* Fix proof list items */
body.dark-mode .list-group-item {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc !important;
}

body.dark-mode .list-group-item:hover {
  background: rgba(37, 99, 235, 0.1);
}

/* Fix form labels and text */
body.dark-mode .form-label {
  color: #f8fafc !important;
}

body.dark-mode .form-text {
  color: #94a3b8 !important;
}

/* Fix proof cards */
body.dark-mode .proof-card {
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

body.dark-mode .proof-card .card-title,
body.dark-mode .proof-card .card-text {
  color: #f8fafc !important;
}

/* Fix items section dark mode - comprehensive color fixes */
body.dark-mode .item-card {
  background: rgba(15, 23, 42, 0.98) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}

body.dark-mode .item-card .card-body {
  background: transparent !important;
  color: #f8fafc !important;
}

body.dark-mode .item-card .fw-semibold {
  color: #f8fafc !important;
}

body.dark-mode .item-card .small {
  color: #cbd5e0 !important;
}

body.dark-mode .item-card .text-muted {
  color: #94a3b8 !important;
}

body.dark-mode .item-card .copyable {
  color: #f8fafc !important;
}

body.dark-mode .item-card div {
  color: #cbd5e0 !important;
}

/* Fix item table in dark mode */
body.dark-mode .item-table {
  background: rgba(15, 23, 42, 0.98) !important;
  color: #f8fafc !important;
}

body.dark-mode .item-table th {
  background: rgba(37, 99, 235, 0.1) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}

body.dark-mode .item-table td {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e0 !important;
}

body.dark-mode .item-table .copyable {
  color: #cbd5e0 !important;
}

/* Fix item status badges */
body.dark-mode .item-status-badge {
  color: #0f172a !important;
}

/* Fix item search section */
body.dark-mode #itemResults {
  background: transparent !important;
  color: #f8fafc !important;
}

body.dark-mode #itemResults .text-muted {
  color: #94a3b8 !important;
}

/* Fix any Bootstrap overrides */
body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) > td {
  background-color: rgba(15, 23, 42, 0.5) !important;
  color: #cbd5e0 !important;
}

body.dark-mode .table-hover > tbody > tr:hover > td {
  background-color: rgba(37, 99, 235, 0.1) !important;
  color: #f8fafc !important;
}

/* Fix card overrides */
body.dark-mode .card {
  background: rgba(15, 23, 42, 0.98) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}

body.dark-mode .card-body {
  background: transparent !important;
  color: #f8fafc !important;
}

/* Fix any remaining text elements */
body.dark-mode .item-card * {
  color: inherit !important;
}

body.dark-mode .item-card .btn {
  color: #0f172a !important;
}
