/*
 * MiGym360 Design System v1
 * Visual-only layer: tokens, reusable component classes, and safe mappings.
 */

:root {
    --mg-color-ink: #0b0d12;
    --mg-color-text: #111827;
    --mg-color-muted: #667085;
    --mg-color-soft: #98a2b3;
    --mg-color-border: #e6e8ee;
    --mg-color-border-strong: #d7dbe4;
    --mg-color-surface: #ffffff;
    --mg-color-canvas: #f6f7f9;
    --mg-color-canvas-soft: #fbfcfe;
    --mg-color-brand: var(--gym-accent, #f97316);
    --mg-color-brand-soft: #fff4e8;
    --mg-color-black: #08090b;
    --mg-color-success: #16803c;
    --mg-color-success-soft: #e8f7ee;
    --mg-color-danger: #dc2626;
    --mg-color-danger-soft: #fff0f0;
    --mg-color-warning: #b7791f;
    --mg-color-warning-soft: #fff6d7;
    --mg-color-info: #155ca8;
    --mg-color-info-soft: #eef6ff;
    --mg-radius-sm: 10px;
    --mg-radius: 12px;
    --mg-radius-lg: 16px;
    --mg-radius-xl: 18px;
    --mg-space-1: 4px;
    --mg-space-2: 8px;
    --mg-space-3: 12px;
    --mg-space-4: 16px;
    --mg-space-5: 20px;
    --mg-space-6: 24px;
    --mg-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --mg-shadow-sm: 0 6px 16px rgba(16, 24, 40, 0.06);
    --mg-shadow-md: 0 14px 32px rgba(16, 24, 40, 0.08);
    --mg-focus: 0 0 0 4px rgba(var(--gym-accent-rgb, 249, 115, 22), 0.16);
    --mg-transition: 150ms ease;
}

body.layout-gym,
body.layout-admin,
body.layout-member,
body.layout-app {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--mg-color-text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.mg-section {
    display: grid;
    gap: var(--mg-space-4);
}

.mg-section__header,
.mg-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--mg-space-3);
    flex-wrap: wrap;
}

.mg-section__title,
.mg-page-title {
    margin: 0;
    color: var(--mg-color-text);
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.15;
}

.mg-page-title {
    font-size: clamp(1.35rem, 1vw + 1rem, 1.85rem);
}

.mg-section__subtitle,
.mg-text-muted,
.mg-field__hint {
    color: var(--mg-color-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.mg-card,
.mg-panel,
.mg-table-wrap,
.mg-modal,
.mg-empty-state,
.mg-kpi-card,
.mg-metric-card {
    background: linear-gradient(180deg, var(--mg-color-surface) 0%, var(--mg-color-canvas-soft) 100%);
    border: 1px solid var(--mg-color-border);
    border-radius: var(--mg-radius-lg);
    box-shadow: var(--mg-shadow-sm);
}

.mg-card,
.mg-panel,
.mg-empty-state,
.mg-kpi-card,
.mg-metric-card {
    padding: var(--mg-space-5);
}

.mg-card__header,
.mg-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--mg-space-3);
    padding-bottom: var(--mg-space-3);
    margin-bottom: var(--mg-space-4);
    border-bottom: 1px solid var(--mg-color-border);
}

.mg-card__title,
.mg-panel__title,
.mg-kpi-card__label,
.mg-metric-card__label {
    margin: 0;
    color: var(--mg-color-text);
    font-weight: 600;
    line-height: 1.2;
}

.mg-card__subtitle,
.mg-panel__subtitle {
    margin: 4px 0 0;
    color: var(--mg-color-muted);
    font-size: 0.88rem;
}

.mg-icon-box,
.mg-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: var(--mg-radius);
    background: var(--mg-color-brand-soft);
    color: var(--mg-color-brand);
    border: 1px solid rgba(var(--gym-accent-rgb, 249, 115, 22), 0.18);
}

.mg-icon-box {
    width: 38px;
    height: 38px;
}

.mg-icon-box svg,
.mg-icon-box i,
.mg-btn svg,
.mg-btn i,
.mg-icon-btn svg,
.mg-icon-btn i {
    width: 17px;
    height: 17px;
    stroke-width: 2;
}

