/* =========================================================
   Пустые окна добавления + компактная мобильная версия
   ========================================================= */

/* Модальные окна на телефоне компактнее и читаемее */
@media (max-width: 950px) {
    .modal-overlay {
        padding: 8px !important;
        align-items: flex-start !important;
        padding-top: 10px !important;
    }

    .modal-box,
    .report-modal-box,
    .client-info-modal-box,
    .portal-comment-box,
    .admin-comments-box {
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100vh - 20px) !important;
        overflow-y: auto !important;
        border-radius: 14px !important;
        padding: 14px !important;
    }

    .modal-title {
        margin-bottom: 10px !important;
    }

    .modal-title h2 {
        font-size: 18px !important;
        line-height: 1.2 !important;
    }

    .modal-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    label {
        font-size: 12px !important;
        margin-bottom: 4px !important;
    }

    input,
    select,
    textarea {
        min-height: 40px !important;
        height: auto !important;
        padding: 8px 9px !important;
        font-size: 14px !important;
        border-radius: 9px !important;
    }

    textarea {
        min-height: 86px !important;
    }

    .modal-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin-top: 12px !important;
    }

    .modal-actions button {
        min-height: 42px !important;
        font-size: 13px !important;
        border-radius: 9px !important;
    }

    .card {
        padding: 12px !important;
    }

    .card-title h2 {
        font-size: 18px !important;
    }

    .hint {
        font-size: 12px !important;
    }
}

/* =========================================================
   Администратор на телефоне:
   показываем коротко менеджер / клиент / сумма, детали по кнопке +
   ========================================================= */

.admin-mobile-toggle-cell {
    display: none;
}

@media (max-width: 950px) {
    #adminSection table,
    #adminSection thead,
    #adminSection tbody,
    #adminSection th,
    #adminSection td,
    #adminSection tr,
    #waitingLaunchSection table,
    #waitingLaunchSection thead,
    #waitingLaunchSection tbody,
    #waitingLaunchSection th,
    #waitingLaunchSection td,
    #waitingLaunchSection tr {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    #adminSection thead,
    #waitingLaunchSection thead {
        display: none !important;
    }

    #adminSection tr,
    #waitingLaunchSection tr {
        position: relative !important;
        padding: 10px !important;
        padding-right: 54px !important;
        border-radius: 12px !important;
        border: 1px solid #e5e7eb !important;
        background: #ffffff !important;
        margin-bottom: 10px !important;
        box-shadow: 0 4px 14px rgba(17, 24, 39, .05) !important;
    }

    #adminSection td,
    #waitingLaunchSection td {
        border: none !important;
        padding: 6px 0 !important;
        display: grid !important;
        grid-template-columns: 92px 1fr !important;
        gap: 8px !important;
        align-items: start !important;
        font-size: 13px !important;
        line-height: 1.25 !important;
        background: transparent !important;
    }

    #adminSection td::before,
    #waitingLaunchSection td::before {
        content: attr(data-label);
        font-size: 11px !important;
        color: #6b7280 !important;
        font-weight: 900 !important;
        text-transform: none !important;
    }

    #adminSection tr:not(.admin-mobile-open) td.admin-mobile-detail-cell,
    #waitingLaunchSection tr:not(.admin-mobile-open) td.admin-mobile-detail-cell {
        display: none !important;
    }

    #adminSection td.admin-mobile-main-cell,
    #waitingLaunchSection td.admin-mobile-main-cell {
        display: grid !important;
    }

    #adminSection td[data-label="Клиент"],
    #waitingLaunchSection td[data-label="Клиент"] {
        font-weight: 900 !important;
        color: #111827 !important;
    }

    #adminSection td[data-label="Сумма"],
    #adminSection td[data-label="Деньги"],
    #waitingLaunchSection td[data-label="Сумма"],
    #waitingLaunchSection td[data-label="Деньги"] {
        font-weight: 900 !important;
        color: #111827 !important;
    }

    .admin-mobile-toggle-cell {
        display: block !important;
        position: absolute !important;
        top: 10px !important;
        right: 10px !important;
        width: 34px !important;
        padding: 0 !important;
    }

    .admin-mobile-toggle-cell::before {
        display: none !important;
    }

    .admin-mobile-toggle-btn {
        width: 32px !important;
        min-width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
        padding: 0 !important;
        border-radius: 9px !important;
        background: #ffffff !important;
        color: #d71920 !important;
        border: 1px solid #fecaca !important;
        font-size: 20px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
    }

    .admin-mobile-open .admin-mobile-toggle-btn {
        background: #d71920 !important;
        color: #ffffff !important;
        border-color: #d71920 !important;
    }

    /* Внутри раскрытых строк кнопки не растягиваем чрезмерно */
    #adminSection .row-actions-cell,
    #waitingLaunchSection .row-actions-cell {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 6px !important;
    }

    #adminSection .edit-btn,
    #waitingLaunchSection .edit-btn {
        width: 38px !important;
        min-width: 38px !important;
    }
}
