/**
 * WA Book Order - Professional DashLite Style
 * Modern Admin Dashboard Theme
 */

/* =====================================================
   CSS Variables - Design Tokens
   ===================================================== */
:root {
  /* Primary Colors */
  --primary: #6571ff;
  --primary-dark: #5166f5;
  --primary-dim: #6571ff1a;
  --primary-soft: #f0f2ff;
  
  /* Secondary Colors */
  --secondary: #8392ab;
  --secondary-dark: #657084;
  --secondary-light: #a0aec0;
  
  /* Success/Info Colors */
  --success: #16a34a;
  --success-dark: #15803d;
  --success-light: #dcfce7;
  --success-soft: #f0fdf4;
  
  /* Warning Colors */
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --warning-light: #fef3c7;
  --warning-soft: #fffbeb;
  
  /* Danger Colors */
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --danger-light: #fee2e2;
  --danger-soft: #fef2f2;
  
  /* Neutral Colors */
  --dark: #344050;
  --dark-1: #364152;
  --dark-2: #1e293e;
  --dark-3: #111827;
  --gray-100: #f8fafc;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #8898aa;
  --gray-700: #6c757d;
  --gray-800: #495057;
  --gray-900: #212529;
  
  /* Background Colors */
  --bg-lighter: #f5f7fa;
  --bg-lightest: #fafbfd;
  --bg-white: #ffffff;
  
  /* Border Colors */
  --border-color: #e9ecef;
  --border-light: #f0f0f0;
  --border-dark: #e2e8f0;
  
  /* Text Colors */
  --text-primary: #344050;
  --text-secondary: #6c757d;
  --text-muted: #8094ae;
  --text-light: #a8adb7;
  
  /* Shadow Colors */
  --shadow: 0 1px 3px rgba(52, 64, 80, 0.08), 0 1px 2px rgba(52, 64, 80, 0.06);
  --shadow-sm: 0 0.125rem 0.25rem rgba(52, 64, 80, 0.04);
  --shadow-md: 0 0.5rem 1rem rgba(52, 64, 80, 0.08);
  --shadow-lg: 0 1rem 3rem rgba(52, 64, 80, 0.12);
  --shadow-xl: 0 3rem 5rem rgba(52, 64, 80, 0.15);
  
  /* Border Radius */
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-pill: 9999px;
  
  /* Spacing */
  --space-xs: 2px;
  --space-sm: 4px;
  --space-md: 8px;
  --space-lg: 12px;
  --space-xl: 16px;
  --space-2xl: 20px;
  --space-3xl: 24px;
  --space-4xl: 32px;
  
  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 64px;
  
  /* Typography */
  --font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Transitions */
  --transition-fast: 0.1s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* =====================================================
   Reset & Base Styles
   ===================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-lighter);
  height: 100%;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
}

p {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
}

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

/* =====================================================
   App Layout
   ===================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* =====================================================
   Sidebar
   ===================================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-white);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: width var(--transition-base), transform var(--transition-base);
}

.sidebar.is-compact {
  width: var(--sidebar-collapsed-width);
}

/* Sidebar Header / Brand */
.sidebar-header {
  padding: var(--space-xl) var(--space-xl);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  min-height: var(--topbar-height);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.sidebar-logo-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  object-fit: cover;
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
}

.sidebar-logo-title {
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  color: var(--dark);
  line-height: 1.2;
}

.sidebar-logo-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section {
  margin-bottom: var(--space-lg);
}

.nav-section-title {
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-xs);
}

.sidebar-nav a,
.sidebar-nav button {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  position: relative;
}

.sidebar-nav a:hover,
.sidebar-nav button:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

.sidebar-nav a.active,
.sidebar-nav button.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.sidebar-nav a.active::before,
.sidebar-nav button.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.sidebar-nav .icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-nav .icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.sidebar-nav .text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav .badge-count {
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: white;
  min-width: 18px;
  text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-color);
  background: var(--bg-lightest);
}

.sidebar-footer-title {
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

/* =====================================================
   Main Content Area
   ===================================================== */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-base);
}

.main.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed-width);
}

