/* Charte 360cteam.com (thème tpl_360cteam) : fond bleuté, reliefs doux, boutons pilule en dégradé, Manrope. */
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(fonts/manrope-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(fonts/manrope-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --c-bg: #edf1fa;
  --c-bg-muted: #e4eaf7;
  --c-bg-hover: #e5ebf8;
  --c-text: #2d3847;
  --c-emphasis: #223650;
  --c-muted: #747a96;
  --c-border: #e0e5ed;
  --c-primary: #1991ee;
  --c-primary-hover: #52b0f9;
  --c-primary-dark: #0f76c5;
  --c-secondary: #0c273a;
  --c-danger: #ff4352;
  --c-danger-dark: #d62e3c;
  --logo-blue: #2ab3dd;
  --logo-red: #ce312d;
  --logo-yellow: #f7b525;
  --logo-green: #39a243;
  --logo-stripes: linear-gradient(90deg, var(--logo-blue) 0 25%, var(--logo-red) 25% 50%, var(--logo-yellow) 50% 75%, var(--logo-green) 75% 100%);
  --grad-button: linear-gradient(51deg, #1865e0 50%, #199ef2 80%, #16b6f5 100%);
  --grad-dark: linear-gradient(-40deg, #0c273a, #081925);
  --raise: -5px -5px 15px rgba(255, 255, 255, .9), 4px 4px 12px rgba(57, 65, 124, .2);
  --raise-hover: -2px -2px 5px rgba(255, 255, 255, .9), 2px 2px 4px rgba(57, 65, 124, .2);
  --raise-blue: -5px -5px 15px rgba(255, 255, 255, .9), 5px 5px 15px rgba(11, 89, 150, .3);
  --raise-blue-hover: -2px -2px 5px rgba(255, 255, 255, .7), 2px 2px 5px rgba(11, 89, 150, .3);
  --raise-card: -15px -15px 20px rgba(255, 255, 255, .6), 15px 15px 20px rgba(57, 65, 124, .1);
  --inset: inset 2px 2px 5px rgba(57, 65, 124, .15), inset -2px -2px 5px rgba(255, 255, 255, .9);
  --radius: 12px;
  --pill: 500px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--c-bg); color: var(--c-text); font: 15px/1.6 Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--c-primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--c-primary-hover); }
h1, h2, h3 { color: var(--c-emphasis); font-weight: 600; }
h1 { font-size: 30px; line-height: 1.2; margin: 0; }
h2 { font-size: 18px; line-height: 1.3; margin: 0 0 16px; }
.form h2:not(:first-of-type) { margin-top: 12px; }
code { background: var(--c-bg-muted); color: var(--c-emphasis); padding: 1px 6px; border-radius: 6px; font-size: .88em; }
pre { white-space: pre-wrap; word-break: break-all; }

/* En-tête : barre translucide comme sur le site, trait aux couleurs du logo */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 28px; padding: 0 32px; height: 76px;
          background: rgba(237, 241, 250, .9); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); border-bottom: 1px solid var(--c-border); }
