/* ============================================
   NORD THEME COLOR PALETTE - LIGHT VERSION (BRIGHTER)
   ============================================ */
:root {
  /* Light backgrounds - Brighter */
  --nord0: #f8fafb;   /* Very light, almost white */
  --nord1: #f0f3f7;   /* Light bright */
  --nord2: #e8ecf1;   /* Medium light gray */
  --nord3: #dce2e8;   /* Slightly darker gray */
  
  /* Dark text */
  --nord4: #2e3440;   /* Very dark */
  --nord5: #3b4252;   /* Dark */
  --nord6: #4c566a;   /* Medium dark */
  
  /* Frost - Accent colors (Brighter) */
  --nord7: #5dd9d1;   /* Bright Cyan */
  --nord8: #5ecfe8;   /* Bright Cyan-Blue */
  --nord9: #6bb6d8;   /* Bright Blue */
  --nord10: #5e81ac;  /* Dark Blue */
  
  /* Aurora - Vibrant accents (Brighter) */
  --nord11: #d84848;  /* Bright Red */
  --nord12: #e89966;  /* Bright Orange */
  --nord13: #f4d86d;  /* Bright Yellow */
  --nord14: #7fcf7f;  /* Bright Green */
  --nord15: #c099c0;  /* Bright Purple */
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  background: linear-gradient(135deg, var(--nord0) 0%, var(--nord1) 100%);
  color: var(--nord4);
  min-height: 100vh;
}

/* ============================================
   NAVIGATION BAR
   ============================================ */
.navbar {
  background: linear-gradient(90deg, var(--nord0) 0%, var(--nord1) 100%);
  border-bottom: 3px solid var(--nord8);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--nord4);
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link,
.nav-btn {
  color: var(--nord4);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
}

.nav-link:hover,
.nav-btn:hover {
  color: var(--nord8);
  background: rgba(136, 192, 208, 0.1);
  transform: translateY(-2px);
}

.nav-link.active {
  color: var(--nord8);
  background: rgba(136, 192, 208, 0.2);
  border-bottom: 2px solid var(--nord8);
}

.nav-email {
  color: var(--nord4);
  font-size: 0.95rem;
  margin: 0 0.5rem;
  padding: 0.6rem 0;
  border-right: 1px solid rgba(136, 192, 208, 0.3);
  padding-right: 1.5rem;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.5rem;
  color: var(--nord4);
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--nord8) 0%, var(--nord9) 100%);
  color: var(--nord0);
  box-shadow: 0 5px 15px rgba(136, 192, 208, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(136, 192, 208, 0.4);
}

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

.btn-secondary {
  background: var(--nord3);
  color: var(--nord6);
  border: 2px solid var(--nord7);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
  background: var(--nord7);
  color: var(--nord0);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Enhanced Add Item Button */
#addItemBtn.btn-secondary,
.items-header .btn-secondary {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--nord8) 0%, var(--nord7) 100%);
  color: var(--nord0);
  border: 2px solid var(--nord7);
  box-shadow: 0 6px 20px rgba(136, 192, 208, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
  height: fit-content;
}

#addItemBtn.btn-secondary:hover,
.items-header .btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(136, 192, 208, 0.4);
  background: linear-gradient(135deg, var(--nord7) 0%, var(--nord8) 100%);
}

