@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* ==========================================================
   KEYFRAMES
   ========================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes waPopupShow {
  from { transform: scale(0.75); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ==========================================================
   DESIGN TOKENS
   ========================================================== */
:root {
  --bg-dark:       #09090f;
  --bg-surface:    #0e0e18;
  --bg-card:       rgba(14, 14, 22, 0.95);
  --bg-card-hover: rgba(18, 18, 28, 0.98);
  --bg-input:      rgba(6, 6, 14, 0.9);

  --border-subtle:  rgba(255, 255, 255, 0.05);
  --border-color:   rgba(212, 170, 60, 0.12);
  --border-active:  rgba(212, 170, 60, 0.38);

  --color-text-main:    #f4f0e8;
  --color-text-sub:     #c8c0a8;
  --color-text-muted:   #6b6558;

  /* Primary — gold */
  --buyer-primary:      #d4aa3c;
  --buyer-secondary:    #a07a1e;
  --buyer-glow:         rgba(212, 170, 60, 0.18);
  --buyer-bg:           rgba(212, 170, 60, 0.07);

  /* Supplier — warm gold-amber */
  --supplier-primary:   #c49a28;
  --supplier-secondary: #8f6e14;
  --supplier-glow:      rgba(196, 154, 40, 0.18);
  --supplier-bg:        rgba(196, 154, 40, 0.07);

  /* Semantic */
  --color-success:      #10b981;
  --color-success-bg:   rgba(16, 185, 129, 0.1);
  --color-warning:      #f59e0b;
  --color-warning-bg:   rgba(245, 158, 11, 0.1);
  --color-danger:       #ef4444;
  --color-danger-bg:    rgba(239, 68, 68, 0.1);
  --color-info:         #60a5fa;
  --color-info-bg:      rgba(96, 165, 250, 0.1);

  --font-family:        'Outfit', sans-serif;
  --transition:         all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm:          8px;
  --radius-md:          12px;
  --radius-lg:          16px;
  --radius-xl:          20px;
}

/* ==========================================================
   RESET & BASE
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { max-width: 100vw; overflow-x: hidden; overflow-y: auto; }

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--color-text-main);
  min-height: 100vh;
  max-width: 100vw;
  margin: 0; padding: 0;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Multi-colored Ambient Neon Glow Background (Emerald, Teal, Gold, Magenta, Indigo) */
body::before {
  content: '';
  position: fixed; inset: 0;
  z-index: -2; pointer-events: none;
  background:
    /* Top-Left: Emerald Green & Cyan Glow */
    radial-gradient(circle at 2% 22%, rgba(16, 185, 129, 0.35) 0%, rgba(6, 182, 212, 0.18) 25%, transparent 55%),
    /* Bottom-Left: Deep Teal Glow */
    radial-gradient(circle at 4% 88%, rgba(20, 184, 166, 0.30) 0%, transparent 50%),
    /* Top-Right: Warm Golden / Amber Glow */
    radial-gradient(circle at 82% 5%, rgba(245, 158, 11, 0.30) 0%, rgba(217, 119, 6, 0.15) 30%, transparent 55%),
    /* Mid-Right: Magenta & Pink Glow */
    radial-gradient(circle at 98% 48%, rgba(236, 72, 153, 0.28) 0%, rgba(168, 85, 247, 0.20) 30%, transparent 55%),
    /* Bottom-Right: Deep Indigo & Purple Glow */
    radial-gradient(circle at 85% 94%, rgba(99, 102, 241, 0.28) 0%, rgba(139, 92, 246, 0.18) 30%, transparent 50%);
  filter: blur(40px);
  opacity: 0.95;
}

body::after {
  content: '';
  position: fixed; inset: 0;
  z-index: -1; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 30%, rgba(9, 9, 15, 0.65) 100%);
}

/* ==========================================================
   CONTAINER
   ========================================================== */
.container {
  width: 100%; max-width: 1240px;
  margin: 0 auto; padding: 2rem 1.5rem; overflow-x: hidden;
}

/* ==========================================================
   LEGACY HEADER (fallback)
   ========================================================== */
header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2.5rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}
.sticky-header-wrapper header {
  margin-bottom: 0 !important; padding-bottom: 0 !important;
  border-bottom: none !important; width: 100%;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.logo-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--buyer-primary), var(--buyer-secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.25rem; color: #fff;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.28);
}
.brand h1 {
  font-size: 1.5rem; font-weight: 700;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.user-status { display: flex; align-items: center; gap: 1rem; }
.role-badge {
  padding: 0.4rem 0.9rem; border-radius: 20px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.role-buyer {
  background: var(--buyer-bg); color: var(--buyer-primary);
  border: 1px solid rgba(225, 29, 72, 0.22);
}
.role-supplier {
  background: var(--supplier-bg); color: var(--supplier-primary);
  border: 1px solid rgba(196, 154, 40, 0.22);
}

/* ==========================================================
   CARD
   ========================================================== */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 8px 24px rgba(0,0,0,0.28);
  transition: var(--transition);
  max-width: 100%; min-width: 0;
  word-break: break-word; overflow-wrap: break-word;
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(212, 170, 60, 0.18);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15), 0 12px 32px rgba(0,0,0,0.35);
}

/* Section title inside cards */
.section-title {
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--color-text-muted);
  display: flex; align-items: center; gap: 0.5rem;
  padding-bottom: 0.65rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

/* ==========================================================
   PORTAL / AUTH
   ========================================================== */