.mg-btn,
.mg-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: var(--mg-radius);
    padding: 9px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--mg-transition), box-shadow var(--mg-transition), background var(--mg-transition), border-color var(--mg-transition), color var(--mg-transition);
}

.mg-icon-btn {
    width: 38px;
    padding: 0;
}

.mg-btn:hover,
.mg-icon-btn:hover {
    transform: translateY(-1px);
}

.mg-btn:active,
.mg-icon-btn:active {
    transform: translateY(0);
}

.mg-btn:disabled,
.mg-icon-btn:disabled,
.mg-is-disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none;
}

.mg-btn--primary {
    background: linear-gradient(135deg, var(--mg-color-brand), #fb923c);
    border-color: rgba(var(--gym-accent-rgb, 249, 115, 22), 0.42);
    color: #111111;
    box-shadow: 0 10px 18px rgba(var(--gym-accent-rgb, 249, 115, 22), 0.18);
}

.mg-btn--secondary,
.mg-icon-btn {
    background: #ffffff;
    border-color: var(--mg-color-border-strong);
    color: #344054;
    box-shadow: var(--mg-shadow-xs);
}

.mg-btn--dark {
    background: var(--mg-color-black);
    border-color: var(--mg-color-black);
    color: #ffffff;
}

.mg-btn--success {
    background: var(--mg-color-success);
    border-color: var(--mg-color-success);
    color: #ffffff;
}

.mg-btn--warning {
    background: var(--mg-color-warning);
    border-color: var(--mg-color-warning);
    color: #ffffff;
}

.mg-btn--danger {
    background: var(--mg-color-danger);
    border-color: var(--mg-color-danger);
    color: #ffffff;
}

.mg-field {
    display: grid;
    gap: 6px;
}

.mg-field__label {
    color: #5f6675;
    font-size: 0.82rem;
    font-weight: 600;
}

.mg-input,
.mg-select,
.mg-textarea,
.mg-search-box {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--mg-color-border-strong);
    border-radius: var(--mg-radius);
    background: #ffffff;
    color: var(--mg-color-text);
    padding: 9px 12px;
    box-shadow: var(--mg-shadow-xs);
    transition: border-color var(--mg-transition), box-shadow var(--mg-transition), background var(--mg-transition);
}

.mg-textarea {
    min-height: 92px;
    line-height: 1.45;
}

.mg-input:focus,
.mg-select:focus,
.mg-textarea:focus,
.mg-search-box:focus-within {
    outline: none;
    border-color: var(--mg-color-brand);
    box-shadow: var(--mg-focus), var(--mg-shadow-xs);
}

.mg-check,
.mg-radio,
.mg-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #475467;
    font-size: 0.9rem;
    font-weight: 500;
}

.mg-check input,
.mg-radio input {
    accent-color: var(--mg-color-brand);
}

.mg-switch input {
    width: 38px;
    height: 22px;
    accent-color: var(--mg-color-brand);
}

.mg-badge,
.mg-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 24px;
    border-radius: 999px;
    padding: 4px 10px;
    border: 1px solid transparent;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.1;
}

.mg-badge--success,
.mg-status-chip--success {
    background: var(--mg-color-success-soft);
    color: #176b37;
    border-color: #c9ecd6;
}

.mg-badge--warning,
.mg-status-chip--warning {
    background: var(--mg-color-warning-soft);
    color: #8a5a00;
    border-color: #f6df94;
}

.mg-badge--danger,
.mg-status-chip--danger {
    background: var(--mg-color-danger-soft);
    color: #a82f2f;
    border-color: #ffd2d2;
}

.mg-badge--info,
.mg-status-chip--info {
    background: var(--mg-color-info-soft);
    color: var(--mg-color-info);
    border-color: #d6e8ff;
}

.mg-badge--neutral,
.mg-status-chip--neutral {
    background: #eef1f5;
    color: #344054;
    border-color: #dde3eb;
}

