/* =======================================================
   CONNECT+ Design System - connect_plus.css
   Couleurs : Jaune #FFB81D | Sidebar #1A1A1A | Fond #F0F2F5
   Police   : Montserrat (Google Fonts)
   Version  : 1.0 | WURA PLUS 2026
======================================================= */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  --cp-primary   : #FFB81D;
  --cp-primary-h : #e5a619;
  --cp-dark      : #1A1A1A;
  --cp-dark2     : #242424;
  --cp-light     : #F0F2F5;
  --cp-white     : #FFFFFF;
  --cp-text      : #1A1A1A;
  --cp-muted     : #6B7280;
  --cp-border    : #E5E7EB;
  --cp-danger    : #EF4444;
  --cp-success   : #22C55E;
  --cp-blue      : #004F70;
  --cp-sidebar-w : 240px;
  --cp-radius    : 14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Montserrat', Arial, sans-serif; background: var(--cp-light); color: var(--cp-text); font-size: 14px; }

/* ── LAYOUT ──────────────────────────────────────── */
.cp-layout { display: flex; min-height: 100vh; }
.cp-main   { flex: 1; margin-left: var(--cp-sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.cp-content { padding: 24px; flex: 1; }

/* ── SIDEBAR ─────────────────────────────────────── */
.cp-sidebar {
  width: var(--cp-sidebar-w); background: var(--cp-dark);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh; z-index: 200;
}
.cp-sidebar-logo {
  padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 10px;
}
.cp-logo-icon {
  width: 36px; height: 36px; background: var(--cp-primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--cp-dark); font-size: 14px; flex-shrink: 0;
}
.cp-logo-text strong { display: block; color: #fff; font-size: 13px; font-weight: 800; }
.cp-logo-text small  { color: var(--cp-primary); font-size: 10px; font-weight: 600; }

.cp-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.cp-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; color: #9CA3AF; text-decoration: none;
  font-size: 12px; font-weight: 600; margin-bottom: 2px;
  transition: background .2s, color .2s;
}
.cp-nav a:hover  { background: rgba(255,255,255,.08); color: #fff; }
.cp-nav a.active { background: var(--cp-primary); color: var(--cp-dark); }
.cp-nav a svg, .cp-nav a .ico { width: 16px; height: 16px; flex-shrink: 0; }

.cp-sidebar-bottom { padding: 10px 8px; border-top: 1px solid rgba(255,255,255,.1); }
.cp-sidebar-user { padding: 8px 12px; margin-bottom: 4px; }
.cp-sidebar-user strong { display: block; color: #fff; font-size: 12px; }
.cp-sidebar-user small  { color: #6B7280; font-size: 11px; }
.cp-nav-logout {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; color: #9CA3AF; text-decoration: none;
  font-size: 12px; font-weight: 600; transition: all .2s; cursor: pointer;
  background: none; border: none; width: 100%; font-family: inherit;
}
.cp-nav-logout:hover { background: rgba(239,68,68,.1); color: #EF4444; }

/* ── TOP BAR ─────────────────────────────────────── */
.cp-topbar {
  background: #fff; border-bottom: 1px solid var(--cp-border);
  padding: 14px 24px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); position: sticky; top: 0; z-index: 50;
}
.cp-topbar h1 { font-size: 15px; font-weight: 800; color: var(--cp-dark); }
.cp-topbar-right { display: flex; align-items: center; gap: 10px; }
.cp-avatar {
  width: 32px; height: 32px; background: var(--cp-primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  font-weight: 800; color: var(--cp-dark);
}

/* ── CARDS ───────────────────────────────────────── */
.cp-card {
  background: #fff; border-radius: var(--cp-radius);
  border: 1px solid var(--cp-border); padding: 20px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.cp-card-title { font-size: 13px; font-weight: 700; color: var(--cp-text); margin-bottom: 14px; }

/* ── STATS ───────────────────────────────────────── */
.cp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.cp-stat { background: #fff; border-radius: var(--cp-radius); border: 1px solid var(--cp-border); padding: 16px; }
.cp-stat-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; margin-bottom: 10px; }
.cp-stat-value { font-size: 20px; font-weight: 800; color: var(--cp-dark); }
.cp-stat-label { font-size: 11px; color: var(--cp-muted); margin-top: 3px; font-weight: 600; }

/* ── FORMS ───────────────────────────────────────── */
.cp-input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--cp-border); font-family: 'Montserrat', Arial;
  font-size: 13px; background: #fff; color: var(--cp-dark); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.cp-input:focus { border-color: var(--cp-primary); box-shadow: 0 0 0 3px rgba(255,184,29,.15); }
.cp-input-blink { border: 2px solid #fb923c; animation: cpBlink 1.5s infinite; }
@keyframes cpBlink { 0%,100%{ background:#fff } 50%{ background:#fff7ed } }
.cp-label { display: block; font-size: 11px; font-weight: 700; color: var(--cp-muted); margin-bottom: 5px; }
.cp-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.cp-form-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.cp-form-group { margin-bottom: 12px; }

/* ── BUTTONS ─────────────────────────────────────── */
.cp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; font-family: 'Montserrat', Arial;
  font-size: 12px; font-weight: 700; cursor: pointer; border: none;
  text-decoration: none; transition: all .2s; white-space: nowrap;
}
.cp-btn-primary  { background: var(--cp-primary); color: var(--cp-dark); }
.cp-btn-primary:hover  { background: var(--cp-primary-h); }
.cp-btn-secondary { background: #F3F4F6; color: var(--cp-dark); }
.cp-btn-secondary:hover { background: #E5E7EB; }
.cp-btn-danger  { background: #FEF2F2; color: var(--cp-danger); border: 1px solid #FEE2E2; }
.cp-btn-danger:hover  { background: #FEE2E2; }
.cp-btn-success { background: #F0FDF4; color: var(--cp-success); border: 1px solid #DCFCE7; }
.cp-btn-success:hover { background: #DCFCE7; }
.cp-btn-wa  { background: #25D366; color: #fff; }
.cp-btn-wa:hover  { background: #1da851; }
.cp-btn-blue { background: #EFF6FF; color: var(--cp-blue); border: 1px solid #DBEAFE; }
.cp-btn-sm  { padding: 6px 12px; font-size: 11px; border-radius: 8px; }
.cp-btn-full { width: 100%; }

/* ── TABLES ──────────────────────────────────────── */
.cp-table-wrap { overflow-x: auto; }
.cp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cp-table th { background: #F9FAFB; color: var(--cp-muted); font-weight: 700; font-size: 11px; padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--cp-border); }
.cp-table td { padding: 11px 14px; border-bottom: 1px solid #F3F4F6; }
.cp-table tr:hover td { background: #F9FAFB; }
.cp-table .mono { font-family: 'Courier New', monospace; color: var(--cp-blue); }

/* ── ROUTER CARD ─────────────────────────────────── */
.cp-router { background: #F9FAFB; border: 1px solid var(--cp-border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.cp-router-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.cp-router-icon { width: 38px; height: 38px; background: rgba(255,184,29,.12); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; margin-right: 10px; flex-shrink: 0; }
.cp-router-name { font-weight: 800; font-size: 13px; }
.cp-router-sub  { color: var(--cp-muted); font-size: 11px; margin-top: 2px; }
.cp-router-info { font-size: 12px; line-height: 2; margin-bottom: 12px; }
.cp-router-info .missing { color: #fb923c; cursor: pointer; font-weight: 700; animation: cpBlink 1.5s infinite; }
.cp-router-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cp-edit-box { display: none; margin-top: 14px; padding: 16px; background: #fff; border-radius: 10px; border: 1px solid var(--cp-border); }

/* ── BADGES ──────────────────────────────────────── */
.cp-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.cp-badge-success { background: #F0FDF4; color: var(--cp-success); }
.cp-badge-warning { background: #FFFBEB; color: #D97706; }
.cp-badge-danger  { background: #FEF2F2; color: var(--cp-danger); }
.cp-badge-blue    { background: #EFF6FF; color: var(--cp-blue); }

/* ── MONTH NAV ───────────────────────────────────── */
.cp-month-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cp-month-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 8px; border: 1px solid var(--cp-border); text-decoration: none; color: var(--cp-dark); font-size: 16px; transition: all .2s; }
.cp-month-btn:hover { border-color: var(--cp-primary); }
.cp-month-label { padding: 6px 14px; background: #fff; border-radius: 8px; border: 1px solid var(--cp-border); font-size: 13px; font-weight: 700; min-width: 120px; text-align: center; }
.cp-search-input { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--cp-border); font-family: 'Montserrat', Arial; font-size: 12px; outline: none; width: 180px; }
.cp-search-input:focus { border-color: var(--cp-primary); }

/* ── SCRIPT TEXTAREA ─────────────────────────────── */
.cp-script { width: 100%; background: #111; color: #4ade80; font-family: 'Courier New', monospace; font-size: 12px; padding: 14px; border-radius: 10px; border: none; resize: vertical; outline: none; min-height: 200px; }
.cp-script-wrap { position: relative; }
.cp-copy-btn { position: absolute; top: 8px; right: 8px; }

/* ── AUTH PAGE ───────────────────────────────────── */
.cp-auth-page { min-height: 100vh; display: flex; background: var(--cp-dark); }
.cp-auth-left { width: 380px; flex-shrink: 0; background: var(--cp-dark); display: flex; flex-direction: column; justify-content: space-between; padding: 40px; }
.cp-auth-right { flex: 1; background: var(--cp-light); display: flex; align-items: center; justify-content: center; padding: 30px; }
.cp-auth-box { background: #fff; border-radius: 20px; padding: 36px; width: 100%; max-width: 400px; }
.cp-auth-tabs { display: flex; background: #F3F4F6; border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.cp-auth-tabs a { flex: 1; text-align: center; padding: 10px; border-radius: 10px; font-size: 12px; font-weight: 700; text-decoration: none; color: var(--cp-muted); transition: all .2s; }
.cp-auth-tabs a.active { background: #fff; color: var(--cp-dark); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.cp-auth-left-features { display: flex; flex-direction: column; gap: 12px; }
.cp-auth-feature { display: flex; align-items: center; gap: 10px; color: #D1D5DB; font-size: 13px; }
.cp-auth-feature .dot { width: 18px; height: 18px; background: rgba(255,184,29,.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cp-auth-feature .dot::after { content: ''; width: 7px; height: 7px; background: var(--cp-primary); border-radius: 50%; display: block; }

/* ── PARTNER HEADER ──────────────────────────────── */
.cp-partner-header { background: var(--cp-dark); padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.cp-partner-body { padding: 20px; max-width: 1100px; margin: 0 auto; }

/* ── ALERTS ──────────────────────────────────────── */
.cp-alert { padding: 10px 14px; border-radius: 10px; font-size: 12px; margin-bottom: 14px; }
.cp-alert-error   { background: #FEF2F2; border: 1px solid #FEE2E2; color: var(--cp-danger); }
.cp-alert-success { background: #F0FDF4; border: 1px solid #DCFCE7; color: var(--cp-success); }
.cp-alert-info    { background: #EFF6FF; border: 1px solid #DBEAFE; color: var(--cp-blue); }

/* ── MODAL ───────────────────────────────────────── */
.cp-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 999; align-items: center; justify-content: center; }
.cp-modal.open, .cp-modal[style*="flex"] { display: flex !important; }
.cp-modal-box { background: #fff; border-radius: 20px; padding: 28px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.cp-modal-title { font-size: 15px; font-weight: 800; margin-bottom: 16px; }

/* ── OVERLAY (popup confirm) ─────────────────────── */
.cp-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300; }
.cp-popup { display: none; position: absolute; background: #fff; padding: 24px; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 400; width: 290px; text-align: center; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.cp-popup-title { font-size: 13px; font-weight: 800; margin-bottom: 12px; }

/* ── SECTION TOGGLE ──────────────────────────────── */
.cp-section-toggle { cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: var(--cp-dark); margin-bottom: 10px; user-select: none; }
.cp-hidden { display: none; }

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 768px) {
  :root { --cp-sidebar-w: 60px; }
  .cp-sidebar-logo .cp-logo-text { display: none; }
  .cp-nav a span, .cp-nav-logout span, .cp-sidebar-user { display: none; }
  .cp-auth-left { display: none; }
  .cp-form-grid { grid-template-columns: 1fr; }
  .cp-stats { grid-template-columns: 1fr 1fr; }
  .cp-topbar h1 { font-size: 13px; }
  .cp-month-nav { gap: 6px; }
}
@media (max-width: 480px) {
  .cp-content { padding: 14px; }
  .cp-partner-body { padding: 14px; }
  .cp-stats { grid-template-columns: 1fr 1fr; }
}