.portal-wrapper {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.portal-card {
  max-width: 420px; width: 100%; text-align: center;
  padding: 2.5rem;
  background: rgba(14, 14, 22, 0.98);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(225,29,72,0.06) inset;
  animation: slideUp 0.4s ease forwards;
}
.portal-card h2 {
  font-size: 2rem; font-weight: 700; margin-bottom: 0.3rem;
  background: linear-gradient(135deg, #fff 40%, #f0d060);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.portal-card p { color: var(--color-text-muted); margin-bottom: 2rem; font-size: 0.9rem; }

/* ==========================================================
   FORMS
   ========================================================== */
.login-form { display: flex; flex-direction: column; gap: 1.1rem; text-align: left; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
label { font-size: 0.82rem; font-weight: 600; color: var(--color-text-muted); }

input, select, textarea {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  color: var(--color-text-main);
  font-family: var(--font-family); font-size: 0.95rem;
  outline: none; transition: var(--transition); width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--color-text-muted); font-size: 0.88rem; }
input:focus, select:focus, textarea:focus {
  border-color: var(--buyer-primary);
  background: rgba(10, 5, 20, 0.9);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1);
}
.supplier-theme input:focus,
.supplier-theme select:focus,
.supplier-theme textarea:focus {
  border-color: var(--supplier-primary);
  box-shadow: 0 0 0 3px rgba(190, 18, 60, 0.1);
}

/* ==========================================================
   BUTTONS
   ========================================================== */
button {
  cursor: pointer; border: none; font-family: var(--font-family);
  font-weight: 600; border-radius: var(--radius-sm);
  padding: 0.7rem 1.4rem; transition: var(--transition);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
}

.btn-primary {
  background: var(--buyer-primary); color: #fff;
  border: 1px solid var(--buyer-primary);
  box-shadow: 0 2px 10px rgba(225, 29, 72, 0.28);
}
.btn-primary:hover {
  background: #f43f5e; border-color: #f43f5e;
  transform: translateY(-1px); box-shadow: 0 4px 16px rgba(225, 29, 72, 0.4);
}

.btn-supplier {
  background: var(--supplier-primary); color: #fff;
  border: 1px solid var(--supplier-primary);
  box-shadow: 0 2px 10px rgba(196, 154, 40, 0.28);
}
.btn-supplier:hover {
  background: #e11d48; transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(190, 18, 60, 0.4);
}

.btn-outline {
  background: transparent; color: var(--color-text-sub);
  border: 1px solid var(--border-subtle);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.15); color: #fff;
}

.btn-danger {
  background: var(--color-danger-bg); color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.28);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2); transform: translateY(-1px);
}

.btn-success {
  background: #059669; color: #fff;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
  background: #10b981; transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
}

/* ==========================================================
   TABS
   ========================================================== */
.tab-btns {
  display: flex; gap: 0; border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem; overflow-x: auto; scrollbar-width: none;
}
.tab-btns::-webkit-scrollbar { display: none; }

.tab-btn {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--color-text-muted); font-size: 0.9rem; font-weight: 600;
  padding: 0.65rem 1.1rem; border-radius: 0; margin-bottom: -1px;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.tab-btn:hover { color: var(--color-text-sub); }
.tab-btn.active {
  color: var(--buyer-primary);
  border-bottom-color: var(--buyer-primary);
}
.supplier-theme .tab-btn.active {
  color: var(--supplier-primary);
  border-bottom-color: var(--supplier-primary);
}

/* ==========================================================
   DASHBOARD GRID
   ========================================================== */
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) {
  .dashboard-grid { grid-template-columns: 1fr 3fr; }
  .full-width { grid-column: span 2; }
}

/* ==========================================================
   STAT CARDS  — Premium style
   ========================================================== */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin-bottom: 1.75rem;
}
.stat-card {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 1.2rem 1.3rem; min-height: 90px;
  position: relative; overflow: hidden;
}
/* Top accent bar */
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--buyer-primary), transparent);
}
.supplier-theme .stat-card::before {
  background: linear-gradient(90deg, var(--supplier-primary), transparent);
}
.stat-title {
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-muted);
  margin-bottom: 0.6rem;
}
.stat-value {
  font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1;
  color: #fff;
}
/* Highlight specific stats */
.buyer-theme .stat-value.highlight  { color: var(--buyer-primary); }
.supplier-theme .stat-value.highlight { color: var(--supplier-primary); }

/* ==========================================================
   PRICE TAG
   ========================================================== */
.price-tag {
  font-size: 1.15rem; font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================
   INFO ROW (label : value pairs)
   ========================================================== */
.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
}
.info-row:last-child { border-bottom: none; }
.info-row .info-label { color: var(--color-text-muted); font-size: 0.8rem; }
.info-row .info-value { font-weight: 600; color: var(--color-text-main); }

/* ==========================================================
   ORDER LIST
   ========================================================== */
.order-list { display: flex; flex-direction: column; gap: 0.75rem; padding-right: 0.25rem; }

.order-list::-webkit-scrollbar, .closures-list::-webkit-scrollbar { width: 3px; }
.order-list::-webkit-scrollbar-track, .closures-list::-webkit-scrollbar-track { background: transparent; }
.order-list::-webkit-scrollbar-thumb, .closures-list::-webkit-scrollbar-thumb {
  background: rgba(212, 170, 60, 0.2); border-radius: 4px;
}

.order-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.95rem 1.1rem 0.95rem 1.35rem;
  background: rgba(13, 13, 20, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition); position: relative; overflow: hidden;
}
.order-item::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%; width: 2.5px;
  background: var(--buyer-primary); border-radius: 2px;
}
.order-item:hover {
  background: rgba(20, 20, 30, 0.9);
  border-color: rgba(212, 170, 60, 0.18);
}
.order-info { display: flex; flex-direction: column; gap: 0.2rem; }
.order-header-line { display: flex; align-items: center; gap: 0.65rem; }
.order-id { font-family: 'Courier New', monospace; font-size: 0.78rem; color: var(--color-text-muted); }
.order-title { font-weight: 600; font-size: 0.95rem; color: var(--color-text-main); }
.order-notes {
  font-size: 0.8rem; color: var(--color-text-muted); font-style: italic;
  max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.order-creds {
  font-family: 'Courier New', monospace; font-size: 0.8rem;
  background: rgba(0,0,0,0.45); padding: 0.4rem 0.65rem;
  border-radius: 6px; border: 1px solid rgba(255,255,255,0.05);
  margin-top: 0.35rem; color: var(--color-text-sub); word-break: break-all;
}
.order-price { font-size: 1.1rem; font-weight: 700; color: #fff; white-space: nowrap; }

/* ==========================================================
   BADGES
   ========================================================== */
.badge {
  padding: 0.18rem 0.6rem; border-radius: 20px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap;
}
.badge-pending  { background: rgba(245,158,11,0.1);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.22); }
.badge-delivered{ background: rgba(16,185,129,0.1);  color: #34d399; border: 1px solid rgba(16,185,129,0.22); }
.badge-unpaid   { background: rgba(239,68,68,0.1);   color: #f87171; border: 1px solid rgba(239,68,68,0.22);  }
.badge-paid     { background: rgba(245,158,11,0.1);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.22); }
.badge-confirmed{ background: rgba(16,185,129,0.1);  color: #34d399; border: 1px solid rgba(16,185,129,0.22); }

/* ==========================================================
   TABLES
   ========================================================== */
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead tr {
  background: rgba(255,255,255,0.025);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky; top: 0; z-index: 1;
  backdrop-filter: blur(8px);
}
thead th {
  padding: 0.75rem 1rem; text-align: left;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-text-muted);
}
tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background 0.15s;
}
tbody tr:hover { background: rgba(255,255,255,0.025); }
tbody td { padding: 0.7rem 1rem; color: var(--color-text-sub); vertical-align: middle; }
.table-scroll-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ==========================================================
   MODAL (legacy .modal)
   ========================================================== */
.modal {
  display: none; position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.78); backdrop-filter: blur(10px);
  z-index: 100; justify-content: center; align-items: center;
}
.modal-content {
  background: var(--bg-surface);
  border: 1px solid rgba(225, 29, 72, 0.13);
  border-radius: var(--radius-lg); max-width: 500px; width: 90%; padding: 2rem;
  box-shadow: 0 24px 64px rgba(0,0,0,0.65);
}
.modal-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 1.5rem; color: #f0f2f5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }

