/* Журнал действий: компактная таблица по дням. Цвета из переменных панели. */
.act {
    --act-good: #15803d; --act-good-bg: rgba(22, 163, 74, .12);
    --act-danger: #b91c1c; --act-danger-bg: rgba(220, 38, 38, .12);
    --act-edit: #1d4ed8; --act-edit-bg: rgba(37, 99, 235, .11);
    --act-info: #6d28d9; --act-info-bg: rgba(124, 58, 237, .11);
    --act-warn: #b45309; --act-warn-bg: rgba(245, 158, 11, .16);
    display: grid; gap: 10px; font-size: 13.5px;
}

/* Панель: период, итоги, фильтры */
.act-bar {
    display: grid; gap: 8px; padding: 10px 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.act-bar__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.act-seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--surface-muted); }
.act-seg label {
    padding: 4px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text-muted); white-space: nowrap;
}
.act-seg input { position: absolute; opacity: 0; pointer-events: none; }
.act-seg label.is-active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.act-sum { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-muted); }
.act-sum b { color: var(--text); font-weight: 700; }
.act-sum__danger { color: var(--text-muted); text-decoration: none; border-bottom: 1px dashed transparent; }
.act-sum__danger b { color: var(--act-danger); }
.act-sum__danger:hover, .act-sum__danger.is-on { color: var(--act-danger); border-bottom-color: currentColor; }
.act-bar__filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.act-bar__filters select, .act-bar__search {
    height: 32px; padding: 0 8px; font: inherit; font-size: 13px; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px; max-width: 220px;
}
.act-bar__search { flex: 1 1 180px; max-width: none; min-width: 160px; }
.act-bar__filters select:focus, .act-bar__search:focus { outline: none; border-color: var(--primary); }
.act-bar__reset { font-size: 12.5px; color: var(--text-muted); }

/* Таблица */
.act-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.act-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.act-table thead th {
    padding: 8px 10px; font-size: 11.5px; font-weight: 600; text-align: left; text-transform: uppercase;
    letter-spacing: .03em; color: var(--text-muted); background: var(--surface-muted); border-bottom: 1px solid var(--border);
}
.act-table .c-time { width: 58px; }
.act-table .c-who { width: 17%; }
.act-table .c-act { width: 118px; }
.act-table .c-obj { width: 24%; }
.act-table .c-src { width: 116px; }
.act-day th {
    padding: 6px 10px; font-size: 12px; font-weight: 700; text-align: left; color: var(--text);
    background: var(--surface-muted); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.act-day th span { font-weight: 500; color: var(--text-muted); }
.act-table tbody:first-of-type .act-day th { border-top: 0; }
.act-tr td { padding: 7px 10px; vertical-align: top; border-bottom: 1px solid var(--border); line-height: 1.35; }
.act-tr:last-child td { border-bottom: 0; }
.act-tr:hover td { background: var(--surface-muted); }
.act-tr.is-danger td:first-child { box-shadow: inset 3px 0 0 var(--act-danger); }
.act-tr.is-danger td { background: rgba(220, 38, 38, .03); }

.act-tr .c-time { font-variant-numeric: tabular-nums; color: var(--text-muted); white-space: nowrap; }
.act-tr small { display: block; font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-tr small a { color: inherit; }
.act-who { display: block; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-who::before { content: ''; display: inline-block; width: 7px; height: 7px; margin: 0 6px 1px 0; border-radius: 50%; background: #94a3b8; }
.act-who--owner::before { background: #0f766e; }
.act-who--staff::before { background: #2563eb; }
.act-who--trainer::before { background: #ea580c; }
.act-who--client::before { background: #7c3aed; }
.act-who--admin::before { background: #111827; }

.act-pill {
    display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.act-pill--good { color: var(--act-good); background: var(--act-good-bg); }
.act-pill--danger { color: var(--act-danger); background: var(--act-danger-bg); }
.act-pill--edit { color: var(--act-edit); background: var(--act-edit-bg); }
.act-pill--info { color: var(--act-info); background: var(--act-info-bg); }
.act-pill--warn { color: var(--act-warn); background: var(--act-warn-bg); }

.act-tr .c-obj a, .act-tr .c-obj span {
    display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text);
}
.act-tr .c-obj a { color: var(--primary); text-decoration: none; font-weight: 500; }
.act-tr .c-obj a:hover { text-decoration: underline; }

.act-diff { font-size: 12.5px; color: var(--text); overflow-wrap: anywhere; }
.act-diff + .act-diff { margin-top: 1px; }
.act-diff > span { color: var(--text-muted); }
.act-diff s { color: var(--text-muted); text-decoration-color: var(--act-danger); }
.act-none { color: var(--text-muted); }
.act-said {
    margin-top: 3px; font-size: 12px; color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.act-src { display: block; font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-src--assistant { color: var(--primary); font-weight: 600; }
.act-src--desk { color: #2563eb; }
.act-src--partner_app, .act-src--client_app { color: #7c3aed; }

.act-pager { display: flex; justify-content: center; align-items: center; gap: 12px; font-size: 13px; color: var(--text-muted); }
.act-empty {
    display: grid; justify-items: center; gap: 4px; padding: 36px 20px; text-align: center;
    background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; color: var(--text-muted);
}
.act-empty b { color: var(--text); font-size: 15px; }
.act-empty p { max-width: 460px; margin: 0; font-size: 13px; }

/* Телефон: строка становится компактной карточкой */
@media (max-width: 820px) {
    .act-bar__top { flex-direction: column; align-items: stretch; }
    .act-seg { overflow-x: auto; }
    .act-bar__filters { display: grid; grid-template-columns: 1fr 1fr; }
    .act-bar__filters select, .act-bar__search { width: 100%; min-width: 0; max-width: none; margin: 0; }
    .act-bar__reset { grid-column: 1 / -1; }
    .act-sum { gap: 2px 10px; font-size: 12.5px; }
    .act-table, .act-table tbody, .act-table tr, .act-table td, .act-table th { display: block; width: auto !important; }
    .act-table thead { display: none; }
    .act-tr {
        display: grid !important; grid-template-columns: auto auto 1fr; gap: 2px 8px; padding: 8px 12px;
        border-bottom: 1px solid var(--border);
    }
    .act-tr td { padding: 0; border: 0; background: none !important; box-shadow: none !important; }
    .act-tr.is-danger { box-shadow: inset 3px 0 0 var(--act-danger); background: rgba(220, 38, 38, .03); }
    .act-tr .c-time { grid-column: 1; grid-row: 1; align-self: center; }
    .act-tr .c-act { grid-column: 2; grid-row: 1; }
    .act-tr .c-src { grid-column: 3; grid-row: 1; justify-self: end; align-self: center; text-align: right; }
    .act-tr .c-src small { display: none; }
    .act-tr .c-obj { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 6px; align-items: baseline; min-width: 0; }
    .act-tr .c-obj small { flex: 0 0 auto; }
    .act-tr .c-who { grid-column: 1 / -1; grid-row: 3; display: flex; gap: 6px; align-items: baseline; min-width: 0; }
    .act-tr .c-who small { flex: 1 1 auto; }
    .act-tr .c-diff { grid-column: 1 / -1; grid-row: 4; }
    .act-tr .c-diff .act-none { display: none; }
}