.btn-danger {
  background: linear-gradient(135deg, var(--nord11) 0%, #d06060 100%);
  color: var(--nord6);
  box-shadow: 0 5px 15px rgba(191, 97, 106, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(191, 97, 106, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, var(--nord14) 0%, #93d89f 100%);
  color: var(--nord0);
  box-shadow: 0 5px 15px rgba(163, 190, 140, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(163, 190, 140, 0.4);
}

.btn-info {
  background: linear-gradient(135deg, var(--nord9) 0%, var(--nord8) 100%);
  color: var(--nord0);
  box-shadow: 0 5px 15px rgba(136, 192, 208, 0.3);
}

.btn-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(136, 192, 208, 0.4);
}

.btn-icon {
  padding: 0.5rem 0.8rem;
  font-size: 1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

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

.btn-icon:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   SEARCH & FILTER SECTION
   ============================================ */
.search-section {
  background: rgba(255, 255, 255, 0.6);
  border: 2px solid var(--nord8);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.search-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 1rem;
  align-items: end;
}

.search-inputs input {
  padding: 0.8rem 1.2rem;
  background: var(--nord0);
  border: 2px solid var(--nord2);
  border-radius: 8px;
  color: var(--nord4);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-inputs input::placeholder {
  color: var(--nord6);
}

.search-inputs input:focus {
  outline: none;
  border-color: var(--nord8);
  box-shadow: 0 0 10px rgba(136, 192, 208, 0.3);
}

@media (max-width: 1024px) {
  .search-inputs {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .search-inputs {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   TABS
   ============================================ */
.order-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 3px solid var(--nord2);
  padding-bottom: 1rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--nord4);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.tab-btn:hover {
  color: var(--nord8);
  transform: translateY(-2px);
}

.tab-btn.active {
  color: var(--nord8);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1rem;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--nord8), var(--nord7));
  border-radius: 2px;
}

.tab-count {
  background: var(--nord13);
  color: var(--nord0);
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 30px;
  text-align: center;
}

/* ============================================
   ORDERS GRID & CARDS
   ============================================ */
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
  padding: 1rem;
}

.order-card {
  background: linear-gradient(135deg, var(--nord1) 0%, var(--nord0) 100%);
  border: 2px solid var(--nord2);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.order-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--nord8), var(--nord14));
}

.order-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--nord8), transparent);
}

