/* =====================================================================
   NS-NETWORK — Style du dashboard admin, du portail client et des
   pages de connexion. Thème Blanc / Rouge / Noir repris du modèle
   fourni (sidebar sombre + accent rouge, contenu clair en cartes).
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&display=swap');

:root {
  --c-red:         #E8001D;
  --c-red-dark:    #B5001A;
  --c-red-light:   #FF1A35;
  --c-red-subtle:  rgba(232, 0, 29, 0.08);
  --c-red-glow:    rgba(232, 0, 29, 0.25);

  --c-black:       #0A0A0C;
  --c-black-soft:  #111114;
  --c-grey-900:    #1A1A1F;
  --c-grey-800:    #242429;
  --c-grey-700:    #35353D;
  --c-grey-600:    #4F4F5A;
  --c-grey-400:    #8E8E9E;
  --c-grey-200:    #C8C8D4;
  --c-grey-100:    #EBEBF0;
  --c-grey-50:     #F5F5F8;
  --c-white:       #FFFFFF;

  --c-bg:          var(--c-grey-50);
  --c-bg-card:     var(--c-white);
  --c-sidebar-bg:  var(--c-black);
  --c-text-primary:   var(--c-grey-900);
  --c-text-secondary: var(--c-grey-600);
  --c-text-muted:     var(--c-grey-400);
  --c-border:         var(--c-grey-100);
  --c-border-dark:    var(--c-grey-200);

  --c-success: #00B37E;
  --c-warning: #F79009;
  --c-danger:  var(--c-red);
  --c-info:    #0EA5E9;

  --font-display: 'Rajdhani', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);
  --shadow-red: 0 4px 20px var(--c-red-glow);

  --trans-fast: all .15s ease;
  --trans: all .25s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { background: var(--c-bg); color: var(--c-text-primary); font-family: var(--font-body); min-height: 100vh; line-height: 1.6; }
a { color: var(--c-red); text-decoration: none; transition: var(--trans-fast); }
a:hover { color: var(--c-red-light); }
button { cursor: pointer; font-family: var(--font-body); border: none; outline: none; }
input, select, textarea { font-family: var(--font-body); outline: none; }

/* ============================================================
   PAGES DE CONNEXION — split-screen (pitch + formulaire)
   ============================================================ */
.auth-wrapper { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--c-bg); }

.auth-pitch {
  background: var(--c-black); color: var(--c-white);
  padding: 64px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-pitch::before {
  content: ''; position: absolute; right: -150px; top: 20%;
  width: 500px; height: 500px; background: var(--c-red);
  border-radius: 50%; filter: blur(120px); opacity: .35; z-index: 0;
}
.auth-pitch-content { position: relative; z-index: 1; }
.auth-brand { display: inline-flex; align-items: center; gap: 12px; }
.auth-brand img { height: 38px; }
.auth-brand span { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: 1.5px; }

.pitch-headline { font-family: var(--font-display); font-size: 46px; font-weight: 700; line-height: 1.08; letter-spacing: .3px; margin: 70px 0 22px; }
.pitch-headline .accent { color: var(--c-red); }
.pitch-sub { font-size: 16px; color: rgba(255,255,255,.7); max-width: 420px; line-height: 1.55; }

.pitch-features { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 44px; max-width: 560px; position: relative; z-index: 1; }
.pitch-feature { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius); padding: 16px; }
.pitch-feature-icon { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--c-red-subtle); color: var(--c-red); display: flex; align-items: center; justify-content: center; font-size: 16px; margin-bottom: 9px; }
.pitch-feature h4 { font-family: var(--font-display); font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.pitch-feature p { font-size: 11.5px; color: rgba(255,255,255,.55); line-height: 1.5; }

.auth-form-side { background: var(--c-white); padding: 64px; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card img.auth-card-logo { height: 36px; margin-bottom: 22px; }
.auth-section-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--c-red); margin-bottom: 16px; font-weight: 700; }
.auth-section-tag::before { content: ''; width: 24px; height: 1.5px; background: var(--c-red); }
.auth-title { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: .3px; line-height: 1.1; margin-bottom: 10px; }
.auth-subtitle { color: var(--c-text-muted); font-size: 14px; margin-bottom: 30px; }
.auth-footer { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--c-border); font-size: 11px; color: var(--c-text-muted); text-align: center; letter-spacing: .3px; }
.back-link { display: block; text-align: center; margin-top: 20px; font-size: .85rem; color: var(--c-text-muted); }
.back-link:hover { color: var(--c-red); }