.mg-kpi-card,
.mg-metric-card {
    display: grid;
    gap: var(--mg-space-3);
    transition: transform var(--mg-transition), box-shadow var(--mg-transition), border-color var(--mg-transition);
}

.mg-kpi-card:hover,
.mg-metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--mg-color-border-strong);
    box-shadow: var(--mg-shadow-md);
}

.mg-kpi-card__value,
.mg-metric-card__value {
    color: var(--mg-color-text);
    font-size: clamp(1.45rem, 1.2vw + 1rem, 2rem);
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.05;
}

.mg-empty-state {
    display: grid;
    place-items: center;
    gap: var(--mg-space-3);
    text-align: center;
    color: var(--mg-color-muted);
    padding: 36px 24px;
}

.mg-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--mg-space-3);
    padding: 12px 14px;
    border-radius: var(--mg-radius);
    border: 1px solid transparent;
    box-shadow: var(--mg-shadow-xs);
}

.mg-alert--success { background: var(--mg-color-success-soft); color: #176b37; border-color: #c9ecd6; }
.mg-alert--warning { background: var(--mg-color-warning-soft); color: #8a5a00; border-color: #f6df94; }
.mg-alert--danger { background: var(--mg-color-danger-soft); color: #a82f2f; border-color: #ffd2d2; }
.mg-alert--info { background: var(--mg-color-info-soft); color: var(--mg-color-info); border-color: #d6e8ff; }

.mg-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.mg-table th {
    background: #f8fafc;
    color: #667085;
    border-bottom: 1px solid var(--mg-color-border);
    padding: 13px 14px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
}

.mg-table td {
    color: #1f2937;
    border-bottom: 1px solid #eef1f5;
    padding: 13px 14px;
    vertical-align: middle;
}

.mg-table tbody tr {
    transition: background var(--mg-transition);
}

.mg-table tbody tr:hover {
    background: #fbfcff;
}

.mg-search-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mg-search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.mg-filters,
.mg-tabs,
.mg-pagination {
    display: flex;
    align-items: center;
    gap: var(--mg-space-2);
    flex-wrap: wrap;
}

.mg-pagination {
    justify-content: space-between;
    margin-top: var(--mg-space-4);
}

.mg-pagination__links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mg-page-link {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--mg-color-border);
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform var(--mg-transition), box-shadow var(--mg-transition), border-color var(--mg-transition), background var(--mg-transition);
}

.mg-page-link:hover {
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
    transform: translateY(-1px);
}

.mg-page-link.is-active {
    border-color: var(--mg-color-primary);
    background: var(--mg-color-primary);
    color: #ffffff;
}

.mg-page-link.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.mg-tab {
    min-height: 34px;
    border: 1px solid var(--mg-color-border);
    border-radius: 999px;
    background: #ffffff;
    color: #475467;
    padding: 7px 12px;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
}

.mg-tab.is-active,
.mg-tab[aria-selected="true"] {
    background: var(--mg-color-black);
    color: #ffffff;
    border-color: var(--mg-color-black);
}

.mg-accordion {
    display: grid;
    gap: var(--mg-space-2);
}

.mg-accordion__item {
    border: 1px solid var(--mg-color-border);
    border-radius: var(--mg-radius);
    background: #ffffff;
    overflow: hidden;
}

.mg-accordion__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--mg-space-3);
    padding: 12px 14px;
    border: 0;
    background: transparent;
    color: var(--mg-color-text);
    font-weight: 600;
    cursor: pointer;
}

.mg-accordion__body {
    padding: 0 14px 14px;
    color: var(--mg-color-muted);
}

.mg-timeline {
    display: grid;
    gap: var(--mg-space-3);
}

.mg-timeline__item {
    position: relative;
    padding-left: 22px;
}

.mg-timeline__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--mg-color-brand);
    box-shadow: 0 0 0 4px rgba(var(--gym-accent-rgb, 249, 115, 22), 0.14);
}

.mg-progress {
    width: 100%;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf1f6;
}

.mg-progress__bar {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--mg-color-brand), #fb923c);
}

