/* Suivi SI Cop1 */

/* ── Corps ──────────────────────────────────────────── */

body.suivi-layout {
    background-color: var(--cop1-cream);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.9rem;
    -webkit-font-smoothing: antialiased;
}

/* ── Navbar override ────────────────────────────────── */

body.suivi-layout .navbar-cop1 {
    background: #1e2229;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    box-shadow: none;
}

body.suivi-layout .navbar-cop1 .navbar-brand {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

body.suivi-layout .navbar-cop1 .navbar-brand::before {
    display: none;
}

body.suivi-layout .navbar-cop1 .suivi-active {
    color: #fff !important;
    background: rgba(255,255,255,0.08) !important;
}

/* ── Layout split-screen château ───────────────────── */

.chateau-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 56px);
    margin: -1.5rem calc(-1 * var(--bs-gutter-x, 1.5rem) / 2) calc(-1 * var(--bs-gutter-x, 1.5rem));
    overflow: hidden;
}

.chateau-sidebar {
    background: #1e2229;
    color: #fff;
    border-right: 1px solid rgba(255,255,255,0.07);
}

.chateau-sidebar-inner {
    padding: 2rem 1.75rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Eyebrow */
.suivi-hero-eyebrow {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--cop1-coral);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Grand titre sidebar */
.chateau-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 2rem;
    font-variation-settings: 'WONK' 1, 'SOFT' 50;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin: 0;
}

.chateau-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.6;
    margin: 0.75rem 0 0;
}

/* Avancement — grand nombre, pas de ring */
.chateau-avancement {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 1.5rem;
}

.chateau-pct {
    font-family: 'Fraunces', serif;
    font-size: 3.5rem;
    font-weight: 600;
    color: #fff;
    line-height: 1;
    letter-spacing: -0.03em;
}

.chateau-pct-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.35);
    margin-top: 6px;
}

.chateau-pct-bar {
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 1px;
    margin-top: 14px;
}

.chateau-pct-bar-fill {
    height: 100%;
    background: var(--cop1-coral);
    border-radius: 1px;
    transition: width 1.2s ease;
}

/* Stats secondaires */
.chateau-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chateau-meta-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.45);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.75rem;
}

.chateau-meta-line:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.chateau-meta-line strong {
    font-family: 'Fraunces', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
}

/* Navigation rapide sidebar */
.chateau-quick-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 1.5rem;
}

.chateau-quick-nav a {
    color: rgba(255,255,255,0.45);
    text-decoration: none;
    font-size: 0.82rem;
    padding: 6px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chateau-quick-nav a:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.05);
}

.chateau-quick-nav a i {
    width: 14px;
    text-align: center;
    font-size: 0.75rem;
}

/* Légende */
.chateau-legende {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.07);
    padding-top: 1.25rem;
}

.chateau-legende-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.25);
    margin-bottom: 0.625rem;
}

.chateau-legende-items {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.cli {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
}

.cld {
    width: 12px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Zone principale (plan) */
.chateau-main {
    background: #F0EAD8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.chateau-main .chateau-wrap {
    background: #FBF6EB;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
    width: 100%;
}

/* Responsive */
@media (max-width: 860px) {
    .chateau-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .chateau-main {
        min-width: 0; /* empeche le grid item de s'elargir au-dela de 1fr */
    }
}

/* ── Château SVG ────────────────────────────────────── */

.chateau-wrap {
    background: #FBF6EB;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border: 1px solid rgba(0,0,0,0.06);
}

.chateau-svg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

@media (max-width: 600px) {
    /* Le plan SVG a un viewBox 1000x580 avec des labels fins (11-15px) :
       a width:100% sur un ecran de 375px les textes deviennent illisibles.
       On garde une largeur minimale lisible et on scrolle horizontalement. */
    .chateau-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        min-width: 0; /* empeche le flex item de s'elargir au-dela du conteneur */
    }
    .chateau-svg {
        width: 900px;
        max-width: none;
    }
}

/* Hover sur les zones */
.plan-zone-link {
    cursor: pointer;
    transition: opacity 0.15s;
}

.plan-zone-link:hover {
    opacity: 0.85;
}

.plan-zone-label {
    font-family: 'Work Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    fill: #2A0C08;
}

.plan-zone-sublabel {
    font-family: 'Work Sans', sans-serif;
    font-size: 10px;
    fill: #6A3020;
    font-style: italic;
}

.plan-zone-pct {
    font-family: 'Work Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    fill: #9A3020;
}

.plan-donjon-label {
    font-size: 15px;
    font-family: 'Fraunces', serif;
    fill: #1A0808;
}

.plan-donjon-pct { font-size: 13px; }

/* ── Page header standard ───────────────────────────── */

.suivi-page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.07);
}