/* ==========================================================
   MODAL OVERLAY & CARD
   ========================================================== */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(4, 4, 10, 0.9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  z-index: 2000; justify-content: center; align-items: flex-start;
  overflow-y: auto; padding: 4vh 1.5rem 2rem;
}
.modal-card {
  background: rgba(13, 13, 20, 0.99);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-xl); padding: 2rem;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(225,29,72,0.05) inset;
  display: flex; flex-direction: column;
  width: 100%; max-width: 900px; max-height: 90vh;
  overflow-y: auto; margin: 0 auto;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 1rem; margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-header h3 {
  font-size: 1.1rem; font-weight: 700; margin: 0; color: #f0f2f5;
  display: flex; align-items: center; gap: 0.5rem;
}

/* ==========================================================
   WMT CONVERTER SPECIFIC
   ========================================================== */
.converter-modal-card {
  background: rgba(13, 13, 20, 0.99);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-radius: var(--radius-xl); padding: 1.75rem;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  max-width: 480px; width: 90%; margin: 0 auto;
}
.converter-rate-display {
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-radius: var(--radius-md); padding: 0.65rem 1rem;
  font-size: 0.88rem; color: #4ade80; font-weight: 600;
  text-align: center; margin-top: 1rem;
}

/* ==========================================================
   CLOSURES LIST
   ========================================================== */
.closures-list { display: flex; flex-direction: column; gap: 0.75rem; }
.closure-item {
  padding: 1.1rem 1.2rem; border-radius: var(--radius-md);
  background: rgba(13, 13, 20, 0.8);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}
.closure-item:hover { border-color: rgba(225,29,72,0.18); background: rgba(20,20,30,0.88); }
.closure-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.65rem; }
.closure-id { font-family: monospace; font-size: 0.78rem; color: var(--color-text-muted); }
.closure-date { font-weight: 700; color: var(--color-text-main); font-size: 0.9rem; }
.closure-body { display: flex; justify-content: space-between; font-size: 0.875rem; margin-bottom: 0.65rem; }
.closure-counts { color: var(--color-text-muted); }
.closure-amount { font-weight: 700; color: #fff; }
.closure-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 0.65rem; border-top: 1px solid rgba(255,255,255,0.05);
}

/* ==========================================================
   GROUPED ORDER CARD
   ========================================================== */
.group-wrapper {
  display: flex; flex-direction: column;
  background: rgba(13,13,20,0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); overflow: hidden; transition: var(--transition);
}
.group-wrapper:hover {
  border-color: rgba(225,29,72,0.2); background: rgba(18,18,28,0.9);
}
.group-header {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; padding: 1.1rem 1.25rem; user-select: none;
  background: rgba(0,0,0,0.2); border-bottom: 1px solid rgba(255,255,255,0.03);
}
.group-header:hover { background: rgba(225,29,72,0.05); }
.group-title-line { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.group-toggle-icon { font-size: 0.8rem; color: var(--color-text-muted); transition: var(--transition); }
.group-toggle-icon.expanded { transform: rotate(180deg); color: var(--buyer-primary); }
.supplier-theme .group-toggle-icon.expanded { color: var(--supplier-primary); }
.group-body {
  display: none; flex-direction: column; gap: 0.5rem;
  padding: 0.75rem 1rem 1rem; background: rgba(0,0,0,0.15);
}
.group-sub-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.65rem 0.85rem;
  background: rgba(8,8,16,0.6);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm); font-size: 0.875rem; transition: var(--transition);
}
.group-sub-item:hover { background: rgba(18,18,28,0.7); border-color: rgba(212,170,60,0.14); }

/* ==========================================================
   ERROR MESSAGE
   ========================================================== */
.error-message { color: var(--color-danger); font-size: 0.82rem; margin-top: 0.3rem; }

/* ==========================================================
   ANIMATIONS
   ========================================================== */
.fade-in { animation: fadeIn 0.26s ease forwards; }

/* ==========================================================
   SIDEBAR DRAWER
   ========================================================== */
.sidebar-drawer {
  position: fixed; top: 0; left: -280px; width: 280px; height: 100vh;
  background: rgba(9, 9, 15, 0.99); backdrop-filter: blur(24px);
  border-right: 1px solid rgba(225,29,72,0.1);
  box-shadow: 12px 0 40px rgba(0,0,0,0.6);
  z-index: 1000; transition: all 0.28s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
}
.sidebar-drawer.open { left: 0; }
.drawer-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.35rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.drawer-header h3 { font-size: 1rem; font-weight: 700; color: #f0f2f5; margin: 0; }
#closeDrawerBtn {
  background: none; border: none; color: var(--color-text-muted);
  font-size: 1.75rem; cursor: pointer; transition: var(--transition); line-height: 1;
}
#closeDrawerBtn:hover { color: #fff; }
.drawer-menu { display: flex; flex-direction: column; padding: 0.85rem; gap: 0.35rem; overflow-y: auto; flex: 1; }
.drawer-item {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.8rem 0.9rem;
  background: transparent; border: 1px solid transparent;
  border-radius: 9px; color: var(--color-text-muted);
  cursor: pointer; transition: var(--transition);
  text-align: left; font-family: inherit; font-size: 0.875rem;
}
.drawer-item:hover {
  background: rgba(225,29,72,0.06); color: var(--color-text-main);
  border-color: rgba(212,170,60,0.14);
}
.drawer-item.active {
  background: rgba(225,29,72,0.1); border-color: rgba(225,29,72,0.3);
  color: #fff; font-weight: 600;
}
.drawer-item.active .indicator { background: var(--buyer-primary); }
.drawer-item .indicator {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.12); flex-shrink: 0; transition: var(--transition);
}
.drawer-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(3px);
  z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.28s ease;
}
.drawer-overlay.show { opacity: 1; pointer-events: auto; }

