/* ============================================
   Fashion Boutique - Main CSS
   v1.0.0
   ============================================ */

:root {
  /* Palette LUXE : Cognac & Champagne */
  --bg: #FAF6F0;            /* creme */
  --bg-elev: #ffffff;
  --bg-soft: #F5EDE0;       /* ivoire */
  --border: #E8D5A2;        /* champagne */
  --border-soft: #F5EDE0;
  --text: #2C1810;          /* cafe fonce */
  --text-muted: #7A5C45;    /* taupe */
  --text-soft: #B5A088;     /* taupe clair */

  --primary: #8B4513;       /* cognac */
  --primary-hover: #6B3410; /* cognac fonce */
  --primary-soft: #F5EDE0;  /* ivoire */

  --accent: #D4AF37;        /* or chaud */
  --success: #6B8E4E;       /* vert olive */
  --warning: #C19A6B;       /* camel */
  --danger: #A52A2A;        /* brun rouge */
  --info: #8B4513;          /* cognac */

  /* Sidebar (admin) */
  --sidebar-bg: #1F1611;          /* noir cafe */
  --sidebar-bg-hover: #3D2914;    /* brun chocolat */
  --sidebar-text: #E8D5A2;        /* champagne */
  --sidebar-text-active: #FFFFFF;
  --sidebar-accent: #D4AF37;      /* or */
  --sidebar-w: 260px;
  --sidebar-w-collapsed: 64px;

  /* Layout */
  --topbar-h: 56px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,.10), 0 4px 6px -2px rgba(0,0,0,.04);

  --transition: .18s ease;
}

/* Dark mode desactive : on garde la palette claire luxe en permanence
   (le dark cassait l'identite marron/gold/creme) */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

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

/* Layout général */
#app {
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

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

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.topbar-right {
  display: flex;
  gap: 8px;
}

.content {
  padding: 24px;
  flex: 1;
}

.mobile-menu {
  display: none;
  font-size: 22px;
  padding: 4px 8px;
}

@media (max-width: 768px) {
  .mobile-menu {
    display: inline-block;
  }
  .content {
    padding: 14px;
  }
  /* Boutons tactiles plus grands */
  .btn { min-height: 40px; padding: 10px 14px; }
  .btn-icon { min-width: 40px; min-height: 40px; }
  .btn-sm { min-height: 34px; }
  .topbar h1 { font-size: 15px; }
  .topbar { padding: 0 12px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-value { font-size: 20px; }
  .kpi-card { padding: 12px; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-actions { flex-wrap: wrap; }
  .form-row { grid-template-columns: 1fr; }
  .table { font-size: 12px; }
  .table th, .table td { padding: 8px 10px; }
  .modal { border-radius: 12px 12px 0 0; max-height: 95vh; }
  /* Empêcher zoom iOS sur focus input */
  .form-input, .form-select, .form-textarea, input { font-size: 16px !important; }
  /* Backdrop click ferme mobile sidebar */
  .sidebar.mobile-open ~ .main::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 49;
  }
}

/* Loading */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

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

/* Utility */
.hidden { display: none !important; }
[hidden] { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