.topbar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--logo-stripes); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--c-emphasis); font-weight: 600; white-space: nowrap; }
.brand img { display: block; height: 36px; width: auto; }
.brand span { padding-left: 12px; border-left: 1px solid var(--c-border); color: var(--c-muted); font-size: 14px; }
.topbar nav { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
.topbar nav a { position: relative; color: var(--c-emphasis); padding: 10px 14px; font-weight: 600; white-space: nowrap; }
.topbar nav a::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 3px; background: var(--logo-stripes); opacity: 0; transition: opacity .2s; }
.topbar nav a:hover { color: var(--c-primary); }
.topbar nav a.active { color: var(--c-primary); }
.topbar nav a.active::before, .topbar nav a:hover::before { opacity: 1; }
.topbar .logout { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.topbar .logout .who { color: var(--c-emphasis); font-weight: 600; font-size: 14px; }
.topbar .logout .link { color: var(--c-muted); font-weight: 600; }

.wrap { max-width: 1260px; margin: 0 auto; padding: 36px 32px 72px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head p { margin: 6px 0 0; }
.head-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Cartes en relief */
.card { background: var(--c-bg); border-radius: var(--radius); padding: 26px; margin-bottom: 28px; box-shadow: var(--raise-card); }
.card.empty { text-align: center; padding: 56px 26px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-side { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.align-start { align-items: start; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-bottom: 28px; }
.stat { background: var(--c-bg); border-radius: var(--radius); padding: 20px 22px; color: var(--c-muted); box-shadow: var(--raise-card); position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.stat:nth-child(1)::after { background: var(--logo-blue); }
.stat:nth-child(2)::after { background: var(--logo-red); }
.stat:nth-child(3)::after { background: var(--logo-yellow); }
.stat:nth-child(4)::after { background: var(--logo-green); }
.stat span { display: block; font-size: 30px; font-weight: 700; color: var(--c-emphasis); line-height: 1.25; }
.stat small { display: block; color: var(--c-danger-dark); }

/* Formulaires : champs « creusés » */
.form { display: grid; gap: 16px; align-content: start; }
label { display: grid; gap: 7px; font-weight: 600; font-size: 14px; color: var(--c-emphasis); }
label .muted { font-weight: 400; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--c-text); }
label.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--c-primary); flex: none; box-shadow: none; }
input, select, textarea { font: inherit; color: var(--c-text); padding: 11px 16px; border: 1px solid transparent; border-radius: var(--radius);
                          background: var(--c-bg); box-shadow: var(--inset); width: 100%; min-width: 0; transition: border-color .15s, background .15s; }
textarea { resize: vertical; }
input[type=color] { padding: 5px; height: 46px; }
input[type=file] { box-shadow: none; padding: 6px 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-primary); background: #f5f8fd; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input-with-btn { display: flex; gap: 12px; align-items: center; }
.input-with-btn input { flex: 1; }
.form-actions { padding-top: 8px; }
.hint { font-size: 13px; color: var(--c-muted); margin: 0; }
.error { color: var(--c-danger-dark); }
.code { font-family: Consolas, Menlo, monospace; font-size: 12.5px; }
.code.small, pre.small { padding: 14px; border-radius: var(--radius); background: var(--c-bg); box-shadow: var(--inset); font-size: 12.5px; }
.search { display: flex; gap: 12px; margin-bottom: 18px; }
.inline { display: inline; }
form.inline.head-actions { display: flex; }
.head-actions select { width: auto; }
.center { text-align: center; }

/* Boutons pilule */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: 15px; line-height: 40px;
       padding: 0 24px; border-radius: var(--pill); border: 2px solid transparent; background: var(--c-bg); color: var(--c-emphasis);
       box-shadow: var(--raise); cursor: pointer; white-space: nowrap; transition: .2s ease-in-out; transition-property: color, box-shadow, background-position; }
.btn:hover { color: var(--c-primary); box-shadow: var(--raise-hover); }
.btn:active { box-shadow: var(--inset); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background-color: var(--c-primary); background-image: var(--grad-button); background-size: 200%; background-position-x: 100%; color: #fff; box-shadow: var(--raise-blue); }
.btn-primary:hover { color: #fff; background-position-x: 0; box-shadow: var(--raise-blue-hover); }
.btn-danger { background: var(--c-danger); color: #fff; box-shadow: -5px -5px 15px rgba(255, 255, 255, .9), 5px 5px 15px rgba(180, 30, 45, .3); }
.btn-danger:hover { color: #fff; background: var(--c-danger-dark); }
.btn-danger-outline { color: var(--c-danger-dark); }
.btn-danger-outline:hover { color: var(--c-danger); }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--c-primary); cursor: pointer; }
.link:hover { color: var(--c-primary-hover); }
.link.danger { color: var(--c-danger-dark); }
.chip { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 16px; border-radius: var(--pill); border: 0; background: var(--c-bg); color: var(--c-emphasis); box-shadow: var(--raise-hover); cursor: pointer; transition: color .15s, box-shadow .15s; }
.chip:hover { color: var(--c-primary); }
.chip:active { box-shadow: var(--inset); }

/* Tableaux */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); font-weight: 600; padding: 8px 12px; border-bottom: 1px solid var(--c-border); }
.table td { padding: 12px; border-bottom: 1px solid var(--c-border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--c-bg-hover); }
.table .num { text-align: right; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; font-size: 13px; }
.table-scroll { overflow-x: auto; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.small { font-size: 12.5px; }
.muted { color: var(--c-muted); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
.click-list { list-style: none; margin: 6px 0 0; padding: 0 0 0 10px; border-left: 3px solid var(--logo-green); font-size: 12.5px; color: var(--c-muted); }
.click-list li { margin: 2px 0; word-break: break-all; }
.list { padding-left: 20px; margin: 0 0 14px; }
.list li { margin-bottom: 6px; }

/* Badges */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 11px; border-radius: var(--pill); background: var(--c-bg-muted); color: var(--c-emphasis); white-space: nowrap; }
.badge-active, .badge-sent { background: #dff2e1; color: #2a7d33; }
.badge-pending, .badge-scheduled, .badge-queued { background: #fdf0d2; color: #8a6106; }
.badge-sending { background: #dcedfc; color: var(--c-primary-dark); }
.badge-unsubscribed, .badge-skipped, .badge-draft { background: var(--c-bg-muted); color: var(--c-muted); }
.badge-bounced, .badge-failed { background: #fbe1e1; color: var(--logo-red); }
.badge-paused { background: #fde9d6; color: #a2560c; }

/* Onglets, messages, pagination */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--c-border); }
.tabs a { position: relative; padding: 10px 14px; color: var(--c-emphasis); font-weight: 600; }
.tabs a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 3px; background: var(--logo-stripes); opacity: 0; }
.tabs a.active { color: var(--c-primary); }
.tabs a.active::after { opacity: 1; }
.tabs span { font-size: 12px; background: var(--c-bg-muted); padding: 1px 8px; border-radius: var(--pill); margin-left: 4px; color: var(--c-muted); }
.flash { padding: 14px 20px; border-radius: var(--radius); margin-bottom: 22px; font-weight: 600; box-shadow: var(--raise-hover); border-left: 4px solid; }
.flash-ok { background: #e6f5e8; color: #256d2d; border-color: var(--logo-green); }
.flash-error { background: #fbe6e6; color: #a5231f; border-color: var(--logo-red); }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; color: var(--c-muted); }
.danger-zone h2 { color: var(--c-danger-dark); }
.progress { height: 12px; background: var(--c-bg); box-shadow: var(--inset); border-radius: var(--pill); overflow: hidden; margin-bottom: 12px; }
.progress-bar { height: 100%; background: var(--grad-button); transition: width .4s; }

/* Éditeur */
.title-input { font-size: 24px; font-weight: 600; color: var(--c-emphasis); box-shadow: none; background: transparent; padding: 6px 12px; flex: 1; max-width: 640px; }
.title-input:hover { box-shadow: var(--inset); }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.preview-col { position: sticky; top: 96px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-weight: 600; color: var(--c-emphasis); }
.seg { display: inline-flex; background: var(--c-bg); box-shadow: var(--inset); border-radius: var(--pill); padding: 4px; }
.seg button { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: none; padding: 5px 14px; border-radius: var(--pill); cursor: pointer; color: var(--c-muted); }
.seg button.active { background: var(--grad-button); color: #fff; }
.preview-frame { background: var(--c-bg-muted); border-radius: var(--radius); overflow: hidden; display: flex; justify-content: center; box-shadow: var(--inset); }
.preview-frame iframe { width: 100%; height: calc(100vh - 160px); min-height: 520px; border: 0; background: var(--c-bg); transition: width .25s; }
.preview-frame.small-frame iframe { height: 520px; }
.blocks { display: grid; gap: 16px; margin-bottom: 18px; }
.block { border-radius: var(--radius); background: var(--c-bg); box-shadow: var(--raise); }
.block-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--c-border); }
.block-head strong { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--c-primary); }
.block-tools { display: flex; gap: 6px; }
.block-tools button { width: 32px; height: 32px; border: 0; background: var(--c-bg); box-shadow: var(--raise-hover); border-radius: 50%; cursor: pointer; font-size: 14px; color: var(--c-emphasis); }
.block-tools button:hover:not(:disabled) { color: var(--c-primary); }
.block-tools button:active:not(:disabled) { box-shadow: var(--inset); }
.block-tools button:disabled { opacity: .35; cursor: default; }
.block-tools button.danger:hover { color: var(--c-danger-dark); }
.block-body { display: grid; gap: 12px; padding: 14px; }
.field { display: grid; gap: 7px; }
.field-label { font-weight: 600; font-size: 14px; color: var(--c-emphasis); }
.image-field { display: grid; gap: 10px; }
.thumb { max-width: 160px; max-height: 90px; border-radius: 8px; object-fit: cover; }
.thumb:not([src]), .thumb[src=""] { display: none; }
.add-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.send-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.send-row input { width: auto; }

/* Connexion */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--c-bg); border-radius: var(--radius); padding: 36px 32px; box-shadow: var(--raise-card); position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--logo-stripes); }
.login-card .brand { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 26px; }
.login-card .brand img { height: 40px; }
.login-card .brand span { border: 0; padding: 0; }
.login-card form { display: grid; gap: 16px; }

@media (max-width: 1080px) {
  .editor-grid, .grid-2, .grid-side { grid-template-columns: 1fr; }
  .preview-col { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .topbar { padding: 12px 16px 6px; gap: 10px 16px; height: auto; flex-wrap: wrap; }
  .brand span { display: none; }
  .topbar nav { order: 3; flex-basis: 100%; }
  .topbar .logout { margin-left: auto; }
  .wrap { padding: 24px 16px 56px; }
  .row { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  h1 { font-size: 24px; }
  .stats { gap: 16px; }
  .table .actions { white-space: normal; }
}