.order-card:hover {
  transform: translateY(-15px) scale(1.02);
  border-color: var(--nord8);
  box-shadow: 0 25px 60px rgba(136, 192, 208, 0.2);
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.order-info {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.order-customer {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--nord4);
  margin-bottom: 0;
}

.order-date {
  color: var(--nord6);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.contact-link {
  color: var(--nord8);
  font-size: 0.85rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.3s ease;
  border-bottom: 1px solid transparent;
  font-weight: 500;
}

.contact-link:hover {
  color: var(--nord9);
  border-bottom-color: var(--nord8);
}

.order-status {
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.order-status.bought {
  background: linear-gradient(135deg, var(--nord14) 0%, #93d89f 100%);
  color: var(--nord0);
  box-shadow: 0 4px 12px rgba(163, 190, 140, 0.3);
}

.order-status.not-bought {
  background: linear-gradient(135deg, var(--nord13) 0%, #f4d399 100%);
  color: var(--nord0);
  box-shadow: 0 4px 12px rgba(235, 203, 139, 0.3);
}

.order-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 2px solid var(--nord2);
  font-size: 0.9rem;
}

.order-meta span {
  color: var(--nord6);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.order-items {
  margin-bottom: 1.2rem;
  background: rgba(216, 222, 233, 0.2);
  padding: 1.2rem;
  border-radius: 12px;
  border: 2px solid var(--nord8);
}

.order-items h4 {
  color: var(--nord8);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.order-item {
  background: linear-gradient(135deg, rgba(136, 192, 208, 0.08) 0%, rgba(143, 188, 187, 0.08) 100%);
  padding: 1rem;
  border-radius: 10px;
  margin-bottom: 0.8rem;
  border: 2px solid var(--nord8);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.order-item:hover {
  border-color: var(--nord7);
  box-shadow: 0 6px 16px rgba(136, 192, 208, 0.1);
  transform: translateY(-2px);
}

.item-name {
  color: var(--nord4);
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  background: transparent;
  border: none;
  padding: 0;
}

.item-link {
  color: var(--nord8);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.item-link:hover {
  color: var(--nord7);
  text-decoration: underline;
}

.item-meta {
  color: var(--nord6);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.item-size-tag,
.item-color-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(95, 207, 232, 0.15);
  color: var(--nord8);
  border: 1px solid var(--nord8);
}

.item-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--nord6);
  margin-top: 0;
  align-items: center;
  flex: 1;
  min-width: 200px;
  gap: 1rem;
}

/* Enhanced Item Display Styles */
.item-price {
  background: rgba(163, 190, 140, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  color: var(--nord14);
  font-size: 0.95rem;
  flex-shrink: 0;
  min-width: fit-content;
}

.item-quantity {
  background: rgba(136, 192, 208, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  color: var(--nord8);
  font-size: 0.95rem;
}

.item-total {
  background: rgba(81, 161, 193, 0.15);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  color: var(--nord9);
  font-size: 1rem;
}

/* Item Purchase Status Indicator */
.order-item.purchased {
  border-left: 5px solid var(--nord14);
  background: linear-gradient(135deg, rgba(127, 207, 127, 0.12) 0%, rgba(94, 207, 232, 0.08) 100%);
  box-shadow: inset 0 2px 4px rgba(127, 207, 127, 0.15);
}

.order-item.purchased::before {
  content: '✓ Purchased';
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0.4rem 0.8rem;
  background: linear-gradient(135deg, var(--nord14) 0%, #5dd9d1 100%);
  width: fit-content;
  border-radius: 6px;
  box-shadow: 0 3px 8px rgba(127, 207, 127, 0.3);
}

.order-item.not-purchased {
  border-left: 5px solid var(--nord13);
  background: linear-gradient(135deg, rgba(244, 216, 109, 0.12) 0%, rgba(94, 207, 232, 0.08) 100%);
  box-shadow: inset 0 2px 4px rgba(244, 216, 109, 0.15);
}

.order-item.not-purchased::before {
  content: '⏳ Pending';
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0.4rem 0.8rem;
  background: linear-gradient(135deg, var(--nord12) 0%, #e89966 100%);
  width: fit-content;
  border-radius: 6px;
  box-shadow: 0 3px 8px rgba(232, 153, 102, 0.3);
}

/* Progress Indicator */
.progress-indicator {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(216, 222, 233, 0.3);
  border-radius: 8px;
  border: 1.5px solid var(--nord2);
}

.progress-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--nord4);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-bar {
  height: 8px;
  background: var(--nord2);
  border-radius: 4px;
  overflow: hidden;
  width: 100%;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--nord8) 0%, var(--nord14) 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.order-totals {
  background: rgba(136, 192, 208, 0.08);
  border: 2px solid var(--nord7);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  margin-top: 1.5rem;
}

.total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  color: var(--nord4);
  align-items: center;
  padding: 1rem 0;
  font-weight: 600;
}

.total-row:last-child {
  margin-bottom: 0;
}

.total-row span {
  font-weight: 600;
  color: var(--nord6);
  font-size: 0.95rem;
  padding: 0.5rem 0;
}

.total-row strong {
  color: var(--nord8);
  font-size: 1.2rem;
  font-weight: 700;
}

.order-actions {
  display: flex;
  gap: 0.8rem;
  border-top: 2px solid var(--nord2);
}

.order-actions button {
  flex: 1;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  font-weight: 600;
  border-radius: 8px;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.5);
  border: 2px dashed var(--nord2);
  border-radius: 12px;
  color: var(--nord6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: 300px;
}

.empty-state i {
  color: var(--nord8);
  margin-bottom: 0;
  opacity: 0.7;
  font-size: 4rem;
}

.empty-state h2 {
  color: var(--nord4);
  margin-bottom: 0.8rem;
  font-size: 1.8rem;
  font-weight: 700;
}

.empty-state p {
  color: var(--nord6);
  font-size: 1.1rem;
  margin: 0;
  max-width: 400px;
  line-height: 1.6;
}

/* ============================================
   ORDER ACTION BUTTONS
   ============================================ */
.action-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.action-btn {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.action-btn-primary {
  background: linear-gradient(135deg, var(--nord8) 0%, var(--nord9) 100%);
  color: var(--nord0);
  box-shadow: 0 5px 15px rgba(136, 192, 208, 0.3);
}

.action-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(136, 192, 208, 0.4);
}

.action-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.action-btn-success {
  background: linear-gradient(135deg, var(--nord14) 0%, #93d89f 100%);
  color: var(--nord0);
  box-shadow: 0 5px 15px rgba(163, 190, 140, 0.3);
}

.action-btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(163, 190, 140, 0.4);
}

.action-btn-success:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.action-btn-danger {
  background: linear-gradient(135deg, var(--nord11) 0%, #d06060 100%);
  color: var(--nord0);
  box-shadow: 0 5px 15px rgba(191, 97, 106, 0.3);
}

.action-btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(191, 97, 106, 0.4);
}

.action-btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.delivery-info {
  background: rgba(93, 217, 209, 0.1);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  border-left: 4px solid var(--nord7);
}

.total-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(136, 192, 208, 0.2);
}

.total-item:last-child {
  border-bottom: none;
}

.total-item span {
  color: var(--nord6);
  font-weight: 600;
}

.total-item strong {
  color: var(--nord8);
  font-size: 1.1rem;
}

.payment-status.paid strong {
  color: var(--nord14);
}

.payment-status.partial strong {
  color: var(--nord12);
}

.payment-status.unpaid strong {
  color: var(--nord11);
}

/* ============================================
   MODAL STYLES
   ============================================ */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
  padding: 2rem;
  overflow-y: auto;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: linear-gradient(135deg, var(--nord0) 0%, var(--nord1) 100%);
  border: 2px solid var(--nord8);
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease;
  margin: auto;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--nord2);
}

.modal-header h2 {
  color: var(--nord4);
  font-size: 1.8rem;
}

.close {
  font-size: 2rem;
  font-weight: bold;
  color: var(--nord6);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.close:hover {
  color: var(--nord11);
  transform: rotate(90deg);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--nord4);
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--nord0);
  border: 2px solid var(--nord2);
  border-radius: 8px;
  color: var(--nord4);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--nord6);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--nord8);
  box-shadow: 0 0 10px rgba(136, 192, 208, 0.3);
}

.form-group small {
  display: block;
  margin-top: 0.4rem;
  color: var(--nord6);
  font-size: 0.85rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  color: var(--nord4);
  font-weight: 500;
}

.checkbox-label input[type='checkbox'] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--nord8);
}

