/* ==========================================================================
   ShopPilot AI — Modern SaaS Control Panel & Admin Design System
   CSS-Only Redesign: Shopify Admin + Linear + Stripe Dashboard inspired
   ========================================================================== */

:root {
  /* 1. Typography Tokens */
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  
  /* 2. Color Palette */
  --bg-app: #f6f7f9;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-active: #eef2ff;
  --bg-hover: #f9fafb;
  --bg-glass: rgba(255, 255, 255, 0.85);
  
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-placeholder: #9ca3af;
  --text-inverse: #ffffff;
  
  --border-default: #e5e7eb;
  --border-light: #f1f5f9;
  --border-strong: #d1d5db;
  --border-focus: #6366f1;
  
  --brand-primary: #4f46e5;
  --brand-hover: #4338ca;
  --brand-light: #eef2ff;
  --brand-border: #c7d2fe;
  --brand-gradient: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
  --brand-gradient-hover: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);

  --color-success: #047857;
  --color-success-bg: #ecfdf3;
  --color-success-text: #047857;
  --color-success-border: #a7f3d0;
  
  --color-warning: #b45309;
  --color-warning-bg: #fffbeb;
  --color-warning-text: #b45309;
  --color-warning-border: #fde68a;
  
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  --color-error-text: #b91c1c;
  --color-error-border: #fecaca;
  
  --color-info: #2563eb;
  --color-info-bg: #eff6ff;
  --color-info-text: #2563eb;
  --color-info-border: #bfdbfe;

  --color-pro: #7e22ce;
  --color-pro-bg: #f3e8ff;
  --color-pro-border: #e9d5ff;

  --color-neutral-badge-bg: #f3f4f6;
  --color-neutral-badge-text: #374151;

  /* 3. Radius Tokens */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-input: 8px;
  --radius-button: 8px;
  --radius-card: 14px;
  --radius-modal: 14px;
  --radius-pill: 9999px;

  /* 4. Multi-Layer Modern Elevation & Shadows */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-card-hover: 0 4px 12px rgba(16, 24, 40, 0.06);
  --shadow-dropdown: 0 10px 25px -5px rgba(16, 24, 40, 0.1), 0 8px 10px -6px rgba(16, 24, 40, 0.04);
  --shadow-modal: 0 20px 25px -5px rgba(16, 24, 40, 0.1), 0 8px 10px -6px rgba(16, 24, 40, 0.05);

  /* 5. Smooth Transition Curves */
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* 6. Control Dimensions */
  --height-button: 38px;
  --height-input: 40px;
  --height-header: 64px;
  --width-sidebar: 240px;
}

/* ==========================================================================
   Reset & Global Base Styles
   ========================================================================== */

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

html, body {
  font-family: var(--font-sans) !important;
  background-color: var(--bg-app) !important;
  color: var(--text-primary) !important;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Universal Typography Enforcement */
input, select, textarea, button, label, p, h1, h2, h3, h4, h5, h6, span, div, table, td, th {
  font-family: var(--font-sans);
}

/* Icon Font Preservation */
.fa-solid, .fa-regular, .fa-brands, .fa, .fas, .far, .fab, [class^="fa-"], [class*=" fa-"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", "FontAwesome" !important;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  line-height: 1;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* ==========================================================================
   Polaris Component Overrides (Clean, Modern Pill Badges & Cards)
   ========================================================================== */

.Polaris-Badge {
  border-radius: var(--radius-pill) !important;
  padding: 3px 8px !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  display: inline-flex !important;
  align-items: center !important;
  border: none !important;
  text-transform: none !important;
  box-shadow: none !important;
}

.Polaris-Badge--toneSuccess {
  background-color: var(--color-success-bg) !important;
  color: var(--color-success-text) !important;
}

.Polaris-Badge--toneInfo {
  background-color: var(--color-info-bg) !important;
  color: var(--color-info-text) !important;
}

.Polaris-Badge--toneAttention,
.Polaris-Badge--toneWarning {
  background-color: var(--color-warning-bg) !important;
  color: var(--color-warning-text) !important;
}

.Polaris-Badge--toneCritical {
  background-color: var(--color-error-bg) !important;
  color: var(--color-error-text) !important;
}

.Polaris-Badge:not([class*="tone"]) {
  background-color: var(--color-neutral-badge-bg) !important;
  color: var(--color-neutral-badge-text) !important;
}

.Polaris-Banner {
  border-radius: var(--radius-input) !important;
  border: 1px solid var(--border-default) !important;
  box-shadow: var(--shadow-xs) !important;
}

/* ==========================================================================
   ShopPilot AI Control Panel Layout (.cc-*)
   ========================================================================== */

.cc-dashboard-wrapper {
  padding: 24px 20px;
  max-width: 1360px;
  margin: 0 auto;
  background-color: var(--bg-app);
  font-family: var(--font-sans);
}

/* Header Section */
.cc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-default);
}

