/* ============================================
   AgendaLocal — Feuille de style principale
   ============================================ */

:root {
  --font-main:    'DM Sans', system-ui, sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;

  --color-primary:      #009139;
  --color-primary-dark: #006B2A;
  --color-primary-light:#E6F4EC;

  --color-bg:       #F8F8F6;
  --color-surface:  #FFFFFF;
  --color-border:   rgba(0,0,0,.10);
  --color-border2:  rgba(0,0,0,.16);

  --color-text:     #1A1A18;
  --color-muted:    #6B6B67;
  --color-hint:     #9E9E98;

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-main); background: var(--color-bg); color: var(--color-text); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a    { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img  { max-width: 100%; display: block; }


/* ---- FontAwesome helpers ---- */
.fa-icon-sm { font-size: 14px; }
.fa-icon-lg { font-size: 20px; }
.nav-link i, .btn i, .tab i { font-size: 13px; margin-right: 3px; }
.flash i { font-size: 14px; margin-right: 6px; }
.admin-sidebar a i { width: 16px; text-align: center; margin-right: 6px; font-size: 13px; }
.info-icon i { font-size: 15px; }
.event-banner i { font-size: 36px; }
.metric-icon { font-size: 24px; color: var(--color-primary); margin-bottom: 6px; }

/* ---- Navbar ---- */
.navbar { background: var(--color-surface); border-bottom: 0.5px solid var(--color-border); position: sticky; top: 0; z-index: 200; }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; height: 58px; display: flex; align-items: center; gap: 1rem; }
.logo { display: flex; align-items: center; }
.logo-img { height: 32px; width: auto; display: block; }
.logo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-primary); flex-shrink: 0; }
.nav-center { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; flex-wrap: wrap; }
.nav-link { font-size: 13px; color: var(--color-muted); padding: 5px 10px; border-radius: var(--radius-sm); transition: background .15s, color .15s; }
.nav-link:hover { background: var(--color-primary-light); color: var(--color-primary-dark); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 6px; }
.nav-org  { font-size: 13px; color: var(--color-muted); padding: 4px 10px; background: var(--color-bg); border-radius: var(--radius-sm); }
.nav-toggle { display: none; background: none; border: none; font-size: 20px; cursor: pointer; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; cursor: pointer; border: 0.5px solid var(--color-border2); background: transparent; color: var(--color-text); transition: background .15s; text-decoration: none; }
.btn:hover { background: var(--color-bg); text-decoration: none; }
.btn-sm   { padding: 5px 13px; font-size: 13px; }
.btn-primary { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); color: #fff; }
.btn-ghost  { border-color: transparent; color: var(--color-muted); }
.btn-ghost:hover { background: var(--color-bg); }
.btn-danger { background: #E24B4A; color: #fff; border-color: #E24B4A; }
.btn-danger:hover { background: #A32D2D; }
.btn-full { width: 100%; justify-content: center; padding: 10px; }
.btn-lg   { padding: 11px 24px; font-size: 15px; }

/* ---- Flash messages ---- */
.flash { display: flex; align-items: center; justify-content: space-between; padding: 12px 1.5rem; font-size: 14px; border-bottom: 0.5px solid var(--color-border); }
.flash button { background: none; border: none; font-size: 18px; cursor: pointer; line-height: 1; color: inherit; opacity: .6; }
.flash-success { background: #EAF3DE; color: #3B6D11; }
.flash-error   { background: #FCEBEB; color: #A32D2D; }
.flash-info    { background: #E6F1FB; color: #185FA5; }
.flash-warning { background: #FAEEDA; color: #854F0B; }

/* ---- Main content ---- */
.main-content { min-height: calc(100vh - 58px - 180px); }

/* ---- Hero ---- */
.hero { text-align: center; padding: 4rem 1.5rem 3rem; }
.hero h1 { font-family: var(--font-display); font-size: clamp(28px, 5vw, 46px); font-weight: 400; line-height: 1.15; margin-bottom: 1rem; }
.hero p { font-size: 16px; color: var(--color-muted); max-width: 500px; margin: 0 auto 2rem; }
.search-bar { display: flex; gap: 8px; max-width: 520px; margin: 0 auto; }
.search-bar input { flex: 1; padding: 10px 14px; border: 0.5px solid var(--color-border2); border-radius: var(--radius-md); font-size: 14px; background: var(--color-surface); }
.search-bar input:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(0,145,57,.12); }

/* ---- Filter chips ---- */
.filter-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 0 1.5rem 2.5rem; }
.chip { padding: 6px 16px; border-radius: 999px; border: 0.5px solid var(--color-border2); font-size: 13px; cursor: pointer; background: var(--color-surface); color: var(--color-muted); transition: all .15s; text-decoration: none; display: inline-block; }
.chip:hover, .chip.active { background: var(--color-primary-light); color: var(--color-primary-dark); border-color: #4DB870; text-decoration: none; }

/* ---- Events grid ---- */
.events-section { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem 4rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.5rem; }
.section-head h2 { font-size: 18px; font-weight: 500; }
.section-head small { font-size: 13px; color: var(--color-muted); }
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* ---- Event card ---- */
.event-card { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color .15s, box-shadow .15s; display: flex; flex-direction: column; }
.event-card:hover { border-color: var(--color-border2); box-shadow: var(--shadow-md); text-decoration: none; }
.event-banner { height: 160px; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.event-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.event-cat { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.event-title { font-size: 15px; font-weight: 500; color: var(--color-text); line-height: 1.3; }
.event-meta { font-size: 13px; color: var(--color-muted); display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding-top: 8px; }
.event-org  { margin-top: 10px; padding-top: 10px; border-top: 0.5px solid var(--color-border); font-size: 12px; color: var(--color-hint); }
.empty-state { text-align: center; padding: 3rem; color: var(--color-muted); grid-column: 1 / -1; }

/* ---- Event detail ---- */
.event-detail { max-width: 860px; margin: 2rem auto; padding: 0 1.5rem; }
.detail-header { margin-bottom: 2rem; }
.detail-banner { height: 200px; display: flex; align-items: center; justify-content: center; font-size: 64px; border-radius: var(--radius-lg); margin-bottom: 1.5rem; }
.detail-header h1 { font-family: var(--font-display); font-size: clamp(22px, 4vw, 34px); font-weight: 400; margin-bottom: .5rem; }
.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; }
.detail-body { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.5rem; }
.detail-body h3 { font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; color: var(--color-muted); margin-bottom: 1rem; }
.detail-body p { font-size: 15px; line-height: 1.7; white-space: pre-wrap; }
.detail-sidebar { display: flex; flex-direction: column; gap: 12px; }
.info-card { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.25rem; }
.info-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.info-row:last-child { margin-bottom: 0; }
.info-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.info-label { font-size: 12px; color: var(--color-muted); margin-bottom: 2px; }

/* ---- Auth pages ---- */
.auth-wrap  { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 58px); padding: 2rem; }
.auth-card  { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: var(--radius-lg); padding: 2rem; width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 22px; font-weight: 500; margin-bottom: .4rem; }
.auth-card > p { font-size: 14px; color: var(--color-muted); margin-bottom: 1.5rem; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--color-muted); margin-bottom: 5px; }
.form-group input,
.form-group select,
.form-group textarea { width: 100%; padding: 9px 12px; border: 0.5px solid var(--color-border2); border-radius: var(--radius-md); font-size: 14px; font-family: var(--font-main); background: var(--color-surface); color: var(--color-text); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(0,145,57,.12); }
.form-group textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-card { background: var(--color-surface); border: 0.5px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1rem; }
.form-card h3 { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; color: var(--color-muted); margin-bottom: 1rem; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-bottom: 3rem; }
.form-divider { text-align: center; font-size: 13px; color: var(--color-hint); margin: 1rem 0; position: relative; }
.form-divider::before { content: ''; position: absolute; left: 0; top: 50%; right: 0; height: 0.5px; background: var(--color-border); }
.form-divider span { background: var(--color-surface); padding: 0 10px; position: relative; }
.form-help { font-size: 12px; color: var(--color-hint); margin-top: 4px; }

/* ---- Dashboard ---- */
.dash-wrap { max-width: 1000px; margin: 0 auto; padding: 2rem 1.5rem; }
.dash-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.dash-header h1 { font-size: 22px; font-weight: 500; }
.dash-header p  { font-size: 14px; color: var(--color-muted); margin-top: 4px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 2rem; }
.metric  { background: var(--color-bg); border-radius: var(--radius-md); padding: 1rem; }
.metric-label { font-size: 13px; color: var(--color-muted); margin-bottom: 4px; }
.metric-val   { font-size: 26px; font-weight: 500; }

/* ---- Tab bar ---- */
.tab-bar { display: flex; border-bottom: 0.5px solid var(--color-border); background: var(--color-surface); padding: 0 1.5rem; overflow-x: auto; }
.tab { padding: 12px 18px; font-size: 14px; cursor: pointer; color: var(--color-muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; display: inline-block; }
.tab:hover { color: var(--color-text); text-decoration: none; }
.tab.active { color: var(--color-text); border-bottom-color: var(--color-primary); }

/* ---- Table ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; padding: 8px 12px; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; color: var(--color-muted); border-bottom: 0.5px solid var(--color-border); }
.data-table td { padding: 12px; border-bottom: 0.5px solid var(--color-border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--color-bg); }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.badge-pub   { background: #EAF3DE; color: #3B6D11; }
.badge-draft { background: #F1EFE8; color: #5F5E5A; }
.badge-arch  { background: #FAEEDA; color: #854F0B; }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 4px; justify-content: center; padding: 2rem 0; }
.page-link { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 0.5px solid var(--color-border); font-size: 14px; color: var(--color-muted); }
.page-link:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }
.page-link.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ---- Breadcrumb ---- */
.breadcrumb { font-size: 13px; color: var(--color-muted); padding: 1rem 1.5rem 0; max-width: 1200px; margin: 0 auto; }
.breadcrumb a { color: var(--color-muted); }
.breadcrumb span { margin: 0 6px; }

/* ---- Admin ---- */
.admin-grid { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 58px); }
.admin-sidebar { background: var(--color-surface); border-right: 0.5px solid var(--color-border); padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 4px; }
.admin-sidebar a { padding: 8px 12px; border-radius: var(--radius-md); font-size: 14px; color: var(--color-muted); display: block; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--color-primary-light); color: var(--color-primary-dark); text-decoration: none; }
.admin-main { padding: 2rem; }

/* ---- Footer ---- */
.site-footer { background: var(--color-surface); border-top: 0.5px solid var(--color-border); padding: 2.5rem 1.5rem 0; margin-top: 3rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem; }
.footer-brand p { font-size: 13px; color: var(--color-muted); margin-top: 6px; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links strong { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.footer-links a { font-size: 13px; color: var(--color-muted); }
.footer-links a:hover { color: var(--color-primary); text-decoration: none; }
.footer-bottom { border-top: 0.5px solid var(--color-border); text-align: center; padding: 1rem; font-size: 12px; color: var(--color-hint); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav-center { display: none; flex-direction: column; position: absolute; top: 58px; left: 0; right: 0; background: var(--color-surface); border-bottom: 0.5px solid var(--color-border); padding: 1rem; }
  .nav-center.open { display: flex; }
  .nav-toggle { display: block; }
  .nav-right { gap: 4px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
}
@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr; }
  .events-grid { grid-template-columns: 1fr; }
}