/* =====================================================
   Topbar / Header
   ===================================================== */
.topbar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  padding: 0 var(--space-2xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.topbar-title {
  display: flex;
  flex-direction: column;
}

.topbar-title h1 {
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  color: var(--dark);
  line-height: 1.2;
}

.topbar-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

/* Status Chip */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-lighter);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
}

.status-chip .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-chip .dot.connected {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.2);
}

.status-chip .dot.disconnected {
  background: var(--danger);
}

.status-chip .dot.pending,
.status-chip .dot.connecting {
  background: var(--warning);
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* =====================================================
   Content Area
   ===================================================== */
.content {
  padding: var(--space-2xl);
  flex: 1;
}

.content-inner {
  max-width: 1400px;
  margin: 0 auto;
}

/* =====================================================
   Panels
   ===================================================== */
.panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

.panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =====================================================
   Cards
   ===================================================== */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: var(--space-xl) var(--space-2xl);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  background: var(--bg-lightest);
}

.card-header h3 {
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  color: var(--dark);
}

.card-body {
  padding: var(--space-2xl);
}

.card-footer {
  padding: var(--space-lg) var(--space-2xl);
  border-top: 1px solid var(--border-color);
  background: var(--bg-lightest);
}

/* =====================================================
   Tab Navigation
   ===================================================== */
.tab-nav {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-xl);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xs);
  overflow: hidden;
}

.tab-btn {
  flex: 1;
  padding: var(--space-md) var(--space-xl);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-lighter);
}

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* =====================================================
   Stat Cards / Widgets
   ===================================================== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  display: flex;
  align-items: flex-start;
  gap: var(--space-lg);
  transition: all var(--transition-fast);
}

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

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-icon.primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-card-icon.success {
  background: var(--success-soft);
  color: var(--success);
}

.stat-card-icon.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.stat-card-icon.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.stat-card-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.8;
}

.stat-card-content {
  flex: 1;
  min-width: 0;
}

.stat-card-label {
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.stat-card-value {
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  color: var(--dark);
  line-height: 1.2;
}

.stat-card-value.primary {
  color: var(--primary);
}

.stat-card-value.success {
  color: var(--success);
}

.stat-card-change {
  font-size: 11px;
  margin-top: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.stat-card-change.up {
  color: var(--success);
}

.stat-card-change.down {
  color: var(--danger);
}

/* =====================================================
   Tables
   ===================================================== */
.table-wrapper {
  overflow-x: auto;
}

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

table th,
table td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  vertical-align: middle;
}

table th {
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-lighter);
  border-bottom: 1px solid var(--border-color);
}

table td {
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
}

table tbody tr {
  transition: background var(--transition-fast);
}

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

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

/* =====================================================
   Badges
   ===================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  border-radius: var(--radius-pill);
  line-height: 1;
  white-space: nowrap;
}

.badge.primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge.success,
.badge.CONFIRMED,
.badge.INVOICED,
.badge.PAID {
  background: var(--success-soft);
  color: var(--success);
}

.badge.warning,
.badge.WAITING_STOCK_CHECK,
.badge.WAITING_RETRY,
.badge.NEW {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.danger,
.badge.REJECTED,
.badge.CANCELLED {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.secondary,
.badge.NOT_ORDER,
.badge.SORTED {
  background: var(--gray-200);
  color: var(--text-secondary);
}

.badge.shipping {
  background: #e0f2fe;
  color: #0369a1;
}

/* Status Badge Large */
.badge-lg {
  padding: 6px 14px;
  font-size: 12px;
}

/* =====================================================
   Buttons
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-size: 13px;
  font-weight: var(--font-weight-semibold);
  font-family: inherit;
  line-height: 1.4;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-dim);
}

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

.btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

/* Button Sizes */
.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 10px 20px;
  font-size: 14px;
}

/* Button Variants */
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-secondary {
  background: var(--gray-200);
  color: var(--text-primary);
  border-color: var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-300);
}

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

.btn-success:hover {
  background: var(--success-dark);
  border-color: var(--success-dark);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-dark);
  border-color: var(--danger-dark);
}

.btn-warning {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
}