@media (max-width: 1024px) {
  .auth-wrapper { grid-template-columns: 1fr; }
  .auth-pitch { padding: 40px; }
  .pitch-headline { font-size: 34px; margin: 50px 0 18px; }
  .auth-form-side { padding: 40px; }
}
@media (max-width: 768px) {
  .auth-pitch { padding: 32px 24px; }
  .pitch-headline { font-size: 26px; margin: 32px 0 14px; }
  .pitch-features { grid-template-columns: 1fr; gap: 10px; }
  .auth-form-side { padding: 32px 24px; }
  .auth-title { font-size: 26px; }
}

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form-group, .field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 7px; }
.form-label, .field label { font-size: 13.5px; font-weight: 500; color: var(--c-text-secondary); }
.form-control, .field input, .field select, .field textarea {
  width: 100%; padding: 11px 14px; background: var(--c-white);
  border: 1.5px solid var(--c-border-dark); border-radius: var(--radius);
  font-size: 14px; color: var(--c-text-primary); transition: var(--trans-fast); font-family: var(--font-body);
}
.form-control:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--c-red); box-shadow: 0 0 0 3px var(--c-red-subtle); }
.field textarea { min-height: 90px; resize: vertical; }
.checkbox-field { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--c-text-secondary); }
.checkbox-field input { accent-color: var(--c-red); }

.auth-error, .alert-danger { background: var(--c-red-subtle); border-left: 3px solid var(--c-red); color: var(--c-red-dark); padding: 12px 16px; border-radius: var(--radius); font-size: .87rem; margin-bottom: 18px; }

.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-bottom: 18px; }
.form-grid--2 { grid-template-columns: 1fr; }
@media (min-width: 620px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }

/* ============================================================
   LAYOUT DASHBOARD (sidebar + contenu)
   ============================================================ */
.dash { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width); background: var(--c-sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  overflow-y: auto;
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s ease; }
  .sidebar.is-open { transform: translateX(0); }
}

.sidebar__brand { height: var(--topbar-height); display: flex; align-items: center; padding: 0 20px; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }
.sidebar__brand img { width: 30px; height: 30px; object-fit: contain; }
.sidebar__brand span { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--c-white); letter-spacing: 1.5px; }

.sidebar nav { flex: 1; padding: 16px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  color: rgba(255,255,255,.7); border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  transition: var(--trans-fast); white-space: nowrap;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: var(--c-white); }
.sidebar nav a.is-active { background: rgba(232,0,29,.12); color: var(--c-white); border-left: 2px solid var(--c-red); padding-left: 10px; }
.sidebar nav a .badge { margin-left: auto; background: var(--c-red); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }

.sidebar__footer { padding: 16px 10px; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar__footer a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; color: rgba(255,255,255,.55); font-size: 13.5px; border-radius: var(--radius-sm); transition: var(--trans-fast); }
.sidebar__footer a:hover { background: rgba(255,255,255,.06); color: var(--c-white); }

.main { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; min-height: 100vh; padding: 0 32px 60px; }
@media (max-width: 860px) { .main { margin-left: 0; padding: 0 18px 50px; } }

