/* Modern Color Scheme */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --info-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
  --dark-gradient: linear-gradient(135deg, #434343 0%, #000000 100%);
}

/* Body & Background */
body {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  background-attachment: fixed;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Modern Navbar */
.navbar {
  background: var(--primary-gradient) !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1040;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-link {
  font-weight: 500;
  transition: all 0.3s ease;
  border-radius: 6px;
  margin: 0 2px;
  padding: 0.5rem 1rem !important;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.navbar-toggler {
  border: none;
  padding: 0.35rem 0.5rem;
  box-shadow: none !important;
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

/* Offcanvas Navigation */
.offcanvas-main-nav {
  background: var(--dark-gradient) !important;
}

.offcanvas-main-nav .offcanvas-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.offcanvas-main-nav .nav-link {
  color: rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  margin: 0.15rem 0;
}

.offcanvas-main-nav .nav-link:hover,
.offcanvas-main-nav .nav-link:focus {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.logout-button {
  font-weight: 600;
  padding: 0.65rem 1.25rem;
}

/* Modern Cards */
.card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 10px 20px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  background: #ffffff;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15), 0 6px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  border: none;
  padding: 1rem 1.25rem;
}

/* Dashboard Stat Cards */
.card.text-bg-primary {
  background: var(--primary-gradient) !important;
  border: none;
  color: white !important;
}

.card.text-bg-primary .card-title,
.card.text-bg-primary .display-6 {
  color: white !important;
}

.card.text-bg-success {
  background: var(--success-gradient) !important;
  border: none;
  color: white !important;
}

.card.text-bg-success .card-title,
.card.text-bg-success .display-6 {
  color: white !important;
}

.card.text-bg-info {
  background: var(--info-gradient) !important;
  border: none;
  color: white !important;
}

.card.text-bg-info .card-title {
  color: white !important;
}

.card.text-bg-warning {
  background: var(--warning-gradient) !important;
  border: none;
  color: #000 !important;
}

.card.text-bg-warning .card-title,
.card.text-bg-warning .display-6,
.card.text-bg-warning .small {
  color: #000 !important;
  font-weight: 600;
}

/* Stat Cards Enhancement */
.card.text-bg-primary .display-6,
.card.text-bg-success .display-6,
.card.text-bg-info .display-6 {
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card .card-body {
  padding: 1.5rem;
}

.card .card-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
  margin-bottom: 0.75rem;
}

/* Modern Buttons */
.btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  transition: all 0.3s ease;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success-gradient);
  color: white;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

/* Forms */
.form-control, .form-select {
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
  transform: translateY(-1px);
}

/* Tables */
.table {
  border-radius: 12px;
  overflow: hidden;
}

.table thead {
  background: var(--primary-gradient);
  color: white;
}

.table thead th {
  border: none;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(102, 126, 234, 0.05);
}

/* Profit Table */
.profit-table-wrapper {
  max-height: 60vh;
  overflow-x: auto;
}

.profit-search-wrapper {
  position: relative;
}

.profit-search-input {
  padding-left: 2.5rem;
}

.profit-search-label {
  display: none;
}

.profit-search-wrapper::before {
  content: "\1F50D";
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.6;
}

.profit-table-col-qty {
  width: 120px;
}

.profit-qty-cell {
  min-width: 110px;
}

.profit-qty-mobile-btn {
  display: none;
  border: none;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
  background: rgba(102, 126, 234, 0.12);
  color: #4a4a4a;
  transition: all 0.2s ease;
}

.profit-qty-mobile-btn:hover:not(:disabled),
.profit-qty-mobile-btn:focus-visible:not(:disabled) {
  background: rgba(118, 75, 162, 0.2);
  color: #2d3748;
}

.profit-qty-mobile-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.profit-qty-input {
  width: 100%;
  min-width: 95px;
  font-size: 1rem;
  text-align: center;
  padding: 0.6rem 0.75rem;
}

@media (max-width: 768px) {
  .profit-qty-mobile-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .profit-table {
    font-size: 0.95rem;
  }

  .profit-search-input {
    padding-left: 2.75rem;
    font-size: 1rem;
  }

  .profit-table-col-qty {
    width: 140px;
  }

  .profit-qty-cell {
    min-width: 160px;
  }

  .profit-qty-input {
    min-width: 120px;
    font-size: 1.05rem;
    padding: 0.65rem;
  }
}

@media (max-width: 576px) {
  .profit-qty-mobile-wrapper {
    width: 100%;
    gap: 0.75rem;
  }

  .profit-table thead,
  .profit-table colgroup {
    display: none;
  }

  .profit-table tbody tr {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    background: #ffffff;
  }

  .profit-table tbody tr td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    border: none;
  }

  .profit-table tbody tr td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #4a5568;
    margin-right: 1rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
  }

  .profit-qty-cell {
    min-width: 0;
  }

  .profit-qty-mobile-controls {
    display: inline-flex;
    gap: 0.65rem;
  }

  .profit-qty-mobile-btn {
    display: inline-flex;
  }

  .profit-qty-input {
    max-width: 100%;
    flex: 1;
  }
}

/* Alerts */
.alert {
  border-radius: 12px;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 1rem 1.25rem;
}

.alert-info {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0c4a6e;
  border-left: 4px solid #0ea5e9;
}

.alert-success {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #14532d;
  border-left: 4px solid #22c55e;
}

.alert-danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.alert-warning {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border-left: 4px solid #f59e0b;
}

/* Main Container */
main.container {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding: 2rem !important;
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1;
}


/* Login Page Enhancement */
.card.shadow-sm {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
  border-radius: 20px;
}

/* Badges */
.badge {
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
}

/* Hover Effects */
a {
  transition: all 0.3s ease;
}

a:hover {
  transform: translateX(2px);
}

/* Responsive Improvements */
@media (max-width: 768px) {
  main.container {
    border-radius: 0;
    margin: 0;
    padding: 1rem !important;
    box-shadow: none;
  }
  
  .card {
    border-radius: 12px;
  }

  .navbar-brand {
    font-size: 1.25rem;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

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

::-webkit-scrollbar-thumb:hover {
  background: #764ba2;
}

/* Admin Navigation */
.admin-nav-link {
  padding: 0.75rem 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  color: #495057;
  text-decoration: none;
  display: block;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.admin-nav-link:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  transform: translateY(-2px);
  text-decoration: none;
}

.admin-nav-link.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.admin-nav-link.active small {
  color: rgba(255, 255, 255, 0.9) !important;
}

.admin-nav-link.active:hover {
  transform: translateY(0);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.admin-nav-link small {
  font-size: 0.75rem;
  margin-top: 2px;
}

@media (max-width: 768px) {
  .admin-nav-link {
    padding: 0.5rem 0.25rem;
    min-height: auto;
    font-size: 0.85rem;
  }
  
  .admin-nav-link small {
    display: none;
  }
}

/* Modern Modals - Minimal styling, let Bootstrap handle functionality */
.modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 16px 16px 0 0;
  border: none;
  padding: 1.25rem;
}

.modal-header .btn-close {
  filter: invert(1);
  opacity: 0.9;
}

.modal-header .modal-title {
  font-weight: 600;
  font-size: 1.25rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 1rem 1.5rem;
}

.modal-footer .btn {
  border-radius: 8px;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
}

