/* === Sistema de marca GaeliKA · Herramienta de propuestas PEIDi === */
:root {
    --gael-blue: #4FA3D1;
    --ka-green: #6BC46D;
    --deep-blue: #1F4E79;
    --tech-gray: #4A4A4A;
    --light-gray: #E9EEF2;
    --white: #FFFFFF;
    --warn: #f39c12;
    --danger: #d32f2f;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--tech-gray);
    background: #f0f2f5;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--gael-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== LANDING ===== */
.landing-body { min-height: 100vh; background-image: linear-gradient(135deg, #ffffff 60%, var(--light-gray) 100%); }

.page { max-width: 1240px; margin: 0 auto; padding: 24px 28px; min-height: 100vh; display: flex; flex-direction: column; }

.page-header {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: 24px; border-bottom: 1px solid var(--light-gray);
    margin-bottom: 32px; gap: 30px; flex-wrap: wrap;
}
.header-logos { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.header-logos img { display: block; object-fit: contain; width: auto; }
.logo-bioef        { max-height: 60px; }
.logo-osakidetza   { max-height: 50px; }
.logo-departamento { max-height: 38px; }
.logo-gaelika      { max-height: 38px; }

.landing-main { flex-grow: 1; }
.landing-hero { text-align: center; margin-bottom: 40px; }
.cover-line { width: 80px; height: 5px; background: var(--ka-green); margin: 0 auto 18px; }
.landing-hero h1 { font-size: 42px; font-weight: 800; color: var(--deep-blue); margin: 0 0 12px; text-transform: uppercase; letter-spacing: -0.5px; }
.hero-subtitle { font-size: 17px; color: var(--tech-gray); margin: 0; }

.alert-error {
    background: #fdecea; border-left: 4px solid var(--danger);
    color: #b71c1c; padding: 14px 20px; border-radius: 6px;
    margin: 0 auto 28px; max-width: 800px; font-size: 14.5px;
}
.match-hint {
    background: #e8f4fc; border: 1px solid #b8defa; border-left: 4px solid var(--gael-blue);
    color: var(--deep-blue); padding: 10px 14px; border-radius: 6px; font-size: 13px; line-height:1.45;
}

.landing-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; max-width: 1000px; margin: 0 auto; }
.entry-card {
    background: white; border: 1px solid var(--light-gray); border-radius: 16px;
    padding: 30px 32px; box-shadow: 0 4px 20px rgba(0,0,0,0.04); text-align: center;
    border-top: 6px solid var(--gael-blue);
}
.entry-card-coordinator { border-top-color: var(--ka-green); }
.entry-card-icon {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--light-gray); color: var(--deep-blue);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; margin: 0 auto 18px;
}
.entry-card-coordinator .entry-card-icon { background: rgba(107,196,109,0.15); color: var(--ka-green); }
.entry-card h2 { font-size: 22px; color: var(--deep-blue); margin: 0 0 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.entry-card > p { color: var(--tech-gray); font-size: 14px; margin: 0 0 22px; }

.entry-form { text-align: left; display: flex; flex-direction: column; gap: 10px; }
.entry-form label { font-size: 12px; font-weight: 700; color: var(--deep-blue); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 6px; }
.entry-form .optional { color: #999; font-weight: 500; text-transform: none; letter-spacing: 0; }
.entry-form input, .entry-form select, .entry-form textarea {
    padding: 11px 14px; border: 1px solid #d0d7de; border-radius: 8px;
    font-family: inherit; font-size: 15px; color: var(--tech-gray);
    background: white; transition: border-color 0.15s, box-shadow 0.15s;
}
.entry-form input:focus, .entry-form select:focus, .entry-form textarea:focus {
    outline: none; border-color: var(--gael-blue); box-shadow: 0 0 0 3px rgba(79,163,209,0.15);
}

.btn-primary {
    margin-top: 14px; background: var(--gael-blue); color: white; border: none;
    padding: 13px 22px; border-radius: 8px; font-family: inherit; font-size: 15px;
    font-weight: 700; cursor: pointer; transition: background-color 0.15s, transform 0.15s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-primary:hover { background: #3d8bb8; transform: translateY(-1px); }
.btn-primary-green { background: var(--ka-green); }
.btn-primary-green:hover { background: #58b15a; }

.landing-footer-note { margin: 40px auto 0; max-width: 800px; text-align: center; color: var(--tech-gray); font-size: 13.5px; line-height: 1.5; }
.page-footer { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--light-gray); text-align: center; color: #999; font-size: 12.5px; }


/* ===== APP HEADER ===== */
.app-body { background: #f0f2f5; min-height: 100vh; }
.app-header {
    background: white; border-bottom: 1px solid var(--light-gray);
    padding: 14px 24px; display: flex; justify-content: space-between;
    align-items: center; gap: 16px; flex-wrap: wrap;
    position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.coord-header { border-top: 4px solid var(--ka-green); }
.header-left, .header-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.header-code { font-size: 14px; color: var(--tech-gray); }
.header-code strong { color: var(--deep-blue); letter-spacing: 4px; }
.header-badge-coord { background: var(--ka-green); color: white; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; }
.header-eje { padding: 5px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 700; }
.header-participant { font-size: 14px; color: var(--tech-gray); }
.header-stage { background: var(--light-gray); color: var(--deep-blue); padding: 6px 14px; border-radius: 20px; font-size: 12.5px; font-weight: 700; }
.header-stage.stage-phase1, .header-stage.phase1 { background: rgba(79,163,209,0.18); color: var(--gael-blue); }
.header-stage.stage-phase2, .header-stage.phase2 { background: rgba(243,156,18,0.18); color: #b8770b; }
.header-stage.stage-phase3, .header-stage.phase3 { background: rgba(107,196,109,0.18); color: var(--ka-green); }
.header-stage.stage-phase4, .header-stage.phase4 { background: rgba(31,78,121,0.18); color: var(--deep-blue); }
.header-stage.stage-results, .header-stage.results { background: rgba(31,78,121,0.18); color: var(--deep-blue); }
.header-stage.stage-closed, .header-stage.closed { background: #f0f0f0; color: #777; }


/* ===== MAIN ===== */
.app-main { max-width: 1240px; margin: 0 auto; padding: 20px 22px 80px; }
.coord-main { max-width: 1380px; }

/* === Stage banner === */
.stage-banner {
    background: white; border: 1px solid var(--light-gray);
    border-left: 6px solid var(--gael-blue); border-radius: 12px;
    padding: 18px 22px; margin-bottom: 20px;
    display: flex; justify-content: space-between; align-items: center; gap: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.stage-banner.phase1 { border-left-color: var(--gael-blue); }
.stage-banner.phase2 { border-left-color: var(--warn); }
.stage-banner.phase3 { border-left-color: var(--ka-green); }
.stage-banner.phase4 { border-left-color: var(--deep-blue); }
.stage-banner.results { border-left-color: var(--deep-blue); }
.stage-banner.waiting { border-left-color: #999; }
.stage-banner.closed { border-left-color: #999; background: #fafafa; }
.stage-content { display: flex; align-items: center; gap: 16px; flex-grow: 1; }
.stage-icon { width: 48px; height: 48px; border-radius: 50%; background: var(--light-gray); color: var(--deep-blue); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.stage-text h3 { margin: 0 0 4px; color: var(--deep-blue); font-size: 17px; }
.stage-text p { margin: 0; font-size: 13.5px; color: var(--tech-gray); line-height: 1.4; }
.stage-meta { font-size: 13px; color: var(--tech-gray); text-align: right; }
.stage-side { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }

/* === Temporizador === */
.session-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(31,78,121,0.10);
    color: var(--deep-blue);
    padding: 8px 16px;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.session-timer .timer-display { font-size: 17px; letter-spacing: 0.5px; }
.session-timer .timer-total   { color: #888; font-weight: 500; font-size: 12px; }
.session-timer .timer-flag    { background: white; color: var(--danger); padding: 2px 9px; border-radius: 10px; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; margin-left: 4px; }
.session-timer.timer-warning  { background: rgba(243,156,18,0.20); color: #b8770b; animation: timer-pulse 1.5s ease-in-out infinite; }
.session-timer.timer-expired  { background: rgba(211,47,47,0.15); color: var(--danger); }
@keyframes timer-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(243,156,18,0); }
    50%     { box-shadow: 0 0 0 6px rgba(243,156,18,0.15); }
}

/* === Card expandible === */
.item-card .item-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px; color: var(--tech-gray); line-height: 1.5;
    margin: 0;
}
.item-card.expanded .item-desc {
    -webkit-line-clamp: unset;
    overflow: visible;
    display: block;
}
.item-card .item-extra { display: none; }
.item-card.expanded .item-extra { display: block; }
.item-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px dashed var(--light-gray);
    color: var(--gael-blue);
    cursor: pointer;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 16px;
    margin-top: 10px;
}
.item-toggle:hover { background: rgba(79,163,209,0.08); border-color: var(--gael-blue); }

/* === Indicadores en la ficha === */
.item-indicadores {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--light-gray);
}
.item-card.expanded .item-indicadores { display: block; }
.indicadores-title {
    font-size: 12.5px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.6px; color: var(--deep-blue); margin-bottom: 8px;
    display: flex; align-items: center; gap: 8px;
}
.indicadores-title i { color: var(--ka-green); }
.indicadores-count { background: var(--ka-green); color: white; padding: 1px 8px; border-radius: 10px; font-size: 10.5px; }
.indicador-card {
    background: rgba(107,196,109,0.06);
    border: 1px solid rgba(107,196,109,0.30);
    border-left: 4px solid var(--ka-green);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
}
.indicador-card:last-child { margin-bottom: 0; }
.indicador-nombre { font-size: 13.5px; font-weight: 700; color: var(--deep-blue); margin-bottom: 4px; }
.indicador-desc { font-size: 13px; color: var(--tech-gray); margin-bottom: 6px; line-height: 1.45; }
.indicador-meta { margin: 0; font-size: 12.5px; color: var(--tech-gray); line-height: 1.55; }
.indicador-meta dt { display: inline; font-weight: 700; color: var(--deep-blue); }
.indicador-meta dd { display: inline; margin: 0 0 0 4px; }
.indicador-meta div { margin-bottom: 2px; }

/* === Indicadores en la modal (form) === */
.indicadores-section {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px dashed rgba(107,196,109,0.40);
    border-radius: 10px;
    background: rgba(107,196,109,0.04);
}
.indicadores-section-head { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; color: var(--deep-blue); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.indicadores-section-head i { color: var(--ka-green); }
.indicador-block {
    background: white;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    position: relative;
}
.indicador-block-head {
    font-size: 12px; font-weight: 800; color: var(--deep-blue);
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex; align-items: center; justify-content: space-between;
}
.indicador-remove {
    background: transparent; border: none; color: var(--danger);
    cursor: pointer; padding: 2px 6px; font-size: 14px;
}
.indicador-remove:hover { color: #b71c1c; }
.indicador-block .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.indicador-block label { margin-top: 8px; margin-bottom: 2px; }
@media (max-width: 540px) {
    .indicador-block .grid-2 { grid-template-columns: 1fr; }
}

/* === Votes tracker === */
.votes-tracker {
    background: rgba(107,196,109,0.10); border: 1px solid rgba(107,196,109,0.35);
    border-radius: 10px; padding: 12px 18px; margin-bottom: 18px;
    display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
    font-size: 14px; color: var(--deep-blue);
}
.votes-tracker .votes-quadrant { background: white; padding: 5px 12px; border-radius: 16px; font-weight: 600; border: 1px solid rgba(107,196,109,0.35); }
.votes-tracker .votes-quadrant.filled { background: var(--ka-green); color: white; border-color: var(--ka-green); }

/* === Items list === */
.items-container { display: flex; flex-direction: column; gap: 12px; }
.loading { padding: 40px; text-align: center; color: #999; font-size: 14px; }

.item-card {
    background: white; border: 1px solid var(--light-gray);
    border-left: 5px solid var(--gael-blue); border-radius: 10px;
    padding: 14px 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: box-shadow 0.15s, transform 0.15s;
}
.item-card.origin-pacto    { border-left-color: var(--deep-blue); }
.item-card.origin-encuesta { border-left-color: var(--gael-blue); }
.item-card.origin-nueva    { border-left-color: var(--ka-green); background: linear-gradient(135deg, rgba(107,196,109,0.06), white 40%); }
.item-card.mine            { background: linear-gradient(135deg, rgba(243,156,18,0.06), white 40%); }
.item-card.top10           { border: 1px solid var(--warn); border-left: 5px solid var(--warn); }
.item-card.top3            { border: 2px solid var(--ka-green); border-left: 5px solid var(--ka-green); background: linear-gradient(135deg, rgba(107,196,109,0.10), white 40%); }

.item-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.item-tag {
    font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
    padding: 2px 9px; border-radius: 10px; background: var(--light-gray); color: var(--tech-gray);
}
.item-tag-pacto    { background: var(--deep-blue); color: white; }
.item-tag-encuesta { background: var(--gael-blue); color: white; }
.item-tag-nueva    { background: var(--ka-green); color: white; }
.item-tag-mine     { background: var(--warn); color: white; }
.item-tag-top10    { background: #fbeacd; color: #b8770b; border: 1px solid var(--warn); }
.item-tag-top3     { background: var(--ka-green); color: white; }
.item-tag-locked   { background: #eceff3; color: #6b7280; border: 1px solid #cbd5e0; }
.item-tag-locked i { color: #6b7280; }
.item-tag-objetivo { color: #fff; }
.item-tag-objetivo i { color: #fff; margin-right: 1px; }

.item-title { font-size: 16px; font-weight: 700; color: var(--deep-blue); margin: 0 0 6px; line-height:1.35; }
.item-desc  { font-size: 14px; color: var(--tech-gray); margin: 0; line-height:1.5; }
.item-extra { margin-top: 10px; font-size: 13px; color: var(--tech-gray); line-height: 1.5; }
.item-extra dt { font-weight: 700; color: var(--deep-blue); display: inline; }
.item-extra dd { display: inline; margin: 0 0 0 4px; }
.item-extra .row { margin-bottom: 4px; }

.item-meta { display: flex; gap: 14px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--light-gray); font-size: 12.5px; color: #888; flex-wrap: wrap; }
.item-meta i { margin-right: 4px; }

.item-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.item-btn {
    background: white; border: 1px solid var(--light-gray); color: var(--deep-blue);
    padding: 7px 14px; border-radius: 18px; font-family: inherit; font-size: 12.5px;
    font-weight: 600; cursor: pointer; transition: all 0.15s;
    display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.item-btn:hover { background: var(--light-gray); text-decoration: none; }
.item-btn.btn-comment { border-color: var(--gael-blue); color: var(--gael-blue); }
.item-btn.btn-comment:hover { background: var(--gael-blue); color: white; }
.item-btn.btn-edit { border-color: var(--warn); color: var(--warn); }
.item-btn.btn-edit:hover { background: var(--warn); color: white; }
.item-btn.btn-danger { border-color: var(--danger); color: var(--danger); }
.item-btn.btn-danger:hover { background: var(--danger); color: white; }

/* Voting buttons 5/3/1 */
.vote-group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.vote-btn {
    border: 2px solid var(--light-gray); background: white; color: var(--tech-gray);
    padding: 7px 14px; border-radius: 18px; font-family: inherit; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px;
}
.vote-btn:hover { border-color: var(--ka-green); color: var(--ka-green); }
.vote-btn.active { background: var(--ka-green); color: white; border-color: var(--ka-green); }
.vote-btn.disabled { opacity: 0.45; cursor: not-allowed; }
.vote-btn[data-points="5"].active { background: #228e25; border-color: #228e25; }
.vote-btn[data-points="3"].active { background: var(--ka-green); border-color: var(--ka-green); }
.vote-btn[data-points="1"].active { background: #9bd49d; border-color: #9bd49d; color: var(--deep-blue); }
.vote-clear { color: #888; background: transparent; border: none; font-size: 12px; text-decoration: underline; cursor: pointer; }
.vote-group.vote-locked { margin-top: 12px; }
.vote-locked-msg {
    display: inline-flex; align-items: center; gap: 7px;
    background: #fff6e5; color: #8a5a00; border: 1px dashed #e0b25a;
    padding: 7px 12px; border-radius: 12px; font-size: 12.5px; font-weight: 600;
}

.vote-score { font-size: 13px; color: var(--tech-gray); margin-left: 8px; }
.vote-score strong { color: var(--deep-blue); }

/* Score bar */
.score-bar { margin-top: 10px; height: 6px; background: var(--light-gray); border-radius: 4px; overflow: hidden; }
.score-bar-fill { height: 100%; background: var(--warn); transition: width 0.3s; }

/* === Add proposal === */
.btn-add {
    background: var(--ka-green); color: white; border: none;
    padding: 12px 22px; border-radius: 24px; font-family: inherit; font-size: 14px;
    font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
}
.btn-add:hover { background: #58b15a; }
.btn-add[disabled] { opacity: 0.4; cursor: not-allowed; }
.muted { color: #888; font-size: 13px; margin-left: 14px; }

/* === Coordinator panels === */
.coord-panel { background: white; border: 1px solid var(--light-gray); border-radius: 12px; padding: 22px 26px; margin-bottom: 22px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }
.panel-title-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.panel-title { color: var(--deep-blue); font-size: 16px; margin: 0 0 16px; text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 8px; }
.panel-title i { color: var(--gael-blue); }
.panel-actions { display: flex; gap: 10px; }

.invite-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; }
.invite-box { background: #f8fafc; border: 1px solid var(--light-gray); border-radius: 8px; padding: 14px 18px; }
.invite-label { display: block; font-size: 11px; color: var(--gael-blue); font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.invite-value-row { display: flex; align-items: center; gap: 10px; }
.invite-value-row code { font-family: 'Montserrat', monospace; color: var(--deep-blue); font-size: 13.5px; background: white; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--light-gray); flex: 1; word-break: break-all; }
.invite-code { font-weight: 800; font-size: 18px !important; letter-spacing: 4px; }
.invite-count { font-size: 32px; font-weight: 800; color: var(--ka-green); display: block; }
.btn-copy { background: var(--gael-blue); color: white; border: none; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; flex-shrink: 0; }
.btn-copy:hover { background: #3d8bb8; }

.stage-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stage-btn {
    background: white; border: 1px solid var(--light-gray); border-top: 4px solid #ccc;
    border-radius: 10px; padding: 14px 12px; cursor: pointer; transition: all 0.15s;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--deep-blue); font-family: inherit; font-size: 14px; font-weight: 700; text-align: center;
}
.stage-btn:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); transform: translateY(-1px); }
.stage-btn.active { background: var(--deep-blue); color: white; }
.stage-btn.active small { color: rgba(255,255,255,0.85); }
.stage-btn small { display: block; color: #999; font-weight: 500; font-size: 11px; margin-top: 4px; }
.stage-btn i { font-size: 18px; margin-bottom: 4px; }
.stage-btn-close { border-top-color: var(--danger); }
.stage-btn-close:hover { background: var(--danger); color: white; border-color: var(--danger); }

.btn-export {
    background: var(--ka-green); color: white; border: none;
    padding: 9px 16px; border-radius: 20px; font-family: inherit; font-size: 13px;
    font-weight: 700; cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-export:hover { background: #58b15a; text-decoration: none; color: white; }

/* Lista participantes */
.participants-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.participant-chip {
    background: #f8fafc; border: 1px solid var(--light-gray); border-radius: 24px;
    padding: 8px 14px; display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.participant-chip.online { border-color: var(--ka-green); background: rgba(107,196,109,0.06); }
.participant-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #ccc; flex-shrink: 0; }
.participant-chip.online .dot { background: var(--ka-green); box-shadow: 0 0 0 3px rgba(107,196,109,0.18); }
.participant-chip .pname { font-weight: 700; color: var(--deep-blue); }
.participant-chip .pent { color: #888; font-size: 12px; }

/* === Filtro de propuestas por objetivo (asistentes) === */
.objetivo-filter {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: 4px 0 14px;
}
.obj-filter-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #fff; color: var(--deep-blue);
    border: 1px solid var(--light-gray);
    border-radius: 999px; padding: 5px 12px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.obj-filter-chip:hover { border-color: var(--gael-blue); }
.obj-filter-chip.active { color: #fff; border-color: var(--deep-blue); }
.obj-filter-count {
    font-size: 11.5px; font-weight: 700;
    background: rgba(0,0,0,0.07); border-radius: 999px;
    padding: 1px 7px; min-width: 18px; text-align: center;
}
.obj-filter-chip.active .obj-filter-count { background: rgba(255,255,255,0.28); }

/* === Objetivos panel (reparto de propuestas por objetivo del eje) === */
.objetivos-panel .panel-title .muted,
.objetivos-panel-participant .panel-title .muted { font-weight: 500; color: #777; font-size: 13px; margin-left: 4px; }
.objetivos-panel-participant {
    background: white; border: 1px solid var(--light-gray);
    border-radius: 12px; padding: 14px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    margin-bottom: 18px;
}
.objetivos-list { display: flex; flex-direction: column; gap: 10px; }
.objetivo-row { border: 1px solid var(--light-gray); border-radius: 8px; padding: 8px 12px; background: #fafbfc; }
.objetivo-row-sin { background: #f5f5f5; }
.objetivo-row-head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.objetivo-code { font-weight: 800; color: var(--deep-blue); flex-shrink: 0; font-size: 12.5px; letter-spacing: 0.3px; }
.objetivo-label { color: var(--tech-gray); flex-grow: 1; }
.objetivo-count { color: var(--deep-blue); font-size: 12.5px; white-space: nowrap; }
.objetivo-count strong { font-size: 15px; }
.objetivo-bar { background: var(--light-gray); height: 6px; border-radius: 4px; overflow: hidden; margin-top: 6px; }
.objetivo-bar-fill { height: 100%; transition: width 0.25s; }

/* Admin table */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--light-gray); text-align: left; }
.admin-table th { background: #f8fafc; color: var(--deep-blue); text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
.admin-table tbody tr:hover { background: #f8fafc; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 14px; font-size: 11.5px; font-weight: 700; }
.badge-closed { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 10.5px; font-weight: 700; background: #f0f0f0; color: #777; margin-left: 4px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal { background: white; border-radius: 12px; width: 92%; max-width: 700px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--light-gray); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; color: var(--deep-blue); font-size: 17px; }
.modal-close { background: transparent; border: none; cursor: pointer; font-size: 20px; color: #777; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex-grow: 1; }
.modal-body label { display:block; font-size:12px; font-weight:700; color: var(--deep-blue); text-transform:uppercase; letter-spacing: 0.5px; margin: 12px 0 4px; }
.modal-body input[type="text"], .modal-body input[type="number"], .modal-body textarea, .modal-body select {
    width: 100%; padding: 10px 12px; border: 1px solid #d0d7de; border-radius: 8px;
    font-family: inherit; font-size: 14px; box-sizing: border-box;
}
.modal-body textarea { min-height: 90px; resize: vertical; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--light-gray); }
.modal-actions button { padding: 9px 18px; border-radius: 8px; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.btn-cancel { background: white; border-color: #d0d7de; color: var(--tech-gray); }
.btn-save   { background: var(--gael-blue); border-color: var(--gael-blue); color: white; }
.btn-save:hover { background: #3d8bb8; }

/* Toast */
.toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
    background: var(--deep-blue); color: white; padding: 10px 18px; border-radius: 22px;
    font-size: 13px; box-shadow: 0 4px 14px rgba(0,0,0,0.15);
    opacity: 0; transition: opacity 0.25s; z-index: 300; pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--ka-green); }

/* Responsivo */
@media (max-width: 720px) {
    .landing-cards { grid-template-columns: 1fr; }
    .invite-grid { grid-template-columns: 1fr; }
    .stage-controls { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Comentarios sobre propuestas (visibles para todos los roles)
   Añadido 2026-06-15
   ============================================================ */
.item-comments {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--light-gray);
}
.comments-head {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--deep-blue);
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
}
.comments-head i { color: var(--gael-blue); }
.comments-count {
    background: var(--gael-blue);
    color: white;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 700;
}
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}
.comment {
    background: #f8fafc;
    border: 1px solid var(--light-gray);
    border-left: 3px solid var(--gael-blue);
    border-radius: 8px;
    padding: 8px 12px;
}
.comment-coord {
    border-left-color: var(--ka-green);
    background: rgba(107,196,109,0.07);
}
.comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}
.comment-author {
    font-size: 12px;
    font-weight: 700;
    color: var(--deep-blue);
    display: flex;
    align-items: center;
    gap: 5px;
}
.comment-coord .comment-author i { color: var(--ka-green); }
.comment-entity { font-weight: 500; color: #888; }
.comment-body {
    font-size: 13.5px;
    color: #333;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}
.comment-del {
    background: transparent;
    border: none;
    color: #bbb;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1;
    flex-shrink: 0;
}
.comment-del:hover { color: var(--danger); background: rgba(0,0,0,0.04); }
.modal-sub {
    font-size: 13px;
    color: #666;
    background: var(--light-gray);
    padding: 8px 12px;
    border-radius: 8px;
    margin: 0 0 14px;
}
.modal-sub i { color: var(--gael-blue); margin-right: 5px; }


/* ============================================================
   Fusión de propuestas con IA (coordinación) — añadido 2026-06-15
   ============================================================ */
.mark-toggle {
    float: right;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--deep-blue);
    background: var(--light-gray);
    padding: 3px 10px;
    border-radius: 14px;
    cursor: pointer;
    user-select: none;
}
.mark-toggle.disabled { opacity: .45; cursor: not-allowed; }
.mark-toggle input { accent-color: var(--gael-blue); cursor: inherit; }
.item-card.marked { outline: 2px solid #7b2ff7; outline-offset: 1px; box-shadow: 0 0 0 4px rgba(123,47,247,.12); }
/* Al marcar, la propia casilla se tiñe del color de fusión para reforzar la acción */
.item-card.marked .mark-toggle { background: #7b2ff7; color: #fff; }
.item-card.marked .mark-toggle input { accent-color: #fff; }
.item-tag-fusion { background: #7b2ff7; color: #fff; }

/* ── Barra "Fusionar con IA": superpuesta y fija en la parte superior ──
   Aparece al marcar la primera propuesta (deslizándose desde arriba) y queda
   por encima del contenido (z sobre el header sticky=50, por debajo de los
   modales=200 y de los toasts=300). */
.merge-bar {
    position: fixed;
    left: 50%;
    top: 14px;
    transform: translateX(-50%);
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #7b2ff7 0%, #5b13d6 100%);
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 14px 40px rgba(91,19,214,.45);
    border-radius: 40px;
    padding: 11px 14px 11px 22px;
    color: #fff;
    max-width: calc(100vw - 24px);
    flex-wrap: wrap;
    justify-content: center;
    animation: mergeBarIn .38s cubic-bezier(.2,.9,.3,1.25);
}
@keyframes mergeBarIn {
    from { opacity: 0; transform: translate(-50%, -26px) scale(.94); }
    to   { opacity: 1; transform: translate(-50%, 0)     scale(1); }
}
.merge-bar-info { font-size: 14px; color: #fff; font-weight: 600; }
.merge-bar-info i { color: #fff; margin-right: 5px; }
.merge-bar-info strong { font-weight: 800; }
.merge-hint { font-weight: 600; font-size: 12.5px; opacity: .82; }
.merge-btn {
    background: #fff;
    color: #5b13d6;
    border: none;
    border-radius: 24px;
    padding: 11px 20px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 12px rgba(0,0,0,.18);
    transition: transform .12s ease, box-shadow .12s ease;
}
.merge-btn i { color: #f5b301; }
.merge-btn:not(:disabled) { animation: mergePulse 1.9s ease-in-out infinite; }
.merge-btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 7px 20px rgba(0,0,0,.30); }
.merge-btn:disabled { opacity: .6; cursor: not-allowed; }
@keyframes mergePulse {
    0%, 100% { box-shadow: 0 3px 12px rgba(0,0,0,.18), 0 0 0 0 rgba(255,255,255,.55); }
    50%      { box-shadow: 0 3px 12px rgba(0,0,0,.18), 0 0 0 9px rgba(255,255,255,0); }
}
.merge-clear {
    background: rgba(255,255,255,.18);
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 20px;
    padding: 9px 14px;
    transition: background .12s ease;
}
.merge-clear:hover { background: rgba(255,255,255,.32); color: #fff; }
@media (prefers-reduced-motion: reduce) {
    .merge-bar { animation: none; }
    .merge-btn:not(:disabled) { animation: none; }
}