/* ==========================================================
   NAV BAR
   ========================================================== */
.nav-bar {
  display: flex; justify-content: center; gap: 0.35rem;
  background: rgba(10,10,18,0.92);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md); padding: 0.4rem; margin-bottom: 1.75rem;
  position: sticky; top: 1rem; z-index: 100;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
  align-items: center; flex-wrap: wrap;
}
.nav-link {
  display: flex; align-items: center; gap: 0.4rem;
  color: var(--color-text-muted); text-decoration: none;
  font-weight: 500; padding: 0.42rem 0.85rem;
  border-radius: 8px; transition: var(--transition);
  cursor: pointer; font-size: 0.855rem; border: 1px solid transparent;
}
.nav-link:hover { color: var(--color-text-main); background: rgba(255,255,255,0.04); }
.buyer-theme .nav-link.active {
  color: #fff; background: rgba(212,170,60,0.14);
  border-color: rgba(225,29,72,0.28); font-weight: 600;
}
.supplier-theme .nav-link.active {
  color: #fff; background: rgba(190,18,60,0.14);
  border-color: rgba(190,18,60,0.28); font-weight: 600;
}

/* ==========================================================
   STICKY HEADER
   ========================================================== */
.sticky-header-wrapper {
  position: sticky; top: 0; z-index: 999;
  background: rgba(7, 7, 13, 0.98);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(225,29,72,0.1);
  box-shadow: 0 1px 16px rgba(0,0,0,0.5);
}
.sticky-header-wrapper header {
  margin-bottom: 0 !important; padding-bottom: 0 !important;
  border-bottom: none !important; width: 100%;
}
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px; padding: 0 1.5rem; position: relative;
}
.header-left {
  display: flex; align-items: center; gap: 0.7rem;
  flex: 1 1 30%; justify-content: flex-start; min-width: 0;
}
.header-logo {
  width: 36px; height: 36px; object-fit: contain;
  filter: invert(1) hue-rotate(180deg) brightness(1.2);
  mix-blend-mode: screen; flex-shrink: 0;
}
.current-supplier-badge {
  font-size: 0.7rem; font-weight: 700; color: var(--buyer-primary);
  background: var(--buyer-bg); border: 1px solid rgba(225,29,72,0.2);
  border-radius: 5px; padding: 0.2rem 0.55rem;
  letter-spacing: 0.05em; white-space: nowrap;
}
.header-dropdowns {
  display: flex; align-items: center; gap: 0.4rem;
  flex: 1 1 40%; justify-content: center; min-width: 0;
}
.hdr-dropdown { position: relative; }
.hdr-dropdown-btn {
  display: flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.07);
  color: var(--color-text-sub); font-size: 0.82rem; font-weight: 600;
  padding: 0.42rem 0.85rem; border-radius: 8px;
  cursor: pointer; transition: all 0.18s; white-space: nowrap; font-family: var(--font-family);
}
.hdr-dropdown-btn:hover {
  background: rgba(212,170,60,0.08); border-color: rgba(225,29,72,0.2); color: #f0f2f5;
}
.dd-arrow { font-size: 0.65rem; opacity: 0.45; transition: transform 0.2s; }
.hdr-dropdown-panel {
  display: flex; visibility: hidden; opacity: 0;
  transform: translateX(-50%) translateY(-8px) scale(0.96);
  transition: opacity 0.14s cubic-bezier(0.16,1,0.3,1), transform 0.14s cubic-bezier(0.16,1,0.3,1), visibility 0.14s;
  pointer-events: none; position: absolute;
  top: calc(100% + 7px); left: 50%; min-width: 215px;
  background: rgba(9,9,16,0.99);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-md); padding: 0.45rem;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  z-index: 1100; flex-direction: column; gap: 0.15rem;
}
.hdr-dropdown-panel.open {
  visibility: visible; opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1); pointer-events: auto;
}
.dd-item {
  display: flex; align-items: center; gap: 0.55rem;
  width: 100%; background: transparent; border: none;
  color: var(--color-text-muted); font-size: 0.875rem; font-weight: 500;
  padding: 0.52rem 0.7rem; border-radius: 7px;
  cursor: pointer; text-align: left; transition: all 0.14s; font-family: var(--font-family);
}
.dd-item:hover { background: rgba(212,170,60,0.08); color: var(--color-text-main); }
.dd-item--active { background: rgba(225,29,72,0.1); color: var(--buyer-primary); font-weight: 700; }
.dd-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.header-right {
  display: flex; align-items: center; gap: 0.55rem;
  flex: 1 1 30%; justify-content: flex-end; min-width: 0;
}
.header-badge { padding: 0.28rem 0.7rem; font-size: 0.75rem; }
.btn-logout {
  background: rgba(225,29,72,0.07); border: 1px solid rgba(225,29,72,0.2);
  color: #fca5a5; font-size: 0.78rem; font-weight: 600;
  padding: 0.32rem 0.8rem; border-radius: 7px;
  cursor: pointer; transition: all 0.18s; white-space: nowrap; font-family: var(--font-family);
}
.btn-logout:hover { background: rgba(225,29,72,0.15); border-color: rgba(225,29,72,0.38); }
.hamburger-btn {
  display: none; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
  color: white; font-size: 1.25rem; cursor: pointer;
  padding: 0.3rem 0.52rem; border-radius: 8px;
  line-height: 1; transition: all 0.18s; font-family: var(--font-family);
}
.hamburger-btn:hover { background: rgba(225,29,72,0.09); border-color: rgba(225,29,72,0.22); }

/* ==========================================================
   POWERED BY
   ========================================================== */