.items-section {
  background: rgba(216, 222, 233, 0.3);
  padding: 1.5rem;
  border-radius: 8px;
  border: 2px solid var(--nord2);
  margin-bottom: 1.5rem;
  max-width: 1050px;
  margin-left: auto;
  margin-right: auto;
}

.items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.items-header h3 {
  color: var(--nord4);
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
  padding: 0.5rem 0;
  background: linear-gradient(135deg, var(--nord8) 0%, var(--nord7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
}

.item-row {
  background: var(--nord0);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  border: 2px solid var(--nord2);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  transition: all 0.3s ease;
}

.item-row:hover {
  border-color: var(--nord8);
  box-shadow: 0 4px 12px rgba(94, 207, 232, 0.15);
}

.item-row-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.8rem;
  flex: 1;
  min-width: 100%;
}

.item-row input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 2px;
}

.item-row button {
  padding: 0.6rem 1rem;
}

.item-row-footer {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
}

.item-row-footer label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--nord6);
  margin: 0;
}

.item-row-footer input[type='checkbox'] {
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Item Form Row Styling */
.item-form-row {
  background: linear-gradient(135deg, var(--nord0) 0%, var(--nord1) 100%);
  padding: 1.2rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  margin-left: auto;
  margin-right: auto;
  border: 2px solid var(--nord8);
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  max-width: 1000px;
}

.item-form-row:hover {
  border-color: var(--nord7);
  box-shadow: 0 6px 16px rgba(136, 192, 208, 0.1);
  transform: translateY(-2px);
}

.item-link,
.item-name,
.item-link,
.item-name,
.item-size,
.item-color,
.item-cost,
.item-count {
  padding: 0.85rem 1.2rem;
  background: var(--nord0);
  border: none;
  border-radius: 8px;
  color: var(--nord4);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.3px;
}

.item-link {
  flex: 2;
  min-width: 200px;
}

.item-name {
  flex: 2.5;
  min-width: 240px;
}

.item-size {
  flex: 1;
  min-width: 80px;
}

.item-color {
  flex: 1;
  min-width: 100px;
}

.item-cost {
  flex: 1.2;
  min-width: 120px;
}

.item-count {
  flex: 1;
  min-width: 100px;
  text-align: center;
}

.item-link::placeholder,
.item-name::placeholder,
.item-size::placeholder,
.item-color::placeholder,
.item-cost::placeholder,
.item-count::placeholder {
  color: var(--nord6);
}

.item-link:focus,
.item-name:focus,
.item-size:focus,
.item-color:focus,
.item-cost:focus,
.item-count:focus {
  outline: none;
  box-shadow: 0 0 10px rgba(136, 192, 208, 0.3);
  background: var(--nord1);
}

/* Item Total Display */
.item-form-row .item-total {
  background: linear-gradient(135deg, rgba(81, 161, 193, 0.15) 0%, rgba(136, 192, 208, 0.15) 100%);
  padding: 0.85rem 1.2rem;
  border-radius: 8px;
  font-weight: 700;
  color: var(--nord9);
  border: 2px solid var(--nord8);
  min-width: 80px;
  text-align: center;
  font-size: 1rem;
  height: fit-content;
}

/* Remove Button Styling */
.item-form-row .btn-icon {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  min-width: auto;
  height: fit-content;
}

.item-form-row .btn-danger {
  padding: 0.85rem 1rem;
}

.totals-section {
  background: rgba(136, 192, 208, 0.08);
  border: 2px solid var(--nord7);
  padding: 1.2rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  max-width: 1050px;
  margin-left: auto;
  margin-right: auto;
}

.total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  color: var(--nord6);
  font-weight: 600;
}

