/* myEasyCompta v2.0 - CSS Principal */

/* ============================================
   WORDPRESS ADMIN INTEGRATION
   ============================================ */

/* Garder la sidebar WordPress visible, juste ajuster le layout */
#wpbody-content {
  padding-bottom: 0 !important;
}

/* Ajuster adminbar */
#wpadminbar {
  z-index: 99998 !important;
}

/* === 1. BASE (Kloxy Design System) === */
:root {
  --kloxy-bg: #f8fafc;
  --kloxy-surface: #ffffff;
  --kloxy-card: rgba(255, 255, 255, 0.92);
  --kloxy-text: #111827;
  --kloxy-muted: #4b5563;
  --kloxy-border: rgba(226, 232, 240, 0.9);
  --kloxy-grad: linear-gradient(to bottom right, #f9fafb 0%, rgba(59, 130, 246, 0.08) 50%, rgba(147, 51, 234, 0.08) 100%);

  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --secondary: #6366f1;
  --bg: var(--kloxy-bg);
  --card-bg: var(--kloxy-card);
  --text: var(--kloxy-text);
  --text-light: var(--kloxy-muted);
  --border: var(--kloxy-border);
}

[data-theme="dark"] {
  --kloxy-bg: #0b1220;
  --kloxy-surface: #0f172a;
  --kloxy-card: rgba(15, 23, 42, 0.85);
  --kloxy-text: #e5e7eb;
  --kloxy-muted: #cbd5e1;
  --kloxy-border: rgba(51, 65, 85, 0.7);
  --kloxy-grad: linear-gradient(to bottom right, #0b1220 0%, rgba(30, 41, 59, 0.6) 50%, rgba(15, 23, 42, 0.85) 100%);

  --primary: #60a5fa;
  --primary-dark: #3b82f6;
  --secondary: #818cf8;
  --bg: var(--kloxy-bg);
  --card-bg: var(--kloxy-card);
  --text: var(--kloxy-text);
  --text-light: var(--kloxy-muted);
  --border: var(--kloxy-border);
}

* {
  box-sizing: border-box;
}

body,
html {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Kloxy Design System Utility Classes --- */
.kloxy-label {
  display: block;
  margin-left: 0.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  /* slate-400 */
}

.dark .kloxy-label {
  color: #64748b;
  /* slate-500 */
}

.kloxy-input {
  display: block;
  width: 100%;
  background-color: #f8fafc !important;
  border: 1px solid #f1f5f9 !important;
  border-radius: 1rem !important;
  padding: 1rem 1.5rem !important;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none !important;
  box-shadow: none !important;
}

.dark .kloxy-input {
  background-color: #020617 !important;
  color: #f8fafc !important;
  border-color: #1e293b !important;
}

.kloxy-input:focus {
  border-color: #c4b5fd !important;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1) !important;
}

.dark .kloxy-input:focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1) !important;
}

.kloxy-input::placeholder {
  color: #94a3b8;
  font-weight: 600;
}

/* Specific support for selects to reset appearance */
select.kloxy-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.25rem center;
  background-size: 1.25rem;
  padding-right: 3.5rem;
}

.kloxy-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #7c3aed;
  /* purple-600 */
  color: #ffffff !important;
  padding: 0.5rem 1.25rem;
  border-radius: 0.875rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(124, 58, 237, 0.2);
  border: none !important;
  cursor: pointer;
  text-decoration: none !important;
}

.kloxy-btn-primary:hover {
  transform: translateY(-2px);
  background-color: #6d28d9;
  box-shadow: 0 20px 25px -5px rgba(124, 58, 237, 0.4);
  color: #ffffff !important;
}

.kloxy-btn-primary:active {
  transform: scale(0.95);
}

.kloxy-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: #ffffff;
  color: #334155 !important;
  /* slate-700 */
  border: 1px solid #e2e8f0 !important;
  /* slate-200 */
  padding: 0.5rem 1.25rem;
  border-radius: 0.875rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: none;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none !important;
}

.dark .kloxy-btn-secondary {
  background-color: #1e293b;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

.kloxy-btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1 !important;
}

.dark .kloxy-btn-secondary:hover {
  background-color: #334155;
  border-color: #475569 !important;
}

.kloxy-btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #ffffff !important;
  padding: 0.5rem 1.25rem;
  border-radius: 0.875rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none !important;
  cursor: pointer;
  background-color: #10b981;
  /* emerald-500 */
  box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
  text-decoration: none !important;
}