.powered-by-footer {
  position: fixed; bottom: 0.75rem; left: 50%; transform: translateX(-50%);
  font-size: 0.68rem; font-weight: 600; color: rgba(255,255,255,0.1);
  letter-spacing: 0.1em; text-transform: uppercase;
  pointer-events: none; z-index: 500; user-select: none;
}

/* ==========================================================
   RESPONSIVE ≤ 900px
   ========================================================== */
@media (max-width: 900px) {
  .sticky-header-wrapper { margin-left: -1rem; margin-right: -1rem; }
  .app-header { height: 56px; padding: 0 1rem; gap: 0.5rem; }
  .header-dropdowns { display: none !important; }
  .header-badge { display: none; }
  .hamburger-btn { display: flex; }
  .btn-logout { font-size: 0.72rem; padding: 0.28rem 0.55rem; }
  .current-supplier-badge { font-size: 0.65rem; padding: 0.18rem 0.42rem; }
  .container { padding: 1rem; }
  .stats-container { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .dashboard-grid { grid-template-columns: 1fr !important; gap: 1rem; }
  .order-item { padding: 0.75rem; flex-direction: column; align-items: flex-start; gap: 0.65rem; }
  .order-item > div:last-child {
    width: 100%; display: flex; flex-direction: row;
    align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem;
  }
  .btn-primary, .btn-secondary, .btn-supplier, .btn-success, .btn-outline, .btn-danger {
    padding: 0.4rem 0.75rem; font-size: 0.82rem;
  }
  table { font-size: 0.78rem; }
  table th, table td { padding: 0.55rem 0.5rem !important; font-size: 0.75rem !important; }
  div[style*="overflow-x: auto"], div[style*="overflow-x:auto"] { -webkit-overflow-scrolling: touch; max-width: 100%; }
  .closure-item { padding: 0.85rem; }
  .closure-header, .closure-body, .closure-footer { flex-direction: column; align-items: flex-start; gap: 0.45rem; }
  .closure-footer button { width: 100%; margin-top: 0.45rem; }
}

/* ==========================================================
   MODAL RESPONSIVE
   ========================================================== */
@media (max-width: 768px) {
  .nav-bar {
    justify-content: flex-start; overflow-x: auto;
    white-space: nowrap; gap: 0.3rem; padding: 0.35rem;
    margin-bottom: 1.25rem; top: 0.5rem; border-radius: 10px;
    flex-wrap: nowrap; scrollbar-width: none;
  }
  .nav-bar::-webkit-scrollbar { display: none; }
  .nav-link { padding: 0.38rem 0.72rem; font-size: 0.78rem; flex-shrink: 0; }
  .modal-overlay { padding: 2vh 0.75rem 2rem; }
  .modal-card { padding: 1.25rem !important; max-height: 92vh; border-radius: var(--radius-lg); }
  table th, table td { padding: 0.65rem 0.45rem !important; font-size: 0.78rem !important; }
  .stats-container { grid-template-columns: 1fr 1fr; gap: 0.65rem; }
  .dashboard-grid { grid-template-columns: 1fr !important; gap: 1.25rem; }
  .btn-primary, .btn-secondary, .btn-supplier, .btn-success, .btn-outline, .btn-danger {
    padding: 0.38rem 0.75rem; font-size: 0.82rem;
  }
}

/* ==========================================================
   COMPREHENSIVE MOBILE ≤ 600px
   ========================================================== */
@media (max-width: 600px) {
  .container { padding: 0.75rem !important; }
  .app-header { height: 52px; padding: 0 0.75rem; }
  .header-logo { width: 28px; height: 28px; }
  .current-supplier-badge { font-size: 0.58rem; padding: 0.14rem 0.32rem; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .btn-logout { font-size: 0.68rem; padding: 0.22rem 0.48rem; }
  .stats-container { grid-template-columns: 1fr 1fr !important; gap: 0.45rem; margin-bottom: 0.85rem; }
  .stat-card { padding: 0.8rem 0.9rem; min-height: 75px; }
  .stat-title { font-size: 0.68rem; margin-bottom: 0.35rem; }
  .stat-value { font-size: 1.55rem; }
  .dashboard-grid { grid-template-columns: 1fr !important; gap: 0.85rem; }
  .card { padding: 0.9rem !important; border-radius: var(--radius-md); }
  .order-item { flex-direction: column; align-items: flex-start; gap: 0.55rem; padding: 0.8rem; }
  .order-item > div:last-child { width: 100%; display: flex; flex-direction: row; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
  .order-info { width: 100%; }
  .order-header-line { flex-wrap: wrap; gap: 0.35rem; }
  .order-title { font-size: 0.82rem; word-break: break-all; }
  .order-creds { font-size: 0.7rem; word-break: break-all; white-space: normal; max-width: 100%; }
  .btn-primary, .btn-secondary, .btn-supplier, .btn-success, .btn-outline, .btn-danger { padding: 0.38rem 0.6rem; font-size: 0.76rem; }
  .closures-list { gap: 0.55rem; }
  .closure-item { padding: 0.7rem; }
  .closure-header { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .closure-body { flex-direction: column; align-items: flex-start; gap: 0.3rem; font-size: 0.78rem; }
  .closure-footer { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .closure-footer button { width: 100%; }
  .closure-date { font-size: 0.8rem; }
  .closure-id { font-size: 0.64rem; }
  .closure-amount { font-size: 0.88rem; }
  .modal-overlay { padding: 0 !important; align-items: flex-end !important; }
  .modal-card { width: 100% !important; max-width: 100% !important; border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important; padding: 1.25rem 1rem !important; max-height: 90vh; overflow-y: auto; }
  .modal-header h3 { font-size: 1rem; }
  .table-scroll-wrapper, [style*="overflow-x: auto"], [style*="overflow-x:auto"] { overflow-x: auto !important; -webkit-overflow-scrolling: touch; max-width: 100%; }
  table { min-width: 460px; font-size: 0.75rem; }
  table th, table td { padding: 0.48rem 0.38rem !important; font-size: 0.7rem !important; white-space: nowrap; }
  td .order-creds, td code, td span[style*="font-family: monospace"], td span[style*="font-family:monospace"] { font-size: 0.66rem !important; word-break: break-all; white-space: normal !important; }
  div[style*="grid-template-columns: repeat(3, 1fr)"] { grid-template-columns: 1fr !important; gap: 0.4rem !important; }
  #financeSettingsGrid { grid-template-columns: 1fr !important; }
  .login-form { gap: 0.8rem; }
  .form-group label { font-size: 0.8rem; }
  .form-group input, .form-group select, .form-group textarea { font-size: 0.85rem; padding: 0.52rem 0.72rem; }
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 3fr"],
  div[style*="grid-template-columns: 1fr 2fr"],
  div[style*="grid-template-columns: 2fr 1fr"],
  div[style*="grid-template-columns: 3fr 1fr"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns: 1.2fr 1.5fr 1fr"] { grid-template-columns: 1fr !important; }
  #addStockForm { grid-template-columns: 1fr !important; }
  #addStockForm > div[style*="grid-column: span 3"] { grid-column: span 1 !important; }
  div[style*="grid-template-columns: 1fr 1fr 1fr"] { grid-template-columns: 1fr !important; }
  .sidebar-drawer { left: -100% !important; width: 85% !important; max-width: 295px !important; height: 100vh !important; }
  .sidebar-drawer.open { left: 0 !important; }
  .drawer-menu { padding: 0.65rem !important; gap: 0.3rem !important; overflow-y: auto !important; flex: 1 !important; }
  .drawer-item { padding: 0.6rem 0.8rem !important; font-size: 0.82rem !important; border-radius: 8px !important; }
  .tab-btns, div[style*="display: flex"][style*="gap"][style*="border-bottom"] { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; white-space: nowrap; }
  .card h2, .card h3 { font-size: 1rem; }
  div[style*="grid-template-columns"][style*="1fr auto 1fr"] { grid-template-columns: 1fr !important; }
  #liveCurrencyBadge { font-size: 0.68rem; padding: 0.22rem 0.42rem; }
  .header-right { gap: 0.35rem; }
}

/* ==========================================================
   EXTRA SMALL ≤ 380px
   ========================================================== */
@media (max-width: 380px) {
  .stats-container { grid-template-columns: 1fr !important; }
  .modal-card { padding: 0.9rem 0.7rem !important; }
  .btn-logout { display: none; }
  .app-header { gap: 0.25rem; }
}

/* ==========================================================
   WHATSAPP WIDGET
   ========================================================== */
.whatsapp-wrapper { position: fixed; bottom: 2.5rem; right: 1.5rem; z-index: 1000; }
.whatsapp-float {
  width: 52px; height: 52px; background: #25d366; color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4); border: none; cursor: pointer;
  transition: all 0.28s cubic-bezier(0.4,0,0.2,1);
}
.whatsapp-float:hover { transform: scale(1.08); background: #128c7e; }
.whatsapp-popup {
  position: absolute; bottom: 66px; right: 0; width: 295px;
  background: rgba(11,11,18,0.99);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg); box-shadow: 0 12px 48px rgba(0,0,0,0.65);
  display: flex; flex-direction: column; overflow: hidden;
  transform-origin: bottom right; animation: waPopupShow 0.28s cubic-bezier(0.34,1.56,0.64,1); z-index: 1000;
}
.wa-popup-header { background: #075e54; padding: 0.7rem 0.9rem; display: flex; align-items: center; gap: 0.7rem; color: #fff; }
.wa-avatar { position: relative; width: 34px; height: 34px; background: rgba(255,255,255,0.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.wa-online-dot { position: absolute; bottom: 1px; right: 1px; width: 8px; height: 8px; background: #25d366; border-radius: 50%; border: 1px solid #075e54; }
.wa-header-info { flex: 1; }
.wa-name { font-weight: 700; font-size: 0.82rem; }
.wa-status { font-size: 0.68rem; color: rgba(255,255,255,0.75); }
.wa-close-btn { background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; padding: 0.2rem; }
.wa-popup-body { padding: 0.9rem; background: rgba(0,0,0,0.25); }
.wa-message-bubble { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); padding: 0.7rem; border-radius: 10px; border-top-left-radius: 0; font-size: 0.78rem; line-height: 1.45; color: var(--color-text-sub); }
.wa-popup-footer { padding: 0.7rem; background: rgba(8,8,14,0.95); border-top: 1px solid rgba(255,255,255,0.06); display: flex; }
.wa-chat-btn { display: block; width: 100%; background: #25d366; color: #fff; text-align: center; padding: 0.55rem; border-radius: 7px; font-weight: 700; font-size: 0.78rem; text-decoration: none; transition: background 0.18s; }
.wa-chat-btn:hover { background: #128c7e; }
@media (max-width: 900px) {
  .whatsapp-wrapper { bottom: 2.5rem; right: 1rem; }
  .whatsapp-float { width: 46px; height: 46px; }
  .whatsapp-popup { bottom: 58px; width: 272px; }
}

/* ==========================================================
   PROFESSIONAL DASHBOARD UPGRADE v13
   ========================================================== */

/* ── Stats container spacing ── */
.stats-container { margin-top: 3.5rem !important; }

/* ── Stat card enhanced ── */
.stat-card {
  background: rgba(13, 13, 22, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.055) !important;
  border-radius: 14px !important;
  padding: 1.35rem 1.4rem !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3) !important;
  position: relative; overflow: hidden;
  transition: all 0.22s ease;
  min-height: 90px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.stat-card:hover {
  border-color: rgba(212, 170, 60, 0.2) !important;
  background: rgba(16, 16, 26, 0.97) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4) !important;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--buyer-primary, #d4aa3c), transparent);
  border-radius: 14px 14px 0 0;
}
.supplier-theme .stat-card::before {
  background: linear-gradient(90deg, var(--supplier-primary, #c49a28), transparent);
}
.stat-title {
  font-size: 0.7rem !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: 0.1em !important;
  color: rgba(255,255,255,0.3) !important; margin-bottom: 0.5rem;
}
.stat-value {
  font-size: 2.1rem !important; font-weight: 800 !important;
  letter-spacing: -0.04em; line-height: 1; color: #fff;
}

/* ── Main card overhaul ── */
.card {
  background: rgba(13, 13, 22, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.055) !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 20px rgba(0,0,0,0.28) !important;
}
.card:hover {
  border-color: rgba(212, 170, 60, 0.15) !important;
  box-shadow: 0 4px 28px rgba(0,0,0,0.36) !important;
}

/* ── Section / card headings ── */
.card h3 {
  font-size: 0.9rem !important; font-weight: 700 !important;
  letter-spacing: 0.02em; color: #f0f2f5 !important;
  display: flex; align-items: center; gap: 0.5rem;
}

/* ── Collapsible section header ── */
.section-collapse-header {
  padding: 1.25rem 1.5rem;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; user-select: none;
  transition: background 0.18s;
}
.section-collapse-header:hover { background: rgba(212, 170, 60, 0.04); }

/* ── Dashboard grid ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr !important; }
}

/* ── Order form card (left panel) ── */
#sectionCreateOrder {
  position: sticky; top: 75px;
}
#sectionCreateOrder .login-form { gap: 0.85rem; }
#sectionCreateOrder label {
  font-size: 0.72rem !important; font-weight: 700 !important;
  text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.32) !important;
}
#sectionCreateOrder input,
#sectionCreateOrder select,
#sectionCreateOrder textarea {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 9px !important; font-size: 0.9rem !important;
  color: #f0f2f5 !important; padding: 0.65rem 0.9rem !important;
  transition: all 0.2s;
}
#sectionCreateOrder input:focus,
#sectionCreateOrder select:focus,
#sectionCreateOrder textarea:focus {
  border-color: rgba(225, 29, 72, 0.45) !important;
  background: rgba(212, 170, 60, 0.04) !important;
  box-shadow: 0 0 0 3px rgba(212, 170, 60, 0.08) !important;
}
#sectionCreateOrder .btn-primary {
  width: 100% !important; padding: 0.82rem !important;
  font-size: 0.92rem !important; font-weight: 700 !important;
  border-radius: 10px !important; letter-spacing: 0.02em;
  background: linear-gradient(135deg, #e11d48 0%, #9f1239 100%) !important;
  border: none !important;
  box-shadow: 0 3px 16px rgba(212, 170, 60, 0.3) !important;
}
#sectionCreateOrder .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 22px rgba(225, 29, 72, 0.44) !important;
}

/* ── Tab buttons (Adet / Liste) ── */
.tab-btn {
  cursor: pointer; font-weight: 600 !important; font-size: 0.85rem !important;
  padding: 0.45rem 0.75rem !important; border-radius: 8px !important;
  color: rgba(255,255,255,0.35) !important; transition: all 0.18s;
  border-bottom: 2px solid transparent !important;
  user-select: none;
}
.tab-btn.active {
  color: var(--buyer-primary) !important;
  border-bottom-color: var(--buyer-primary) !important;
}
.tab-btn:hover:not(.active) { color: rgba(255,255,255,0.65) !important; }
.supplier-theme .tab-btn.active {
  color: var(--supplier-primary) !important;
  border-bottom-color: var(--supplier-primary) !important;
}

/* ── Active Orders panel header ── */
#sectionActiveOrders h3,
#sectionSupplierOrders h3 {
  font-size: 0.88rem !important; font-weight: 700 !important;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: rgba(255,255,255,0.5) !important;
}
#sectionActiveOrders .btn-outline,
#sectionSupplierOrders .btn-outline {
  font-size: 0.78rem !important; padding: 0.35rem 0.7rem !important;
  border-radius: 7px !important;
}

/* ── Order item professional ── */
.order-item {
  padding: 1rem 1.1rem 1rem 1.3rem !important;
  background: rgba(10, 10, 18, 0.75) !important;
  border: 1px solid rgba(255,255,255,0.05) !important;
  border-radius: 11px !important;
  transition: all 0.18s !important;
}
.order-item::before {
  width: 2px !important; top: 22% !important; bottom: 22% !important;
  border-radius: 2px !important; background: var(--buyer-primary) !important;
}
.order-item:hover {
  background: rgba(18, 18, 28, 0.88) !important;
  border-color: rgba(212, 170, 60, 0.14) !important;
  transform: translateX(2px);
}
.supplier-theme .order-item::before { background: var(--supplier-primary) !important; }

/* ── Group wrapper ── */
.group-wrapper {
  background: rgba(10, 10, 18, 0.75) !important;
  border: 1px solid rgba(255,255,255,0.05) !important;
  border-radius: 12px !important;
}
.group-wrapper:hover { border-color: rgba(212, 170, 60, 0.16) !important; }
.group-header {
  padding: 0.95rem 1.1rem !important;
  background: rgba(0,0,0,0.15) !important;
}
.group-header:hover { background: rgba(212, 170, 60, 0.04) !important; }

/* ── Collapsible section cards (Kapanış, Raporlar) ── */
.card[style*="padding: 0"] > div:first-child,
.card[style*="padding:0"] > div:first-child {
  border-radius: 14px 14px 0 0;
}

/* ── Filter select ── */
#filterStatus, #filterStockProduct, #filterStockStatus {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 7px !important; font-size: 0.78rem !important;
  color: rgba(255,255,255,0.65) !important; padding: 0.32rem 0.6rem !important;
  cursor: pointer;
}

/* ── Bulk action bar ── */
#bulkActionBar {
  background: rgba(212, 170, 60, 0.06) !important;
  border: 1px solid rgba(212, 170, 60, 0.18) !important;
  border-radius: 11px !important;
}

/* ── Supplier stats ── */
.supplier-theme .stat-card::before {
  background: linear-gradient(90deg, var(--supplier-primary), transparent) !important;
}

/* ── Currency badge — uniform ── */
#liveCurrencyBadge {
  color: #f0d060 !important;
  background: rgba(212, 170, 60, 0.08) !important;
  border: 1px solid rgba(225, 29, 72, 0.22) !important;
  border-radius: 7px !important; font-size: 0.78rem !important;
  font-weight: 700 !important; padding: 0.28rem 0.62rem !important;
  cursor: pointer; transition: all 0.18s;
}
#liveCurrencyBadge:hover {
  background: rgba(212, 170, 60, 0.14) !important;
  border-color: rgba(225, 29, 72, 0.38) !important;
}

