/* ================= GymPro - Site theme (Bootstrap 5 based) ================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --gms-primary: #ff6a1a;
    --gms-grad: linear-gradient(135deg, #ff6a1a 0%, #ff3d6e 100%);
    --gms-sidebar: #151a28;
    --gms-sidebar-2: #1d2436;
    --gms-sidebar-hover: rgba(255,255,255,.06);
    --gms-bg: #f3f5fa;
    --gms-border: #e7eaf2;
    --gms-muted: #6b7489;
    --gms-radius: 14px;
    --gms-shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 14px rgba(16,24,40,.06);
    --bs-link-color: #e2550a;
    --bs-link-hover-color: #b8420a;
}

body { background: var(--gms-bg); font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: .9rem; color: #1e2433; }
a { text-decoration: none; color: #e2550a; }
a:hover { color: #b8420a; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9cfdc; border-radius: 8px; }

/* ---------- Layout ---------- */
.gms-wrapper { display: flex; min-height: 100vh; }
.gms-sidebar {
    width: 250px; background: linear-gradient(180deg, var(--gms-sidebar) 0%, var(--gms-sidebar-2) 100%); color: #b9c1d4; flex-shrink: 0;
    position: fixed; top: 0; bottom: 0; left: 0; overflow-y: auto; z-index: 1030; transition: left .25s; padding-bottom: 24px;
}
.gms-sidebar .brand { padding: 18px 20px; font-size: 1.25rem; font-weight: 800; color: #fff; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.gms-sidebar .brand i { background: var(--gms-grad); color: #fff; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; box-shadow: 0 6px 16px rgba(255,90,40,.4); }
.gms-sidebar .menu-search { margin: 4px 14px 6px; }
.gms-sidebar .menu-search input { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); color: #fff; border-radius: 10px; font-size: .82rem; padding: 7px 10px; width: 100%; outline: none; }
.gms-sidebar .menu-search input::placeholder { color: #7f89a0; }
.gms-sidebar .menu-head { font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: #6b758c; padding: 16px 22px 6px; font-weight: 700; }
.gms-sidebar a.menu-link { display: flex; align-items: center; gap: 10px; color: #b9c1d4; padding: 8px 14px; margin: 1px 10px; border-radius: 10px; font-weight: 500; font-size: .86rem; transition: background .15s, color .15s; }
.gms-sidebar a.menu-link i { width: 20px; text-align: center; font-size: 1rem; opacity: .85; }
.gms-sidebar a.menu-link:hover { background: var(--gms-sidebar-hover); color: #fff; }
.gms-sidebar a.menu-link.active { background: var(--gms-grad); color: #fff; box-shadow: 0 6px 16px rgba(255,90,40,.35); }
.gms-sidebar a.menu-link.active i { opacity: 1; }

.gms-main { margin-left: 250px; flex-grow: 1; min-width: 0; }
.gms-topbar {
    background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--gms-border); padding: 10px 24px; display: flex; align-items: center;
    gap: 12px; position: sticky; top: 0; z-index: 1020; flex-wrap: wrap;
}
.gms-topbar .gym-name { font-weight: 700; }
.gms-topbar .form-select { border-radius: 10px; font-weight: 600; }
.gms-topbar .user-chip { display: inline-flex; align-items: center; gap: 8px; background: #f3f5fa; border-radius: 30px; padding: 4px 12px 4px 4px; font-size: .82rem; color: #3b4357; }
.gms-topbar .user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--gms-grad); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.gms-content { padding: 24px; max-width: 1600px; }
.gms-sidebar-toggle { display: none; }
.gms-backdrop { display: none; }

@media (max-width: 991px) {
    .gms-sidebar { left: -260px; }
    .gms-sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.5); }
    .gms-sidebar.open ~ .gms-backdrop { display: block; position: fixed; inset: 0; background: rgba(10,14,25,.45); z-index: 1025; }
    .gms-main { margin-left: 0; }
    .gms-sidebar-toggle { display: inline-block; }
    .gms-content { padding: 14px; }
    .gms-topbar { padding: 8px 12px; }
}

/* ---------- Page title ---------- */
.page-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-title > i { background: var(--gms-grad); color: #fff; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; box-shadow: 0 6px 16px rgba(255,90,40,.3); }
.page-title small, .page-sub { font-size: .82rem; font-weight: 500; color: var(--gms-muted); letter-spacing: 0; }
.page-title .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--gms-border); border-radius: var(--gms-radius); box-shadow: var(--gms-shadow); margin-bottom: 18px; overflow: hidden; }
.card-header { background: #fff; font-weight: 700; border-bottom: 1px solid var(--gms-border); padding: 13px 18px; font-size: .92rem; }
.card-header .bi { color: var(--gms-primary); }
.card-body { padding: 18px; }
.card.border-primary { border: 1px solid #ffc8a8 !important; box-shadow: 0 8px 24px rgba(255,106,26,.12); }
.card.border-primary > .card-header { background: #fff6f0; }

/* ---------- Stat cards ---------- */
.stat-card { position: relative; border-radius: var(--gms-radius); padding: 16px 18px; background: #fff; border: 1px solid var(--gms-border); box-shadow: var(--gms-shadow); height: 100%; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.stat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--gms-grad); }
a .stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(16,24,40,.1); }
.stat-card .label { color: var(--gms-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; padding-right: 44px; }
.stat-card .value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: #141824; margin-top: 2px; }
.stat-card .sub { font-size: .76rem; color: var(--gms-muted); }
.stat-card .ico { position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.15rem; background: #fff1e8; color: var(--gms-primary); }
.stat-card.blue::before { background: linear-gradient(180deg,#3b82f6,#6366f1); } .stat-card.blue .ico { background: #eaf1ff; color: #3b6ff6; }
.stat-card.green::before { background: linear-gradient(180deg,#10b981,#22c55e); } .stat-card.green .ico { background: #e7f8f1; color: #0f9f6e; }
.stat-card.red::before { background: linear-gradient(180deg,#ef4444,#f43f5e); } .stat-card.red .ico { background: #fdecee; color: #e23b4b; }
.stat-card.yellow::before { background: linear-gradient(180deg,#f59e0b,#fbbf24); } .stat-card.yellow .ico { background: #fff6e0; color: #d48806; }
.stat-card.purple::before { background: linear-gradient(180deg,#8b5cf6,#a855f7); } .stat-card.purple .ico { background: #f2ecff; color: #7c4ddb; }
.stat-card.teal::before { background: linear-gradient(180deg,#14b8a6,#06b6d4); } .stat-card.teal .ico { background: #e3f8f6; color: #0d9488; }

/* ---------- Quick action tiles ---------- */
.quick-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.quick-tile { background: #fff; border: 1px solid var(--gms-border); border-radius: var(--gms-radius); padding: 14px 10px; text-align: center; color: #1e2433; font-weight: 600; font-size: .8rem; box-shadow: var(--gms-shadow); transition: transform .15s, box-shadow .15s; }
.quick-tile i { display: flex; margin: 0 auto 8px; width: 44px; height: 44px; border-radius: 14px; align-items: center; justify-content: center; font-size: 1.25rem; background: #fff1e8; color: var(--gms-primary); }
.quick-tile:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(16,24,40,.1); color: #141824; }
.quick-tile:nth-child(6n+2) i { background: #eaf1ff; color: #3b6ff6; }
.quick-tile:nth-child(6n+3) i { background: #e7f8f1; color: #0f9f6e; }
.quick-tile:nth-child(6n+4) i { background: #f2ecff; color: #7c4ddb; }
.quick-tile:nth-child(6n+5) i { background: #fff6e0; color: #d48806; }
.quick-tile:nth-child(6n+6) i { background: #e3f8f6; color: #0d9488; }

/* ---------- Alerts feed ---------- */
.alert-feed { display: flex; flex-direction: column; gap: 10px; }
.alert-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--gms-border); color: #1e2433; transition: background .15s; }
.alert-item:hover { background: #fafbfe; color: #1e2433; }
.alert-item .a-ico { flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.alert-item .a-title { font-weight: 700; font-size: .86rem; }
.alert-item .a-detail { font-size: .78rem; color: var(--gms-muted); }
.alert-item.danger .a-ico { background: #fdecee; color: #e23b4b; }
.alert-item.warning .a-ico { background: #fff6e0; color: #d48806; }
.alert-item.info .a-ico { background: #eaf1ff; color: #3b6ff6; }
.alert-item .bi-chevron-right { margin-left: auto; color: #b7bfd0; align-self: center; }

/* ---------- Segmented filter buttons ---------- */
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.seg .btn { background: #fff; border: 1px solid var(--gms-border); color: #3b4357; padding: 6px 14px; border-radius: 30px; font-size: .82rem; }
.seg .btn:hover { border-color: #ffc8a8; color: #e2550a; }
.seg .btn.active { background: var(--gms-grad); color: #fff; border-color: transparent; box-shadow: 0 6px 14px rgba(255,90,40,.3); }
.seg .btn .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 20px; background: rgba(0,0,0,.08); font-size: .72rem; }
.seg .btn.active .count { background: rgba(255,255,255,.25); }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 600; }
.btn-sm { border-radius: 8px; }
.btn-primary { background: var(--gms-grad); border: 0; box-shadow: 0 4px 12px rgba(255,90,40,.25); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: linear-gradient(135deg, #f05c0e 0%, #f02c60 100%) !important; }
.btn-outline-primary { color: #e2550a; border-color: #ffb78f; }
.btn-outline-primary:hover, .btn-outline-primary.active { background: #ff6a1a; border-color: #ff6a1a; color: #fff; }
.btn-warning { color: #fff; background: #f59e0b; border-color: #f59e0b; }
.btn-warning:hover { color: #fff; background: #e08e05; }

/* ---------- Tables ---------- */
.table { font-size: .85rem; margin-bottom: 0; --bs-table-hover-bg: #fff8f3; }
.table th { white-space: nowrap; background: #f8f9fc; color: #5a6378; font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--gms-border) !important; padding: 10px 12px; }
.table td { padding: 9px 12px; vertical-align: middle; border-color: #f0f2f7; }
.table-responsive { max-height: 70vh; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: #dfe3ec; }
.form-control:focus, .form-select:focus { border-color: #ffb78f; box-shadow: 0 0 0 .2rem rgba(255,106,26,.15); }
.form-control-sm, .form-select-sm { border-radius: 8px; }
.form-label { font-weight: 600; margin-bottom: 3px; font-size: .8rem; color: #3b4357; }
.required::after { content: " *"; color: #e23b4b; }
.form-check-input:checked { background-color: #ff6a1a; border-color: #ff6a1a; }

/* ---------- Badges ---------- */
.badge { font-weight: 600; border-radius: 20px; padding: .38em .7em; }
.badge-soft { background: #f1f3f8; color: #3b4357; }
.badge-soft-green { background: #e7f8f1; color: #0f8a60; }
.badge-soft-red { background: #fdecee; color: #d02f40; }
.badge-soft-yellow { background: #fff6e0; color: #b57300; }
.badge-soft-blue { background: #eaf1ff; color: #2f5fdd; }
.badge-soft-purple { background: #f2ecff; color: #6b3fd0; }
.badge-status-Active, .badge-status-Paid, .badge-status-Completed, .badge-status-Working, .badge-status-Converted, .badge-status-Attended, .badge-status-Booked, .badge-status-Given { background: #12a36f; }
.badge-status-Expired, .badge-status-Cancelled, .badge-status-Suspended, .badge-status-Unpaid, .badge-status-Refunded, .badge-status-Breakdown, .badge-status-Lost, .badge-status-NoShow { background: #e23b4b; }
.badge-status-Upcoming, .badge-status-Grace, .badge-status-Frozen, .badge-status-PartlyPaid, .badge-status-Waitlist, .badge-status-Pending { background: #f08c00; }
.badge-status-Upgraded, .badge-status-Inactive, .badge-status-Anonymized, .badge-status-Retired { background: #8a93a6; }
.badge-status-New, .badge-status-Contacted { background: #3b6ff6; }
.badge-status-TrialBooked, .badge-status-TrialDone, .badge-status-UnderRepair { background: #7c4ddb; }

.risk-bar { height: 6px; border-radius: 6px; background: #eef0f5; overflow: hidden; min-width: 70px; }
.risk-bar > span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #fbbf24, #ef4444); }

.member-photo { width: 110px; height: 130px; object-fit: cover; border-radius: 12px; background: #e9ecef; }
.member-photo-sm { width: 42px; height: 42px; object-fit: cover; border-radius: 50%; background: #e9ecef; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.photo-grid .ph { background: #fff; border: 1px solid var(--gms-border); border-radius: 12px; overflow: hidden; text-align: center; font-size: .75rem; padding-bottom: 6px; }
.photo-grid img { width: 100%; height: 150px; object-fit: cover; display: block; margin-bottom: 4px; }

/* ---------- Heatmap ---------- */
.heatmap { border-collapse: separate; border-spacing: 3px; font-size: .72rem; }
.heatmap th { color: var(--gms-muted); font-weight: 600; text-align: center; padding: 2px 4px; white-space: nowrap; }
.heatmap td { min-width: 34px; height: 28px; border-radius: 6px; text-align: center; font-weight: 600; }

/* ---------- Class schedule ---------- */
.class-card { border: 1px solid var(--gms-border); border-radius: 12px; padding: 12px 14px; background: #fff; display: flex; gap: 12px; align-items: center; color: #1e2433; transition: border-color .15s, box-shadow .15s; }
.class-card:hover, .class-card.active { border-color: #ffb78f; box-shadow: 0 6px 18px rgba(255,106,26,.14); color: #1e2433; }
.class-card .time { font-weight: 800; font-size: 1rem; min-width: 56px; color: #e2550a; }
.progress { border-radius: 10px; background: #eef0f5; }
.progress-bar { background: var(--gms-grad); }

/* ---------- Check-in ---------- */
.checkin-panel { border-radius: 14px; padding: 18px; }
.checkin-ok { background: #e3f7ee; }
.checkin-warn { background: #fff4d6; }
.checkin-bad { background: #fde6e9; }

/* ---------- Messages ---------- */
.alert { border-radius: 12px; border: 0; box-shadow: var(--gms-shadow); }
.alert-success { background: #e3f7ee; color: #0b6b4a; }
.alert-danger { background: #fde6e9; color: #a3202f; }
.alert-warning { background: #fff4d6; color: #8a5a00; }
.alert-info { background: #e7efff; color: #234fb8; }
.note-estimate { font-size: .8rem; color: #8a5a00; background: #fff8e6; border: 1px dashed #f2c46d; border-radius: 10px; padding: 8px 12px; }

/* ---------- Login ---------- */
.login-bg { min-height: 100vh; background: radial-gradient(circle at 20% 20%, rgba(255,106,26,.25) 0, transparent 40%), radial-gradient(circle at 80% 80%, rgba(255,61,110,.22) 0, transparent 40%), linear-gradient(135deg, #141824 0%, #232a3d 100%); display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 410px; border-radius: 20px; border: 0; box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.login-card .logo { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.login-card .logo i { background: var(--gms-grad); color: #fff; border-radius: 12px; padding: 4px 8px; }

/* ---------- Print ---------- */
@media print {
    .gms-sidebar, .gms-topbar, .no-print, .btn { display: none !important; }
    .gms-main { margin-left: 0; }
    body { background: #fff; }
    .card { box-shadow: none; border: 0; }
}