.kloxy-btn-success:hover {
  transform: translateY(-2px);
  background-color: #059669;
  box-shadow: 0 20px 25px -5px rgba(16, 185, 129, 0.4);
}

.kloxy-btn-warning {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #ffffff !important;
  padding: 0.5rem 1.25rem;
  border-radius: 0.875rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none !important;
  cursor: pointer;
  background-color: #f59e0b;
  /* amber-500 */
  box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.2);
  text-decoration: none !important;
}

.kloxy-btn-warning:hover {
  transform: translateY(-2px);
  background-color: #d97706;
  box-shadow: 0 20px 25px -5px rgba(245, 158, 11, 0.4);
}

.kloxy-btn-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 0.875rem;
  font-size: 0.875rem;
  font-weight: 700;
  transition: all 0.2s;
  opacity: 0.5 !important;
  cursor: not-allowed;
  background-color: #f1f5f9;
  color: #94a3b8 !important;
  border: 1px solid #e2e8f0 !important;
}

.dark .kloxy-btn-disabled {
  background-color: #0f172a;
  color: #475569;
}

/* Kloxy Inputs/Selects/Textarea */
.ecwp-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.ecwp-app select,
.ecwp-app textarea {
  appearance: none;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  box-shadow: none;
  outline: none;
  transition: all 0.2s ease;
}

[data-theme="dark"] .ecwp-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
[data-theme="dark"] .ecwp-app select,
[data-theme="dark"] .ecwp-app textarea {
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
}

.ecwp-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):hover,
.ecwp-app select:hover,
.ecwp-app textarea:hover {
  border-color: #d1d5db;
}

[data-theme="dark"] .ecwp-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):hover,
[data-theme="dark"] .ecwp-app select:hover,
[data-theme="dark"] .ecwp-app textarea:hover {
  border-color: #475569;
}

.ecwp-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
.ecwp-app select:focus,
.ecwp-app textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
  transform: scale(1.02);
}

[data-theme="dark"] .ecwp-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
[data-theme="dark"] .ecwp-app select:focus,
[data-theme="dark"] .ecwp-app textarea:focus {
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
}

.ecwp-app input::placeholder,
.ecwp-app textarea::placeholder {
  color: #9ca3af;
}

[data-theme="dark"] .ecwp-app input::placeholder,
[data-theme="dark"] .ecwp-app textarea::placeholder {
  color: #94a3b8;
}

/* === 2. ECWP APP CONTAINER === */
.ecwp-app {
  position: relative !important;
  display: flex !important;
  background: var(--kloxy-bg) !important;
  min-height: calc(100vh - 32px) !important;
  color: var(--text);
}

.ecwp-main-wrapper {
  flex: 1 !important;
  margin-left: 64px !important;
  transition: margin-left 0.3s ease !important;
  background: var(--kloxy-grad) !important;
}

.ecwp-main-wrapper.sidebar-expanded {
  margin-left: 256px !important;
}

/* === 3. SIDEBAR === */
.ecwp-sidebar {
  position: fixed !important;
  left: 160px !important;
  /* Largeur de la sidebar WordPress (160px) */
  top: 32px !important;
  bottom: 0 !important;
  width: 64px !important;
  background: white !important;
  border-right: 1px solid var(--border) !important;
  display: flex !important;
  flex-direction: column !important;
  transition: width 0.3s ease !important;
  z-index: 1000 !important;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05) !important;
}

.ecwp-sidebar.sidebar-expanded {
  width: 256px !important;
}

/* Sur les écrans où WordPress réduit sa sidebar (repliée) */
@media screen and (max-width: 960px) {
  .ecwp-sidebar {
    left: 36px !important;
    /* WordPress folded menu width */
  }
}

/* Sur mobile, WordPress cache sa sidebar */
@media screen and (max-width: 782px) {
  .ecwp-sidebar {
    left: 0 !important;
  }
}

/* Logo */
.sidebar-logo {
  padding: 1.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  font-weight: 800;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-expanded .sidebar-logo-text {
  opacity: 1;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 1rem 0.5rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
  border-radius: 0.75rem;
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.nav-item:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary);

  .ecwp-btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
  }

  .ecwp-btn-secondary {
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
  }

  .ecwp-btn-secondary:hover {
    background: var(--kloxy-bg);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
  }

  box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.3);
}

.nav-item-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item-text {
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-weight: 600;
  font-size: 0.875rem;
}

.sidebar-expanded .nav-item-text {
  opacity: 1;
}

