*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:          #0e0e0e;
  --bg-card:     #161616;
  --bg-input:    #1c1c1c;
  --border:      #2a2a2a;
  --purple:      #8b5cf6;
  --green:       #22c55e;
  --amber:       #f59e0b;
  --red:         #ef4444;
  --text:        #f0f0f0;
  --text-muted:  #888888;
  --radius:      8px;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

/* ===== LOGIN ===== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.login-logo { height: 40px; margin-bottom: 1.5rem; }
.login-box h1 { font-size: 22px; margin-bottom: 4px; }
.login-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 1.5rem; }
.login-error { color: var(--red); font-size: 13px; margin-bottom: 1rem; }

.login-box form { display: flex; flex-direction: column; gap: 10px; }

.login-box input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
}

.login-box button {
  background: var(--purple);
  border: none;
  border-radius: var(--radius);
  padding: 12px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.login-box button:hover { background: #7c3aed; }

/* ===== NAV ===== */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
}

.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-brand img { height: 28px; }
.nav-brand span { font-size: 16px; font-weight: 600; }

.btn-logout {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.btn-logout:hover { color: var(--text); border-color: var(--purple); }

/* ===== MAIN ===== */
main { padding: 2rem; }
.container { max-width: 800px; margin: 0 auto; }

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: 700; }
.stat-value.muted { color: var(--text-muted); }
.stat-value.success { color: var(--green); }

/* ===== PLAFOND ===== */
.plafond-section { margin-bottom: 1rem; }

.plafond-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.plafond-bar-wrap {
  height: 8px;
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
}

.plafond-bar {
  height: 100%;
  background: var(--purple);
  border-radius: 20px;
  transition: width 0.3s;
}

.plafond-bar.warning { background: var(--amber); }
.plafond-bar.danger { background: var(--red); }

/* ===== PAYMENT STATS ===== */
.payment-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 13px;
  color: var(--text-muted);
}

.payment-stat { display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.success { background: var(--green); }
.dot.warning { background: var(--amber); }
.payment-stat strong { color: var(--text); }

/* ===== CARD ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.card h2 { font-size: 16px; margin-bottom: 1rem; }

/* ===== FORM ===== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }

.form-card input,
.form-card select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 10px;
}

.form-card select option { background: var(--bg-card); }

.btn-add {
  width: 100%;
  background: var(--purple);
  border: none;
  border-radius: var(--radius);
  padding: 12px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-add:hover { background: #7c3aed; }

/* ===== INVOICES LIST ===== */
.empty-state { color: var(--text-muted); font-size: 14px; text-align: center; padding: 1rem 0; }

.invoices-list { display: flex; flex-direction: column; gap: 8px; }

.invoice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.invoice-client { font-size: 14px; font-weight: 600; }
.invoice-meta { font-size: 12px; color: var(--text-muted); }

.invoice-actions { display: flex; align-items: center; gap: 10px; }

.badge-btn {
  border: none;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
}

.badge-success { background: rgba(34,197,94,0.15); color: #6ee7b7; }
.badge-warning { background: rgba(245,158,11,0.15); color: #fcd34d; }

.invoice-amount { font-size: 14px; font-weight: 700; min-width: 70px; text-align: right; }

.btn-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  transition: color 0.2s;
}

.btn-delete:hover { color: var(--red); }

/* ===== FOOTER ===== */
footer { text-align: center; padding: 2rem; color: var(--text-muted); font-size: 12px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  nav { padding: 1rem; }
  main { padding: 1rem; }
}