/**
 * Afecom CRM — Dark Mode E-Commerce Design
 * Bold, Modern, Entrepreneurial
 */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Colors - Dark E-Commerce Theme */
  --primary: #FF6B35;
  --primary-light: #FF8A5C;
  --primary-dark: #E5511A;
  --secondary: #00D9FF;
  --secondary-light: #33E0FF;
  --secondary-dark: #00C1E6;
  
  --bg-page: #0A0E14;
  --bg-card: #131920;
  --bg-sidebar: #0F1419;
  --bg-input: #1A1F26;
  --bg-hover: #1E242D;
  
  --text-primary: #E8EAED;
  --text-secondary: #9BA1A6;
  --text-muted: #6B7280;
  
  --border: #252B36;
  --border-light: #1E242D;
  
  --success: #00E676;
  --warning: #FFB800;
  --danger: #FF4757;
  --info: #4FC3F7;
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow: 0 4px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 6px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.6);
  
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

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

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden { display: none !important; }

.font-mono {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.9em;
}

/* ── LOGIN PAGE ──────────────────────────────── */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0A0E14 0%, #1A1F26 50%, #252B36 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,107,53,0.1) 0%, transparent 50%);
  animation: rotate 20s linear infinite;
}

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

.login-box {
  background: var(--bg-card);
  padding: 48px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 1;
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 28px;
  color: white;
  margin: 0 auto 20px;
  box-shadow: 0 8px 16px rgba(255,107,53,0.3);
}

.login-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.test-accounts {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.test-accounts > p {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  font-weight: 600;
}

.account-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}

.account-row strong {
  color: var(--text-secondary);
  font-weight: 600;
}

.account-row span {
  color: var(--text-muted);
}

/* ── DASHBOARD LAYOUT ────────────────────────── */
.dashboard-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  background: var(--bg-page);
}

/* ── SIDEBAR ─────────────────────────────────── */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 28px 24px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.sidebar-logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.sidebar-logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius);
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #0A0E14;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  list-style: none;
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sidebar-nav-item {
  margin-bottom: 4px;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 14px;
}

.sidebar-nav-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-nav-link.active {
  background: linear-gradient(135deg, rgba(255,107,53,0.15) 0%, rgba(0,217,255,0.1) 100%);
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,107,53,0.3);
}

.sidebar-nav-icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
  opacity: 0.8;
}

/* ── MAIN CONTENT ────────────────────────────── */
.main-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(19, 25, 32, 0.95);
}

.topbar-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

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

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-input);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.9); }
}

.content-area {
  flex: 1;
  padding: 32px;
}

/* ── CARDS ───────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, var(--bg-card) 0%, rgba(37,43,54,0.3) 100%);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.card-actions {
  display: flex;
  gap: 12px;
}

.card-body {
  padding: 24px;
}

/* ── STATS GRID ──────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.stat-card:hover::before {
  opacity: 1;
}

.stat-card.accent-card {
  background: linear-gradient(135deg, rgba(255,107,53,0.1) 0%, rgba(0,217,255,0.05) 100%);
  border-color: rgba(255,107,53,0.3);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.stat-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}

.stat-card-icon.primary {
  background: rgba(255,107,53,0.15);
  color: var(--primary);
}

.stat-card-icon.success {
  background: rgba(0,230,118,0.15);
  color: var(--success);
}

.stat-card-icon.warning {
  background: rgba(255,184,0,0.15);
  color: var(--warning);
}

.stat-card-icon.danger {
  background: rgba(255,71,87,0.15);
  color: var(--danger);
}

.stat-card-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.stat-card-value.accent {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── FORMS ───────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-input,
.form-select,
select.form-input,
textarea.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
select.form-input:focus,
textarea.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
  background: var(--bg-hover);
}

.form-input::placeholder {
  color: var(--text-muted);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* ── BUTTONS ─────────────────────────────────── */
.btn {
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255,107,53,0.4);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

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

/* ── ACTION BUTTONS ──────────────────────────── */
.action-buttons {
  display: flex;
  gap: 8px;
}

.btn-edit,
.btn-delete,
.btn-view {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
  background: var(--bg-input);
  color: var(--text-secondary);
}

.btn-edit:hover {
  background: rgba(79,195,247,0.15);
  color: var(--info);
  transform: scale(1.1);
}

.btn-delete:hover {
  background: rgba(255,71,87,0.15);
  color: var(--danger);
  transform: scale(1.1);
}