.nav-item-badge {
  margin-left: auto;
  background: #ef4444;
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-expanded .nav-item-badge {
  opacity: 1;
}

/* Toggle Button */
.sidebar-toggle-wrapper {
  padding: 0.5rem;
  border-top: 1px solid var(--border);
}

.sidebar-toggle {
  width: 100%;
  padding: 0.75rem;
  background: rgba(102, 126, 234, 0.1);
  border: none;
  border-radius: 0.75rem;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background: rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

/* Search Action */
.sidebar-action-wrapper {
  padding: 0.5rem;
  border-top: 1px solid var(--border);
}

.sidebar-action-btn {
  width: 100%;
  padding: 0.75rem;
  background: rgba(102, 126, 234, 0.1);
  border: none;
  border-radius: 0.75rem;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.sidebar-action-btn:hover {
  background: rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

.sidebar-action-text {
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
  font-weight: 600;
  font-size: 0.875rem;
}

.sidebar-expanded .sidebar-action-text {
  opacity: 1;
}

/* Footer avec Dark Mode */
.sidebar-footer {
  padding: 0.5rem;
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.sidebar-theme-toggle {
  width: 100%;
  padding: 0.75rem;
  background: rgba(102, 126, 234, 0.1);
  border: none;
  border-radius: 0.75rem;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.sidebar-theme-toggle:hover {
  background: rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

/* === 4. CONTENT === */
.ecwp-page {
  animation: fade-in 0.5s ease forwards;
}

.ecwp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.gradient-text {
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ecwp-subtitle {
  color: var(--text-light);
  font-size: 1rem;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.ecwp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
}

.ecwp-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(102, 126, 234, 0.3);
}

.ecwp-btn-icon {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 0.75rem;
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary);
}

.ecwp-btn-icon:hover {
  background: rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

/* === 5. STATS GRID === */
.ecwp-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  animation: slide-up 0.5s ease forwards;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.stat-card-icon.icon-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.stat-card-icon.icon-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.stat-card-icon.icon-success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.stat-card-icon.icon-primary {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary);
}

.stat-card-content {
  flex: 1;
}

.stat-card-label {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.stat-card-value {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card-desc {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* === 6. GRID & CARDS === */
.ecwp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.ecwp-col-span-2 {
  grid-column: span 2;
}

.ecwp-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  animation: slide-up 0.5s ease forwards;
}

.ecwp-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.ecwp-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 1rem 0;
}

/* === 7. ANIMATIONS === */
@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
  }
}

/* === 19. DROPDOWN MENU === */
.ecwp-dropdown {
  position: relative;
  display: inline-block;
}

.ecwp-dropdown-toggle {
  background: var(--ecwp-input-bg);
  border: 1px solid var(--ecwp-input-border);
  color: var(--ecwp-secondary-text-color);
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* === Button Variants === */
.ecwp-btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  height: auto;
}

.ecwp-btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  height: auto;
}

.ecwp-btn-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.ecwp-btn-outline-error {
  background: transparent;
  border: 1px solid #ef4444;
  color: #ef4444;
}

.ecwp-btn-outline-error:hover {
  background: rgba(239, 68, 68, 0.1);
  transform: translateY(-2px);
}

.ecwp-btn-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.ecwp-btn-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
}

.ecwp-btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.ecwp-btn-outline-info {
  background: transparent;
  border: 1px solid #3b82f6;
  color: #3b82f6;
}

.ecwp-btn-outline-info:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-2px);
}

.ecwp-btn-outline-success {
  background: transparent;
  border: 1px solid #22c55e;
  color: #22c55e;
}

.ecwp-btn-outline-success:hover {
  background: rgba(34, 197, 94, 0.1);
  transform: translateY(-2px);
}

.ecwp-btn-outline-warning {
  background: transparent;
  border: 1px solid #f59e0b;
  color: #f59e0b;
}

.ecwp-btn-outline-warning:hover {
  background: rgba(245, 158, 11, 0.1);
  transform: translateY(-2px);
}

.ecwp-btn-ghost {
  background: transparent;
  color: var(--text-light);
  box-shadow: none;
}

.ecwp-btn-ghost:hover {
  background: rgba(107, 114, 128, 0.1);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

/* === 8. UI ELEMENTS === */

/* Toggle */
.ecwp-toggle {
  appearance: none;
  width: 3rem;
  height: 1.5rem;
  background: var(--kloxy-muted);
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ecwp-toggle:checked {
  background: var(--primary);
}

.ecwp-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.5rem - 4px);
  height: calc(1.5rem - 4px);
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.ecwp-toggle:checked::after {
  left: calc(3rem - 1.5rem + 2px);
}

/* File Input */
.ecwp-file-input {
  border: 2px dashed var(--border);
  border-radius: 0.75rem;
  padding: 0.5rem;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ecwp-file-input:hover {
  border-color: var(--primary);
}

.ecwp-file-input::file-selector-button {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  margin-right: 1rem;
  cursor: pointer;
  font-weight: 600;
}

/* Badge */
.ecwp-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.ecwp-badge-primary {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary);
  border-color: transparent;
}

.ecwp-badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-color: transparent;
}

.ecwp-badge-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: transparent;
}