.mg-toast {
    display: inline-flex;
    align-items: center;
    gap: var(--mg-space-2);
    padding: 10px 12px;
    border: 1px solid var(--mg-color-border);
    border-radius: var(--mg-radius);
    background: #ffffff;
    box-shadow: var(--mg-shadow-md);
}

.mg-dropdown {
    position: relative;
    display: inline-block;
}

.mg-dropdown__menu {
    min-width: 190px;
    border: 1px solid var(--mg-color-border);
    border-radius: var(--mg-radius);
    background: #ffffff;
    box-shadow: var(--mg-shadow-md);
    padding: 6px;
}

.mg-avatar {
    width: 38px;
    height: 38px;
    overflow: hidden;
    font-weight: 600;
}

.mg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mg-modal-backdrop {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(17, 24, 39, 0.46);
    z-index: 1000;
}

.mg-modal {
    width: min(92vw, 560px);
    max-height: 90vh;
    overflow: auto;
}

body.layout-gym .card,
body.layout-gym .table-card,
body.layout-gym .settings-card,
body.layout-gym .report-card,
body.layout-gym .filter-card,
body.layout-gym .summary-card,
body.layout-gym .cash-card,
body.layout-admin .card,
body.layout-admin .table-card,
body.layout-member .member-card {
    border-radius: var(--mg-radius-lg);
}

body.layout-gym .empty-state,
body.layout-admin .empty-state,
body.layout-member .empty-state {
    border-radius: var(--mg-radius-lg);
}

@media (max-width: 760px) {
    .mg-card,
    .mg-panel,
    .mg-empty-state,
    .mg-kpi-card,
    .mg-metric-card {
        padding: var(--mg-space-4);
    }

    .mg-toolbar,
    .mg-section__header {
        align-items: stretch;
    }
}

/*
 * v2 visible adoption layer.
 * Maps legacy classes to the new MiGym360 visual language without changing markup.
 */

body.layout-gym,
body.layout-admin,
body.layout-app {
    --mg-color-brand: var(--gym-accent, #f97316);
    --mg-color-brand-soft: #fff3e7;
    --mg-glass: rgba(255, 255, 255, 0.86);
    --mg-panel-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 252, 0.96) 100%);
    --mg-hero-gradient: radial-gradient(circle at 12% 0%, rgba(var(--gym-accent-rgb, 249, 115, 22), 0.16), transparent 28%),
        radial-gradient(circle at 88% 8%, rgba(37, 99, 235, 0.12), transparent 32%),
        linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
    background: var(--mg-hero-gradient) !important;
}

body.layout-gym .main-content,
body.layout-admin .main-content,
body.layout-app > div[style*="padding-top"] {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0)),
        transparent !important;
}

body.layout-gym .page-header,
body.layout-admin .page-header,
body.layout-member .member-header,
body.layout-gym .pos-topbar,
body.layout-gym .profile-toolbar,
body.layout-gym .members-toolbar,
body.layout-gym .dashboard-period-filter,
body.layout-gym .payments-search,
body.layout-gym .payments-filters,
body.layout-gym form[class*="filter"],
body.layout-gym .report-actions,
body.layout-gym .toolbar {
    position: relative;
    border: 1px solid rgba(214, 220, 230, 0.92) !important;
    border-radius: 20px !important;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.92) 100%) !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.86) !important;
}

body.layout-gym .page-header,
body.layout-admin .page-header,
body.layout-member .member-header {
    padding: 18px 20px !important;
    margin-bottom: 22px !important;
}

body.layout-gym .page-header::before,
body.layout-admin .page-header::before,
body.layout-member .member-header::before,
body.layout-gym .pos-topbar::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    border-radius: 20px 0 0 20px;
    background: linear-gradient(180deg, var(--mg-color-brand), #facc15);
}

