:root {
  --ink: #0f0e0d;
  --paper: #f5f2ee;
  --cream: #ede9e3;
  --accent: #c8522a;
  --accent-soft: #f0e0d8;
  --gold: #b8902a;
  --text-muted: #7a7368;
  --border: #ddd8d0;
  --white: #ffffff;
  --success: #2a7a4f;
  --success-soft: #d8f0e4;
  --danger: #c8522a;
  --radius: 2px;
  --shadow: 0 1px 3px rgba(15,14,13,0.08), 0 4px 16px rgba(15,14,13,0.06);
  --shadow-lg: 0 8px 32px rgba(15,14,13,0.12);
}

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

[v-cloak] { display: none !important; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ── APP LAYOUT ──────────────────────────────────── */
.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  background: var(--ink);
  display: flex;
  flex-direction: column;
  padding: 32px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  color: var(--white);
  padding: 0 28px 32px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo span { color: var(--accent); }

.sidebar-nav {
  flex: 1;
  padding: 24px 0;
}

.nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.25);
  padding: 0 28px;
  margin-bottom: 8px;
  margin-top: 24px;
}

.nav-label:first-child { margin-top: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 28px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  font-size: 14px;
  font-weight: 400;
  border-left: 2px solid transparent;
  margin: 1px 0;
  text-decoration: none;
}

.nav-item:hover {
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.04);
}

.nav-item.active {
  color: var(--white);
  background: rgba(200,82,42,0.12);
  border-left-color: var(--accent);
  font-weight: 500;
}

.nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-item.active .nav-icon { opacity: 1; }

.sidebar-user {
  padding: 20px 28px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-size: 15px;
  color: var(--white);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name {
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
}

.user-email {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
}

.logout-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 12px;
  margin-top: 12px;
  padding: 0;
  font-family: 'DM Sans', sans-serif;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logout-btn:hover { color: rgba(255,255,255,0.7); }

/* ── MAIN CONTENT ────────────────────────────────── */
.main-content {
  background: var(--paper);
  overflow-y: auto;
}

.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 28px 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.page-title {
  font-family: 'DM Serif Display', serif;
  font-size: 30px;
  letter-spacing: -0.5px;
  line-height: 1;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.page-body {
  padding: 36px 40px;
}

/* ── CARDS ───────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-family: 'DM Serif Display', serif;
  font-size: 18px;
  letter-spacing: -0.3px;
}

.card-body { padding: 28px; }

/* ── BADGES ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ── TOAST ───────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--ink);
  color: var(--white);
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.3s ease;
}

.toast.success { background: var(--success); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── TRANSITIONS ─────────────────────────────────── */
.fade-enter-active, .fade-leave-active { transition: opacity 0.2s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ── COMMON BUTTONS ──────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--ink);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.2px;
}

.btn-primary:hover { background: #2a2724; }
.btn-primary:active { transform: scale(0.99); }

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 900px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .page-body { padding: 20px; }
  .page-header { padding: 20px; }
}

/* Selecteur de contrat (compte multi-contrats) */
.contrat-switch { padding: .6rem 1.1rem 0; }
.contrat-switch select {
  width: 100%;
  margin-top: .3rem;
  padding: .5rem .6rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: inherit;
  font: inherit;
  font-size: .82rem;
}
.contrat-switch select option { color: #1a1a1f; }