.suivi-page-header .suivi-title {
    font-size: 1.6rem;
    margin-bottom: 0;
}

/* ── Typographie ────────────────────────────────────── */

.suivi-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--cop1-charcoal);
    line-height: 1.2;
}

/* ── Cards chantiers ────────────────────────────────── */

.suivi-card {
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.suivi-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.suivi-card-muted { opacity: 0.55; }

/* Accent gauche */
.suivi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
    background: var(--accent-color, #E0D8CC);
    border-radius: 12px 0 0 12px;
}

/* ── Icône chantier ─────────────────────────────────── */

.chantier-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: rgba(0,0,0,0.04);
    color: var(--cop1-coral-dark);
}

/* ── Progress bar ───────────────────────────────────── */

.suivi-progress-bar {
    background: linear-gradient(90deg, var(--cop1-coral-dark), var(--cop1-coral));
    border-radius: 4px;
}

.progress { overflow: hidden; }

/* ── Badges statut ──────────────────────────────────── */

.suivi-badge-statut-a_faire        { background: #EDE8DF; color: #6b6155; }
.suivi-badge-statut-en_cours       { background: #FEF3C7; color: #92400e; }
.suivi-badge-statut-bloque         { background: #FEE2E2; color: #991b1b; }
.suivi-badge-statut-fait           { background: #D1FAE5; color: #065f46; }
.suivi-badge-statut-hors_perimetre { background: #E3E4F1; color: #4A5478; }

.suivi-badge-priorite-must   { background: var(--cop1-coral); color: #fff; }
.suivi-badge-priorite-should { background: #f59e0b; color: #fff; }
.suivi-badge-priorite-could  { background: #E9E4DC; color: #6b6155; }
.suivi-badge-priorite-wont   { background: #E9E4DC; color: #9a9284; }
.suivi-badge-priorite-na     { background: #E9E4DC; color: #9a9284; }

/* ── Mini stat badges ───────────────────────────────── */

.suivi-mini-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 600;
}

.suivi-mini-stat-a_faire  { background: #EDE8DF; color: #6b6155; }
.suivi-mini-stat-en_cours { background: #FEF3C7; color: #92400e; }
.suivi-mini-stat-bloque   { background: #FEE2E2; color: #991b1b; }
.suivi-mini-stat-fait     { background: #D1FAE5; color: #065f46; }

/* ── Decision tag ───────────────────────────────────── */

.suivi-decision-tag {
    background: var(--cop1-cream-dark);
    border-left: 2px solid var(--cop1-coral);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.82rem;
    color: #5a5049;
}

/* ── Commentaires ───────────────────────────────────── */

.suivi-comments { display: flex; flex-direction: column; gap: 8px; }

.suivi-comment {
    background: var(--cop1-cream-dark);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.88rem;
}

/* ── Boutons ────────────────────────────────────────── */

.btn-outline-cop1 {
    border: 1.5px solid var(--cop1-coral);
    color: var(--cop1-coral-dark);
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.15s;
}

.btn-outline-cop1:hover {
    background: var(--cop1-coral);
    color: #fff;
}

/* ── Filtres ────────────────────────────────────────── */

.suivi-filtres select, .suivi-filtres input {
    min-width: 140px;
    border-radius: 8px;
}

/* ── Tickets ────────────────────────────────────────── */

.suivi-ticket-titre { font-size: 0.875rem; }
.suivi-tickets-table td { vertical-align: middle; }

.suivi-statut-select {
    border: none;
    border-radius: 6px;
    padding: 3px 7px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    max-width: 140px;
}

.suivi-statut-select.statut-a_faire       { background: #EDE8DF; color: #6b6155; }
.suivi-statut-select.statut-en_cours      { background: #FEF3C7; color: #92400e; }
.suivi-statut-select.statut-bloque        { background: #FEE2E2; color: #991b1b; }
.suivi-statut-select.statut-fait          { background: #D1FAE5; color: #065f46; }
.suivi-statut-select.statut-hors_perimetre{ background: #E3E4F1; color: #4A5478; }
.suivi-statut-select:hover                { filter: brightness(0.95); }

.suivi-comment-btn { font-size: 0.85rem; opacity: 0.4; }
.suivi-comment-btn:hover { opacity: 1; color: var(--cop1-coral) !important; }

/* ── Chantiers — vue liste ──────────────────────────── */

.chantier-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(0,0,0,0.3);
    font-weight: 600;
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
}

/* Socle — bande fondation */
.chantier-featured {
    display: grid;
    grid-template-columns: 2.75rem 1fr auto;
    gap: 1.25rem;
    align-items: start;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-left: 3px solid var(--cop1-coral);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.chantier-featured:hover {
    background: #FAFAF9;
    color: inherit;
}

.chantier-featured-icon {
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--cop1-coral-dark);
    background: var(--cop1-cream-dark);
    border-radius: 10px;
    flex-shrink: 0;
}

.chantier-featured-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cop1-charcoal);
    margin-bottom: 0.2rem;
}

.chantier-featured-desc {
    font-size: 0.8rem;
    color: rgba(0,0,0,0.4);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.chantier-pct {
    font-family: 'Fraunces', serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--cop1-charcoal);
    line-height: 1;
    white-space: nowrap;
    padding-top: 0.1rem;
}

/* Barre de progression fine */
.chantier-bar {
    height: 3px;
    background: rgba(0,0,0,0.07);
    border-radius: 2px;
}

.chantier-bar-fill {
    height: 100%;
    background: var(--cop1-coral);
    border-radius: 2px;
}

/* Table liste */
.chantier-table {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    overflow: hidden;
}

.chantier-row {
    display: grid;
    grid-template-columns: 2.25rem 1fr 3.5rem;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    align-items: start;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.chantier-row:last-child { border-bottom: none; }
.chantier-row:hover { background: #FAFAF9; color: inherit; }

.chantier-row-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: rgba(0,0,0,0.25);
    background: rgba(0,0,0,0.03);
    border-radius: 8px;
    flex-shrink: 0;
    margin-top: 1px;
}

.chantier-row-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--cop1-charcoal);
    line-height: 1.35;
    margin-bottom: 0.3rem;
}

.chantier-row-desc {
    font-size: 0.78rem;
    color: rgba(0,0,0,0.38);
    line-height: 1.5;
    margin-bottom: 0.35rem;
}

.chantier-row-stats {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.chantier-row-pct {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(0,0,0,0.35);
    text-align: right;
    white-space: nowrap;
    padding-top: 2px;
}

.chantier-row-muted { opacity: 0.4; }

/* ── Légende (compat) ───────────────────────────────── */

.legende-echafaudage, .legende-pierre {
    display: inline-block;
    width: 12px; height: 12px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 3px;
}

.legende-echafaudage {
    background: repeating-linear-gradient(45deg, #b9a687, #b9a687 2px, transparent 2px, transparent 6px);
    border: 1px dashed #8c7a5f;
}

.legende-pierre {
    background: linear-gradient(135deg, #c44a3a, var(--cop1-coral));
}

/* ── Alpine.js ──────────────────────────────────────── */

[x-cloak] { display: none !important; }

/* ── Château — panneaux sidebar Alpine ─────────────── */

.chateau-panel {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Titre de zone (panel B hover) */
.chateau-zone-title {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.8rem;
    font-variation-settings: 'WONK' 1, 'SOFT' 30;
    color: #fff;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin: 0;
}

.chateau-zone-desc {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.6;
    margin: 0;
}

.chateau-zone-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cop1-coral);
    text-decoration: none;
    border-bottom: 1px solid rgba(223,95,77,0.3);
    padding-bottom: 2px;
    transition: border-color 0.15s;
    margin-top: auto;
}

.chateau-zone-cta:hover {
    color: #f4a69b;
    border-color: #f4a69b;
}


/* Sidebar inner : retire le padding/flex (géré par .chateau-panel) */
.chateau-sidebar-inner {
    padding: 0;
    gap: 0;
    position: relative;
}

/* ── Arbre des technologies ─────────────────────────── */

.arbre-main {
    background: #1D1510 !important;
    overflow: auto !important;
    display: block !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    height: calc(100vh - 56px);
    cursor: grab;
    user-select: none;
}

.arbre-main.arbre-grabbing,
.arbre-main.arbre-grabbing * {
    cursor: grabbing !important;
}

.arbre-scroll-wrap {
    padding: 1.5rem;
    min-width: min-content;
}

.arbre-svg {
    display: block;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
}

.arbre-zone-link {
    cursor: pointer;
    outline: none;
}

.arbre-zone-link g {
    transition: filter 0.18s;
}

.arbre-zone-link:hover g {
    filter: brightness(1.1);
}

.arbre-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.45);
    font-size: 0.78rem;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    width: 100%;
    font-family: 'Inter', sans-serif;
}

.arbre-back-btn:hover {
    background: rgba(255,255,255,0.09);
    color: rgba(255,255,255,0.75);
}

.arbre-sidebar-tier {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.arbre-sidebar-tier--plan         { background: #263458; color: #90B8E8; }
.arbre-sidebar-tier--debut        { background: #352210; color: #E0B860; }
.arbre-sidebar-tier--construction { background: #3A230A; color: #F0C060; }
.arbre-sidebar-tier--avance       { background: #3A1510; color: #FF9878; }
.arbre-sidebar-tier--acheve       { background: #352A12; color: #F8DC80; }
.arbre-sidebar-tier--bloque       { background: #2A1228; color: #D09098; }
