/* =============================================
   АДАПТИВНЫЕ СТИЛИ — Менеджер баланса тренировок
   ============================================= */

#tbm-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    color: #000 !important;           /* Общий чёрный текст */
}

#tbm-app h1 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #1d2327;
}

/* Табы */
#tbm-tabs button {
    margin: 4px 2px;
}

/* ====================== ТАБЛИЦА ====================== */
#tbm-app table { 
    width: 100%; 
    border-collapse: collapse; 
    color: #000 !important;
}

#tbm-app th, 
#tbm-app td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #c3c4c7;
    color: #000 !important;           /* Чёрный текст в таблице */
}

#tbm-app th { 
    background: #f6f7f7; 
    font-weight: 600; 
}

#tbm-app tr:hover { 
    background: #f9f9f9; 
}

/* Подсветка по балансу */
#tbm-app tr.balance-positive { background-color: #f0f9f0 !important; }
#tbm-app tr.balance-zero     { background-color: #fff8e1 !important; }
#tbm-app tr.balance-negative { background-color: #fce8e6 !important; }

.balance-cell {
    font-size: 24px !important;
    font-weight: 700 !important;
    text-align: center !important;
    color: #000 !important;
}

/* Кнопки — светлые (стандарт WordPress стиль) */
#tbm-app .button {
    margin: 2px;
    font-size: 13px;
    padding: 6px 12px;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    color: #2271b1 !important;           /* Синий текст кнопок */
    text-decoration: none;
}

#tbm-app .button.button-primary {
    background: #2271b1;
    color: #fff !important;
    border-color: #2271b1;
}

#tbm-app .button.button-link-delete {
    color: #b32d2e !important;
}

/* ====================== МОБИЛЬНЫЕ УСТРОЙСТВА ====================== */
@media (max-width: 768px) {
    #tbm-app {
        padding: 12px 10px;
        margin: 10px;
    }

    #tbm-app h1 { 
        font-size: 21px; 
    }

    /* Карточки вместо таблицы */
    #tbm-app table,
    #tbm-app thead,
    #tbm-app tbody,
    #tbm-app th,
    #tbm-app td,
    #tbm-app tr {
        display: block;
    }

    #tbm-app thead { 
        display: none; 
    }

    #tbm-app tr {
        margin-bottom: 16px;
        border: 1px solid #c3c4c7;
        border-radius: 8px;
        padding: 16px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        position: relative;           /* Важно для чекбокса */
    }

    #tbm-app td {
        border: none;
        padding: 8px 0;
        color: #000 !important;
    }

    /* Чекбокс — исправленное позиционирование */
    #tbm-app td:first-child {
        position: absolute;
        top: 16px;
        right: 16px;
        width: 20px;
        height: 20px;
        padding: 0;
        margin: 0;
        z-index: 10;
    }

    #tbm-app td:first-child input[type="checkbox"] {
        width: 20px;
        height: 20px;
        margin: 0;
    }

    /* Имя ученика */
    #tbm-app td:nth-child(2) {
        font-size: 18px;
        font-weight: 700;
        padding-right: 50px;          /* место под чекбокс */
        color: #000 !important;
    }

    /* Баланс */
    #tbm-app td:nth-child(3) {
        font-size: 32px !important;
        text-align: center;
        padding: 12px 0;
        margin: 10px 0;
        border-top: 1px solid #eee;
        border-bottom: 1px solid #eee;
        color: #000 !important;
    }

    /* Блок кнопок */
    #tbm-app td:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
        padding-top: 12px;
    }

    #tbm-app .button {
        flex: 1;
        min-width: 100px;
        font-size: 14px;
        padding: 10px 8px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    #tbm-app .button { 
        min-width: 100%; 
        margin: 4px 0; 
    }
}
.actions .button {
	min-width: 80px !important;
	max-width: max-content;
}