/* ===== WhatsApp CRM ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green: #00a884;
    --green-dark: #008069;
    --bg: #f0f2f5;
    --panel: #ffffff;
    --border: #e3e6ea;
    --text: #111b21;
    --muted: #667781;
    --in-bubble: #ffffff;
    --out-bubble: #d9fdd3;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== Топбар ===== */
.topbar {
    background: var(--green-dark);
    color: #fff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.topbar-title { font-weight: 600; font-size: 17px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.poll-status { color: #7fe8d0; transition: color .3s; }
.poll-status.active { color: #ffd966; }
.poll-status.error { color: #ff8a80; }
.btn-menu {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
}

/* ===== Layout ===== */
.layout {
    display: flex;
    flex: 1;
    min-height: 0;
    position: relative;
}

/* ===== Сайдбар (инстансы) ===== */
.sidebar {
    width: 270px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.sidebar-overlay { display: none; }
.sidebar-head {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}
.instance-list { flex: 1; overflow-y: auto; }
.instance-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.instance-item:hover { background: #f5f6f6; }
.instance-item.selected { background: #e7f8f3; }
.instance-name { font-weight: 600; font-size: 14px; }
.instance-phone { font-size: 13px; color: var(--muted); }
.instance-state {
    display: inline-block;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    margin-top: 4px;
    background: #eee;
    color: var(--muted);
}
.instance-state.authorized { background: #d9fdd3; color: #1a7a44; }
.instance-state.notAuthorized { background: #ffe4e1; color: #c0392b; }
.instance-actions { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.sidebar-tools { padding: 10px 12px; border-top: 1px solid var(--border); }
.btn-tool { text-align: left; margin-top: 6px; font-size: 13px; }
.btn-tool:first-child { margin-top: 0; }
.sidebar-foot { padding: 10px 12px; border-top: 1px solid var(--border); }
.filter-label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 8px; }
.filter-label select { width: 100%; margin-top: 4px; }

/* ===== Список чатов ===== */
.chatlist-col {
    width: 340px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.chatlist-head { padding: 10px; border-bottom: 1px solid var(--border); }
.chatlist-head input {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--bg);
    outline: none;
    font-size: 14px;
}
.chat-list { flex: 1; overflow-y: auto; }
.chat-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.chat-item:hover { background: #f5f6f6; }
.chat-item.selected { background: #e7f8f3; }
.chat-avatar {
    width: 44px; height: 44px;
    background: var(--green);
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
    font-size: 17px;
    flex-shrink: 0;
}
.chat-info { flex: 1; min-width: 0; }
.chat-top { display: flex; justify-content: space-between; gap: 6px; }
.chat-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.chat-bottom { display: flex; justify-content: space-between; gap: 6px; margin-top: 2px; }
.chat-preview {
    font-size: 13px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-badges { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }
.badge-unread {
    background: var(--green);
    color: #fff;
    border-radius: 12px;
    font-size: 11px;
    padding: 1px 7px;
    font-weight: 600;
}
.chat-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.chat-instance { font-size: 12px; color: #98a5b0; }

/* метка-чип */
.label-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    color: #fff;
    white-space: nowrap;
}

/* ===== Окно чата ===== */
.chat-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #efeae2;
}
.chat-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-head {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.btn-back {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--green-dark);
    padding: 0 4px;
}
.chat-head-info { flex: 1; min-width: 0; }
.chat-head-name { font-weight: 700; font-size: 17px; }
.chat-head-phone {
    font-size: 17px;
    font-weight: 600;
    color: var(--green-dark);
    letter-spacing: .3px;
    user-select: all; /* удобно копировать номер */
}
.chat-head-instance { font-size: 12px; color: var(--muted); }
.chat-head-actions { display: flex; gap: 8px; align-items: center; }

/* ===== Панель меток в чате ===== */
.label-bar {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}
.label-bar .label-bar-title {
    font-size: 12px;
    color: var(--muted);
    margin-right: 2px;
}
.label-pick {
    border: 2px solid var(--lc, #ccc);
    color: var(--lc, #555);
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 16px;
    cursor: pointer;
    transition: all .15s;
}
.label-pick:hover { filter: brightness(.95); }
.label-pick.active {
    background: var(--lc, #555);
    color: #fff;
}

/* ===== Заметки ===== */
.notes-panel {
    background: #fffbe6;
    border-bottom: 1px solid #f0e6b8;
    padding: 14px 16px;
    flex-shrink: 0;
}
.notes-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.notes-panel input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e8dc9a;
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 8px;
    font-family: inherit;
}
.notes-panel textarea {
    width: 100%;
    min-height: 140px;
    border: 1px solid #e8dc9a;
    border-radius: 8px;
    padding: 12px;
    resize: vertical;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
}
.notes-actions { display: flex; gap: 8px; margin-top: 8px; }

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 8%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.msg {
    max-width: 70%;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 14.5px;
    line-height: 1.35;
    box-shadow: 0 1px 1px rgba(0,0,0,.08);
    white-space: pre-wrap;
    word-break: break-word;
}
.msg.in  { background: var(--in-bubble); align-self: flex-start; border-top-left-radius: 0; }
.msg.out { background: var(--out-bubble); align-self: flex-end; border-top-right-radius: 0; }
.msg-time { font-size: 10px; color: var(--muted); text-align: right; margin-top: 2px; }
.msg a { color: var(--green-dark); }

/* медиа внутри сообщений */
.msg-img {
    display: block;
    max-width: 280px;
    max-height: 320px;
    width: auto;
    border-radius: 8px;
    margin-bottom: 4px;
}
.msg-audio {
    display: block;
    width: 260px;
    max-width: 100%;
    margin-bottom: 4px;
}
.msg-video {
    display: block;
    max-width: 300px;
    max-height: 320px;
    border-radius: 8px;
    margin-bottom: 4px;
}
.msg-doc {
    display: inline-block;
    font-weight: 600;
    margin-bottom: 4px;
}
.msg-empty { color: var(--muted); font-style: italic; }

@media (max-width: 768px) {
    .msg-img, .msg-video { max-width: 100%; }
    .msg-audio { width: 230px; }
}

/* ===== Быстрые ответы ===== */
.quick-panel {
    background: var(--panel);
    border-top: 1px solid var(--border);
    padding: 10px 14px;
    max-height: 45%;
    overflow-y: auto;
    flex-shrink: 0;
}
.quick-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.hint-inline { font-weight: 400; font-size: 12px; color: var(--muted); }
.quick-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    background: #fafbfc;
}
.quick-item-text {
    flex: 1;
    font-size: 14px;
    cursor: pointer;
    white-space: pre-wrap;          /* видны переносы строк */
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;          /* до 3 строк, дальше — троеточие */
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}
.quick-item-text:hover { color: var(--green-dark); }
.quick-item .btn { flex-shrink: 0; }

/* редактирование ответа на месте */
.quick-item.quick-edit { flex-direction: column; align-items: stretch; }
.quick-edit textarea {
    width: 100%;
    min-height: 110px;
    padding: 10px 12px;
    border: 1px solid var(--green);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.45;
    resize: vertical;
    outline: none;
}
.quick-edit-actions { display: flex; gap: 8px; margin-top: 8px; }

/* добавление нового ответа */
.quick-add {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.quick-add textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.45;
    resize: vertical;
    outline: none;
}
.quick-add textarea:focus { border-color: var(--green); }
.quick-add .btn { align-self: flex-end; }
.btn-quick {
    font-size: 17px;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    flex-shrink: 0;
    background: #fff3cd;
}
.btn-quick.open { background: #ffe08a; }

.send-form {
    background: var(--panel);
    padding: 10px 14px;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.send-form textarea {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 10px 14px;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    max-height: 120px;
    outline: none;
}
.btn-send { font-size: 17px; border-radius: 50%; width: 44px; height: 44px; padding: 0; flex-shrink: 0; }

/* ===== Кнопки и формы ===== */
.btn {
    background: #e9edef;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    text-decoration: none;
    display: inline-block;
}
.btn:hover { filter: brightness(.96); }
.btn-primary { background: var(--green); color: #fff; }
.btn-danger { background: #ffe4e1; color: #c0392b; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; margin-top: 10px; }

label { display: block; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
label input, label select {
    width: 100%;
    margin-top: 4px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 15px;
    outline: none;
}
label input:focus { border-color: var(--green); }
select { padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }

.empty { color: var(--muted); text-align: center; padding: 24px; font-size: 14px; }
.empty-big { margin: auto; font-size: 17px; line-height: 1.6; }

.alert { padding: 10px 12px; border-radius: 6px; margin: 10px 0; font-size: 13px; }
.alert-error { background: #ffe4e1; color: #c0392b; }
.alert-ok { background: #d9fdd3; color: #1a7a44; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.45; }

/* ===== Модалки ===== */
.modal-back {
    position: fixed; inset: 0;
    background: rgba(17,27,33,.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 50;
}
.modal {
    background: #fff;
    border-radius: 10px;
    padding: 18px 20px 20px;
    width: 440px;
    max-width: 94vw;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-head {
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; font-size: 16px;
    margin-bottom: 6px;
}
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--muted); padding: 4px; }
.tabs { display: flex; gap: 6px; margin: 10px 0; }
.tab {
    flex: 1; padding: 9px; border: 1px solid var(--border);
    background: #fff; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.tab.active { background: var(--green); color: #fff; border-color: var(--green); }
.qr-box {
    display: flex; align-items: center; justify-content: center;
    min-height: 280px;
    margin-top: 10px;
}
.qr-box img { width: 264px; height: 264px; max-width: 80vw; max-height: 80vw; }
.qr-status { text-align: center; font-size: 13px; color: var(--muted); margin-top: 8px; min-height: 18px; }

/* ===== Редактор меток ===== */
.label-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}
.label-row input[type="color"],
.label-add-row input[type="color"] {
    width: 44px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px;
    cursor: pointer;
    flex-shrink: 0;
    background: #fff;
}
.label-row input[type="text"],
.label-add-row input[type="text"] {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}
.label-row .btn { flex-shrink: 0; }
.label-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

/* блок менеджера: имя+цвет и аккаунт для входа */
.manager-block {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    background: #fafbfc;
}
.manager-account {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.manager-account input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
}

/* ===== Справочник объектов ===== */
.modal-wide { width: 640px; }
.obj-toolbar { display: flex; gap: 8px; margin: 10px 0; }
.obj-toolbar input {
    flex: 1;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--bg);
    outline: none;
    font-size: 14px;
}
.obj-list { max-height: 55vh; overflow-y: auto; }
.obj-item {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    background: #fafbfc;
}
.obj-item:hover { background: #eef7f4; border-color: var(--green); }
.obj-item-title { font-weight: 700; font-size: 15px; }
.obj-item-snippet {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
    white-space: pre-wrap;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.obj-title-input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    margin: 10px 0 8px;
    outline: none;
}
.obj-title-input:focus { border-color: var(--green); }
.obj-text-input {
    width: 100%;
    min-height: 320px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14.5px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}
.obj-text-input:focus { border-color: var(--green); }
.obj-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ===== Калькулятор ===== */
.calc-result {
    background: #eef7f4;
    border: 1px solid #cdeae0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 14px;
    font-size: 14.5px;
    line-height: 1.7;
    white-space: pre-wrap;
}
.calc-result b { font-size: 17px; color: var(--green-dark); }

/* ===== Отчёты ===== */
.btn-hot { background: #e74c3c !important; color: #fff !important; }
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 12px 0;
}
.stat-card {
    border: 2px solid var(--sc, #ccc);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}
.stat-num { font-size: 28px; font-weight: 700; color: var(--sc, #333); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.report-h { margin: 16px 0 6px; font-size: 15px; }
.report-range { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.report-range input {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.report-table { width: 100%; border-collapse: collapse; }
.report-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); font-size: 14px; }
.dot {
    display: inline-block;
    width: 12px; height: 12px;
    border-radius: 50%;
    vertical-align: -1px;
    margin-right: 4px;
}

/* ===== Страницы входа/установки ===== */
.auth-page {
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--green-dark) 0%, var(--green) 35%, var(--bg) 35.1%);
}
.auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.18);
    padding: 30px 34px;
    width: 380px;
    max-width: 92vw;
    margin: auto;
}
.auth-logo { font-size: 40px; text-align: center; }
.auth-card h1 { font-size: 20px; text-align: center; margin: 8px 0 6px; }
.auth-card .btn-block { margin-top: 16px; }

/* =====================================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ===================================================== */
@media (max-width: 768px) {
    .btn-menu { display: block; }
    .topbar-user { display: none; }
    .topbar { padding: 8px 10px; }

    /* сайдбар — выезжающая панель */
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 290px;
        max-width: 85vw;
        z-index: 60;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: 4px 0 18px rgba(0,0,0,.18);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open .sidebar-overlay {
        display: block;
        position: fixed; inset: 0;
        background: rgba(17,27,33,.45);
        z-index: 55;
    }

    /* список чатов — на весь экран */
    .chatlist-col { width: 100%; border-right: none; }

    /* окно чата — поверх списка, на весь экран */
    .chat-col {
        position: absolute;
        inset: 0;
        z-index: 30;
        display: none;
    }
    body.chat-open .chat-col { display: flex; }
    body.chat-open .chatlist-col { display: none; }
    .btn-back { display: block; }

    #chatEmpty { display: none; }

    .messages { padding: 12px 3%; }
    .msg { max-width: 85%; font-size: 15px; }

    .chat-head { padding: 8px 10px; gap: 8px; }
    .chat-head-name { font-size: 16px; }
    .chat-head-phone { font-size: 16px; }
    .label-bar { padding: 8px 10px; overflow-x: auto; flex-wrap: nowrap; }
    .label-pick { flex-shrink: 0; }

    .send-form { padding: 8px 10px; }
    .send-form textarea { font-size: 16px; } /* iOS не зумит при 16px+ */

    .modal { width: 100%; max-width: 96vw; padding: 14px 14px 18px; }
}

/* ===== Настройки (распределение лидов) ===== */
.radio-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    margin: 8px 0 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
}
.radio-row input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    padding: 0;
    border: none;
    flex-shrink: 0;
    accent-color: var(--green);
}
.radio-row span { flex: 1; min-width: 0; }
.radio-row:hover { border-color: var(--green); }

/* ===== Карточка старого клиента (Битрикс) ===== */
.bitrix-card {
    margin: 8px 12px 0;
    padding: 10px 12px;
    border: 1px solid #2c5fb3;
    border-left: 4px solid #2c5fb3;
    border-radius: 8px;
    background: rgba(44, 95, 179, 0.07);
    font-size: 13px;
}
.bitrix-card .bx-head { font-weight: 600; color: #2c5fb3; margin-bottom: 6px; }
.bitrix-card .bx-src { font-weight: 400; color: var(--muted); }
.bitrix-card .bx-row { display: flex; gap: 8px; padding: 2px 0; }
.bitrix-card .bx-label { color: var(--muted); min-width: 140px; flex-shrink: 0; }
.bitrix-card .bx-val { color: var(--text); font-weight: 500; }

/* ===== Напоминания ===== */
.rem-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.rem-form textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--border);
    border-radius: 8px; font: inherit; resize: vertical;
}
.rem-list-title { font-weight: 600; margin: 6px 0 8px; }
.rem-list { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow-y: auto; }
.rem-item {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
.rem-item-main { flex: 1; min-width: 0; }
.rem-item-text { font-weight: 500; }
.rem-item-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rem-done { color: #2ecc71; }
.rem-wait { color: #f39c12; }

/* всплывающее уведомление по центру экрана */
.rem-popup-back {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, 0.5); padding: 16px;
}
.rem-popup { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 380px; }
.rem-card {
    background: var(--panel); border-radius: 14px; padding: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    border-top: 5px solid #f39c12; text-align: center;
    animation: remPop 0.18s ease-out;
}
@keyframes remPop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rem-card-head { font-size: 15px; font-weight: 700; color: #f39c12; margin-bottom: 8px; }
.rem-card-text { font-size: 18px; font-weight: 600; color: var(--text); word-break: break-word; }
.rem-card-meta { font-size: 12px; color: var(--muted); margin: 8px 0 14px; }
