/* ──────────────────────────────────────────────────────────────────────────
   avui.css — Pestanya "Avui": estils de l'arbre de decisions diari
   ────────────────────────────────────────────────────────────────────────── */

/* ── Card contenidor ─────────────────────────────────────────────────────── */
.avui-card {
    padding: 0;
    overflow: hidden;
}

/* ── Barra de navegació de data ──────────────────────────────────────────── */
.avui-nav-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.avui-nav-btn {
    min-width: 2.25rem;
    padding: .3rem .6rem;
    font-size: 1.1rem;
    line-height: 1;
}

.avui-date-label {
    font-family: 'Fredoka One', sans-serif;
    font-size: 1.05rem;
    color: #1e3a5f;
    min-width: 220px;
    text-align: center;
    font-weight: 600;
}

/* ── Contenidor del node (animació fade) ─────────────────────────────────── */
.avui-node-container {
    padding: 1.25rem 1.5rem 1.5rem;
    min-height: 220px;
}

@keyframes avuiFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.avui-fade-in {
    animation: avuiFadeIn .25s ease both;
}

/* ── Botó Enrere ─────────────────────────────────────────────────────────── */
.avui-back-row {
    margin-bottom: .75rem;
}

.avui-back-btn {
    font-size: .85rem;
    padding: .3rem .75rem;
}

