*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --c-bg:       #f0f2f5;
    --c-white:    #ffffff;
    --c-border:   #e2e4e8;
    --c-text:     #1a1c23;
    --c-muted:    #6b7280;
    --c-accent:   #1e6fcc;
    --c-accent-h: #1558a8;
    --c-success:  #16a34a;
    --c-warn:     #d97706;
    --c-danger:   #dc2626;
    --c-gam:      #2d6a4f;
    --c-gam-light:#e8f5ee;
    --radius:     10px;
    --shadow:     0 1px 4px rgba(0,0,0,.08);
    --shadow-md:  0 4px 12px rgba(0,0,0,.10);
}

body { font-family: system-ui, -apple-system, sans-serif; font-size: 15px;
       background: var(--c-bg); color: var(--c-text); line-height: 1.6; }

a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
.main-header { background: var(--c-gam); color: #fff; padding: 0; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.main-header .inner { display: flex; align-items: center; justify-content: space-between;
                       max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 56px; }
.main-header .logo  { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -.3px; display:flex; align-items:center; gap:8px; }
.main-header .logo span { opacity: .65; font-weight: 400; font-size: 13px; }
.main-header nav { display: flex; align-items: center; gap: 4px; }
.main-header nav a { color: rgba(255,255,255,.8); padding: 6px 12px; border-radius: 6px;
                     font-size: 13px; font-weight: 500; transition: background .15s; }
