/* Console Proview — style minimaliste mat, accent vert Proview */
* { box-sizing: border-box; margin: 0; }
:root {
  --primary: #27B768; --primary-d: #1d9152;
  --dark: #1f2129; --tile: #22242c;
  --bg: #f5f6f8; --card: #fff; --border: #e2e8f0;
  --text: #1e293b; --muted: #64748b;
  --red: #dc2626; --orange: #f59e0b; --green: #16a34a;
}
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.muted { color: var(--muted); }

/* ── Login ── */
#login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--dark); }
.login-card { background: var(--card); border-radius: 16px; padding: 34px 36px; width: 360px; }
.login-logo { text-align: center; margin-bottom: 22px; }
.logo-mark {
  width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 13px;
  background: var(--tile); color: #fff; font-weight: 800; font-size: 24px;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.logo-mark::after { content: ""; position: absolute; right: 7px; bottom: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.logo-mark.sm { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; margin: 0; display: inline-flex; }
.logo-mark.sm::after { right: 4px; bottom: 4px; width: 4px; height: 4px; }
.login-logo h1 { font-size: 21px; } .login-logo h1 span { color: var(--primary); }
.login-logo p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.login-card label { display: block; font-size: 12px; font-weight: 600; margin: 12px 0 5px; }
.login-card input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; }
.alert { background: #fee2e2; color: #b91c1c; border-radius: 9px; padding: 9px 12px; font-size: 13px; margin-bottom: 8px; }

/* ── Layout ── */
.topbar {
  background: var(--dark); color: #fff; height: 52px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.brand b { color: var(--primary); font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; }
main { max-width: 1100px; margin: 26px auto; padding: 0 20px; }

/* ── Boutons ── */
.btn { border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 9px; padding: 8px 15px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: #cbd5e1; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.25); color: #fff; }
.btn-full { width: 100%; margin-top: 18px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { color: var(--red); }

/* ── Cartes / titres ── */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-head h2 { font-size: 19px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.card h3 { font-size: 14px; margin-bottom: 14px; }

/* ── Table tenants ── */
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--border); background: #fafbfc; }
td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.badge.active    { background: #dcfce7; color: #15803d; }
.badge.grace     { background: #fef3c7; color: #b45309; }
.badge.suspended { background: #fee2e2; color: #b91c1c; }
.badge.type      { background: #f1f5f9; color: #475569; }
.ech-warn { color: var(--orange); font-weight: 600; }
.ech-over { color: var(--red); font-weight: 600; }

/* ── Fiche tenant ── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; font-size: 13.5px; background: #fff; }
.field textarea { resize: vertical; min-height: 60px; }

/* Modules du tenant */
.tmods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tmod { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; font-size: 12.5px; cursor: pointer; }
.tmod input { accent-color: var(--primary); }
.tmod.core { opacity: .65; }

/* Paiements */
.pay-form { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr auto; gap: 8px; align-items: end; margin-top: 10px; }

.loading { text-align: center; color: var(--muted); padding: 50px 0; }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
@media (max-width: 760px) { .grid2, .grid4, .pay-form { grid-template-columns: 1fr; } }

/* Navigation topbar */
.topnav { display: flex; gap: 4px; margin-left: 26px; flex: 1; }
.topnav-item {
  background: transparent; border: none; color: rgba(255,255,255,.65);
  font-size: 13.5px; font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer;
}
.topnav-item:hover { color: #fff; }
.topnav-item.active { background: rgba(255,255,255,.12); color: #fff; }

/* Écran Plans */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 20px; }
.plan-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; cursor: pointer; transition: border-color .15s, transform .12s; position: relative; }
.plan-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.plan-card.inactive { opacity: .5; }
.plan-name { font-weight: 700; font-size: 15px; }
.plan-price { font-size: 22px; font-weight: 800; color: var(--primary); margin: 8px 0 2px; }
.plan-price small { font-size: 12px; font-weight: 600; color: var(--muted); }
.plan-meta { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.sup-row td input { width: 100%; padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px; }

/* Pastille nouvelles commandes */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; margin-left: 7px;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: 10.5px; font-weight: 700;
}

/* Vue d'ensemble (stats) */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 22px; font-weight: 800; }
.stat span { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.stat.ok b { color: var(--primary); }
.stat.warn b { color: var(--orange); }

/* Petites actions inline (échéance, régénération) */
.ech-quick { font-weight: 400; font-size: 11px; margin-left: 6px; }
.ech-quick a { color: var(--primary); cursor: pointer; text-decoration: underline; }

/* Note client dans les commandes */
.cmd-note { font-size: 12px; color: var(--muted); font-style: italic; cursor: help; }

/* Vrai logo Proview */
.logo-real { width: 52px; height: 52px; display: block; margin: 0 auto 10px; }
.logo-real.sm { width: 30px; height: 30px; margin: 0; }