/* ── Node genèric ────────────────────────────────────────────────────────── */
.avui-node {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.avui-info-text {
    font-size: 1rem;
    color: #1f2937;
    margin: 0;
    line-height: 1.5;
}

.avui-info-subtext {
    font-size: .875rem;
    margin: 0;
    line-height: 1.4;
}

.avui-question-text {
    font-family: 'Fredoka One', sans-serif;
    font-size: 1.2rem;
    color: #1e3a5f;
    margin: 0;
    line-height: 1.4;
}

.avui-closing-info {
    font-size: .9rem;
    color: #92400e;
    background: #fef3c7;
    border-radius: 6px;
    padding: .4rem .75rem;
    margin: 0;
}

.avui-closing-big {
    font-family: 'Fredoka One', sans-serif;
    font-size: 2rem;
    color: #1e3a5f;
    margin: 0;
    text-align: center;
}

/* ── Branques (botons de decisió) ────────────────────────────────────────── */
.avui-branch-row {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.avui-branch-btn {
    flex: 1 1 140px;
    text-align: center;
    font-weight: 600;
    border-radius: 10px;
    padding: .65rem 1rem;
    font-size: .95rem;
}

.avui-branch-yes {
    background: #dcfce7;
    color: #14532d;
    border: 2px solid #86efac;
}
.avui-branch-yes:hover { background: #bbf7d0; }

.avui-branch-no {
    background: #fee2e2;
    color: #7f1d1d;
    border: 2px solid #fca5a5;
}
.avui-branch-no:hover { background: #fecaca; }

.avui-branch-neutral {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #cbd5e1;
}
.avui-branch-neutral:hover { background: #e2e8f0; }

/* ── Files de fills ──────────────────────────────────────────────────────── */
.avui-children-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.avui-child-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    background: #f8fafc;
    border-radius: 8px;
    padding: .5rem .75rem;
}

.avui-child-icon { font-size: 1.1rem; }

.avui-child-name {
    font-weight: 600;
    color: #1f2937;
    min-width: 90px;
}

.avui-child-route {
    color: #6b7280;
    font-size: .875rem;
}

.avui-child-action { margin-left: auto; }

.avui-status-text {
    font-size: .875rem;
    color: #6b7280;
    font-style: italic;
}

/* ── Pills d'estat ───────────────────────────────────────────────────────── */
.avui-status-pill {
    display: inline-block;
    border-radius: 99px;
    padding: .2rem .65rem;
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}

.avui-pill-covered   { background: #dcfce7; color: #14532d; }
.avui-pill-partial   { background: #fef3c7; color: #92400e; }
.avui-pill-pending   { background: #fef9c3; color: #854d0e; }
.avui-pill-uncovered { background: #fee2e2; color: #7f1d1d; }
.avui-pill-complete  {
    background: #15803d;
    color: #fff;
    font-family: 'Fredoka One', sans-serif;
    font-size: 1rem;
    padding: .35rem 1rem;
}

/* ── Node missió completa ────────────────────────────────────────────────── */
.avui-node-complete {
    align-items: flex-start;
}

.avui-secondary-actions {
    opacity: .7;
}

/* ── Files d'ofertes disponibles ─────────────────────────────────────────── */
.avui-offers-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.avui-offer-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
    background: #f0f9ff;
    border-radius: 8px;
    padding: .5rem .75rem;
    border: 1px solid #bae6fd;
}

.avui-offer-conductor { font-weight: 600; color: #0c4a6e; }
.avui-offer-route     { color: #6b7280; font-size: .875rem; }
.avui-offer-time      { color: #475569; font-size: .875rem; }
.avui-offer-places    { color: #0369a1; font-weight: 600; font-size: .875rem; }

.avui-reserve-btn, .avui-cancel-btn {
    margin-left: auto;
    font-size: .85rem;
    padding: .3rem .7rem;
}

/* ── Resum d'ofertes pròpies (missió completa) ───────────────────────────── */
.avui-offers-summary {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-top: .5rem;
}

.avui-offer-summary {
    font-size: .875rem;
    color: #374151;
    background: #f8fafc;
    border-radius: 6px;
    padding: .4rem .75rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ── Formularis inline ───────────────────────────────────────────────────── */
.avui-form {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-width: 480px;
}

.avui-form-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.avui-form-row label {
    min-width: 110px;
    font-size: .9rem;
    color: #374151;
    font-weight: 500;
}

.avui-form-row input[type=number],
.avui-form-row select {
    flex: 1 1 160px;
    padding: .35rem .6rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .9rem;
}

.avui-reserve-row {
    align-items: flex-start;
}

.avui-child-checks {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.avui-child-check {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .875rem;
    background: #f3f4f6;
    border-radius: 6px;
    padding: .25rem .5rem;
    cursor: pointer;
}

.avui-form-msg {
    font-size: .875rem;
    color: #dc2626;
    min-height: 1.2rem;
}

/* ── Acció row (botons d'enviament) ──────────────────────────────────────── */
.avui-action-row {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ── Banner de canvi d'estat ─────────────────────────────────────────────── */
.avui-changed-banner {
    background: #fef9c3;
    border: 1px solid #fde047;
    border-radius: 8px;
    padding: .5rem .75rem;
    font-size: .9rem;
    color: #713f12;
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}

/* ── Node descobert (alerta) ─────────────────────────────────────────────── */
.avui-node-uncovered .avui-info-text {
    color: #7f1d1d;
}

/* ── Node dia passat ─────────────────────────────────────────────────────── */
.avui-node-past {
    opacity: .9;
}

/* ── Demanda demand-btn ──────────────────────────────────────────────────── */
.avui-demand-btn {
    font-size: .875rem;
    padding: .3rem .65rem;
}

/* ── Divisor visual ──────────────────────────────────────────────────────── */
.avui-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: .75rem 0 .5rem;
    width: 100%;
}

/* ── Historial d'accions ─────────────────────────────────────────────────── */
.avui-action-log {
    margin-top: 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    font-size: .85rem;
}

.avui-log-summary {
    cursor: pointer;
    padding: .45rem .85rem;
    background: #f8fafc;
    color: #6b7280;
    font-weight: 500;
    user-select: none;
    list-style: none;
}
.avui-log-summary::-webkit-details-marker { display: none; }
.avui-log-summary::before { content: '▸ '; font-size: .75rem; }
details[open] .avui-log-summary::before { content: '▾ '; }

.avui-log-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: .25rem 0;
    background: #fff;
}

.avui-log-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem .85rem;
    border-bottom: 1px solid #f3f4f6;
}
.avui-log-row:last-child { border-bottom: none; }

.avui-log-time { color: #9ca3af; min-width: 3rem; font-variant-numeric: tabular-nums; }
.avui-log-icon { font-size: 1rem; min-width: 1.25rem; text-align: center; }
.avui-log-desc { color: #374151; flex: 1; }