.cc-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cc-logo-badge {
  width: 40px;
  height: 40px;
  background: var(--brand-primary);
  color: var(--text-inverse);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
  flex-shrink: 0;
}

.cc-header-titles h1 {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #111827 !important;
  margin: 0 !important;
  line-height: 28px !important;
  letter-spacing: -0.01em !important;
}

.cc-header-titles p {
  font-size: 13px !important;
  color: #6b7280 !important;
  margin: 2px 0 0 0 !important;
  line-height: 1.4 !important;
  font-weight: 400 !important;
}

/* 2-Column Grid Layout (65% / 35%) */
.cc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

/* Modern Card Component */
.cc-card {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  padding: 18px 20px !important;
  margin-bottom: 20px !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04) !important;
  transition: box-shadow 0.2s var(--ease-smooth), border-color 0.2s var(--ease-smooth);
}

.cc-card:hover {
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06) !important;
}

.cc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  gap: 12px;
  flex-wrap: wrap;
}

.cc-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px !important;
  font-weight: 650 !important;
  color: #111827 !important;
  letter-spacing: -0.01em;
}

.cc-card-title span {
  font-size: 14px !important;
  font-weight: 650 !important;
  color: #111827 !important;
}

.cc-card-icon {
  width: 30px;
  height: 30px;
  background: #eef2ff !important;
  color: #4f46e5 !important;
  border-radius: 8px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.cc-body-text {
  font-size: 12px !important;
  color: #6b7280 !important;
  line-height: 1.5 !important;
}

.cc-section-subtitle {
  font-size: 13px !important;
  font-weight: 650 !important;
  color: #111827 !important;
  margin-bottom: 12px !important;
  letter-spacing: -0.01em;
}

/* Form Labels & Subtexts */
.cc-label {
  display: block;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #374151 !important;
  margin-bottom: 6px !important;
  letter-spacing: 0.01em !important;
  text-transform: none !important;
}

.cc-subtext {
  font-size: 11px !important;
  color: #6b7280 !important;
  margin-top: 5px !important;
  line-height: 1.4 !important;
}

/* Form Inputs, Selects & Textareas */
.cc-input,
.cc-select,
.cc-textarea {
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.cc-input,
.cc-select {
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 12px !important;
}

.cc-textarea {
  min-height: 68px;
  padding: 9px 12px !important;
  line-height: 1.5 !important;
  resize: vertical !important;
}

.cc-input::placeholder,
.cc-select::placeholder,
.cc-textarea::placeholder {
  color: #9ca3af !important;
}

.cc-input:hover,
.cc-select:hover,
.cc-textarea:hover {
  border-color: #9ca3af !important;
}

.cc-input:focus,
.cc-select:focus,
.cc-textarea:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.10) !important;
  outline: none !important;
}

.cc-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  padding-right: 32px !important;
}

/* AI Engine Dynamic Model Box */
.cc-model-highlight-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 12px 14px !important;
  margin-top: 14px !important;
}