.total-row strong {
  color: var(--nord8);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 2px solid var(--nord2);
}

.modal-actions button {
  padding: 0.8rem 1.5rem;
}

/* Settings Tabs */
.settings-tabs {
  display: flex;
  gap: 1rem;
  border-bottom: 2px solid var(--nord2);
  margin-bottom: 1.5rem;
  padding-bottom: 0;
}

.settings-tab-btn {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  color: var(--nord4);
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-tab-btn:hover {
  color: var(--nord8);
}

.settings-tab-btn.active {
  color: var(--nord8);
  border-bottom-color: var(--nord8);
}

.settings-tab-content {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.settings-tab-content.active {
  display: block;
}

/* User Management */
.users-management {
  padding: 1rem 0;
}

.users-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.users-toolbar h3 {
  margin: 0;
  color: var(--nord4);
  font-size: 1.1rem;
}

.btn-sm {
  padding: 0.6rem 1rem !important;
  font-size: 0.9rem !important;
}

.users-table-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--nord2);
  border-radius: 8px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.users-table thead {
  background: var(--nord2);
  position: sticky;
  top: 0;
}

.users-table th {
  padding: 1rem;
  text-align: left;
  color: var(--nord4);
  font-weight: 600;
}

.users-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--nord2);
  color: var(--nord4);
}

.users-table tbody tr:hover {
  background: var(--nord1);
}

.users-table .empty-state td {
  text-align: center;
  color: var(--nord3);
  padding: 2rem 1rem;
}

.users-table .actions-cell {
  display: flex;
  gap: 0.5rem;
}

.users-table button {
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.edit-user-btn {
  background: var(--nord8);
  color: var(--nord6);
}

.edit-user-btn:hover {
  background: var(--nord9);
  transform: translateY(-1px);
}

.delete-user-btn {
  background: #bf616a;
  color: var(--nord6);
}

.delete-user-btn:hover {
  background: #a3373f;
  transform: translateY(-1px);
}

/* ============================================
   STATS PAGE STYLES
   ============================================ */
.stats-section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 1.5rem;
  color: var(--nord4);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.section-title i {
  color: var(--nord8);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: linear-gradient(135deg, var(--nord0) 0%, var(--nord1) 100%);
  border: 2px solid var(--nord2);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-6px);
  border-color: var(--nord8);
  box-shadow: 0 12px 35px rgba(136, 192, 208, 0.15);
}

.stat-icon {
  font-size: 2.5rem;
  min-width: 60px;
  text-align: center;
}

.stat-info {
  flex: 1;
}

.stat-label {
  color: var(--nord6);
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  color: var(--nord4);
  font-size: 1.8rem;
  font-weight: 700;
}

.profit-section {
  background: rgba(163, 190, 140, 0.05);
  border: 2px solid var(--nord14);
  border-radius: 12px;
  padding: 2rem;
}

