:root {
  --blue: #1e40af;
  --blue-2: #2563eb;
  --green: #059669;
  --orange: #f97316;
  --violet: #7c3aed;
  --cyan: #06b6d4;
  --red: #e11d48;
  --bg: #f3f4f6;
  --card: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --border: #e5e7eb;
  --shadow: 0 16px 45px rgba(15, 23, 42, 0.08);
  --radius: 22px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top left, rgba(30,64,175,.18), transparent 34%), linear-gradient(135deg, #eef2ff, #f8fafc);
}
.login-card {
  width: min(460px, 100%);
  background: white;
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 30px;
}
.brand-mark { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.logo-box {
  width: 58px; height: 58px; display: grid; place-items: center;
  border-radius: 18px; background: linear-gradient(135deg, var(--blue), #0f172a); color: white;
  font-size: 25px; font-weight: 900; letter-spacing: -.05em;
}
.login-card h1 { margin: 0; font-size: 24px; }
.login-card p { color: var(--muted); line-height: 1.55; margin: 8px 0 20px; }
.form-grid { display: grid; gap: 12px; }
.field { display: grid; gap: 7px; }
.field label { font-weight: 700; font-size: 13px; color: #334155; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--border); border-radius: 14px; padding: 12px 13px; background: #fff; outline: none;
}
.field textarea { min-height: 82px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue-2); box-shadow: 0 0 0 4px rgba(37, 99, 235, .1); }
.primary-btn, .secondary-btn, .danger-btn, .ghost-btn {
  border: none; border-radius: 14px; padding: 11px 14px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.primary-btn { color: white; background: linear-gradient(135deg, var(--blue), #0f5ed7); box-shadow: 0 10px 24px rgba(30, 64, 175, .22); }
.secondary-btn { color: var(--blue); background: #eff6ff; }
.danger-btn { color: var(--red); background: #fff1f2; }
.ghost-btn { color: #334155; background: transparent; border: 1px solid var(--border); }
.error { color: var(--red); background: #fff1f2; border: 1px solid #fecdd3; border-radius: 14px; padding: 10px 12px; font-weight: 700; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
  background: rgba(255,255,255,.86); backdrop-filter: blur(14px); border-right: 1px solid var(--border); padding: 18px 14px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand-mark { margin: 0 4px 24px; }
.sidebar .logo-box { width: 46px; height: 46px; font-size: 20px; border-radius: 15px; }
.sidebar strong { display: block; }
.sidebar small { color: var(--muted); }
.nav { display: grid; gap: 8px; }
.nav button {
  width: 100%; border: none; background: transparent; text-align: left; padding: 12px 14px; border-radius: 14px; color: #334155; font-weight: 700;
}
.nav button.active { background: var(--blue); color: white; box-shadow: 0 8px 22px rgba(30,64,175,.22); }
.sidebar-tip {
  position: absolute; left: 14px; right: 14px; bottom: 16px; background: #eff6ff; border: 1px solid #dbeafe; border-radius: 18px; padding: 14px; color: #1e3a8a; font-size: 13px; line-height: 1.45;
}
.main { min-width: 0; }
.header {
  background: linear-gradient(135deg, var(--blue), #0f172a); color: white; padding: 18px 26px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px; position: sticky; top: 0; z-index: 10;
}
.header h1 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.header .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.header .actions button, .header .actions a {
  border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.14); color: white; border-radius: 13px; padding: 10px 12px; font-weight: 800; text-decoration: none;
}
.context-bar {
  margin: 18px 26px 0; background: white; border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 8px 22px rgba(15,23,42,.05);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 12px 16px; color: #334155; font-size: 14px;
}
.content { padding: 22px 26px 34px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.kpi { display: flex; align-items: center; gap: 14px; min-height: 108px; }
.icon {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; color: white; font-weight: 900; flex: 0 0 auto;
}
.icon.blue { background: var(--blue); }
.icon.green { background: var(--green); }
.icon.orange { background: var(--orange); }
.icon.violet { background: var(--violet); }
.kpi p { margin: 0; color: var(--muted); font-weight: 700; }
.kpi strong { display: block; font-size: 31px; margin-top: 4px; letter-spacing: -.05em; }
.grid-2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.card-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 900; }
.badge.connected, .badge.active, .badge.done { color: #047857; background: #d1fae5; }
.badge.manual, .badge.planning, .badge.inprogress { color: #0369a1; background: #e0f2fe; }
.badge.limited, .badge.medium { color: #c2410c; background: #ffedd5; }
.badge.expired, .badge.paused, .badge.high, .badge.overdue { color: #be123c; background: #ffe4e6; }
.badge.low, .badge.todo { color: #475569; background: #f1f5f9; }
.account-card, .mission-card, .action-card {
  display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 18px; background: #fff; margin-bottom: 10px;
}
.account-card header, .mission-card header, .action-card header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.account-card h3, .mission-card h3, .action-card h3 { margin: 0; font-size: 16px; }
.meta-line { color: var(--muted); font-size: 13px; line-height: 1.45; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.link-btn { color: var(--blue); font-weight: 900; text-decoration: none; background: #eff6ff; border-radius: 12px; padding: 8px 10px; display: inline-flex; }
.forms-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.forms-grid .full { grid-column: 1 / -1; }
.section { display: none; }
.section.active { display: block; }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search { min-width: min(360px, 100%); border: 1px solid var(--border); border-radius: 14px; padding: 11px 13px; }
.panel-list { display: grid; gap: 12px; }
.alert-box { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; border-radius: 16px; padding: 12px 14px; font-weight: 700; margin-bottom: 14px; }
.empty { border: 1px dashed #cbd5e1; color: var(--muted); border-radius: 18px; padding: 20px; text-align: center; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; padding: 20px; z-index: 100; }
.modal { width: min(760px, 100%); max-height: 92vh; overflow: auto; background: white; border-radius: 24px; padding: 20px; box-shadow: 0 28px 80px rgba(0,0,0,.3); }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-header h2 { margin: 0; }
.close { border: none; background: #f1f5f9; border-radius: 12px; width: 40px; height: 40px; font-weight: 900; }
.analysis-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.analysis-item { border: 1px solid var(--border); border-radius: 18px; padding: 14px; background: #f8fafc; }
.analysis-item strong { display: block; margin-bottom: 5px; }
@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .sidebar-tip { position: relative; left: auto; right: auto; bottom: auto; margin-top: 16px; }
  .kpi-grid, .grid-2, .grid-3, .context-bar { grid-template-columns: 1fr; }
  .forms-grid { grid-template-columns: 1fr; }
  .header { align-items: flex-start; flex-direction: column; }
}

/* Phase 1.2 — Social Account Hub organisé par réseaux */
.hub-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}
.hub-section-title h3 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.hub-section-title span { color: var(--muted); font-size: 13px; font-weight: 700; }
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 10px;
}
.payment-grid { grid-template-columns: minmax(0, 1fr); }
.platform-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: grid;
  gap: 13px;
  min-height: 236px;
  position: relative;
  overflow: hidden;
}
.platform-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--blue);
}
.platform-card header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
}
.platform-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 950;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 22px rgba(15,23,42,.12);
}
.platform-card h3 { margin: 0; font-size: 17px; }
.platform-card p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.35; }
.platform-badge {
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.platform-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.platform-metrics div {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 9px;
}
.platform-metrics strong { display: block; font-size: 22px; letter-spacing: -.04em; }
.platform-metrics span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.platform-accounts {
  display: grid;
  gap: 7px;
  min-height: 44px;
}
.mini-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 700;
}
.mini-account.muted { color: var(--muted); font-weight: 600; justify-content: center; }
.platform-card.facebook::before, .icon.facebook { background: #1e40af; }
.platform-card.instagram::before, .icon.instagram { background: linear-gradient(135deg, #7c3aed, #f97316); }
.platform-card.tiktok::before, .icon.tiktok { background: #0f172a; }
.platform-card.linkedin::before, .icon.linkedin { background: #1d4ed8; }
.platform-card.xnet::before, .icon.xnet { background: #111827; }
.platform-card.youtube::before, .icon.youtube { background: #e11d48; }
.platform-card.paypal::before, .icon.paypal { background: #06b6d4; }
.platform-card.other::before, .icon.other { background: #64748b; }
.platform-card.facebook .platform-icon { background: #1e40af; }
.platform-card.instagram .platform-icon { background: linear-gradient(135deg, #7c3aed, #f97316); }
.platform-card.tiktok .platform-icon { background: #0f172a; }
.platform-card.linkedin .platform-icon { background: #1d4ed8; }
.platform-card.xnet .platform-icon { background: #111827; }
.platform-card.youtube .platform-icon { background: #e11d48; }
.platform-card.paypal .platform-icon { background: #06b6d4; }
.platform-card.other .platform-icon { background: #64748b; }
@media (max-width: 1180px) {
  .platform-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payment-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .platform-grid { grid-template-columns: 1fr; }
  .hub-section-title { align-items: flex-start; flex-direction: column; }
  .platform-card header { grid-template-columns: auto 1fr; }
  .platform-badge { grid-column: 1 / -1; justify-self: start; }
}