.btn-view:hover {
  background: rgba(0,230,118,0.15);
  color: var(--success);
  transform: scale(1.1);
}

/* ── TABLES ──────────────────────────────────── */
.table-controls {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 250px;
}

.search-box input {
  width: 100%;
  padding: 10px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

.filter-select {
  padding: 10px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  min-width: 180px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

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

thead {
  background: linear-gradient(to bottom, var(--bg-input) 0%, rgba(37,43,54,0.5) 100%);
  border-bottom: 2px solid var(--border);
}

thead th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: var(--bg-hover);
}

tbody tr:last-child {
  border-bottom: none;
}

tbody td {
  padding: 16px;
  font-size: 14px;
  color: var(--text-primary);
  white-space: nowrap;
}

.table-dropdown {
  padding: 6px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  min-width: 120px;
  font-weight: 500;
}

.table-dropdown:focus {
  outline: none;
  border-color: var(--primary);
}

.product-image {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.order-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.whatsapp-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(37, 211, 102, 0.1);
  color: #25D366;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: 'JetBrains Mono', monospace;
}

.whatsapp-link:hover {
  background: rgba(37, 211, 102, 0.2);
  transform: scale(1.05);
}

/* ── BADGES ──────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-delivered {
  background: rgba(0,230,118,0.15);
  color: var(--success);
}

.badge-pending {
  background: rgba(255,184,0,0.15);
  color: var(--warning);
}

.badge-cancelled,
.badge-danger {
  background: rgba(255,71,87,0.15);
  color: var(--danger);
}

.badge-no-response {
  background: rgba(156,163,175,0.15);
  color: var(--text-muted);
}

.badge-warning {
  background: rgba(255,184,0,0.15);
  color: var(--warning);
}

.badge-primary {
  background: rgba(255,107,53,0.15);
  color: var(--primary);
}

.badge-success {
  background: rgba(0,230,118,0.15);
  color: var(--success);
}

/* ── PAGINATION ──────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.pagination-info {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pagination-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pagination-btn {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 36px;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-color: transparent;
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── MODALS ──────────────────────────────────── */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10,14,20,0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, var(--bg-card) 0%, rgba(37,43,54,0.3) 100%);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--danger);
  color: white;
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: linear-gradient(to top, var(--bg-card) 0%, rgba(37,43,54,0.3) 100%);
}

/* ── ALERTS ──────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  display: none;
  border-left: 4px solid;
}

.alert.show {
  display: block;
}

.alert-error {
  background: rgba(255,71,87,0.15);
  color: var(--danger);
  border-left-color: var(--danger);
}

.alert-success {
  background: rgba(0,230,118,0.15);
  color: var(--success);
  border-left-color: var(--success);
}

/* ── EMPTY STATES ────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-muted);
}

/* ── CHARTS ──────────────────────────────────── */
.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.chart-container canvas {
  max-height: 300px !important;
}

/* ── FILE UPLOAD ─────────────────────────────── */
.file-upload {
  position: relative;
}

.file-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-upload-label:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.file-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.image-preview {
  margin-top: 16px;
  max-width: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: fixed;
    left: -100%;
    transition: left 0.3s ease;
    z-index: 999;
  }
  
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 640px) {
  .content-area {
    padding: 20px;
  }
  
  .topbar {
    padding: 16px 20px;
  }
  
  .topbar-title {
    font-size: 18px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .table-container {
    font-size: 12px;
  }
  
  tbody td {
    padding: 12px 8px;
  }
}

/* ── IMPROVED TABLE INPUT (matches table styling) ── */
.table-input {
  padding: 6px 12px !important;
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-primary) !important;
  font-size: 13px !important;
  font-family: inherit !important;
  font-weight: 500 !important;
  width: 100% !important;
  min-width: 120px !important;
  transition: all 0.2s ease !important;
  height: 32px !important;
  line-height: 1.4 !important;
}

.table-input:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  background: var(--bg-hover) !important;
  box-shadow: 0 0 0 2px rgba(255,107,53,0.1) !important;
}

.table-input:hover {
  background: var(--bg-hover) !important;
}

.table-input::placeholder {
  color: var(--text-muted) !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}

/* ── CHART SECTIONS (Better Layout) ── */
.chart-section {
  margin-bottom: 32px;
}

.chart-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 2px;
}

.chart-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  min-height: 320px;
}