.profit-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.profit-card {
  background: linear-gradient(135deg, var(--nord1) 0%, var(--nord0) 100%);
  border: 2px solid var(--nord14);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.profit-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 35px rgba(163, 190, 140, 0.15);
  border-color: var(--nord14);
}

.profit-card.weekly,
.profit-card.monthly,
.profit-card.custom {
  border-color: var(--nord8);
}

.profit-card.weekly:hover,
.profit-card.monthly:hover,
.profit-card.custom:hover {
  box-shadow: 0 12px 35px rgba(136, 192, 208, 0.15);
}

.profit-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  color: var(--nord4);
  font-weight: 600;
  font-size: 1.1rem;
}

.profit-header i {
  color: var(--nord14);
  font-size: 1.5rem;
}

.profit-card.weekly .profit-header i,
.profit-card.monthly .profit-header i,
.profit-card.custom .profit-header i {
  color: var(--nord8);
}

.profit-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--nord8);
  margin-bottom: 0.8rem;
}

.profit-formula {
  font-size: 0.85rem;
  color: var(--nord6);
  line-height: 1.4;
}

.date-filter {
  background: rgba(255, 255, 255, 0.6);
  border: 2px solid var(--nord2);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.date-inputs {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.date-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.date-input-group label {
  color: var(--nord4);
  font-weight: 600;
  font-size: 0.9rem;
}

.date-input-group input {
  padding: 0.7rem 1rem;
  background: var(--nord0);
  border: 2px solid var(--nord2);
  border-radius: 8px;
  color: var(--nord4);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .nav-brand {
    font-size: 1.4rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .container {
    padding: 1rem;
  }

  header h1 {
    font-size: 1.8rem;
  }

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

  .search-inputs {
    grid-template-columns: 1fr;
  }

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

  .modal-content {
    width: 95%;
    padding: 1.5rem;
  }

  .date-inputs {
    flex-direction: column;
  }

  .date-input-group {
    width: 100%;
  }

  .item-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-row input {
    margin-top: 0;
  }

  .item-details {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0.5rem;
  }

  .item-price {
    width: 100%;
    text-align: right;
  }

  .order-totals {
    padding: 1rem;
  }

  .total-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .order-header {
    flex-direction: column;
    gap: 1rem;
  }

  .order-actions {
    flex-direction: row;
  }

  .item-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .item-link,
  .item-name,
  .item-cost,
  .item-count {
    min-width: 100%;
  }

  .item-form-row .item-total {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0.8rem;
  }

  .nav-brand {
    font-size: 1.2rem;
  }

  .nav-link,
  .nav-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
  }

  header h1 {
    font-size: 1.4rem;
  }

  .order-header {
    flex-direction: column;
  }

  .order-customer {
    font-size: 1.2rem;
  }

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

  .modal-actions button {
    width: 100%;
  }

  .profit-value {
    font-size: 1.8rem;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .item-row {
    padding: 0.8rem;
    gap: 0.5rem;
  }

  .item-price {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }

  .item-details {
    gap: 0.3rem;
  }

  .order-card {
    padding: 1.5rem 1rem;
  }

  .order-totals {
    padding: 0.8rem;
    margin-bottom: 1rem;
    margin-top: 1rem;
  }

  .total-row {
    padding: 0.5rem 0;
    margin-bottom: 0.8rem;
  }

  .total-row span {
    font-size: 0.85rem;
  }

  .total-row strong {
    font-size: 1rem;
  }

  .modal-content {
    padding: 1.2rem;
    border-radius: 8px;
  }

  .modal-header h2 {
    font-size: 1.4rem;
  }

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

  .item-form-row {
    padding: 0.8rem;
    gap: 0.5rem;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Utility Classes */
.text-muted {
  color: var(--nord4);
}

.text-primary {
  color: var(--nord8);
}

.text-success {
  color: var(--nord14);
}

.text-danger {
  color: var(--nord11);
}

.text-warning {
  color: var(--nord13);
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

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

::-webkit-scrollbar-track {
  background: var(--nord1);
}

::-webkit-scrollbar-thumb {
  background: var(--nord8);
  border-radius: 5px;
}

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