.btn-warning:hover {
  background: var(--warning-dark);
  border-color: var(--warning-dark);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background: var(--primary-soft);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-outline-danger:hover {
  background: var(--danger-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}

/* Button Group */
.btn-group {
  display: inline-flex;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* =====================================================
   Forms
   ===================================================== */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.form-label.required::after {
  content: '*';
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

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

.form-input.is-invalid {
  border-color: var(--danger);
}

.form-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.form-error {
  font-size: 11px;
  color: var(--danger);
  margin-top: var(--space-xs);
}

/* Inline Form */
.form-inline {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  align-items: flex-end;
}

.form-inline .form-group {
  margin-bottom: 0;
}

.form-inline .form-input,
.form-inline .form-select {
  min-width: 150px;
}

/* =====================================================
   WhatsApp Connection Card
   ===================================================== */
.wa-card {
  padding: var(--space-2xl);
}

.wa-card-inner {
  display: flex;
  gap: var(--space-3xl);
  align-items: flex-start;
}

.wa-qr-box {
  width: 220px;
  height: 220px;
  flex-shrink: 0;
  background: var(--gray-100);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-lg);
}

.wa-qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
  border-radius: var(--radius);
}

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

.wa-info h3 {
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  color: var(--dark);
  margin-bottom: var(--space-md);
}

.wa-info p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.wa-status-row {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.wa-actions {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* =====================================================
   WhatsApp Provider Selection
   ===================================================== */
.provider-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.provider-card {
  position: relative;
  cursor: pointer;
}

.provider-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.provider-content {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-xl);
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

.provider-card:hover .provider-content {
  border-color: var(--primary-light);
  background: var(--primary-soft);
}

.provider-card input:checked + .provider-content {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.provider-icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border-radius: var(--radius);
}

.provider-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.provider-info strong {
  font-size: 14px;
  color: var(--dark);
}

.provider-info small {
  font-size: 12px;
  color: var(--gray-600);
}

/* Input Group */
.input-group {
  display: flex;
  gap: 8px;
}

.input-group .form-input {
  flex: 1;
}

/* Alert Styles */
.alert {
  padding: var(--space-lg) var(--space-xl);
  border-radius: var(--radius);
  margin-bottom: var(--space-xl);
}

.alert-info {
  background: var(--primary-soft);
  border-left: 4px solid var(--primary);
  color: var(--dark);
}

.alert-success {
  background: var(--success-soft);
  border-left: 4px solid var(--success);
  color: var(--dark);
}

.alert-warning {
  background: var(--warning-soft);
  border-left: 4px solid var(--warning);
  color: var(--dark);
}

/* =====================================================
   Toast Notifications
   ===================================================== */
.toast-container {
  position: fixed;
  top: var(--space-xl);
  right: var(--space-xl);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.toast {
  min-width: 280px;
  max-width: 400px;
  padding: var(--space-lg) var(--space-xl);
  background: var(--dark);
  color: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  animation: slideIn 0.3s ease;
}

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

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.warning {
  background: var(--warning);
  color: var(--dark);
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-content {
  flex: 1;
}

.toast-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  padding: 0;
}

.toast-close:hover {
  opacity: 1;
}

/* =====================================================
   Empty States
   ===================================================== */
.empty-state {
  text-align: center;
  padding: var(--space-4xl);
  color: var(--text-muted);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-xl);
  background: var(--gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--text-light);
}

.empty-state-title {
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state-text {
  font-size: 13px;
  max-width: 300px;
  margin: 0 auto;
}

/* =====================================================
   Utilities
   ===================================================== */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-dark { color: var(--dark); }

.bg-primary { background: var(--primary); }
.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }
.bg-danger { background: var(--danger); }

.fw-normal { font-weight: var(--font-weight-normal); }
.fw-medium { font-weight: var(--font-weight-medium); }
.fw-semibold { font-weight: var(--font-weight-semibold); }
.fw-bold { font-weight: var(--font-weight-bold); }

.fs-xs { font-size: 11px; }
.fs-sm { font-size: 12px; }
.fs-base { font-size: 13px; }
.fs-md { font-size: 14px; }
.fs-lg { font-size: 16px; }
.fs-xl { font-size: 18px; }
.fs-2xl { font-size: 20px; }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.w-100 { width: 100%; }

/* =====================================================
   Responsive Design
   ===================================================== */
@media (max-width: 1200px) {
  .stat-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.is-open {
    transform: translateX(0);
  }
  
  .main {
    margin-left: 0;
  }
  
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .wa-card-inner {
    flex-direction: column;
  }
  
  .wa-qr-box {
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .content {
    padding: var(--space-lg);
  }
  
  .card-header {
    padding: var(--space-lg);
    flex-direction: column;
    align-items: flex-start;
  }
  
  .card-body {
    padding: var(--space-lg);
  }
  
  .stat-cards {
    grid-template-columns: 1fr;
  }
  
  .form-inline {
    flex-direction: column;
  }
  
  .form-inline .form-group {
    width: 100%;
  }
  
  .form-inline .form-input,
  .form-inline .form-select {
    min-width: 100%;
  }
  
  .topbar {
    padding: 0 var(--space-lg);
  }
}

/* Mobile Toggle Button */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--gray-100);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 992px) {
  .sidebar-toggle {
    display: flex;
  }
}

/* =====================================================
   Tutorial Section Styles
   ===================================================== */
.tutorial-step {
  margin-bottom: var(--space-3xl);
  padding-bottom: var(--space-3xl);
  border-bottom: 1px solid var(--border-light);
}

.tutorial-step:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.tutorial-step-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.tutorial-step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: 14px;
  flex-shrink: 0;
}

.tutorial-step-header h4 {
  font-size: 15px;
  color: var(--dark);
  margin: 0;
}

/* Chat Bubble Styles */
.chat-bubble-group {
  background: var(--bg-lighter);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.chat-bubble {
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

.chat-bubble.chat-admin {
  align-self: flex-end;
}

.chat-bubble.chat-customer {
  align-self: flex-start;
}

.chat-bubble.chat-system {
  align-self: center;
  max-width: 90%;
  background: var(--primary-soft);
  border: 1px solid var(--primary-dim);
}

.chat-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 4px;
  font-size: 11px;
}

.chat-sender {
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
}

.chat-time {
  color: var(--text-light);
}

.chat-content {
  background: var(--bg-white);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.chat-admin .chat-content {
  background: var(--primary-soft);
  border-color: var(--primary-dim);
}

.chat-system .chat-content {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: var(--space-sm);
}

.chat-content p {
  margin: 0;
  line-height: 1.5;
}

.chat-content ul {
  margin: var(--space-sm) 0 0;
  padding-left: var(--space-lg);
}

.chat-content li {
  margin-bottom: 4px;
  font-size: 12px;
}

.chat-image-placeholder {
  background: linear-gradient(135deg, var(--gray-200), var(--gray-300));
  border-radius: var(--radius);
  padding: var(--space-xl);
  text-align: center;
  margin-bottom: var(--space-sm);
  font-size: 24px;
  color: var(--text-muted);
}

/* Tutorial Notes */
.tutorial-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-lighter);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-secondary);
}

.tutorial-note svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  stroke: var(--text-muted);
}

.tutorial-note.danger {
  background: var(--danger-soft);
  border-color: var(--danger-light);
}

.tutorial-note.danger svg {
  stroke: var(--danger);
}

.tutorial-note.success {
  background: var(--success-soft);
  border-color: var(--success-light);
}

.tutorial-note.success svg {
  stroke: var(--success);
}

.tutorial-note code {
  background: rgba(0,0,0,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
}

/* Keyword Tags */
.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.keyword-tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  font-family: var(--font-mono);
}

/* Tips Grid */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-xl);
}

.tip-card {
  background: var(--bg-lighter);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-fast);
}

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

.tip-icon {
  font-size: 28px;
  margin-bottom: var(--space-md);
}

.tip-card h5 {
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  color: var(--dark);
  margin-bottom: var(--space-sm);
}

.tip-card p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* =====================================================
   Dark Mode Support (Optional)
   ===================================================== */
@media (prefers-color-scheme: dark) {
  /* Can be enabled if needed */
}
