/* === ADMIN CHRONOFLEURS — design repris de SUBSITES MANAGEMENT (bottin.gdn) === */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #F0F0F0;
    color: #333;
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    width: 220px;
    background: #2B2B2B;
    color: #FFF;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-top {
    display: flex;
    align-items: center;
    border-bottom: 2px solid #67C096;
    position: relative;
}
.sidebar-logo {
    display: block;
    flex: 1;
    padding: 17px 20px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #FFF;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-logo:hover { color: #67C096; }
.sidebar-logo span { color: #67C096; }

.sidebar-collapse-btn {
    background: none;
    border: 0;
    color: #888;
    cursor: pointer;
    padding: 8px;
    margin-right: 6px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: color .2s, background .2s, transform .25s;
}
.sidebar-collapse-btn:hover { color: #FFF; background: rgba(255,255,255,.1); }

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #CCC;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.sidebar-nav a:hover {
    color: #FFF;
    background: rgba(255,255,255,0.05);
}
.sidebar-nav a.active {
    color: #67C096;
    background: rgba(255,255,255,0.08);
    border-right: 3px solid #67C096;
}
.sidebar-nav a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.sidebar-sep {
    margin: 14px 20px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #777;
}

.sidebar-footer {
    padding: 16px 20px;
    font-size: 12px;
    color: #888;
    border-top: 1px solid #555;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}
.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #BBB;
    text-decoration: none;
    font-weight: 600;
}
.sidebar-footer a:hover { color: #67C096; }

/* === MAIN CONTENT === */
.main {
    margin-left: 220px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    background: #FFF;
    padding: 16px 32px;
    border-bottom: 2px solid #DDD;
    display: flex;
    align-items: center;
    gap: 10px;
}
.main-header svg { color: #999; }
.main-header .btn svg { color: inherit; }   /* pictos des CTA : couleur du bouton (blanc sur fond vert) */
.main-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: #2B2B2B;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.main-header__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.main-content {
    flex: 1;
    padding: 32px;
}

/* === CARDS === */
.card {
    background: #FFF;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card h2 {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    color: #2B2B2B;
    margin-bottom: 16px;
}

/* === FORMS === */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #DDD;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: #67C096;
}

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 16px; }
.form-grid-2, .form-grid-3, .form-grid-4 { align-items: start; }

.form-hint {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
}

textarea.form-input { min-height: 110px; resize: vertical; font-family: inherit; line-height: 1.5; }
select.form-input { background: #FFF; }
.form-input[readonly] { background: #FAFAFA; color: #777; }

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.btn svg { flex-shrink: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }
.btn-primary { background: #4CAF50; color: #FFF; }
.btn-primary:hover { background: #43A047; }
.btn-danger { background: #E53935; color: #FFF; }
.btn-danger:hover { background: #D32F2F; }
.btn-accent { background: #67C096; color: #FFF; }
.btn-accent:hover { background: #A81848; }
.btn-secondary { background: #F5F5F5; color: #555; }
.btn-secondary:hover { background: #EEE; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* === TABLES === */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #888;
    border-bottom: 2px solid #EEE;
}
table td {
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid #F0F0F0;
    vertical-align: middle;
}
table tr:hover td { background: #FAFAFA; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.is-off td { opacity: .55; }

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-green { background: #E8F5E9; color: #2E7D32; }
.badge-orange { background: #FFF3E0; color: #E65100; }
.badge-red { background: #FFEBEE; color: #C62828; }
.badge-blue { background: #E3F2FD; color: #1565C0; }
.badge-purple { background: #EDE7F6; color: #5E35B1; }
.badge-muted { background: #F5F5F5; color: #999; }
.badge-count {
    background: #67C096;
    color: #FFF;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    margin-left: 8px;
}
.badge + .badge { margin-left: 4px; }

/* === ALERTS === */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #E8F5E9; color: #2E7D32; }
.alert-error { background: #FFEBEE; color: #C62828; }
.alert-info { background: #E3F2FD; color: #1565C0; }

/* === STATS GRID === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #FFF;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.stat-value { font-size: 32px; font-weight: 700; color: #2B2B2B; }
.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #888;
    margin-top: 4px;
}

/* === MODULE CARDS (dashboard links) === */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.module-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #FFF;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    text-decoration: none;
    color: inherit;
    transition: transform .15s, box-shadow .15s, border-color .15s;
    border: 2px solid transparent;
}
.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    border-color: #67C096;
}
.module-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #FFF;
}
.module-card__icon--pink { background: #67C096; }
.module-card__icon--blue { background: #1565C0; }
.module-card__icon--green { background: #2E7D32; }
.module-card__icon--orange { background: #E65100; }
.module-card__icon--purple { background: #5E35B1; }
.module-card h3 { font-size: 15px; font-weight: 700; color: #2B2B2B; margin-bottom: 4px; }
.module-card p { font-size: 13px; color: #888; line-height: 1.4; }

/* === UTILITIES === */
a { color: #2B2B2B; }
code { background: #F5F5F5; padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.text-center { text-align: center; }
.text-muted { color: #888; }
.text-danger { color: #C62828; }
.text-small { font-size: 13px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.flex-row { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.action-buttons { display: flex; gap: 6px; align-items: center; }
.link-muted { color: #555; text-decoration: none; font-size: 13px; }
.link-muted:hover { color: #67C096; }
.cell-title { font-weight: 700; color: #2B2B2B; text-decoration: none; }
.cell-title:hover { color: #67C096; }
.cell-sub { display: block; font-size: 12px; color: #888; margin-top: 2px; }
.empty { padding: 40px; text-align: center; color: #888; }

/* === FILTERS === */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filters .form-input { width: auto; min-width: 180px; }
.filters .grow { flex: 1; min-width: 200px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 700; text-transform: uppercase; color: #555; background: #FFF; text-decoration: none; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.tabs a.active { background: #2B2B2B; color: #FFF; }
.tabs a b { color: #67C096; margin-left: 4px; }

/* === PROGRESS === */
.progress { height: 10px; background: #EEE; border-radius: 5px; overflow: hidden; margin: 12px 0; }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, #4CAF50, #66BB6A); transition: width .3s; }

/* === STATS IFRAME === */
.stats-frame {
    width: 100%;
    min-height: 1500px;
    border: none;
    border-radius: 8px;
    background: #FFF;
}

/* === SIDEBAR COLLAPSED (desktop) === */
body.sidebar-collapsed .sidebar { width: 60px; }
body.sidebar-collapsed .sidebar-logo { font-size: 0; padding: 17px 0; text-align: center; }
body.sidebar-collapsed .sidebar-logo::before { content: 'CF'; font-size: 16px; font-weight: 700; letter-spacing: 0; color: #67C096; }
body.sidebar-collapsed .sidebar-collapse-btn { transform: rotate(180deg); margin-right: 0; }
body.sidebar-collapsed .sidebar-top { justify-content: center; }
body.sidebar-collapsed .sidebar-nav a { justify-content: center; padding: 12px 0; gap: 0; }
body.sidebar-collapsed .sidebar-nav a span,
body.sidebar-collapsed .sidebar-nav a .menu-count { display: none; }
/* Hide text nodes in nav links when collapsed — use font-size trick */
body.sidebar-collapsed .sidebar-nav a { font-size: 0; }
body.sidebar-collapsed .sidebar-nav a svg { width: 20px; height: 20px; }
body.sidebar-collapsed .sidebar-sep { font-size: 0; margin: 8px 0 0; height: 1px; background: #444; }
body.sidebar-collapsed .sidebar-footer { padding: 12px 0; text-align: center; }
body.sidebar-collapsed .sidebar-footer a { justify-content: center; font-size: 0; gap: 0; }
body.sidebar-collapsed .sidebar-footer a svg { width: 18px; height: 18px; }
body.sidebar-collapsed .sidebar-nav a.active { border-right: 3px solid #67C096; }
body.sidebar-collapsed .main { margin-left: 60px; }

/* Tooltip on hover when collapsed */
body.sidebar-collapsed .sidebar-nav a { position: relative; }
body.sidebar-collapsed .sidebar-nav a::after {
    content: attr(data-tip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #2B2B2B;
    color: #FFF;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
    margin-left: 8px;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
body.sidebar-collapsed .sidebar-nav a:hover::after { opacity: 1; }

/* Smooth transition */
.sidebar { transition: width .25s ease; }
.main { transition: margin-left .25s ease; }

/* === BURGER & MOBILE === */
.burger { display: none; background: none; border: 0; color: #2B2B2B; padding: 4px; margin-right: 4px; cursor: pointer; }
.sidebar-backdrop { display: none; }

/* === MENU COUNT BADGE === */
.menu-count { margin-left: auto; background: #67C096; color: #FFF; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; }

/* === MODAL === */
.modal { margin: auto; inset: 0; border: 0; padding: 0; border-radius: 14px; width: min(760px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 24px 60px rgba(0,0,0,.3); color: inherit; }
.modal::backdrop { background: rgba(15, 23, 42, .55); }
.modal[open] { display: flex; flex-direction: column; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #eee; margin: 0; }
.modal__head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; }
.modal__close { border: 0; background: none; cursor: pointer; padding: 6px; border-radius: 8px; color: #666; display: grid; }
.modal__close:hover { background: #f2f2f2; }
.modal__body { padding: 18px 20px; overflow: auto; }
.modal__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid #eee; background: #fafafa; }
.modal__foot .grow { flex: 1; }

/* L'attribut hidden l'emporte toujours */
[hidden] { display: none !important; }

/* === RESPONSIVE === */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; box-shadow: 0 0 30px rgba(0,0,0,.3); width: 220px !important; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; }
  .sidebar-collapse-btn { display: none !important; }
  .main { margin-left: 0 !important; }
  .burger { display: inline-flex; }
  .main-header { padding: 12px 16px; position: sticky; top: 0; z-index: 50; flex-wrap: wrap; }
  .main-header h1 { font-size: 16px; }
  .main-content { padding: 16px; }
  .card { padding: 16px; }
  .form-grid-3, .form-grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .main-header__actions { width: 100%; margin-left: 0; }
  .filters .form-input { width: 100%; }
  .hide-sm { display: none; }
  .module-grid { grid-template-columns: 1fr; }
}
