:root {
  --sidebar-bg: #1e293b;
  --sidebar-text: #f8fafc;
  --primary: #3b82f6;
  --bg: #f1f5f9;
  --text: #334155;
  --border: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body.admin-body { font-family: sans-serif; background: var(--bg); color: var(--text); }

/* Login */
.login-overlay {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.login-box {
  background: white; padding: 2rem; border-radius: 8px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
  width: 100%; max-width: 400px;
}
.login-box h2 { margin-bottom: 1.5rem; text-align: center; }

/* Layout */
.admin-app { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column;
}
.sidebar-header { padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-item {
  width: 100%; text-align: left; padding: 0.75rem 1.5rem; border: none; background: transparent;
  color: #94a3b8; cursor: pointer; font-size: 1rem;
}
.nav-item.active { background: rgba(255,255,255,0.05); color: white; border-left: 4px solid var(--primary); }
.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,0.1); }

.content { flex: 1; padding: 2rem; overflow-y: auto; }
.content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }

/* Table */
.table-container { background: white; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { background: #f8fafc; padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.8rem; text-transform: uppercase; color: #64748b; }
td { padding: 1rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
tr:last-child td { border-bottom: none; }

/* Status Badges */
.badge { padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: bold; }
.badge-nouveau { background: #dcfce7; color: #166534; }
.badge-en_cours { background: #fef9c3; color: #854d0e; }
.badge-termine { background: #dbeafe; color: #1e40af; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: white; padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border); }
.stat-label { display: block; font-size: 0.8rem; color: #64748b; margin-bottom: 0.5rem; }
.stat-val { font-size: 1.5rem; font-weight: bold; }

/* Utils */
.btn { padding: 0.5rem 1rem; border-radius: 4px; cursor: pointer; border: none; font-weight: 600; font-size: 0.85rem; }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: #e2e8f0; }
.btn-danger { background: #ef4444; color: white; }
.btn-block { width: 100%; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; }
input[type="text"], input[type="password"] { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: 4px; }
.hidden { display: none !important; }

/* Modals */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 2000; }
.modal-content { background: white; width: 90%; max-width: 600px; border-radius: 8px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 1.5rem; }
.close-modal { background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* Order Detail Helpers */
.order-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.detail-item h4 { font-size: 0.75rem; color: #64748b; text-transform: uppercase; margin-bottom: 0.25rem; }
.detail-item p { font-size: 0.95rem; }
.messages-list { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.message-item { margin-bottom: 1rem; background: #f8fafc; padding: 1rem; border-radius: 4px; }
.message-item h5 { color: var(--primary); margin-bottom: 0.5rem; }

/* Settings View */
.settings-container {
  max-width: 800px;
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 2rem;
}
.settings-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.settings-section:last-of-type {
  border-bottom: none;
}
.settings-section h3 {
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
.section-desc {
  color: #64748b;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
input[type="number"], input[type="email"] {
  width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: 4px;
}
.settings-actions {
  display: flex;
  justify-content: flex-end;
}

