/* =====================================================================
   Owl Veille - feuille de style
   Les couleurs de marque sont regroupees en variables : modifiez-les
   ici pour adapter l'outil a la charte d'Owl Marketing.
   ===================================================================== */

:root {
    --ink:        #171E2E;
    --ink-soft:   #47526A;
    --muted:      #7A8698;
    --line:       #E4E8EF;
    --bg:         #F4F6F9;
    --card:       #FFFFFF;
    --accent:     #E08A2B;
    --accent-dk:  #C2731D;
    --accent-sf:  #FDF2E3;
    --blue:       #2563EB;
    --danger:     #D8443C;
    --ok:         #17916B;
    --radius:     10px;
    --shadow:     0 1px 2px rgba(23,30,46,.06), 0 6px 20px rgba(23,30,46,.06);
    --shadow-lg:  0 20px 60px rgba(23,30,46,.22);
    --topbar-h:   60px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----------------------------------------------------------- topbar ---- */

.topbar {
    position: sticky; top: 0; z-index: 40;
    height: var(--topbar-h);
    display: flex; align-items: center; gap: 14px;
    padding: 0 16px;
    background: var(--ink);
    color: #fff;
}
.brand { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-logo { font-size: 21px; line-height: 1; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }

.searchbar { position: relative; flex: 1; max-width: 620px; margin: 0 auto; }
.searchbar input {
    width: 100%; height: 38px;
    padding: 0 34px 0 34px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.10);
    color: #fff; border-radius: 8px; font-size: 14px; font-family: var(--font);
}
.searchbar input::placeholder { color: rgba(255,255,255,.55); }
.searchbar input:focus { outline: none; border-color: var(--accent); background: rgba(255,255,255,.16); }
.searchbar-icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    color: rgba(255,255,255,.6); font-size: 17px; pointer-events: none;
}
.searchbar-clear {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; color: rgba(255,255,255,.6);
    font-size: 20px; cursor: pointer; padding: 0 6px; line-height: 1;
}
.searchbar-clear:hover { color: #fff; }

.usermenu { position: relative; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    border: 0; cursor: pointer;
    background: var(--accent); color: #fff;
    font-weight: 700; font-size: 12.5px; font-family: var(--font);
}
.icon-btn {
    background: rgba(255,255,255,.10); color: #fff; border: 0;
    width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 15px;
}
.only-mobile { display: none; }

/* ---------------------------------------------------------- boutons ---- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 38px; padding: 0 15px;
    border-radius: 8px; border: 1px solid transparent;
    font: 600 13.5px var(--font); cursor: pointer;
    white-space: nowrap; transition: background .12s, border-color .12s, color .12s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dk); }
.btn-ghost { background: var(--card); color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--muted); color: var(--ink); }
.btn-danger { background: #fff; color: var(--danger); border-color: #F0C9C6; }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--blue); cursor: pointer; font: 500 12.5px var(--font); padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ----------------------------------------------------------- layout ---- */

.layout { display: flex; align-items: flex-start; }

.sidebar {
    position: sticky; top: var(--topbar-h);
    width: 262px; flex: 0 0 262px;
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
    padding: 18px 16px 40px;
    background: var(--card);
    border-right: 1px solid var(--line);
}
.sidebar-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.sidebar-head h2 { font-size: 14px; }

.filter-group { padding: 14px 0; border-top: 1px solid var(--line); }
.filter-group:first-child { border-top: 0; padding-top: 0; }
.filter-group h3 {
    font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); margin-bottom: 9px;
}
.filter-options { display: flex; flex-direction: column; gap: 3px; }
.filter-more { margin-top: 5px; }

.check { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 0; font-size: 13px; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; flex: 0 0 auto; }
.check span { flex: 1; }
.check .count { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.check:hover span { color: var(--accent-dk); }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
.field > span em { color: var(--accent); font-style: normal; }
.field > span small { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
    width: 100%; padding: 9px 10px;
    border: 1px solid var(--line); border-radius: 8px;
    font: 14px var(--font); color: var(--ink); background: #fff;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-sf);
}
.field.small > span { font-size: 11.5px; }
.field.small input, .field.small select { padding: 6px 8px; font-size: 13px; }
.field-row { display: flex; gap: 8px; }
.field-row .field { flex: 1; }
.hint { font-size: 12px; color: var(--muted); margin: -6px 0 12px; }

/* ---------------------------------------------------------- contenu ---- */

.content { flex: 1; min-width: 0; padding: 18px 22px 60px; }

.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; margin-bottom: 16px;
}
.toolbar-left  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.result-count { font-weight: 600; color: var(--ink-soft); white-space: nowrap; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--accent-sf); color: var(--accent-dk);
    border: 1px solid #F3DCBE; border-radius: 999px;
    padding: 3px 6px 3px 10px; font-size: 12px; font-weight: 600;
}
.chip button { background: none; border: 0; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }

.select-inline { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.select-inline select {
    height: 38px; border: 1px solid var(--line); border-radius: 8px;
    background: #fff; padding: 0 8px; font: 13px var(--font); color: var(--ink);
}
.export-menu { position: relative; }

/* ------------------------------------------------------------ cartes --- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
    gap: 16px;
}

.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    box-shadow: var(--shadow); cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #D5DBE5; }

.card-media {
    position: relative; aspect-ratio: 4 / 3;
    background: #EDF0F5 center/cover no-repeat;
    display: flex; align-items: center; justify-content: center;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-media .placeholder { font-size: 13px; font-weight: 700; color: #AEB7C6; letter-spacing: .02em; }
.card-fav {
    position: absolute; top: 8px; right: 8px;
    width: 28px; height: 28px; border-radius: 50%;
    border: 0; cursor: pointer; font-size: 14px; line-height: 1;
    background: rgba(255,255,255,.92); color: #C3CAD6;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.card-fav.on { color: var(--accent); }
.badge-platform {
    position: absolute; left: 8px; top: 8px;
    background: rgba(23,30,46,.82); color: #fff;
    font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
}
.badge-ads {
    position: absolute; left: 8px; bottom: 8px;
    background: var(--accent); color: #fff;
    font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
    padding: 3px 7px; border-radius: 4px; text-transform: uppercase;
}

.card-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.card-brand { font-size: 11.5px; font-weight: 700; color: var(--accent-dk); text-transform: uppercase; letter-spacing: .04em; }
.card-title {
    font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--ink);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-note {
    font-size: 12.5px; color: var(--ink-soft); line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    background: #FAFBFC; border-left: 2px solid var(--line); padding: 5px 0 5px 8px; border-radius: 0 4px 4px 0;
}
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
    background: #F0F2F6; color: var(--ink-soft);
    border-radius: 4px; padding: 2px 6px; font-size: 11px; font-weight: 500;
}
.tag-strong { background: var(--accent-sf); color: var(--accent-dk); }
.card-foot {
    margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11.5px; color: var(--muted);
}
.card-foot a { font-weight: 600; }

/* ------------------------------------------------------------ divers --- */

.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty h3 { font-size: 17px; color: var(--ink); margin-bottom: 6px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 26px; }
.pager button {
    min-width: 34px; height: 34px; padding: 0 9px;
    border: 1px solid var(--line); background: #fff; border-radius: 7px;
    cursor: pointer; font: 600 13px var(--font); color: var(--ink-soft);
}
.pager button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager button:disabled { opacity: .4; cursor: default; }

.skeleton { background: linear-gradient(90deg,#EDF0F5,#F6F8FA,#EDF0F5); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ------------------------------------------------------------ modales -- */

.modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,20,32,.55); backdrop-filter: blur(2px); }
.modal-box {
    position: relative; z-index: 1;
    width: 100%; max-width: 520px;
    background: #fff; border-radius: 14px; padding: 26px;
    box-shadow: var(--shadow-lg);
    animation: pop .16s ease-out;
}
.modal-lg { max-width: 820px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-box > h2 { font-size: 18px; margin-bottom: 18px; }
.modal-close {
    position: absolute; top: 12px; right: 12px;
    width: 30px; height: 30px; border: 0; border-radius: 8px;
    background: #F2F4F7; color: var(--ink-soft); cursor: pointer; font-size: 19px; line-height: 1;
}
.modal-close:hover { background: #E6E9EF; }

.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.criteria-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form-error { background: #FDECEA; color: #A3241C; border: 1px solid #F5C8C3; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-top: 12px; }

.visual-zone { display: flex; gap: 14px; align-items: flex-start; margin: 6px 0 14px; }
.visual-preview {
    width: 150px; height: 112px; flex: 0 0 150px;
    border: 1px dashed var(--line); border-radius: 8px;
    background: #FAFBFC center/cover no-repeat;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: 12px; overflow: hidden;
}
.visual-preview img { width: 100%; height: 100%; object-fit: cover; }
.visual-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.visual-actions .hint { width: 100%; margin: 0; }

/* combobox : liste de reponses + saisie libre */
.combo { position: relative; }
.combo-list {
    position: absolute; z-index: 5; left: 0; right: 0; top: 100%;
    max-height: 210px; overflow-y: auto;
    background: #fff; border: 1px solid var(--line); border-radius: 8px;
    box-shadow: var(--shadow-lg); margin-top: 3px;
}
.combo-list button {
    display: block; width: 100%; text-align: left;
    background: none; border: 0; padding: 7px 11px;
    font: 13.5px var(--font); color: var(--ink); cursor: pointer;
}
.combo-list button:hover, .combo-list button.hl { background: var(--accent-sf); }
.combo-list .new { color: var(--accent-dk); font-weight: 600; border-top: 1px solid var(--line); }

.dropdown {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
    min-width: 232px; background: #fff;
    border: 1px solid var(--line); border-radius: 10px;
    box-shadow: var(--shadow-lg); overflow: hidden; padding: 5px;
}
.dropdown[hidden] { display: none; }
.dropdown button, .dropdown a {
    display: block; width: 100%; text-align: left;
    background: none; border: 0; border-radius: 7px;
    padding: 8px 11px; font: 13.5px var(--font); color: var(--ink);
    cursor: pointer; text-decoration: none;
}
.dropdown button:hover, .dropdown a:hover { background: #F3F5F8; text-decoration: none; }
.dropdown-head { padding: 9px 11px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.dropdown-head strong { display: block; font-size: 13.5px; }
.dropdown-head span { font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------- fiche detail -- */

.detail { display: grid; grid-template-columns: 300px 1fr; gap: 22px; }
.detail-media { border-radius: 10px; overflow: hidden; background: #EDF0F5; }
.detail-media img { width: 100%; display: block; }
.detail-media .placeholder { padding: 60px 10px; text-align: center; color: #AEB7C6; font-weight: 700; }
.detail h2 { font-size: 19px; line-height: 1.3; margin-bottom: 6px; }
.detail-brand { color: var(--accent-dk); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
.detail-note { background: #FAFBFC; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; white-space: pre-wrap; margin: 14px 0; font-size: 13.5px; }
.detail-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.criteria-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px 16px; margin: 14px 0; }
.criteria-list div { font-size: 13px; }
.criteria-list dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.criteria-list dd { margin: 1px 0 0; font-weight: 600; }

/* --------------------------------------------------------- reglages ---- */

.token-box {
    display: flex; gap: 8px; align-items: center;
    background: #F6F8FA; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px;
    font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all;
}
.steps { counter-reset: s; padding: 0; margin: 14px 0; list-style: none; }
.steps li { counter-increment: s; position: relative; padding: 0 0 12px 30px; font-size: 13.5px; color: var(--ink-soft); }
.steps li::before {
    content: counter(s); position: absolute; left: 0; top: 0;
    width: 21px; height: 21px; border-radius: 50%;
    background: var(--accent-sf); color: var(--accent-dk);
    font-size: 11.5px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 7px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tabs button {
    background: none; border: 0; border-bottom: 2px solid transparent;
    padding: 9px 13px; font: 600 13.5px var(--font); color: var(--muted); cursor: pointer;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.pill-admin { background: var(--accent-sf); color: var(--accent-dk); }
.pill-off { background: #F0F2F6; color: var(--muted); }

/* ------------------------------------------------------------- toasts -- */

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: var(--ink); color: #fff; border-radius: 9px;
    padding: 11px 15px; font-size: 13.5px; box-shadow: var(--shadow-lg);
    animation: pop .16s ease-out; max-width: 340px;
}
.toast.err { background: var(--danger); }
.toast.ok  { background: var(--ok); }

.alert { border-radius: 8px; padding: 10px 13px; font-size: 13.5px; margin-bottom: 14px; }
.alert-error { background: #FDECEA; color: #A3241C; border: 1px solid #F5C8C3; }
.alert-info  { background: #EAF2FE; color: #1B4FA8; border: 1px solid #C9DDF9; }
.alert-ok    { background: #E8F6F0; color: #10664C; border: 1px solid #BFE6D6; }

/* ----------------------------------------------------- page connexion -- */

.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--ink); padding: 20px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 24px; }
.auth-logo { font-size: 34px; }
.auth-brand h1 { font-size: 19px; }
.auth-brand p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.auth-form .btn { margin-top: 6px; }
.auth-foot { margin: 20px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

/* --------------------------------------------------------- responsive -- */

@media (max-width: 900px) {
    .only-mobile { display: inline-block; }
    .brand-name { display: none; }
    .sidebar {
        position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
        z-index: 45; transform: translateX(-100%); transition: transform .2s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: none; }
    .content { padding: 14px; }
    .form-cols, .criteria-grid, .detail, .criteria-list { grid-template-columns: 1fr; }
    .modal { padding: 14px; }
    .modal-box { padding: 20px; }
    .visual-zone { flex-direction: column; }
}