body.layout-gym .page-header h1,
body.layout-gym .page-header h2,
body.layout-admin .page-header h1,
body.layout-admin .page-header h2,
body.layout-member .brand-title,
body.layout-gym h1 {
    color: #0b1220 !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

body.layout-gym .page-header p,
body.layout-gym .page-header small,
body.layout-admin .page-header p,
body.layout-member .brand-subtitle {
    color: #667085 !important;
}

body.layout-gym .card,
body.layout-gym .stat-card,
body.layout-gym .table-card,
body.layout-gym .settings-card,
body.layout-gym .report-card,
body.layout-gym .filter-card,
body.layout-gym .summary-card,
body.layout-gym .cash-card,
body.layout-gym .pos-card,
body.layout-gym .pos-summary,
body.layout-admin .card,
body.layout-admin .stat-card,
body.layout-admin .table-card,
body.layout-member .member-card,
body.layout-member .section,
body.layout-member .table-card,
body.layout-gym .panel-section,
body.layout-gym .routine-day,
body.layout-gym .routine-exercise,
body.layout-gym .routine-block,
body.layout-gym .routine-history-card {
    border: 1px solid rgba(214, 220, 230, 0.9) !important;
    border-radius: 20px !important;
    background: var(--mg-panel-gradient) !important;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.86) !important;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease !important;
}

body.layout-gym .card:hover,
body.layout-gym .stat-card:hover,
body.layout-gym .table-card:hover,
body.layout-gym .settings-card:hover,
body.layout-gym .report-card:hover,
body.layout-gym .filter-card:hover,
body.layout-gym .summary-card:hover,
body.layout-gym .cash-card:hover,
body.layout-gym .pos-card:hover,
body.layout-gym .pos-summary:hover,
body.layout-admin .card:hover,
body.layout-admin .stat-card:hover,
body.layout-admin .table-card:hover,
body.layout-member .section:hover,
body.layout-member .table-card:hover,
body.layout-gym .panel-section:hover,
body.layout-gym .routine-day:hover,
body.layout-gym .routine-exercise:hover,
body.layout-gym .routine-block:hover,
body.layout-gym .routine-history-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--gym-accent-rgb, 249, 115, 22), 0.36) !important;
    box-shadow: 0 22px 52px rgba(15, 23, 42, 0.11), 0 4px 12px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

body.layout-gym .card-header,
body.layout-gym .pos-card-header,
body.layout-gym .panel-header,
body.layout-gym .table-card h3,
body.layout-admin .card-header,
body.layout-member .section-title {
    border-bottom: 1px solid rgba(226, 232, 240, 0.92) !important;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(241, 245, 249, 0.76) 100%) !important;
    border-radius: 18px 18px 0 0 !important;
}

body.layout-gym .card-header,
body.layout-admin .card-header {
    padding: 14px 16px !important;
    margin: -22px -22px 18px !important;
}

body.layout-gym .card-header h2,
body.layout-gym .card-header h3,
body.layout-gym .pos-card-title,
body.layout-gym .panel-title,
body.layout-admin .card-header h2,
body.layout-admin .card-header h3 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #0f172a !important;
    font-weight: 600 !important;
}

body.layout-gym .icon-box,
body.layout-gym .stat-card .icon-box,
body.layout-gym .card-header i,
body.layout-gym .card-header svg,
body.layout-admin .icon-box,
body.layout-member .brand-icon,
body.layout-member .nav-icon,
body.layout-member .panel-icon {
    border-radius: 14px !important;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%) !important;
    color: #c2410c !important;
    border: 1px solid rgba(251, 146, 60, 0.28) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px rgba(249, 115, 22, 0.12) !important;
}

body.layout-gym .stat-card {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    min-height: 112px;
}

