/* ============================================================
   BoutiquePro — Styles principaux
   ============================================================ */

:root {
  --sidebar-w: 260px;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #6366f1;
  --sidebar-hover: rgba(255,255,255,0.06);
  --topbar-h: 60px;
  --body-bg: #f1f5f9;
  --primary: #6366f1;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;
  --teal: #0d9488;
  --purple: #8b5cf6;
}

* { box-sizing: border-box; }
body { background: var(--body-bg); font-family: 'Inter', system-ui, sans-serif; margin: 0; }

/* ============================================================
   AUTH
   ============================================================ */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #312e81 100%);
}

.auth-wrapper {
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
}

.sidebar-logo i {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.sidebar-menu { flex: 1; padding: 12px 12px; }

.sidebar-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #475569;
  padding: 16px 8px 6px;
  text-transform: uppercase;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #e2e8f0;
}

.sidebar-link.active {
  background: rgba(99,102,241,0.15);
  color: #818cf8;
}

.sidebar-link i { width: 20px; text-align: center; font-size: 14px; flex-shrink: 0; }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
}

.sidebar-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }

.sidebar-user { flex: 1; min-width: 0; }
.sidebar-user div { color: #e2e8f0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user small { font-size: 11px; }

.sidebar-toggle { display: none; background: none; border: none; color: #94a3b8; }

/* ============================================================
   MAIN WRAPPER / TOPBAR
   ============================================================ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin 0.3s ease;
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.sidebar-toggle-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  padding: 6px 10px;
  line-height: 1;
  display: none;
}

.topbar-title {
  flex: 1;
  font-weight: 600;
  font-size: 16px;
  color: #1e293b;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-icon {
  position: relative;
  background: none;
  border: none;
  color: #64748b;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.topbar-icon:hover { background: #f1f5f9; color: #1e293b; }

.topbar-icon .badge {
  position: absolute;
  top: 4px; right: 4px;
  font-size: 9px;
  padding: 2px 4px;
  min-width: 16px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 5px 10px;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.topbar-user:hover { background: #f8fafc; }
.topbar-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-content {
  flex: 1;
  padding: 24px;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  border-radius: 12px;
  padding: 20px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.stat-icon {
  font-size: 20px;
  margin-bottom: 10px;
  opacity: 0.8;
}

.stat-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  opacity: 0.85;
  font-weight: 500;
}

.bg-purple { background: linear-gradient(135deg, #7c3aed, #a855f7) !important; }
.bg-teal   { background: linear-gradient(135deg, #0d9488, #14b8a6) !important; }
.bg-primary { background: linear-gradient(135deg, #4f46e5, #6366f1) !important; }
.bg-success { background: linear-gradient(135deg, #059669, #10b981) !important; }
.bg-danger  { background: linear-gradient(135deg, #dc2626, #ef4444) !important; }
.bg-warning { background: linear-gradient(135deg, #d97706, #f59e0b) !important; }
.bg-info    { background: linear-gradient(135deg, #0284c7, #06b6d4) !important; }
.bg-secondary { background: linear-gradient(135deg, #475569, #64748b) !important; }

/* ============================================================
   CARDS & TABLES
   ============================================================ */
.card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 12px 12px 0 0 !important;
  padding: 14px 16px;
}

.table th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #64748b; }
.table td { vertical-align: middle; font-size: 14px; }
.table-hover tbody tr:hover { background: #f8fafc; }

.btn-xs { padding: 2px 8px; font-size: 12px; }

/* ============================================================
   POS
   ============================================================ */
.pos-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  height: calc(100vh - 60px - 48px);
}

.pos-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.pos-right {
  overflow-y: auto;
}

.pos-search-bar { position: relative; }

.pos-suggestions {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  z-index: 200;
  max-height: 300px;
  overflow-y: auto;
}

.pos-suggestion-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
  font-size: 14px;
}

.pos-suggestion-item:hover { background: #f8fafc; }

.pos-cart {
  flex: 1;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.pos-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.pos-cart-item {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #e2e8f0;
}

.pos-item-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: #1e293b;
}

.pos-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pos-item-price {
  font-weight: 700;
  color: #6366f1;
  margin-left: auto;
}

.pos-item-unit { margin-top: 4px; }

.pos-totals {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
}

.pos-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 14px;
  color: #475569;
}

.pos-total-row.total {
  border-top: 2px solid #e2e8f0;
  padding-top: 10px;
  margin-top: 5px;
  font-size: 16px;
}

/* ============================================================
   NOTIFICATIONS DROPDOWN
   ============================================================ */
.notif-dropdown {
  width: 340px;
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  font-size: 14px;
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: #374151;
  font-size: 13px;
  transition: background 0.1s;
}

.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: rgba(99,102,241,0.04); }

.notif-empty { padding: 20px; text-align: center; color: #94a3b8; font-size: 13px; }
.notif-footer { display: block; text-align: center; padding: 10px; font-size: 13px; color: var(--primary); text-decoration: none; border-top: 1px solid #e2e8f0; }
.notif-footer:hover { background: #f8fafc; }

/* ============================================================
   SIDEBAR OVERLAY (mobile)
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.sidebar-overlay.show { display: block; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle-btn { display: flex; }

  .pos-wrapper {
    grid-template-columns: 1fr;
    height: auto;
  }
}

@media (max-width: 576px) {
  .page-content { padding: 16px; }
  .stat-value { font-size: 18px; }
}

/* ============================================================
   MISC
   ============================================================ */
.progress { border-radius: 999px; }
.badge { font-weight: 500; }
.form-control:focus, .form-select:focus { box-shadow: 0 0 0 3px rgba(99,102,241,0.15); border-color: #818cf8; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: #4f46e5; border-color: #4f46e5; }

/* Scrollbar fine */
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