/* Color Picker Controls */
.cc-color-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cc-color-swatch-input {
  width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 2px !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  cursor: pointer;
  background: #ffffff !important;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}

.cc-color-swatch-input:hover {
  border-color: #6366f1 !important;
}

/* Modern SaaS Buttons */
.cc-btn {
  height: 38px;
  min-height: 38px;
  padding: 9px 15px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  box-sizing: border-box;
}

.cc-btn-primary {
  background: #4f46e5 !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2) !important;
}

.cc-btn-primary:hover {
  background: #4338ca !important;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3) !important;
}

.cc-btn-secondary {
  background: #ffffff !important;
  color: #374151 !important;
  border: 1px solid #d1d5db !important;
  font-weight: 500 !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04) !important;
}

.cc-btn-secondary:hover {
  background: #f9fafb !important;
  border-color: #9ca3af !important;
  color: #111827 !important;
}

.cc-btn-block {
  width: 100% !important;
}

.cc-btn:active {
  transform: scale(0.99);
}

/* Live Chatbot Preview Container */
.cc-preview-frame {
  background: #0f172a !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  padding: 10px !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16) !important;
  min-width: 290px;
  width: 100%;
  max-width: 30rem !important;
  box-sizing: border-box;
}

.cc-preview-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.cc-widget-mockup {
  background: #ffffff !important;
  border-radius: 12px !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid rgba(226, 232, 240, 0.6);
}

.cc-widget-header {
  padding: 14px 16px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #4f46e5;
}

.cc-widget-header-bot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cc-widget-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.cc-widget-body {
  flex: 1;
  padding: 12px;
  background: #f8fafc;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
}

.cc-widget-msg {
  padding: 9px 13px;
  border-radius: 10px;
  max-width: 85%;
  line-height: 18px;
  word-wrap: break-word;
  font-size: 12px;
}

.cc-widget-msg.bot {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #e2e8f0;
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.cc-widget-msg.user {
  background: #4f46e5;
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
}

.cc-widget-input-bar {
  padding: 8px 12px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cc-widget-input-placeholder {
  font-size: 11px;
  color: #9ca3af;
  flex: 1;
}

/* Sidebar Stats & Performance */
.cc-stat-box {
  background: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px !important;
  padding: 14px 16px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cc-stat-box:hover {
  border-color: #d1d5db !important;
  box-shadow: 0 2px 6px rgba(16, 24, 40, 0.05) !important;
}

.cc-stat-lbl {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #6b7280 !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cc-stat-val {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #111827 !important;
  margin-top: 2px;
  line-height: 1.2;
}

.cc-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* Progress Bar */
.cc-progress-track {
  width: 100%;
  height: 6px;
  background-color: #e5e7eb;
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 6px 0;
}

.cc-progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px !important;
  border-radius: var(--radius-pill) !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 14px;
}

.status-badge.success,
.status-badge.active,
.status-badge.synced {
  background-color: #ecfdf3 !important;
  color: #047857 !important;
}

.status-badge.info {
  background-color: #eff6ff !important;
  color: #2563eb !important;
}

.status-badge.warning,
.status-badge.pending,
.status-badge.replaced {
  background-color: #fffbeb !important;
  color: #b45309 !important;
}

.status-badge.error,
.status-badge.failed,
.status-badge.expired {
  background-color: #fef2f2 !important;
  color: #b91c1c !important;
}

.status-badge.pro {
  background-color: #f3e8ff !important;
  color: #7e22ce !important;
}

/* Modals & Dialogs */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5) !important;
  backdrop-filter: blur(4px) !important;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background-color: #ffffff !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 14px !important;
  box-shadow: var(--shadow-modal) !important;
  max-width: 540px;
  width: 100%;
  padding: 24px !important;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

.modal-title {
  font-size: 17px !important;
  font-weight: 700 !important;
  line-height: 24px;
  color: #111827 !important;
}

.modal-content {
  font-size: 13px !important;
  line-height: 1.5;
  color: #4b5563 !important;
}

/* ==========================================================================
   Admin SaaS Dashboard Classes (saas-admin.tsx compatibility)
   ========================================================================== */

.saas-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-app);
  position: relative;
}

.sidebar {
  width: var(--width-sidebar);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  transition: transform 0.2s ease-in-out;
}

.sidebar-brand {
  height: var(--height-header);
  padding: 0 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--brand-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  font-weight: 700;
  font-size: 14px;
}