body.layout-gym .stat-card .number,
body.layout-admin .stat-card .number,
body.layout-gym .mg-kpi-card__value,
body.layout-gym .mg-metric-card__value {
    color: #0b1220 !important;
    font-size: clamp(1.65rem, 1.5vw + 1rem, 2.25rem) !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

body.layout-gym .stat-card .label,
body.layout-admin .stat-card .label {
    color: #667085 !important;
    font-weight: 500 !important;
}

body.layout-gym .btn,
body.layout-admin .btn,
body.layout-app .btn,
body.layout-member .btn-primary,
body.layout-member .btn-secondary,
body.layout-gym .pos-action-btn,
body.layout-gym .pos-btn-small,
body.layout-gym .pos-top-action,
body.layout-gym button,
body.layout-gym a.btn {
    border-radius: 13px !important;
    min-height: 40px;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease, color 150ms ease !important;
}

body.layout-gym .btn:hover,
body.layout-admin .btn:hover,
body.layout-app .btn:hover,
body.layout-member .btn-primary:hover,
body.layout-member .btn-secondary:hover,
body.layout-gym .pos-action-btn:hover,
body.layout-gym .pos-btn-small:hover,
body.layout-gym .pos-top-action:hover {
    transform: translateY(-1px);
}

body.layout-gym .btn:active,
body.layout-admin .btn:active,
body.layout-app .btn:active,
body.layout-member .btn-primary:active,
body.layout-member .btn-secondary:active,
body.layout-gym .pos-action-btn:active,
body.layout-gym .pos-btn-small:active,
body.layout-gym .pos-top-action:active {
    transform: translateY(0);
}

body.layout-gym .btn-primary,
body.layout-admin .btn-primary,
body.layout-app .btn-primary,
body.layout-member .btn-primary {
    background: linear-gradient(135deg, #111827 0%, #020617 100%) !important;
    border: 1px solid rgba(2, 6, 23, 0.8) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}

body.layout-gym .btn-primary:hover,
body.layout-admin .btn-primary:hover,
body.layout-app .btn-primary:hover,
body.layout-member .btn-primary:hover {
    box-shadow: 0 16px 30px rgba(2, 6, 23, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
}

body.layout-gym .btn-secondary,
body.layout-gym .btn-light,
body.layout-gym .btn-default,
body.layout-admin .btn-secondary,
body.layout-member .btn-secondary,
body.layout-app .btn-outline,
body.layout-gym .pos-btn-small,
body.layout-gym .pos-top-action {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 1px solid rgba(203, 213, 225, 0.96) !important;
    color: #334155 !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

body.layout-gym .btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #15803d 100%) !important;
    box-shadow: 0 12px 24px rgba(22, 163, 74, 0.2) !important;
}

body.layout-gym .btn-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
    color: #3b2200 !important;
    box-shadow: 0 12px 24px rgba(245, 158, 11, 0.2) !important;
}

body.layout-gym .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
    box-shadow: 0 12px 24px rgba(220, 38, 38, 0.2) !important;
}

body.layout-gym input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
body.layout-gym select,
body.layout-gym textarea,
body.layout-admin input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
body.layout-admin select,
body.layout-admin textarea,
body.layout-member input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
body.layout-member select,
body.layout-member textarea,
body.layout-app input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
body.layout-app select,
body.layout-app textarea,
body.layout-gym .pos-input,
body.layout-gym .pos-search,
body.layout-gym .payment-filter__trigger {
    border: 1px solid rgba(203, 213, 225, 0.96) !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
    color: #0f172a !important;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.045), inset 0 1px 0 rgba(255, 255, 255, 0.88) !important;
}

body.layout-gym input:focus,
body.layout-gym select:focus,
body.layout-gym textarea:focus,
body.layout-admin input:focus,
body.layout-admin select:focus,
body.layout-admin textarea:focus,
body.layout-member input:focus,
body.layout-member select:focus,
body.layout-member textarea:focus,
body.layout-app input:focus,
body.layout-app select:focus,
body.layout-app textarea:focus,
body.layout-gym .pos-search:focus-within,
body.layout-gym .payment-filter__trigger:focus {
    outline: none !important;
    border-color: rgba(var(--gym-accent-rgb, 249, 115, 22), 0.58) !important;
    box-shadow: 0 0 0 4px rgba(var(--gym-accent-rgb, 249, 115, 22), 0.16), 0 8px 20px rgba(15, 23, 42, 0.08) !important;
}

body.layout-gym table,
body.layout-admin table,
body.layout-member table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden;
    border-radius: 16px;
}

body.layout-gym th,
body.layout-admin th,
body.layout-member th {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%) !important;
    color: #475467 !important;
    border-bottom: 1px solid rgba(203, 213, 225, 0.92) !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase;
}

body.layout-gym td,
body.layout-admin td,
body.layout-member td {
    border-bottom: 1px solid rgba(226, 232, 240, 0.9) !important;
}

