/* Shared Gym Management UI — buttons and common controls.
   Source of truth aligned with Pricing & Front Desk (Material blue primary). */

.gym-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    line-height: 1.25;
    box-sizing: border-box;
}

.gym-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gym-btn-primary {
    background: #2196F3;
    color: #fff;
}

.gym-btn-primary:hover:not(:disabled) {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.gym-btn-secondary {
    background: #f5f5f5;
    color: #2c3e50;
    border: 1px solid #e0e0e0;
}

.gym-btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
}

.gym-btn-success {
    background: #4caf50;
    color: #fff;
}

.gym-btn-success:hover:not(:disabled) {
    background: #45a049;
}

.gym-btn-warning {
    background: #ff9800;
    color: #fff;
}

.gym-btn-warning:hover:not(:disabled) {
    background: #f57c00;
}

.gym-btn-danger {
    background: #dc2626;
    color: #fff;
}

.gym-btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.gym-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.gym-btn-icon {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gym-btn-icon:hover:not(:disabled) {
    background: #f8fafc;
}

/* Modal close — readable on light headers (plan/service detail dialogs) */
.gym-modal-close-btn {
    background: #f1f5f9;
    border: none;
    color: #475569;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    font-size: 16px;
    flex-shrink: 0;
}

.gym-modal-close-btn:hover {
    background: #e2e8f0;
    transform: scale(1.05);
}

/* Colored modal headers (Pricing / GymManagement) keep a light-on-dark close */
.gym-modal-header:not(.gym-modal-header-light) .gym-modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.gym-modal-header:not(.gym-modal-header-light) .gym-modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Front-desk member workspace */
.gym-fd-split {
    display: grid !important;
    grid-template-columns: minmax(250px, 30%) minmax(0, 70%);
    gap: 20px;
    align-items: start;
}

.gym-fd-left {
    position: sticky;
    top: 12px;
}

.gym-fd-left .gym-detail-card-body {
    display: block;
}

.gym-fd-left .gym-customer-photo-section {
    width: 100%;
}

.gym-fd-left .gym-customer-photo,
.gym-fd-left .gym-customer-photo-placeholder {
    width: 100%;
    max-width: none;
    aspect-ratio: 4 / 5;
    height: auto;
    object-fit: cover;
}

.gym-fd-left .gym-detail-info-grid {
    grid-template-columns: 1fr;
    margin-top: 16px;
}

.gym-fd-right {
    min-width: 0;
}

.gym-fd-action-bar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}

.gym-fd-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    margin-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.gym-fd-tabs button {
    padding: 10px 14px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.gym-fd-tabs button.is-active {
    color: #1976d2;
    border-bottom-color: #1976d2;
}

.gym-subscription-item:not(.gym-subscription-frozen):not(.gym-subscription-expired) {
    border-left: 4px solid #22c55e;
}

.gym-subscription-item.gym-subscription-frozen {
    border-left: 4px solid #f59e0b;
}

.gym-subscription-item.gym-subscription-expired {
    border-left: 4px solid #ef4444;
}

@media (max-width: 900px) {
    .gym-fd-split {
        grid-template-columns: 1fr;
    }

    .gym-fd-left,
    .gym-fd-action-bar {
        position: static;
    }

    .gym-fd-left .gym-customer-photo,
    .gym-fd-left .gym-customer-photo-placeholder {
        aspect-ratio: 1 / 1;
        max-height: 420px;
    }

    .gym-frontdesk-toolbar,
    .gym-frontdesk-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .gym-frontdesk-actions .gym-btn {
        width: 100%;
        justify-content: center;
    }

    .gym-shift-live-summary {
        flex-direction: column;
    }

    .gym-list-page,
    .gym-page-content,
    .module-dashboard {
        padding-left: 12px;
        padding-right: 12px;
    }

    .dashboard-cards {
        grid-template-columns: 1fr !important;
    }

    .gym-shift-detail-grid,
    .gym-sales-kpi-strip,
    .gym-sales-tabs,
    .gym-sales-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .gym-table-wrap {
        margin-inline: -4px;
    }
}

@media (max-width: 768px) {
    .gym-sales-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .gym-sales-search-row .gym-search-input,
    .gym-sales-search-row .gym-filter-select,
    .gym-sales-search-row select {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .gym-sales-kpi-strip {
        gap: 8px;
    }

    .gym-sales-kpi {
        min-width: 0;
        flex: 1 1 140px;
    }

    .gym-list-page {
        padding: 12px;
    }

    .gym-shift-live-summary {
        gap: 8px;
        padding: 8px 12px;
    }
}

@media (max-width: 600px) {
    .gym-detail-header-content,
    .gym-detail-header-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .stat-card {
        padding: 16px !important;
    }

    .gym-table th, .gym-table td {
        padding: 8px 8px;
        font-size: 12px;
    }

    .gym-sales-tabs {
        gap: 4px;
    }

    .gym-sales-tab {
        padding: 6px 10px;
        font-size: 12px;
    }
}