.main-header nav a:hover { background: rgba(255,255,255,.15); color: #fff; text-decoration: none; }
.main-header nav a.active { background: rgba(255,255,255,.2); color: #fff; }

/* ── Hamburger mobile ── */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 4px 0; border-radius: 2px; }

/* ── Layout ── */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.content   { padding: 24px 0 60px; }

/* ── Cards ── */
.card { background: var(--c-white); border: 1px solid var(--c-border);
        border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

/* ── Stats dashboard ── */
.stats-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-box  { background: var(--c-white); border: 1px solid var(--c-border);
             border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.stat-box .val { font-size: 28px; font-weight: 700; color: var(--c-gam); line-height: 1.1; }
.stat-box .lbl { font-size: 12px; color: var(--c-muted); margin-top: 2px; }
.stat-box .trend { font-size: 11px; margin-top: 4px; }
.stat-box .trend.up   { color: var(--c-success); }
.stat-box .trend.down { color: var(--c-danger); }

/* ── Filtres ── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.filters .form-control { height: 36px; font-size: 13px; }
.filters label { font-size: 12px; color: var(--c-muted); font-weight: 500; }

/* ── Score badge ── */
.score-badge { display: inline-flex; align-items: center; justify-content: center;
               width: 40px; height: 40px; border-radius: 50%; font-weight: 700;
               font-size: 15px; flex-shrink: 0; }
.score-badge.high   { background: #dcfce7; color: #15803d; box-shadow: 0 0 0 3px #bbf7d0; }
.score-badge.medium { background: #fef9c3; color: #a16207; box-shadow: 0 0 0 3px #fde68a; }
.score-badge.low    { background: #fee2e2; color: #b91c1c; box-shadow: 0 0 0 3px #fecaca; }

/* ── Annonce card ── */
.annonce-card-wrap { border-radius: var(--radius); border: 1px solid var(--c-border);
                     background: #fff; box-shadow: var(--shadow);
                     margin-bottom: 12px; overflow: hidden; transition: box-shadow .2s; }
.annonce-card-wrap:hover { box-shadow: var(--shadow-md); }
.annonce-card-wrap.unread { border-left: 4px solid var(--c-accent); }
.annonce-card-inner { display: flex; gap: 16px; align-items: flex-start; padding: 16px; }

.source-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
                border-radius: 20px; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.source-badge.boamp  { background: #dbeafe; color: #1d4ed8; }
.source-badge.decp   { background: #ede9fe; color: #6d28d9; }
.source-badge.pappers{ background: #d1fae5; color: #065f46; }
.source-badge.gnews  { background: #fef3c7; color: #92400e; }
.source-badge.lbc    { background: #fee2e2; color: #991b1b; }

.annonce-body { flex: 1; min-width: 0; }
.annonce-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; line-height: 1.4; }
.annonce-title a { color: var(--c-text); }
.annonce-title a:hover { color: var(--c-accent); text-decoration: none; }
.annonce-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px;
                color: var(--c-muted); margin-bottom: 10px; align-items: center; }
.annonce-resume { font-size: 13px; color: #374151; background: #f8fafc;
                  border-left: 3px solid var(--c-accent); padding: 10px 14px;
                  border-radius: 0 6px 6px 0; margin-bottom: 12px; line-height: 1.6; }

/* ── Notes / commentaires ── */
.note-zone { background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px;
             padding: 10px; margin-bottom: 10px; }
.note-zone textarea { width: 100%; border: none; background: transparent; resize: vertical;
                      font-size: 13px; min-height: 60px; outline: none; color: var(--c-text); }
.note-zone .note-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* ── Actions annonce ── */
.annonce-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.annonce-actions form { display: inline; }

/* ── Boutons ── */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px;
       border-radius: 7px; font-size: 13px; font-weight: 500;
       border: 1px solid transparent; cursor: pointer; transition: all .15s; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary   { background: var(--c-gam); color: #fff; border-color: var(--c-gam); }
.btn-primary:hover { background: #235c43; }
.btn-accent    { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.btn-accent:hover { background: var(--c-accent-h); }
.btn-outline   { background: #fff; color: var(--c-text); border-color: var(--c-border); }
.btn-outline:hover { border-color: #9ca3af; background: #f9fafb; }
.btn-ghost     { background: transparent; color: var(--c-muted); border-color: transparent; }
.btn-ghost:hover { background: #f3f4f6; color: var(--c-text); }
.btn-sm        { padding: 4px 10px; font-size: 12px; border-radius: 5px; }
.btn-xs        { padding: 2px 8px; font-size: 11px; border-radius: 4px; }
.btn-saved     { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.btn-saved:hover { background: #fef3c7; }

/* ── Formulaires ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.form-control { width: 100%; padding: 8px 12px; border: 1px solid var(--c-border);
                border-radius: var(--radius); font-size: 14px; background: #fff;
                transition: border-color .15s; }
.form-control:focus { outline: none; border-color: var(--c-gam);
                      box-shadow: 0 0 0 3px rgba(45,106,79,.12); }
.form-hint { font-size: 12px; color: var(--c-muted); margin-top: 4px; }

/* ── Alert ── */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.alert-danger  { background: #fef2f2; color: var(--c-danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--c-success); border: 1px solid #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── Pagination ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--c-border);
    border-radius: 7px; font-size: 13px; background: #fff; transition: all .15s; }
.pagination a:hover { border-color: var(--c-gam); color: var(--c-gam); text-decoration: none; }
.pagination .active { background: var(--c-gam); color: #fff; border-color: var(--c-gam); }

/* ── Login ── */
.login-wrap { max-width: 420px; margin: 80px auto; padding: 0 20px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { color: var(--c-gam); font-size: 24px; }
.login-logo p  { color: var(--c-muted); font-size: 14px; margin-top: 4px; }

/* ── Table admin ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--c-border); }
th { background: #f8fafc; font-weight: 500; font-size: 12px; color: var(--c-muted);
     text-transform: uppercase; letter-spacing: .4px; }
tr:hover td { background: #fafbfc; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 500; }
.badge-admin  { background: #ede9fe; color: #6d28d9; }
.badge-membre { background: #dbeafe; color: #1d4ed8; }

/* ── Tags mots-clés ── */
.tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px;
       font-weight: 500; background: #dbeafe; color: #1d4ed8; margin: 2px; }
.tag.cpv { background: #ede9fe; color: #6d28d9; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--c-muted); }
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; color: var(--c-text); margin-bottom: 6px; }

/* ── Responsive mobile ── */
@media (max-width: 768px) {
    .main-header nav { display: none; flex-direction: column; position: absolute;
                       top: 56px; left: 0; right: 0; background: var(--c-gam);
                       padding: 12px; z-index: 100; box-shadow: 0 4px 8px rgba(0,0,0,.2); }
    .main-header nav.open { display: flex; }
    .main-header nav a { padding: 10px 16px; border-radius: 6px; }
    .nav-toggle { display: block; }
    .main-header .inner { position: relative; }

    .stats-bar { grid-template-columns: 1fr 1fr; }
    .stats-bar .stat-box:last-child { grid-column: 1/-1; }

    .filters { gap: 6px; }
    .filters .form-control { font-size: 12px; }

    .annonce-card-inner { flex-direction: column; gap: 10px; }
    .score-badge { width: 32px; height: 32px; font-size: 13px; }

    .page-wrap { padding: 0 12px; }
    .content { padding: 16px 0 40px; }
}

@media (max-width: 480px) {
    .stats-bar { grid-template-columns: 1fr; }
    .btn { padding: 6px 10px; font-size: 12px; }
}