/* ── Dropdown dd-item color normalization ── */
.dd-item { color: rgba(255,255,255,0.55) !important; }
.dd-item:hover { color: #f0f2f5 !important; background: rgba(212,170,60,0.08) !important; }
.dd-item[style*="color: #22c55e"],
.dd-item[style*="color: #10b981"],
.dd-item[style*="color: #60a5fa"],
.dd-item[style*="color: #a78bfa"],
.dd-item[style*="color: #f59e0b"] {
  color: rgba(255,255,255,0.55) !important;
}
.dd-item[style*="color: #22c55e"]:hover,
.dd-item[style*="color: #10b981"]:hover,
.dd-item[style*="color: #60a5fa"]:hover,
.dd-item[style*="color: #a78bfa"]:hover,
.dd-item[style*="color: #f59e0b"]:hover {
  color: #f0f2f5 !important;
}

/* ── Drawer section labels ── */
.drawer-menu > div[style*="font-size: 0.8rem"] {
  font-size: 0.65rem !important; letter-spacing: 0.12em !important;
  color: rgba(255,255,255,0.2) !important; font-weight: 700 !important;
  text-transform: uppercase !important; margin-top: 1.2rem !important;
  padding: 0 0.35rem 0.4rem !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
}

/* ── Drawer item refined ── */
.drawer-item {
  padding: 0.72rem 0.9rem !important;
  border-radius: 9px !important; font-size: 0.85rem !important;
  font-weight: 500 !important; gap: 0.65rem !important;
  color: rgba(255,255,255,0.45) !important;
  transition: all 0.16s !important;
}
.drawer-item:hover {
  color: rgba(255,255,255,0.88) !important;
  background: rgba(212, 170, 60, 0.07) !important;
  border-color: rgba(212, 170, 60, 0.16) !important;
}
.drawer-item.active {
  color: #fff !important;
  background: rgba(212, 170, 60, 0.12) !important;
  border: 1px solid rgba(212, 170, 60, 0.3) !important;
}

/* ── Drawer logout btn ── */
.drawer-menu > .btn-danger {
  margin-top: 2.5rem !important; width: 100% !important;
  background: rgba(239, 68, 68, 0.08) !important;
  border: 1px solid rgba(239, 68, 68, 0.2) !important;
  color: #fca5a5 !important; border-radius: 10px !important;
  padding: 0.65rem !important; font-weight: 600 !important;
}

/* ── Table polish ── */
.table-scroll-wrapper {
  background: rgba(8,8,16,0.5) !important;
  border: 1px solid rgba(255,255,255,0.05) !important;
  border-radius: 11px !important;
}
thead th {
  font-size: 0.68rem !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: 0.09em !important;
  color: rgba(255,255,255,0.28) !important;
  padding: 0.75rem 1rem !important;
}
tbody td { padding: 0.7rem 1rem !important; font-size: 0.85rem !important; }
tbody tr:hover { background: rgba(212,170,60,0.025) !important; }

/* ── btn-supplier pill ── */
.btn-supplier {
  background: rgba(196, 154, 40, 0.12) !important;
  border: 1px solid rgba(196, 154, 40, 0.28) !important;
  color: #f0d060 !important; border-radius: 8px !important;
}
.btn-supplier:hover {
  background: rgba(196, 154, 40, 0.22) !important;
  border-color: rgba(196, 154, 40, 0.48) !important;
  color: #fff !important;
}

/* ── btn-success refined ── */
.btn-success {
  background: rgba(5, 150, 105, 0.15) !important;
  border: 1px solid rgba(16, 185, 129, 0.28) !important;
  color: #6ee7b7 !important;
}
.btn-success:hover {
  background: rgba(5, 150, 105, 0.28) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
  color: #fff !important;
}

/* ── btn-danger refined ── */
.btn-danger {
  background: rgba(239, 68, 68, 0.08) !important;
  border: 1px solid rgba(239, 68, 68, 0.22) !important;
  color: #fca5a5 !important;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: rgba(239, 68, 68, 0.42) !important;
  color: #fff !important;
}

/* ── btn-outline refined ── */
.btn-outline {
  background: rgba(255,255,255,0.035) !important;
  border: 1px solid rgba(255,255,255,0.09) !important;
  color: rgba(255,255,255,0.45) !important;
  border-radius: 8px !important;
}
.btn-outline:hover {
  background: rgba(255,255,255,0.07) !important;
  border-color: rgba(255,255,255,0.18) !important;
  color: rgba(255,255,255,0.88) !important;
}

/* ── Empty state messages ── */
.order-list > div[style*="text-align: center"],
.closures-list > div[style*="text-align: center"] {
  color: rgba(255,255,255,0.2) !important;
  padding: 3rem 2rem !important;
  font-size: 0.85rem !important; font-style: italic;
}

/* ── hdr-dropdown-panel divider ── */
.hdr-dropdown-panel > div[style*="border-top"] {
  border-top: 1px solid rgba(255,255,255,0.07) !important;
  margin: 0.25rem 0 !important;
}

/* ── Collapsible section arrow ── */
#closuresArrow, #reportsArrow, #problemsArrow {
  font-size: 0.75rem !important; opacity: 0.35;
  transition: transform 0.25s, opacity 0.2s !important;
}

