*{box-sizing:border-box}body{margin:0;background:#f3f5f7;color:#17202b;font-family:Arial,sans-serif}header{background:#111827;color:white;padding:16px 25px;display:flex;justify-content:space-between;gap:20px;align-items:center}header b{font-size:18px}nav{display:flex;gap:14px;flex-wrap:wrap}nav a{color:white;text-decoration:none}main{max-width:1250px;margin:auto;padding:25px 15px 60px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:15px}.stats div,section{background:white;border-radius:13px;padding:20px;margin:16px 0;box-shadow:0 3px 14px #0000000a}.stats small,.stats span{display:block;color:#687385}.stats strong{display:block;font-size:27px;margin:7px 0}.actions,.filters{display:flex;gap:10px;flex-wrap:wrap}.btn{display:inline-block;background:#111827;color:white;border:0;border-radius:8px;padding:11px 16px;text-decoration:none;cursor:pointer}input,select{min-height:42px;border:1px solid #d4d9df;border-radius:8px;padding:9px;background:white}.form{display:grid;grid-template-columns:1fr 1fr 1fr auto;gap:10px}table{width:100%;border-collapse:collapse;min-width:620px}th,td{padding:10px;border-bottom:1px solid #e5e7eb;text-align:left}.small{padding:6px 8px;background:#eef1f5;color:#283344;text-decoration:none;border:0;border-radius:6px;cursor:pointer}.inline{display:inline}.danger{background:#fee2e2;color:#991b1b;border:0;border-radius:6px;padding:6px;cursor:pointer}.flash{padding:12px;border-radius:8px;margin-bottom:12px}.flash.success{background:#e6f7ec;color:#176b38}.flash.error{background:#fde8e8;color:#9b2424}.back{color:#596575;text-decoration:none;font-weight:bold}.edit{max-width:600px;display:grid;gap:14px}.edit label{display:grid;gap:6px}.slot{display:grid;grid-template-columns:80px 1fr auto;gap:12px;padding:15px;border-bottom:1px solid #e5e7eb}.busy{background:#eef2ff}.cal{display:grid;grid-template-columns:repeat(7,1fr);min-width:700px}.calhead{display:contents}.calhead b{text-align:center;padding:8px;background:#f7f8fa}.day{min-height:100px;border:1px solid #e5e7eb;padding:6px}.day a{display:block;background:#eef2ff;color:#17202b;text-decoration:none;padding:4px;margin:3px;font-size:11px;border-radius:4px}.login{max-width:400px;margin:10vh auto;background:white;padding:30px;border-radius:15px}.login form{display:grid;gap:12px}@media(max-width:700px){.stats{grid-template-columns:repeat(2,1fr)}.form{grid-template-columns:1fr}.slot{grid-template-columns:65px 1fr}.slot a{grid-column:2}header{flex-direction:column;align-items:flex-start}}@media(max-width:450px){.stats{grid-template-columns:1fr}main{padding:15px 8px}}

/* FITNESSCRM 4.1 calendar/schedule */
.page-title-row{display:flex;justify-content:space-between;align-items:center;gap:15px}
.muted{color:#687385;margin-top:-10px}
.secondary{background:#eef1f5;color:#17202b}
.calendar-toolbar,.schedule-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.calendar-nav{display:inline-block;padding:10px 13px;background:#eef1f5;color:#17202b;text-decoration:none;border-radius:8px;font-weight:600}
.month-form{display:flex;gap:8px;margin-left:auto}
.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:1px;background:#dfe4ea;border:1px solid #dfe4ea}
.calendar-weekday{background:#f7f8fa;padding:11px;text-align:center;font-size:12px;font-weight:700;color:#687385}
.calendar-day{background:#fff;min-height:145px;padding:8px;position:relative;overflow:hidden}
.calendar-day.other-month{background:#f5f6f8;color:#a4abb5}
.calendar-day.today{box-shadow:inset 0 0 0 2px #111827}
.calendar-day.has-workouts{background:#fbfcff}
.calendar-day-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.day-number{font-weight:800;color:#17202b;text-decoration:none}
.workout-count{font-size:10px;background:#111827;color:white;border-radius:10px;padding:2px 6px}
.calendar-workout{display:block;text-decoration:none;color:#17202b;border-radius:6px;padding:5px 6px;margin:4px 0;font-size:11px;border-left:4px solid #9ca3af;background:#f3f4f6}
.calendar-workout span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calendar-workout.past{border-left-color:#9ca3af;background:#f0f1f3}
.calendar-workout.today-workout{border-left-color:#111827;background:#e8edf5}
.calendar-workout.future{border-left-color:#4b5563;background:#eef2ff}
.day-add{display:block;margin-top:8px;color:#8a94a3;text-decoration:none;font-size:10px}
.calendar-legend{display:flex;gap:18px;flex-wrap:wrap;font-size:12px;color:#687385}
.legend-dot{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:5px;background:#9ca3af}
.today-dot{background:#111827}.future-dot{background:#4b5563}
.day-summary{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.day-summary strong{font-size:28px}.day-summary span{color:#687385;margin-right:auto}
.schedule-list{padding:0;overflow:hidden}
.schedule-slot{display:grid;grid-template-columns:85px 1fr auto;gap:15px;align-items:center;padding:13px 15px;border-bottom:1px solid #e5e7eb}
.schedule-slot:last-child{border-bottom:0}.slot-time{font-size:18px;font-weight:800}
.slot-main{display:flex;flex-direction:column;gap:3px}.slot-main span{color:#687385}.slot-main small{color:#687385}
.slot-actions{display:flex;gap:7px;align-items:center}.free-slot{background:#fafbfc}
.past-slot{border-left:5px solid #9ca3af}.today-slot{border-left:5px solid #111827;background:#f8fafc}.future-slot{border-left:5px solid #4b5563;background:#fbfcff}
@media(max-width:800px){.calendar-grid{min-width:700px}section:has(.calendar-grid){overflow-x:auto}.calendar-day{min-height:120px}}
@media(max-width:600px){.page-title-row{align-items:flex-start}.month-form{margin-left:0;width:100%}.month-form input{flex:1}.schedule-slot{grid-template-columns:65px 1fr}.slot-actions{grid-column:2}.day-summary span{margin-right:0}}



/* FITNESSCRM 4.2 — structured schedule table */

.schedule-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.schedule-table {
    width: 100%;
    min-width: 900px;
    border: 1px solid #e1e5ea;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.schedule-row {
    display: grid;
    grid-template-columns: 90px minmax(220px, 1.4fr) 120px minmax(220px, 1.6fr) 210px;
    align-items: stretch;
    min-height: 62px;
    border-bottom: 1px solid #e5e7eb;
}

.schedule-row:last-child {
    border-bottom: 0;
}

.schedule-head {
    min-height: 48px;
    background: #f4f6f8;
    color: #596474;
    font-size: 12px;
    font-weight: 700;
}

.schedule-cell {
    min-width: 0;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    border-right: 1px solid #edf0f3;
}

.schedule-cell:last-child {
    border-right: 0;
}

.time-col {
    justify-content: center;
    font-size: 16px;
    white-space: nowrap;
}

.client-col {
    overflow: hidden;
}

.client-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.price-col {
    justify-content: flex-start;
    white-space: nowrap;
}

.note-col {
    color: #5f6977;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.actions-col {
    justify-content: flex-end;
    gap: 7px;
    white-space: nowrap;
}

.past-row {
    background: #f7f8fa;
    border-left: 4px solid #9ca3af;
}

.today-row {
    background: #f5f8fc;
    border-left: 4px solid #111827;
}

.future-row {
    background: #fff;
    border-left: 4px solid #4b5563;
}

.free-row {
    background: #fafbfc;
    color: #8a94a3;
}

.free {
    color: #7b8794;
}

.empty-value {
    color: #a1a9b3;
}

.action-edit,
.action-add {
    text-decoration: none;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .schedule-table {
        min-width: 850px;
    }

    .schedule-row {
        grid-template-columns: 75px 190px 100px 220px 190px;
    }

    .schedule-cell {
        padding: 10px 11px;
    }
}

/* Club switcher and XFIT package indicators */
.club-switch{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 0;margin:0;}
.club-switch span{color:var(--muted,#777);font-size:14px;}
.club-switch span b{color:var(--text,#222);}
.inline-check{display:flex;align-items:center;gap:6px;font-size:14px;}
.package-card{border:1px solid var(--border,#ddd);border-radius:12px;padding:14px;margin:10px 0;background:var(--card,#fff);}
.remaining{display:inline-block;font-weight:700;border-radius:8px;padding:5px 9px;margin:8px 0;}
.remaining-green{background:#e5f5e9;color:#176b32;}
.remaining-yellow{background:#fff4cc;color:#805b00;}
.remaining-red{background:#ffe2e2;color:#a31616;}
.progress{height:8px;border-radius:20px;background:#e8e8e8;overflow:hidden;margin-top:5px;}
.progress span{display:block;height:100%;background:#d49a32;border-radius:20px;}


/* XFIT workout form: aligned controls and separate helper text */
.xfit-workout-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: center;
}
.xfit-workout-form > select,
.xfit-workout-form > input:not([type="checkbox"]),
.xfit-workout-form > button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
}
.xfit-workout-form > .inline-check {
    grid-column: 1 / 2;
    min-height: 42px;
    margin: 0;
    justify-content: flex-start;
    white-space: nowrap;
}
.xfit-workout-form > input[name="note"] {
    grid-column: 2 / 4;
}
.xfit-workout-form > button {
    grid-column: 4 / 5;
    align-self: stretch;
}
.xfit-workout-help {
    margin: 14px 0 2px;
    padding: 0;
    color: #687385;
    font-size: 13px;
    line-height: 1.5;
    clear: both;
}
@media (max-width: 800px) {
    .xfit-workout-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .xfit-workout-form > .inline-check { grid-column: 1 / 2; }
    .xfit-workout-form > input[name="note"] { grid-column: 2 / 3; }
    .xfit-workout-form > button { grid-column: 1 / 3; }
}
@media (max-width: 520px) {
    .xfit-workout-form { grid-template-columns: 1fr; }
    .xfit-workout-form > .inline-check,
    .xfit-workout-form > input[name="note"],
    .xfit-workout-form > button { grid-column: 1 / 2; }
}
