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

body{font-family:var(--font);background:var(--bg);color:var(--text);min-height:100vh;display:flex}

/* ── Sidebar ───────────────────────────────────────── */
.sidebar{width:var(--sidebar-w);background:#1a1a2e;color:#fff;display:flex;flex-direction:column;position:fixed;top:0;left:0;height:100vh;z-index:100}
.sidebar-logo{padding:20px 24px;border-bottom:1px solid rgba(255,255,255,.1);display:flex;align-items:center;gap:12px}
.sidebar-logo .logo-icon{width:36px;height:36px;background:var(--accent);border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:18px}
.sidebar-logo h1{font-size:16px;font-weight:700;letter-spacing:-.3px}
.sidebar-logo span{font-size:11px;color:rgba(255,255,255,.5);display:block;margin-top:2px}
.sidebar-nav{flex:1;padding:16px 12px;display:flex;flex-direction:column;gap:2px}
.sidebar-nav a{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:8px;color:rgba(255,255,255,.6);text-decoration:none;font-size:14px;transition:.2s;position:relative}
.sidebar-nav a:hover{background:rgba(255,255,255,.08);color:#fff}
.sidebar-nav a.active{background:rgba(27,122,67,.3);color:#fff}
.sidebar-nav a .badge{position:absolute;right:12px;background:var(--accent);color:#fff;font-size:11px;padding:2px 8px;border-radius:10px;font-weight:600}
.sidebar-nav .sep{height:1px;background:rgba(255,255,255,.1);margin:8px 0}
.sidebar-user{padding:16px;border-top:1px solid rgba(255,255,255,.1);display:flex;align-items:center;gap:12px}
.sidebar-user .avatar{width:36px;height:36px;background:var(--accent);border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px}
.sidebar-user .info{flex:1}
.sidebar-user .info .name{font-size:13px;font-weight:600}
.sidebar-user .info .plan{font-size:11px;color:rgba(255,255,255,.4)}
.sidebar-user .logout{background:none;border:none;color:rgba(255,255,255,.4);cursor:pointer;font-size:18px;padding:4px}
.sidebar-user .logout:hover{color:var(--red)}

/* ── Main ──────────────────────────────────────────── */
.main{margin-left:var(--sidebar-w);flex:1;min-height:100vh}
.topbar{height:var(--header-h);background:var(--card);border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 32px;position:sticky;top:0;z-index:50}
.topbar h2{font-size:20px;font-weight:700;display:flex;align-items:center;gap:10px}
.topbar-actions{display:flex;gap:10px}
.content{padding:28px 32px}

/* ── Buttons ───────────────────────────────────────── */
.btn{display:inline-flex;align-items:center;gap:8px;padding:10px 20px;border-radius:8px;border:none;font-size:14px;font-weight:600;cursor:pointer;transition:.2s;font-family:var(--font)}
.btn-primary{background:var(--accent);color:#fff}.btn-primary:hover{background:var(--accent-dark)}
.btn-secondary{background:var(--bg);color:var(--text);border:1px solid var(--border)}.btn-secondary:hover{background:#e9ecef}
.btn-sm{padding:6px 14px;font-size:13px}

/* ── Stats ─────────────────────────────────────────── */
.stats-bar{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-bottom:24px}
.stat-card{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px;display:flex;align-items:center;gap:14px;box-shadow:var(--shadow)}
.stat-card .icon{width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;font-size:20px}
.stat-card .icon.blue{background:var(--blue-light);color:var(--blue)}
.stat-card .icon.green{background:var(--accent-light);color:var(--accent)}
.stat-card .icon.orange{background:var(--orange-light);color:#b45309}
.stat-card .icon.purple{background:var(--purple-light);color:var(--purple)}
.stat-card .data .value{font-size:24px;font-weight:800}
.stat-card .data .label{font-size:12px;color:var(--muted)}
.stats-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:10px}
.stats-heading h3{font-size:15px}
.stats-scope{font-size:12px;color:var(--muted)}

/* ── Filters ───────────────────────────────────────── */
.filters{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.filters select,.filters input{padding:9px 14px;border:1px solid var(--border);border-radius:8px;font-size:13px;font-family:var(--font);background:var(--card)}
.filters input[type="text"]{min-width:250px}
.filter-feedback{min-height:32px;margin:8px 0 12px;display:flex;align-items:center;gap:10px;color:var(--muted);font-size:13px}
.filter-feedback .btn{padding:5px 10px}
.filtered-empty{text-align:center;padding:40px 20px;color:var(--muted);background:var(--card);border:1px dashed var(--border);border-radius:var(--radius)}
.filtered-empty h3{font-size:17px;color:var(--text);margin-bottom:6px}
.filtered-empty p{font-size:13px;margin-bottom:16px}
.veille-load-state{margin:0 0 16px;padding:12px 16px;border:1px solid #f59e0b;border-radius:8px;background:#fffbeb;color:#78350f;font-size:13px}
.veille-load-state button{margin-left:8px;padding:5px 10px;border:1px solid #b45309;border-radius:6px;background:#fff;color:#92400e;font:inherit;font-weight:700;cursor:pointer}

/* ── Thématique tags ───────────────────────────────── */
.theme-tag{display:inline-block;padding:3px 10px;border-radius:6px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.3px}
.theme-tag.reglementaire{background:#e3f2fd;color:#1565c0}
.theme-tag.pedagogique{background:var(--accent-light);color:var(--accent)}
.theme-tag.emploi{background:var(--orange-light);color:#b45309}
.theme-tag.prospective{background:var(--purple-light);color:var(--purple)}
.theme-tag.handicap{background:var(--gold-light);color:#8a6d1b}
.theme-tag.numerique{background:var(--red-light);color:var(--red)}

/* ── Veille entries ────────────────────────────────── */
.veille-timeline{display:flex;flex-direction:column;gap:0}
.veille-date-group{margin-bottom:24px}
.veille-date-label{font-size:13px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;padding:8px 0;border-bottom:1px solid var(--border);margin-bottom:12px;display:flex;align-items:center;gap:8px}
.veille-entry{background:var(--card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px;margin-bottom:10px;box-shadow:var(--shadow);transition:.2s;display:flex;gap:16px}
.veille-entry:hover{border-color:var(--accent);box-shadow:0 4px 12px rgba(0,0,0,.08)}
.veille-entry .ve-time{font-size:12px;color:var(--muted);min-width:50px;padding-top:2px;font-weight:600}
.veille-entry .ve-content{flex:1}
.veille-entry .ve-title{font-size:15px;font-weight:700;margin-bottom:4px;display:flex;align-items:center;gap:8px}
.veille-entry .ve-title a{color:var(--accent);text-decoration:none}
.veille-entry .ve-title a:hover{text-decoration:underline}
.veille-entry .ve-source{font-size:12px;color:var(--muted);margin-bottom:6px}
.veille-entry .ve-comment{font-size:13px;color:var(--text);background:var(--bg);padding:10px 14px;border-radius:8px;margin-top:8px;border-left:3px solid var(--accent)}
.veille-entry .ve-actions{display:flex;gap:6px;margin-top:10px}
.veille-entry .ve-actions button{background:none;border:1px solid var(--border);border-radius:6px;padding:4px 10px;font-size:12px;cursor:pointer;font-family:var(--font);transition:.2s}
.veille-entry .ve-actions button:hover{border-color:var(--accent);color:var(--accent)}

/* ── Modal ─────────────────────────────────────────── */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:200;display:none;align-items:center;justify-content:center;padding:20px}
.modal-overlay.open{display:flex}
.modal{background:var(--card);border-radius:14px;width:100%;max-width:600px;max-height:90vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,.2);animation:modalIn .25s ease}
@keyframes modalIn{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}
.modal-header{padding:20px 24px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;background:var(--card);z-index:5;border-radius:14px 14px 0 0}
.modal-header h3{font-size:18px;font-weight:700}
.modal-close{background:none;border:none;font-size:22px;cursor:pointer;color:var(--muted);padding:4px 8px;border-radius:6px}
.modal-close:hover{background:#f1f3f5}
.modal-body{padding:24px}
.modal-footer{padding:16px 24px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:10px;position:sticky;bottom:0;background:var(--card);border-radius:0 0 14px 14px}

/* ── Form ──────────────────────────────────────────── */
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.form-grid .full{grid-column:1/-1}
.form-group{display:flex;flex-direction:column;gap:5px}
.form-group label{font-size:13px;font-weight:600;color:var(--text)}
.form-group label .req{color:var(--red)}
.form-group input,.form-group select,.form-group textarea{padding:10px 12px;border:1px solid var(--border);border-radius:8px;font-size:14px;font-family:var(--font);transition:.2s}
.form-group input:focus,.form-group select:focus,.form-group textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(27,122,67,.1)}
.form-group textarea{resize:vertical;min-height:80px}
.form-group .help{font-size:11px;color:var(--muted);margin-top:2px}

/* ── Print ─────────────────────────────────────────── */
.print-area{display:none}
@media print{
  body *{visibility:hidden}
  .print-area,.print-area *{visibility:visible!important;display:block!important}
  .print-area{position:fixed;top:0;left:0;width:100%;padding:30px;font-size:13px}
  .print-area h1{font-size:20px;text-align:center;margin-bottom:20px;border-bottom:2px solid #1b7a43;padding-bottom:10px}
  .print-area h2{font-size:16px;margin:16px 0 8px;color:#1b7a43}
  .print-area table{width:100%;border-collapse:collapse;margin:10px 0}
  .print-area th,.print-area td{border:1px solid #ccc;padding:8px 10px;text-align:left;font-size:12px}
  .print-area th{background:#f0f0f0;font-weight:700}
}

/* ── Toast ─────────────────────────────────────────── */
.toast{position:fixed;bottom:24px;right:24px;background:var(--text);color:#fff;padding:14px 24px;border-radius:10px;font-size:14px;font-weight:500;z-index:999;transform:translateY(80px);opacity:0;transition:.3s}
.toast.show{transform:none;opacity:1}

.empty-state{text-align:center;padding:60px 20px;color:var(--muted)}
.empty-state .icon{font-size:48px;margin-bottom:16px}
.empty-state h3{font-size:18px;color:var(--text);margin-bottom:8px}
.empty-state p{font-size:14px;margin-bottom:20px}

@media(max-width:768px){
  .sidebar{display:none}.main{margin-left:0}.content{padding:16px}
  .topbar{height:auto;min-height:var(--header-h);padding:12px 16px;align-items:flex-start;flex-direction:column;gap:10px}
  .topbar-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}
  .topbar-actions .btn{justify-content:center;min-width:0}
  .stats-bar{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .stat-card{padding:12px;min-width:0}.stat-card .icon{width:36px;height:36px;flex:0 0 36px}
  .form-grid{grid-template-columns:1fr}
  .filters{flex-direction:column;align-items:stretch}
  .filters input[type="text"],.filters select{min-width:0;width:100%}
  .filter-feedback{align-items:flex-start;justify-content:space-between}
  .veille-entry{padding:14px;flex-direction:column;gap:6px}
  .veille-entry .ve-time{min-width:0}.veille-entry .ve-title,.veille-entry .ve-actions{flex-wrap:wrap}
}
@media(max-width:480px){
  .topbar-actions{grid-template-columns:1fr}
  .stats-heading{align-items:flex-start;flex-direction:column;gap:2px}
  .stat-card{gap:9px}.stat-card .data .value{font-size:21px}.stat-card .data .label{font-size:11px}
}