.topbar {
  height: var(--topbar-height); display: flex; align-items: center; justify-content: space-between;
  gap: 16px; position: sticky; top: 0; z-index: 50; background: var(--c-bg);
  margin: 0 -32px 30px; padding: 0 32px; border-bottom: 1px solid var(--c-border);
}
@media (max-width: 860px) { .topbar { margin: 0 -18px 24px; padding: 0 18px; } }
.topbar h1 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: .3px; }
.topbar .mobile-toggle { display: none; background: var(--c-white); border: 1.5px solid var(--c-border-dark); border-radius: var(--radius-sm); padding: 9px 12px; color: var(--c-text-primary); }
@media (max-width: 860px) { .topbar .mobile-toggle { display: inline-flex; } }
.topbar__user { font-size: .82rem; color: var(--c-text-muted); }
.topbar__user strong { color: var(--c-text-primary); }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 32px; }
.stat-card {
  background: var(--c-bg-card); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  padding: 22px 24px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: var(--trans);
}
.stat-card::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: transparent; transition: var(--trans); }
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card:hover::after { background: var(--c-red); }
.stat-card span.label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c-text-muted); }
.stat-card strong { display: block; font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; margin-top: 8px; }

/* ============================================================
   PANELS / CARDS
   ============================================================ */
.panel {
  background: var(--c-bg-card); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 26px; margin-bottom: 26px;
}
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.panel__head h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; }

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: var(--radius);
  font-weight: 600; font-size: .87rem; border: 1.5px solid transparent; transition: var(--trans-fast); font-family: var(--font-body);
}
.btn--primary { background: var(--c-red); color: white; box-shadow: var(--shadow-red); }
.btn--primary:hover { background: var(--c-red-dark); box-shadow: 0 6px 24px var(--c-red-glow); transform: translateY(-1px); }
.btn--ghost { background: var(--c-grey-50); color: var(--c-text-primary); border-color: var(--c-border-dark); }
.btn--ghost:hover { background: var(--c-grey-100); border-color: var(--c-grey-400); }
.btn--danger { background: transparent; color: var(--c-red); border-color: var(--c-red); }
.btn--danger:hover { background: var(--c-red); color: white; }
.btn--sm { padding: 7px 14px; font-size: .78rem; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--c-border); }
table { width: 100%; border-collapse: collapse; min-width: 560px; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--c-border); font-size: 13.5px; }
th { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c-text-muted); background: var(--c-grey-50); }
td { color: var(--c-text-secondary); }
td strong { color: var(--c-text-primary); }
tbody tr { transition: var(--trans-fast); }
tbody tr:hover td { background: var(--c-grey-50); }
tbody tr:last-child td { border-bottom: none; }
.actions-cell { display: flex; gap: 8px; }

/* ============================================================
   BADGES DE STATUT (couleurs sémantiques, comme dans le modèle)
   ============================================================ */
.badge-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.badge-status.payee { background: rgba(0,179,126,.12); color: #00875A; }
.badge-status.en_attente { background: rgba(247,144,9,.12); color: #B54708; }
.badge-status.annulee { background: var(--c-red-subtle); color: var(--c-red-dark); }
.badge-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; background: var(--c-text-muted); }
.badge-dot.non-lu { background: var(--c-red); box-shadow: 0 0 0 3px var(--c-red-subtle); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--c-text-muted); }
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: .87rem; margin-bottom: 18px; border-left: 3px solid transparent; }
.alert--ok { background: rgba(0,179,126,.08); border-left-color: var(--c-success); color: #00875A; }
.alert--err { background: var(--c-red-subtle); border-left-color: var(--c-red); color: var(--c-red-dark); }

/* ============================================================
   PORTAIL CLIENT — cartes factures
   ============================================================ */
.invoice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 18px; }
.invoice-card { background: var(--c-grey-50); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 20px; transition: var(--trans); }
.invoice-card:hover { box-shadow: var(--shadow); border-color: var(--c-red); }
.invoice-card__top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.invoice-card .num { font-size: .78rem; color: var(--c-text-muted); font-weight: 500; }
.invoice-card h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; margin: 4px 0 10px; }
.invoice-card .amount { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; margin-bottom: 14px; }
.invoice-card .meta { font-size: .82rem; color: var(--c-text-secondary); margin-bottom: 16px; }