body.layout-gym tbody tr,
body.layout-admin tbody tr,
body.layout-member tbody tr {
    transition: background 150ms ease, transform 150ms ease;
}

body.layout-gym tbody tr:hover,
body.layout-admin tbody tr:hover,
body.layout-member tbody tr:hover {
    background: #fffaf3 !important;
}

body.layout-gym .badge,
body.layout-gym [class*="badge-"],
body.layout-gym .status-pill,
body.layout-gym .month-badge,
body.layout-admin .badge,
body.layout-member .badge {
    border-radius: 999px !important;
    border: 1px solid rgba(203, 213, 225, 0.75) !important;
    padding: 5px 11px !important;
    min-height: 26px !important;
    font-weight: 600 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68), 0 5px 12px rgba(15, 23, 42, 0.05) !important;
}

body.layout-gym .badge-success,
body.layout-gym .badge-active,
body.layout-gym .badge-paid,
body.layout-member .badge.success {
    background: linear-gradient(180deg, #ecfdf5 0%, #dcfce7 100%) !important;
    color: #166534 !important;
    border-color: #bbf7d0 !important;
}

body.layout-gym .badge-warning,
body.layout-gym .badge-pending,
body.layout-member .badge.warning {
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%) !important;
    color: #92400e !important;
    border-color: #fde68a !important;
}

body.layout-gym .badge-danger,
body.layout-gym .badge-expired,
body.layout-gym .badge-cancelled,
body.layout-member .badge.danger {
    background: linear-gradient(180deg, #fff1f2 0%, #fee2e2 100%) !important;
    color: #991b1b !important;
    border-color: #fecaca !important;
}

body.layout-gym .badge-info,
body.layout-gym .month-badge {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%) !important;
    color: #1d4ed8 !important;
    border-color: #bfdbfe !important;
}

body.layout-gym .badge-secondary,
body.layout-gym .badge-dark,
body.layout-gym .badge-inactive,
body.layout-member .badge.neutral {
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%) !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

body.layout-gym .empty-state,
body.layout-admin .empty-state,
body.layout-member .empty-state,
body.layout-gym .pos-empty,
body.layout-gym .pos-cart-empty {
    border: 1px dashed rgba(var(--gym-accent-rgb, 249, 115, 22), 0.34) !important;
    border-radius: 20px !important;
    background:
        radial-gradient(circle at top, rgba(var(--gym-accent-rgb, 249, 115, 22), 0.09), transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    color: #64748b !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 24px rgba(15, 23, 42, 0.05) !important;
}

body.layout-gym .members-toolbar,
body.layout-gym .payments-search,
body.layout-gym .payments-filters,
body.layout-gym .dashboard-period-filter,
body.layout-gym .report-actions,
body.layout-gym form[class*="filter"] {
    padding: 12px !important;
}

body.layout-gym .pos-product,
body.layout-gym .service-card,
body.layout-gym .product-card {
    border-radius: 18px !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.86) !important;
}

body.layout-gym .pos-product:hover,
body.layout-gym .service-card:hover,
body.layout-gym .product-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

body.layout-gym .pos-payment-option {
    border-radius: 16px !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.85) !important;
}

body.layout-gym .pos-total-main {
    border-radius: 18px !important;
    background:
        linear-gradient(135deg, rgba(236, 253, 245, 0.98) 0%, rgba(239, 246, 255, 0.98) 100%) !important;
    box-shadow: 0 16px 32px rgba(16, 185, 129, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.88) !important;
}

@media (max-width: 900px) {
    body.layout-gym .page-header,
    body.layout-admin .page-header,
    body.layout-member .member-header {
        border-radius: 18px !important;
        padding: 15px !important;
    }

    body.layout-gym .card,
    body.layout-gym .stat-card,
    body.layout-gym .table-card,
    body.layout-gym .settings-card,
    body.layout-gym .report-card,
    body.layout-gym .filter-card,
    body.layout-gym .summary-card,
    body.layout-gym .cash-card,
    body.layout-admin .card,
    body.layout-member .member-card,
    body.layout-member .section {
        border-radius: 18px !important;
    }
}
