/* FURA — сторінка «РОП». Кольори — з theme.css (--f-*). */

/* ag-card і кнопки мають свій display — атрибут hidden має перемагати */
.rop-page [hidden],
#ropHomeBlock[hidden] {
    display: none !important;
}

.rop-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}
.rop-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.rop-actions select {
    height: 38px;
    border: 1px solid var(--f-line, #e4e8ef);
    border-radius: 10px;
    padding: 0 10px;
    background: var(--f-card, #fff);
    max-width: 280px;
}
#ropBody {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.rop-meta {
    font-size: 13px;
    color: var(--f-muted, #6b7280);
}
.rop-warn {
    color: #b45309;
    font-weight: 600;
}
.ag-card-head h2 i {
    color: var(--f-orange, #c9973a);
    vertical-align: -2px;
}
.btn-sm {
    padding: 5px 10px;
    font-size: 13px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

/* ---------- Головне сьогодні ---------- */

.rop-main {
    border-left: 4px solid var(--f-orange, #c9973a);
}
.rop-main .ag-card-head .ag-hint {
    font-size: 14px;
    color: var(--f-text, #111827);
    font-weight: 500;
}
.rop-top {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: top;
    display: grid;
    gap: 10px;
}
.rop-top li {
    counter-increment: top;
    position: relative;
    padding: 10px 12px 10px 46px;
    background: #fff8f0;
    border: 1px solid #fde3c4;
    border-radius: 12px;
}
.rop-top li::before {
    content: counter(top);
    position: absolute;
    left: 12px;
    top: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--f-orange, #c9973a);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: grid;
    place-items: center;
}
.rop-top-title {
    font-weight: 700;
    color: var(--f-navy, #13203f);
}
.rop-top-why {
    font-size: 14px;
    color: #374151;
    margin-top: 2px;
}
.rop-top-foot {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 6px;
}
.rop-week {
    background: #f1f5ff;
    border-radius: 12px;
    padding: 12px 14px;
}
.rop-week h3 {
    margin: 0 0 4px;
    font-size: 15px;
}
.rop-week p {
    margin: 0;
    line-height: 1.5;
}

/* ---------- Цифри ---------- */

.rop-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 1300px) {
    .rop-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .rop-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.rop-kpi {
    background: var(--f-card, #fff);
    border: 1px solid var(--f-line, #e4e8ef);
    border-radius: 14px;
    padding: 12px 14px;
}
.rop-kpi.bad {
    border-color: #fecaca;
    background: #fff5f5;
}
.rop-kpi-l {
    font-size: 12px;
    color: var(--f-muted, #6b7280);
}
.rop-kpi-v {
    font-size: 22px;
    font-weight: 800;
    color: var(--f-navy, #13203f);
    margin: 2px 0;
}
.rop-kpi-x {
    font-size: 12px;
    color: var(--f-muted, #6b7280);
    min-height: 16px;
}
.rop-delta {
    font-weight: 700;
}
.rop-delta.up {
    color: #15803d;
}
.rop-delta.down {
    color: #dc2626;
}

/* ---------- Ризики, тренди, воронка ---------- */

.rop-risk {
    border-left: 3px solid #f59e0b;
    padding: 6px 10px;
    background: #fffbeb;
    border-radius: 0 10px 10px 0;
}
.rop-risk.high {
    border-color: #dc2626;
    background: #fef2f2;
}
.rop-risk p {
    margin: 2px 0 0;
    font-size: 14px;
    color: #374151;
}
.rop-trends {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 4px;
    font-size: 14px;
}
.rop-funnel h3 {
    font-size: 13px;
    margin: 12px 0 6px;
    color: var(--f-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.rop-bar {
    display: grid;
    grid-template-columns: 100px 1fr 40px;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 4px;
}
.rop-bar i {
    display: block;
    height: 10px;
    border-radius: 6px;
    background: var(--f-blue, #1d5bd8);
    min-width: 2px;
}
.rop-bar b {
    text-align: right;
}

/* ---------- Команда ---------- */

.rop-people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}
.rop-person {
    border: 1px solid var(--f-line, #e4e8ef);
    border-radius: 12px;
    padding: 12px 14px;
}
.rop-person-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.rop-person-tasks {
    margin-left: auto;
    border: 0;
    background: #eef2ff;
    color: var(--f-blue, #1d5bd8);
    border-radius: 10px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.rop-person-tasks.bad {
    background: #fee2e2;
    color: #b91c1c;
}
.rop-person dl {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 10px;
    margin: 10px 0 0;
    font-size: 13px;
}
.rop-person dt {
    color: var(--f-muted, #6b7280);
}
.rop-person dd {
    margin: 0;
    font-weight: 600;
    text-align: right;
}
.rop-verdict {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed var(--f-line, #e4e8ef);
    font-size: 13px;
}
.rop-verdict p {
    margin: 0 0 4px;
}
.rop-verdict .good {
    color: #166534;
}
.rop-verdict .improve {
    color: #9a3412;
}

/* ---------- Задачі ---------- */

.rop-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.rop-filters select,
.rop-assign-select {
    height: 32px;
    border: 1px solid var(--f-line, #e4e8ef);
    border-radius: 8px;
    padding: 0 8px;
    background: var(--f-card, #fff);
}
.rop-tasks {
    display: grid;
    gap: 8px;
}
.rop-task {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--f-line, #e4e8ef);
    border-radius: 12px;
    padding: 10px 12px;
}
.rop-task.p1 {
    border-left: 4px solid #dc2626;
}
.rop-task.p2 {
    border-left: 4px solid #f59e0b;
}
.rop-task.p3 {
    border-left: 4px solid #94a3b8;
}
.rop-task-main {
    min-width: 0;
}
.rop-task-top {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.rop-prio {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #94a3b8;
}
.p1 .rop-prio {
    background: #dc2626;
}
.p2 .rop-prio {
    background: #f59e0b;
}
.rop-task-who {
    font-size: 13px;
    font-weight: 700;
    color: var(--f-navy, #13203f);
}
.rop-task-title {
    font-weight: 600;
    margin-top: 4px;
}
.rop-task-details {
    font-size: 13px;
    color: #4b5563;
    margin-top: 2px;
}
.rop-task-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex-shrink: 0;
}
@media (max-width: 800px) {
    .rop-task {
        flex-direction: column;
        align-items: stretch;
    }
    .rop-task-actions {
        justify-content: flex-start;
    }
}

/* ---------- Пороги ---------- */

.rop-modal {
    max-width: 560px;
    width: calc(100% - 32px);
}
.rop-close {
    border: 0;
    background: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--f-muted, #6b7280);
}
.rop-settings {
    display: grid;
    gap: 8px;
    padding: 12px 0;
}
.rop-settings label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.rop-input {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.rop-input input {
    width: 80px;
    height: 34px;
    border: 1px solid var(--f-line, #e4e8ef);
    border-radius: 8px;
    padding: 0 8px;
    text-align: right;
}
.rop-input em {
    font-style: normal;
    color: var(--f-muted, #6b7280);
    width: 28px;
    font-size: 13px;
}
.rop-modal-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ---------- Плитка задач на головній ---------- */

.rop-home-list {
    display: grid;
    gap: 8px;
}
.rop-home-list .rop-task {
    background: var(--f-card, #fff);
}
.rop-home-more {
    margin-top: 8px;
    font-size: 13px;
}

.rop-main .ag-card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}