.brand-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 18px;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--brand-primary);
  line-height: 14px;
}

.sidebar-menu {
  flex: 1;
  padding: 20px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0 10px 6px 10px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-button);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  color: #4b5563;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  transition: background-color 0.15s ease, color 0.15s ease;
}

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

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

.nav-item .nav-icon {
  font-size: 15px;
  width: 16px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background-color: var(--brand-primary);
  color: var(--text-inverse);
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

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

.user-role {
  font-size: 11px;
  font-weight: 400;
  line-height: 14px;
  color: var(--text-secondary);
}

.main-wrapper {
  flex: 1;
  margin-left: var(--width-sidebar);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-header {
  height: var(--height-header);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 40;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-button);
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 28px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.page-description {
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.global-search-input {
  width: 240px;
  height: 38px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-strong);
  padding: 0 12px 0 34px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-surface);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.global-search-input::placeholder {
  color: var(--text-placeholder);
}

.global-search-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.10);
}

.global-search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-placeholder);
  font-size: 14px;
  pointer-events: none;
}

.content-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-default);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.card-heading {
  font-size: 14px;
  font-weight: 650;
  line-height: 20px;
  color: var(--text-primary);
}

.section-heading {
  font-size: 15px;
  font-weight: 650;
  line-height: 22px;
  color: var(--text-primary);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-default);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.kpi-number {
  font-size: 22px;
  font-weight: 700;
  line-height: 28px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-light);
}

.input-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  color: #374151;
  margin-bottom: 6px;
}

.input-helper {
  font-size: 11px;
  font-weight: 400;
  line-height: 16px;
  color: var(--text-muted);
  margin-top: 4px;
}

.input-field, .select-input {
  height: var(--height-input);
  border-radius: var(--radius-input);
  border: 1px solid var(--border-strong);
  padding: 0 12px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background-color: var(--bg-surface);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

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

.input-field:focus, .select-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.10);
}

.btn-primary {
  height: 38px;
  padding: 0 14px;
  background-color: var(--brand-primary);
  color: var(--text-inverse);
  border-radius: var(--radius-button);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

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

.btn-secondary {
  height: 38px;
  padding: 0 14px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: #374151;
  border-radius: var(--radius-button);
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: #9ca3af;
}

.btn-danger {
  height: 38px;
  padding: 0 14px;
  background-color: var(--color-error);
  color: var(--text-inverse);
  border-radius: var(--radius-button);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-button);
  border: 1px solid var(--border-default);
  background-color: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s ease, color 0.15s ease;
}

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

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.modern-table th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-default);
  background-color: var(--bg-subtle);
}

.modern-table tr {
  min-height: 52px;
  transition: background-color 0.15s ease;
}

.modern-table td {
  padding: 14px;
  font-size: 13px;
  font-weight: 400;
  line-height: 20px;
  color: #4b5563;
  border-bottom: 1px solid var(--border-light);
}

.modern-table tr:hover {
  background-color: var(--bg-subtle);
}

.toast-banner {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-dropdown);
}

.toast-success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border: 1px solid #a7f3d0;
}

.toast-error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
  border: 1px solid #fecaca;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */

@media (max-width: 1024px) {
  .cc-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .cc-grid {
    grid-template-columns: 1fr;
  }

  .cc-preview-frame {
    max-width: 100% !important;
  }
}

@media (max-width: 768px) {
  .mobile-hamburger {
    display: block;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .top-header {
    padding: 0 16px;
  }
  .content-body {
    padding: 16px;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .global-search-input {
    width: 180px;
  }
}

@media (max-width: 640px) {
  .cc-dashboard-wrapper {
    padding: 16px 12px;
  }

  .cc-card {
    padding: 14px 16px !important;
    border-radius: 12px !important;
  }

  .cc-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .cc-header-titles h1 {
    font-size: 18px !important;
  }

  .cc-header-titles p {
    font-size: 12px !important;
  }

  .cc-input,
  .cc-select,
  .cc-btn {
    width: 100%;
  }

  .cc-preview-frame {
    min-width: 100% !important;
    max-width: 100% !important;
  }
}