.ecwp-badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border-color: transparent;
}

.ecwp-badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-color: transparent;
}

.ecwp-badge-secondary {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  border-color: transparent;
}

.ecwp-badge-purple {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
  border-color: transparent;
}

/* Divider */
.ecwp-divider {
  display: flex;
  align-items: center;
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
  width: 100%;
}

/* Modal */
.ecwp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  animation: fade-in 0.2s ease forwards;
}

.ecwp-modal-box,
.ecwp-modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 32rem;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  animation: slide-up 0.3s ease forwards;
  color: var(--text);
  position: relative;
}

.ecwp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.ecwp-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
}

.ecwp-modal-close {
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
}

.ecwp-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.ecwp-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Forms */
.ecwp-form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* --- Inputs & Forms --- */
.ecwp-app input[type="text"],
.ecwp-app input[type="number"],
.ecwp-app input[type="email"],
.ecwp-app input[type="tel"],
.ecwp-app input[type="password"],
.ecwp-app input[type="url"],
.ecwp-app input[type="date"],
.ecwp-app textarea,
.ecwp-app select {
  width: 100% !important;
  background-color: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 1rem !important;
  padding: 0.875rem 1.25rem !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  outline: none !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
  height: auto !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}

.dark .ecwp-app input[type="text"],
.dark .ecwp-app input[type="number"],
.dark .ecwp-app input[type="email"],
.dark .ecwp-app input[type="tel"],
.dark .ecwp-app input[type="password"],
.dark .ecwp-app input[type="url"],
.dark .ecwp-app input[type="date"],
.dark .ecwp-app textarea,
.dark .ecwp-app select {
  background-color: #0b0e14 !important;
  border-color: #1e293b !important;
  color: #f1f5f9 !important;
  box-shadow: none !important;
}

.ecwp-app input:focus,
.ecwp-app textarea:focus,
.ecwp-app select:focus {
  background-color: #ffffff !important;
  border-color: #7c3aed !important;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1) !important;
  transform: translateY(-1px);
}

.dark .ecwp-app input:focus,
.dark .ecwp-app textarea:focus,
.dark .ecwp-app select:focus {
  background-color: #0f172a !important;
}

.ecwp-app select {
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 1rem center !important;
  background-size: 1.25rem !important;
  padding-right: 3rem !important;
}

.ecwp-app label {
  display: block !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  color: #94a3b8 !important;
  margin-bottom: 0.5rem !important;
  margin-left: 0.25rem !important;
}

/* Toast */
.ecwp-toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  animation: slide-up 0.3s ease forwards;
  max-width: 24rem;
}

.ecwp-toast-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.ecwp-toast-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.ecwp-toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.ecwp-toast-content {
  font-size: 0.875rem;
  font-weight: 500;
  flex: 1;
}

.ecwp-toast-close {
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  padding: 0.25rem;
  transition: opacity 0.2s ease;
}

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

/* Loading */
.ecwp-loading {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Alert/Toast */
.ecwp-alert {
  padding: 1rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ecwp-alert-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.ecwp-alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.ecwp-alert-warning {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}

.ecwp-alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

/* Pagination */
.ecwp-pagination-nav {
  display: inline-flex;
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  isolation: isolate;
}

.ecwp-pagination-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  margin-left: -1px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ecwp-pagination-btn:first-child {
  border-top-left-radius: 0.375rem;
  border-bottom-left-radius: 0.375rem;
  padding: 0.5rem;
}

.ecwp-pagination-btn:last-child {
  border-top-right-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
  padding: 0.5rem;
}

.ecwp-pagination-btn:hover:not(:disabled) {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary);
  z-index: 10;
}

.ecwp-pagination-btn:focus {
  z-index: 20;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.ecwp-pagination-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  z-index: 10;
}

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

[data-theme="dark"] .ecwp-pagination-btn {
  background: var(--card-bg);
  color: var(--text);
  border-color: var(--border);
}