/* ── modal-card scrollbar ── */
.modal-card::-webkit-scrollbar { width: 3px; }
.modal-card::-webkit-scrollbar-thumb { background: rgba(212,170,60,0.3); border-radius: 4px; }

/* ── Bulk action bar supplier ── */
#bulkActionBar .btn-supplier {
  font-size: 0.8rem !important; padding: 0.38rem 0.9rem !important;
}

/* ── SELECT DROPDOWN — Dark native options ─────────────────── */
/* The select box itself */
select {
  background: rgba(10, 10, 18, 0.96) !important;
  color: #f4f0e8 !important;
  border: 1px solid rgba(212, 170, 60, 0.15) !important;
  border-radius: 9px !important;
  appearance: auto;
  cursor: pointer;
}
select:focus {
  border-color: rgba(212, 170, 60, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(212, 170, 60, 0.09) !important;
  outline: none;
}

/* Option list items — works in Chrome/Firefox/Edge */
select option {
  background: #0e0e18 !important;
  color: #f4f0e8 !important;
  padding: 0.55rem 0.8rem;
  font-size: 0.88rem;
}
select option:checked,
select option:focus,
select option:hover {
  background: rgba(212, 170, 60, 0.18) !important;
  color: #f4f0e8 !important;
}
select option:disabled {
  color: rgba(244, 240, 232, 0.3) !important;
}

/* Filter status select specifically */
#filterStatus option,
#filterStockProduct option,
#filterStockStatus option {
  background: #0e0e18 !important;
  color: #f4f0e8 !important;
}

/* Converter modal selects */
#wmtFromCurrency option,
#wmtToCurrency option {
  background: #0e0e18 !important;
  color: #f4f0e8 !important;
}

