/* Контейнер «Отслеживание напоминаний» */
.apr-container {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .08);
    padding: 16px;
    font-size: 14px;
    color: #1f2937;
}

.apr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}
.apr-title {
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.apr-title { cursor: pointer; }
.apr-title .bi { color: #d97706; }

/* свёрнутая панель: остаётся только шапка */
.apr-collapsed { padding-bottom: 12px; }
.apr-collapsed .apr-header { margin-bottom: 0; }
.apr-collapsed #apr_list { display: none; }
.apr-collapsed #apr_toggle_hidden { display: none; }
.apr-badge {
    background: #fef3c7;
    color: #92400e;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 13px;
    font-weight: 600;
}
.apr-header-actions { display: flex; align-items: center; gap: 8px; }

.apr-icon-btn {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    color: #4b5563;
}
.apr-icon-btn:hover { background: #f3f4f6; }

.apr-link-btn {
    border: 0;
    background: none;
    color: #2563eb;
    font-size: 13px;
    padding: 0;
}
.apr-link-btn:hover { text-decoration: underline; }

.apr-group + .apr-group { margin-top: 14px; }
.apr-group-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6b7280;
    margin-bottom: 6px;
}
.apr-group-count {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 0 6px;
    margin-left: 4px;
}

.apr-deal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #eef0f2;
    border-radius: 8px;
    transition: background .15s;
}
.apr-deal + .apr-deal { margin-top: 6px; }
.apr-deal:hover { background: #fafbfc; }
.apr-deal-hidden { opacity: .55; }

.apr-deal-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}
.apr-deal-number { font-weight: 600; white-space: nowrap; }
.apr-deal-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #374151;
}

.apr-deal-actions { display: flex; gap: 4px; flex-shrink: 0; }
.apr-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 9px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}
.apr-btn:hover { background: #f3f4f6; color: #111827; }
.apr-btn-done {
    background: #56c880;
    border-color: #16a34a;
    color: #fff;
    font-size: 16px;
    padding: 0 12px;
    box-shadow: 0 1px 3px rgba(22, 163, 74, .35);
}
.apr-btn-done:hover { background: #15803d; border-color: #15803d; color: #fff; }

.apr-empty {
    text-align: center;
    color: #6b7280;
}
.apr-empty .bi { color: #16a34a; }

/* модалки */
.apr-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(17, 24, 39, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.apr-modal[hidden] { display: none; }
.apr-modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
}
.apr-modal-wide { max-width: 640px; }
.apr-modal-title { font-size: 17px; font-weight: 600; }
.apr-modal-sub { color: #6b7280; font-size: 13px; margin: 4px 0 14px; }
.apr-modal-label { font-weight: 500; margin-bottom: 8px; }
.apr-modal-error { color: #dc2626; font-size: 13px; margin-top: 10px; }
.apr-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.apr-channels { display: flex; flex-wrap: wrap; gap: 8px; }
.apr-channel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 7px 12px;
    cursor: pointer;
    user-select: none;
}
.apr-channel:has(input:checked) { border-color: #16a34a; background: #f0fdf4; }

.apr-deal-until {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}

.apr-hide-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.apr-preset {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    color: #374151;
}
.apr-preset:hover { background: #f3f4f6; }
.apr-preset.active { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
.apr-hide-until { color: #6b7280; font-size: 13px; margin-top: 10px; }

.apr-text-field + .apr-text-field { margin-top: 14px; }
.apr-text-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
    font-weight: 500;
}

.apr-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 2100;
    background: #111827;
    color: #fff;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
}
.apr-toast[hidden] { display: none; }
.apr-toast-error { background: #dc2626; }

@media (max-width: 600px) {
    .apr-deal { flex-direction: column; align-items: stretch; }
    .apr-deal-info { flex-direction: column; gap: 2px; }
    .apr-deal-name { white-space: normal; }
    .apr-deal-actions { justify-content: flex-end; }
    .apr-btn span { display: none; }
}
