@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --brand: #E53935;
  --brand-dark: #b71c1c;
  --brand-light: #ffcdd2;
  --brand-faint: rgba(229, 57, 53, 0.08);
  
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --surface-3: #eef0f3;

  --border: #e2e5ea;
  --border-dark: #cdd1d8;

  --text: #1a1d23;
  --text-sub: #5a6274;
  --text-muted: #9aa0ae;
  --text-inv: #ffffff;

  --green: #2e7d32;
  --green-bg: #e8f5e9;
  --green-border: #a5d6a7;
  
  --blue: #1565c0;
  --blue-bg: #e3f2fd;
  --blue-border: #90caf9;
  
  --amber: #e65100;
  --amber-bg: #fff3e0;
  --amber-border: #ffcc80;
  
  --red: #c62828;
  --red-bg: #ffebee;
  --red-border: #ef9a9a;

  --sidebar-w: 220px;
  --topbar-h: 54px;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 2px 8px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
  --transition: 0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* â”€â”€â”€ Layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.app { display: flex; min-height: 100vh; }

/* â”€â”€â”€ Sidebar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  height: var(--topbar-h);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 28px; height: 28px;
  background: var(--brand);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

.sidebar-logo h1 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.sidebar-logo p {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 400;
}

.nav {
  padding: 8px 8px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 12px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 1px;
  user-select: none;
  position: relative;
}

.nav-item:hover {
  background: var(--surface-3);
  color: var(--text);
}

.nav-item.active {
  background: var(--brand-faint);
  color: var(--brand);
  font-weight: 600;
}

.nav-item .icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active .icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--brand);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 16px;
}

.sidebar-footer {
  padding: 8px 8px 12px;
  border-top: 1px solid var(--border);
}

.whatsapp-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-sub);
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border-dark);
  flex-shrink: 0;
}

.status-dot.connected { background: var(--green); }
.status-dot.connecting { background: var(--amber); animation: blink 1.2s infinite; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* â”€â”€â”€ Main Content â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

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

.page-content {
  padding: 22px 24px;
  flex: 1;
}

/* â”€â”€â”€ Cards â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
}

.card-body { padding: 16px 18px; }

/* â”€â”€â”€ Stats Grid â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
}

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

.stat-icon {
  font-size: 18px;
  margin-bottom: 10px;
  display: block;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

/* â”€â”€â”€ Buttons â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  line-height: 1.4;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 1px 2px rgba(229,57,53,0.2);
}
.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  box-shadow: 0 3px 8px rgba(229,57,53,0.3);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-sub);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-dark);
}

.btn-success {
  background: var(--green-bg);
  color: var(--green);
  border-color: var(--green-border);
}
.btn-success:hover { background: #c8e6c9; }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
}
.btn-danger:hover { background: #ffcdd2; }

.btn-warning {
  background: var(--amber-bg);
  color: var(--amber);
  border-color: var(--amber-border);
}
.btn-warning:hover { background: #ffe0b2; }

.btn-info {
  background: var(--blue-bg);
  color: var(--blue);
  border-color: var(--blue-border);
}
.btn-info:hover { background: #bbdefb; }

.btn-sm { padding: 5px 10px; font-size: 11.5px; }
.btn-lg { padding: 10px 20px; font-size: 13.5px; }
.btn-icon { padding: 6px; width: 30px; height: 30px; justify-content: center; }

/* â”€â”€â”€ Tables â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  background: var(--surface-2);
  padding: 9px 13px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--surface-3);
  transition: background var(--transition);
}

tbody tr:hover { background: #fafbfc; }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 10px 13px;
  font-size: 12.5px;
  color: var(--text);
  vertical-align: middle;
}

/* â”€â”€â”€ Badges â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.badge-pending { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-pudo { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); }
.badge-shipped { background: #e8eaf6; color: #3949ab; border: 1px solid #9fa8da; }
.badge-delivered { background: var(--blue-bg); color: var(--blue); border: 1px solid var(--blue-border); }
.badge-completed { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.badge-danger { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.badge-primary { background: #fce4e4; color: var(--brand); border: 1px solid #f48fb1; }

/* â”€â”€â”€ Forms â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.form-group { margin-bottom: 14px; }

label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 5px;
  letter-spacing: 0.1px;
}

input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 11px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  box-shadow: var(--shadow-sm);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); }

textarea { resize: vertical; min-height: 80px; }

/* â”€â”€â”€ Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 29, 35, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  backdrop-filter: blur(2px);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(12px);
  transition: transform 0.2s ease;
  box-shadow: var(--shadow-lg);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 14px; font-weight: 700; color: var(--text); }

.modal-close {
  width: 26px; height: 26px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-sub);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }

.modal-body { padding: 18px 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: var(--surface-2);
}

/* â”€â”€â”€ Toast â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 240px;
  max-width: 340px;
  animation: slideIn 0.2s ease;
  pointer-events: all;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.warning { border-left: 3px solid var(--amber); }
.toast.info { border-left: 3px solid var(--blue); }

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

/* â”€â”€â”€ Loading â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-row td { text-align: center; padding: 36px; color: var(--text-muted); }

/* â”€â”€â”€ Empty State â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.empty-state {
  text-align: center;
  padding: 52px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 36px; margin-bottom: 10px; opacity: 0.4; }
.empty-state h3 { font-size: 14px; font-weight: 600; margin-bottom: 5px; color: var(--text-sub); }
.empty-state p { font-size: 12.5px; }

/* â”€â”€â”€ Code Display â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.code-display {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  color: var(--brand);
  letter-spacing: 1.5px;
  display: inline-block;
}

.delivery-code {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--brand);
  font-family: monospace;
}

/* â”€â”€â”€ Info / Status Boxes â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.info-box {
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: 12.5px;
  color: var(--blue);
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.success-box {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: 12.5px;
  color: var(--green);
}

.error-box {
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: 12.5px;
  color: var(--red);
}

/* â”€â”€â”€ Tab Bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.tab-btn {
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition);
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-family: inherit;
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text-sub); }

.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

/* â”€â”€â”€ Grid / Utilities â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.flex { display: flex; }
.flex-center { align-items: center; }
.flex-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

/* â”€â”€â”€ Scrollbar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* â”€â”€â”€ Glow â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.glow-text { color: var(--brand); }

/* â”€â”€â”€ Divider â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

/* â”€â”€â”€ Daily Stats Bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
#daily-stats-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 38px;
  font-family: 'DM Sans', sans-serif;
  flex-shrink: 0;
}

/* â”€â”€â”€ Responsive â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: block !important; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 1000;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 6px 0 20px rgba(0,0,0,0.15);
  }

  .sidebar.active { transform: translateX(0); }

  .main {
    margin-left: 0;
    padding-top: var(--topbar-h);
  }

  .topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 990;
    padding: 0 14px;
    height: var(--topbar-h);
    background: var(--surface);
  }

  /* 24h stats bar responsive adjustments */
  #daily-stats-bar {
    height: auto !important;
    padding: 12px 16px !important;
    flex-wrap: wrap !important;
    gap: 10px 16px !important;
    background: var(--surface) !important;
  }
  
  #daily-stats-bar .bar-separator {
    display: none !important;
  }

  #daily-stats-bar span[id^="daily-stat-"] {
    min-width: auto !important;
  }

  /* Premium Bottom Drawer Modals for Mobile */
  .modal-overlay {
    align-items: flex-end !important;
    transition: opacity 0.25s ease !important;
  }

  .modal {
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
    transform: translateY(100%) !important;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    max-height: 85vh !important;
    border-bottom: none !important;
  }

  .modal-overlay.open .modal {
    transform: translateY(0) !important;
  }

  /* Stats grid card mobile styling */
  .stats-grid { 
    grid-template-columns: 1fr 1fr !important; 
    gap: 10px; 
  }
  .stat-card {
    padding: 12px 14px !important;
  }
  .stat-card .stat-value {
    font-size: 20px !important;
  }
  .stat-card .stat-label {
    font-size: 10px !important;
    margin-bottom: 4px !important;
  }

  .grid-2, .grid-3 { grid-template-columns: 1fr !important; gap: 10px; }

  /* Minimal horizontal scrollbars for tables on mobile */
  .table-wrapper { 
    overflow-x: auto !important; 
    -webkit-overflow-scrolling: touch; 
  }
  .table-wrapper::-webkit-scrollbar {
    height: 4px !important;
  }
  .table-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-dark) !important;
    border-radius: 2px !important;
  }

  /* Better form sizing to avoid auto-zoom issues on iOS */
  input[type="text"], input[type="password"], input[type="date"], input[type="tel"], select, textarea {
    font-size: 15px !important;
    padding: 10px 12px !important;
  }

  .flex { flex-wrap: wrap; gap: 8px !important; }

  .page-content { padding: 14px 16px; }

  /* Trendyol products table responsive cards transformation */
  #trendyol-products-table thead {
    display: none !important;
  }
  #trendyol-products-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    background: transparent !important;
  }
  #trendyol-products-table tbody tr {
    display: flex !important;
    flex-direction: column !important;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    padding: 14px 14px 14px 64px !important;
    gap: 8px !important;
    position: relative !important;
    box-shadow: var(--shadow-sm) !important;
  }
  #trendyol-products-table tbody tr td {
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: left !important;
  }
  #trendyol-products-table tbody tr td:nth-child(1) {
    position: absolute !important;
    left: 14px !important;
    top: 14px !important;
    width: 38px !important;
    height: 38px !important;
  }
  #trendyol-products-table tbody tr td:nth-child(2) {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    white-space: normal !important;
    color: var(--text) !important;
    margin-bottom: 2px !important;
  }
  #trendyol-products-table tbody tr td:nth-child(3) {
    font-size: 12px !important;
    color: var(--text-sub) !important;
  }
  #trendyol-products-table tbody tr td:nth-child(3)::before {
    content: "Barkod: " !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    margin-right: 4px !important;
  }
  #trendyol-products-table tbody tr td:nth-child(4) {
    font-size: 12px !important;
    color: var(--text-sub) !important;
  }
  #trendyol-products-table tbody tr td:nth-child(4)::before {
    content: "Model Kodu: " !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    margin-right: 4px !important;
  }
  #trendyol-products-table tbody tr td:nth-child(5),
  #trendyol-products-table tbody tr td:nth-child(6) {
    width: 50% !important;
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    float: left !important;
  }
  #trendyol-products-table tbody tr td:nth-child(5)::before {
    content: "Stok Adedi" !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
  }
  #trendyol-products-table tbody tr td:nth-child(6)::before {
    content: "SatÄ±ÅŸ FiyatÄ±" !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
  }
  #trendyol-products-table tbody tr td:nth-child(5) input,
  #trendyol-products-table tbody tr td:nth-child(6) .trendyol-inline-input {
    width: 100% !important;
    max-width: 100% !important;
    text-align: left !important;
  }
  #trendyol-products-table tbody tr td:nth-child(6) div {
    width: 100% !important;
  }
  #trendyol-products-table tbody tr::after {
    content: "" !important;
    display: table !important;
    clear: both !important;
  }
  #trendyol-products-table tbody tr td:nth-child(7) {
    margin-top: 4px !important;
  }
  #trendyol-products-table tbody tr td:nth-child(7) div {
    flex-direction: row !important;
    gap: 8px !important;
  }
  #trendyol-products-table tbody tr td:nth-child(8) {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    border-top: 1px solid var(--border) !important;
    padding-top: 12px !important;
    margin-top: 8px !important;
  }
  #trendyol-products-table tbody tr td:nth-child(8) span {
    flex: 1 !important;
    text-align: left !important;
  }
  #trendyol-products-table tbody tr td:nth-child(8) button {
    flex: 1 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr !important; }
}

/* â”€â”€â”€ Trendyol Inline Input Styles â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.trendyol-inline-input {
  width: 90px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.trendyol-inline-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-faint);
}



/* ¦¦¦ Toggle Switch ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-4, #334155);
  border-radius: 28px;
  transition: background 0.25s;
  border: 1px solid var(--border);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--success, #22c55e);
  border-color: var(--success, #22c55e);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}
