/* TNH Scheduling - The Nuclear House Brand Styles */

:root {
    --tnh-white: #f7f8fa;
    --tnh-light-grey: #d0d9e0;
    --tnh-medium-grey: #9babc2;
    --tnh-steel: #4a5d6b;
    --tnh-dark-steel: #364451;
    --tnh-charcoal: #1f2937;
    --tnh-green: #92d050;
    --tnh-blue: #00b0f0;
    --tnh-orange: #cc5500;
    --tnh-amber: #f4c255;
    --font-primary: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: var(--font-primary); background: var(--tnh-white); color: var(--tnh-charcoal); line-height: 1.5; min-height: 100vh; }
.hidden { display: none !important; }

/* Loading */
.loading-screen { position: fixed; inset: 0; background: var(--tnh-charcoal); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.loader { width: 48px; height: 48px; border: 4px solid var(--tnh-steel); border-top-color: var(--tnh-blue); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Auth */
.auth-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: linear-gradient(135deg, var(--tnh-charcoal), var(--tnh-dark-steel)); }
.auth-card { background: white; border-radius: 12px; padding: 2.5rem; width: 100%; max-width: 400px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); }
.auth-logo { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.logo-img { height: 120px; width: auto; }
.logo-placeholder { display: flex; align-items: center; justify-content: center; width: 60px; height: 60px; background: var(--tnh-charcoal); border-radius: 8px; color: white; font-weight: 700; font-size: 1.25rem; }
.auth-title { text-align: center; font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; }
.auth-subtitle { text-align: center; color: var(--tnh-steel); margin-bottom: 2rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.25rem; }
.form-group label { font-size: 0.875rem; font-weight: 500; color: var(--tnh-dark-steel); }
.form-group input, .form-group textarea, .form-group select { padding: 0.75rem 1rem; border: 1px solid var(--tnh-light-grey); border-radius: 8px; font-family: inherit; font-size: 1rem; }
.form-group input:focus { outline: none; border-color: var(--tnh-blue); box-shadow: 0 0 0 3px rgba(0,176,240,0.15); }
.auth-switch { text-align: center; font-size: 0.875rem; color: var(--tnh-steel); margin-top: 0.5rem; }
.auth-switch a { color: var(--tnh-blue); text-decoration: none; font-weight: 500; }
.auth-message { margin-top: 1rem; padding: 1rem; border-radius: 8px; text-align: center; font-size: 0.875rem; }
.auth-message.success { background: rgba(146,208,80,0.15); color: #5a8c2a; }
.auth-message.error { background: rgba(204,85,0,0.15); color: var(--tnh-orange); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border: none; border-radius: 8px; font-family: inherit; font-size: 0.9375rem; font-weight: 600; cursor: pointer; transition: all 150ms ease; }
.btn-primary { background: var(--tnh-blue); color: white; }
.btn-primary:hover { background: #0095cc; }
.btn-secondary { background: var(--tnh-light-grey); color: var(--tnh-charcoal); }
.btn-secondary:hover { background: var(--tnh-medium-grey); }
.btn-success { background: var(--tnh-green); color: white; }
.btn-success:hover { background: #7ab840; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-icon { width: 40px; height: 40px; padding: 0; background: white; border: 1px solid var(--tnh-light-grey); font-size: 1.25rem; color: var(--tnh-steel); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }

/* Header */
.header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 2rem; background: white; border-bottom: 1px solid var(--tnh-light-grey); position: sticky; top: 0; z-index: 100; }
.header-left { display: flex; align-items: center; gap: 1rem; }
.header-logo { height: 50px; width: auto; }
.header-logo-placeholder { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--tnh-charcoal); border-radius: 4px; color: white; font-weight: 700; font-size: 0.875rem; }
.header-title h1 { font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.header-role { display: inline-block; padding: 0.125rem 0.5rem; background: var(--tnh-blue); color: white; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; border-radius: 9999px; }
.header-role.admin { background: var(--tnh-orange); }
.header-right { display: flex; align-items: center; gap: 1rem; }
.user-name { font-weight: 500; color: var(--tnh-steel); }

/* Main Content */
.main-content { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.content-header { margin-bottom: 2rem; }
.content-header h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.content-header p { color: var(--tnh-steel); }

/* Calendar Controls */
.calendar-controls { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.calendar-controls h3 { font-size: 1.125rem; font-weight: 600; min-width: 160px; text-align: center; }
.calendar-legend { display: flex; align-items: center; justify-content: center; gap: 2rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--tnh-steel); }
.legend-dot { width: 16px; height: 16px; border-radius: 4px; }
.legend-dot.available { background: var(--tnh-green); }
.legend-dot.unavailable { background: var(--tnh-light-grey); }
.legend-dot.allocated { background: var(--tnh-blue); }

/* Calendar Grid */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; background: var(--tnh-light-grey); border-radius: 8px; overflow: hidden; margin-bottom: 2rem; }
.calendar-header { background: var(--tnh-dark-steel); color: white; padding: 0.5rem; text-align: center; font-weight: 600; font-size: 0.8125rem; }
.calendar-day { background: white; padding: 0.5rem; min-height: 70px; cursor: pointer; transition: all 150ms ease; position: relative; }
.calendar-day:hover { background: var(--tnh-white); }
.calendar-day.other-month { background: var(--tnh-white); color: var(--tnh-medium-grey); }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--tnh-blue); }
.calendar-day.available { background: rgba(146,208,80,0.2); }
.calendar-day.available:hover { background: rgba(146,208,80,0.3); }
.calendar-day.allocated { background: rgba(0,176,240,0.2); }
.calendar-day.allocated::after { content: '📋'; position: absolute; bottom: 4px; right: 4px; font-size: 0.875rem; }
.calendar-day .date-number { font-weight: 600; font-size: 0.875rem; }
.calendar-day.weekend { background: var(--tnh-white); }

/* Admin Tabs */
.admin-tabs { display: flex; gap: 0.25rem; margin-bottom: 2rem; border-bottom: 2px solid var(--tnh-light-grey); padding-bottom: 0.25rem; overflow-x: auto; }
.tab-btn { padding: 0.5rem 1.5rem; background: transparent; border: none; border-radius: 8px 8px 0 0; font-family: inherit; font-size: 0.9375rem; font-weight: 500; color: var(--tnh-steel); cursor: pointer; white-space: nowrap; }
.tab-btn:hover { background: var(--tnh-white); color: var(--tnh-charcoal); }
.tab-btn.active { background: var(--tnh-blue); color: white; }

/* Availability Grid */
.availability-grid-container { overflow-x: auto; margin-bottom: 2rem; }
.availability-grid { display: grid; gap: 1px; background: var(--tnh-light-grey); border-radius: 8px; overflow: hidden; min-width: 800px; }
.grid-header { background: var(--tnh-dark-steel); color: white; padding: 0.5rem; text-align: center; font-weight: 600; font-size: 0.75rem; }
.grid-header.trainer-name { text-align: left; padding-left: 1rem; min-width: 150px; }
.grid-cell { background: white; padding: 0.5rem; text-align: center; font-size: 0.75rem; min-height: 40px; display: flex; align-items: center; justify-content: center; }
.grid-cell.trainer-row-name { justify-content: flex-start; padding-left: 1rem; font-weight: 500; background: var(--tnh-white); }
.grid-cell.available { background: var(--tnh-green); color: white; font-weight: 600; }
.grid-cell.unavailable { background: var(--tnh-light-grey); color: var(--tnh-steel); }
.grid-cell.unavailable-confirmed { background: #ef4444; color: white; font-weight: 600; }
.grid-cell.not-set { background: var(--tnh-light-grey); color: var(--tnh-medium-grey); }
.grid-cell.allocated { background: var(--tnh-blue); color: white; font-weight: 600; }
.grid-cell.delivered { background: #10b981; color: white; font-weight: 600; }
.grid-cell.selected { background: var(--tnh-amber); color: var(--tnh-charcoal); font-weight: 600; }
.grid-cell.clickable { cursor: pointer; }
.grid-cell.clickable:hover { opacity: 0.8; transform: scale(1.05); }

/* Calendar Day Statuses */
.calendar-day.not-set { background: var(--tnh-light-grey); color: var(--tnh-medium-grey); }
.calendar-day.available { background: var(--tnh-green); color: white; }
.calendar-day.unavailable-confirmed { background: #ef4444; color: white; }
.calendar-day.allocated { background: var(--tnh-blue); color: white; }
.calendar-day.delivered { background: #10b981; color: white; }
.calendar-day.selected { background: var(--tnh-amber); color: var(--tnh-charcoal); border: 2px solid var(--tnh-charcoal); }
.calendar-day .day-status { font-size: 1rem; display: block; margin-top: 0.125rem; }

/* Trainer Action Bar */
.action-bar { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1rem; background: var(--tnh-charcoal); color: white; border-radius: 8px; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.action-bar-info { font-weight: 500; }
.action-bar-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-available { background: var(--tnh-green); color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; font-family: inherit; font-weight: 600; cursor: pointer; }
.btn-available:hover { opacity: 0.9; }
.btn-unavailable { background: #ef4444; color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; font-family: inherit; font-weight: 600; cursor: pointer; }
.btn-unavailable:hover { opacity: 0.9; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }

/* Legend Dots */
.legend-dot.not-set { background: var(--tnh-light-grey); border: 1px dashed var(--tnh-medium-grey); }
.legend-dot.unavailable-confirmed { background: #ef4444; }
.legend-dot.delivered { background: #10b981; }

/* Details Grid */
.details-grid { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.detail-row { padding: 0.5rem 0; border-bottom: 1px solid var(--tnh-light-grey); }
.detail-row:last-child { border-bottom: none; }

/* Employment Toggle */
.employment-toggle { display: flex; gap: 0.5rem; }
.toggle-option { flex: 1; display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem; border: 1px solid var(--tnh-light-grey); border-radius: 6px; cursor: pointer; transition: all 150ms; }
.toggle-option:hover { border-color: var(--tnh-blue); }
.toggle-option input[type="radio"] { accent-color: var(--tnh-blue); }

/* Allocation Card Delivered State */
.allocation-card.delivered { border-left: 4px solid #10b981; }
.status-badge.delivered { background: rgba(16,185,129,0.2); color: #059669; }

/* Allocation Toolbar */
.allocation-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding: 0.75rem 1rem; background: white; border: 1px solid var(--tnh-light-grey); border-radius: 8px; flex-wrap: wrap; gap: 0.5rem; }
.toolbar-left { display: flex; align-items: center; gap: 1rem; }
.toolbar-right { display: flex; align-items: center; gap: 0.5rem; }
.selection-info { font-weight: 500; color: var(--tnh-charcoal); }
.btn-disabled { opacity: 0.5; cursor: not-allowed; }

/* Legend Bar */
.legend-bar { display: flex; justify-content: center; gap: 2rem; margin-top: 1rem; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--tnh-steel); }
.legend-dot { width: 16px; height: 16px; border-radius: 4px; }
.legend-dot.available { background: var(--tnh-green); }
.legend-dot.unavailable { background: var(--tnh-light-grey); }
.legend-dot.allocated { background: var(--tnh-blue); }
.legend-dot.selected { background: var(--tnh-amber); }

/* Modal Large */
.modal-large { max-width: 500px; width: 90%; }
.modal-info { background: var(--tnh-white); padding: 1rem; border-radius: 8px; margin-bottom: 1rem; }
.modal-info p { margin: 0.25rem 0; color: var(--tnh-charcoal); }
.modal-content .form-group { margin-bottom: 1rem; }
.modal-content .form-group input,
.modal-content .form-group textarea,
.modal-content .form-group select { width: 100%; box-sizing: border-box; }
.modal-content .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 500px) { .modal-content .form-row { grid-template-columns: 1fr; } }

/* Training Type Toggle */
.training-type-toggle { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.type-btn { flex: 1; padding: 0.75rem; border: 2px solid var(--tnh-light-grey); border-radius: 8px; background: white; font-family: inherit; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 150ms ease; }
.type-btn:hover { border-color: var(--tnh-medium-grey); }
.type-btn.active.in-person { border-color: var(--tnh-blue); background: rgba(0,176,240,0.1); color: var(--tnh-blue); }
.type-btn.active.remote { border-color: #8b5cf6; background: rgba(139,92,246,0.1); color: #8b5cf6; }

/* Grid cell for remote allocations */
.grid-cell.allocated-remote { background: #8b5cf6; color: white; font-weight: 600; }
.legend-dot.allocated-remote { background: #8b5cf6; }

/* Forms */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.allocate-form { background: white; border: 1px solid var(--tnh-light-grey); border-radius: 8px; padding: 1.5rem; margin-bottom: 2rem; }

/* Trainer Cards */
.trainers-list, .allocations-list { display: grid; gap: 1rem; }
.trainer-card, .allocation-card { display: flex; align-items: center; justify-content: space-between; background: white; border: 1px solid var(--tnh-light-grey); border-radius: 8px; padding: 1rem 1.5rem; flex-wrap: wrap; gap: 1rem; }
.trainer-card:hover { border-color: var(--tnh-blue); }
.trainer-info { display: flex; flex-direction: column; gap: 0.25rem; }
.trainer-info .name { font-weight: 600; }
.trainer-info .email { font-size: 0.875rem; color: var(--tnh-steel); }
.trainer-info .phone { font-size: 0.875rem; color: var(--tnh-medium-grey); }

/* Allocations */
.allocation-card.pending { border-left: 4px solid var(--tnh-amber); }
.allocation-card.confirmed { border-left: 4px solid var(--tnh-green); }
.allocation-card.declined { border-left: 4px solid var(--tnh-orange); }
.allocation-details { flex: 1; }
.allocation-details .title { font-weight: 600; margin-bottom: 0.25rem; }
.allocation-details .meta { font-size: 0.875rem; color: var(--tnh-steel); display: flex; flex-wrap: wrap; gap: 1rem; }
.status-badge { padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.status-badge.pending { background: rgba(244,194,85,0.2); color: #b8860b; }
.status-badge.confirmed { background: rgba(146,208,80,0.2); color: #5a8c2a; }
.status-badge.declined { background: rgba(204,85,0,0.2); color: var(--tnh-orange); }
.no-data { text-align: center; color: var(--tnh-steel); padding: 2rem; background: var(--tnh-white); border-radius: 8px; }
.admin-badge { display: inline-block; padding: 0.125rem 0.5rem; background: var(--tnh-orange); color: white; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; border-radius: 9999px; margin-left: 0.5rem; }

/* Toast */
.toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--tnh-charcoal); color: white; padding: 1rem 2rem; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); z-index: 1000; transition: transform 0.3s ease; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--tnh-green); }
.toast.error { background: var(--tnh-orange); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(31,41,55,0.5); display: flex; align-items: center; justify-content: center; padding: 1.5rem; z-index: 1000; }
.modal-content { background: white; border-radius: 12px; padding: 2rem; max-width: 400px; width: 100%; }
.modal-content h3 { margin-bottom: 1rem; }
.modal-content p { color: var(--tnh-steel); margin-bottom: 1.5rem; }
.modal-actions { display: flex; gap: 1rem; justify-content: flex-end; }

@media (max-width: 768px) {
    .main-content { padding: 1rem; }
    .header { padding: 1rem; }
    .user-name { display: none; }
}

/* =====================================================
   Profile System Styles
   ===================================================== */

/* Profile Modal */
.modal-profile { max-width: 550px; width: 95%; max-height: 90vh; overflow-y: auto; }
.modal-subtitle { color: var(--tnh-steel); margin-bottom: 1.5rem; font-size: 0.9rem; }
.modal-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

/* Error Summary */
.error-summary { background: rgba(204,85,0,0.1); border: 1px solid var(--tnh-orange); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; color: var(--tnh-orange); }
.error-summary ul { margin: 0.5rem 0 0 1.25rem; padding: 0; }
.error-summary li { margin: 0.25rem 0; }

/* Form Sections */
.profile-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-section { padding: 1rem; background: var(--tnh-white); border-radius: 8px; border: 2px solid transparent; transition: border-color 200ms; }
.form-section.section-error { border-color: var(--tnh-orange); background: rgba(204,85,0,0.05); }
.section-label { display: block; font-weight: 600; color: var(--tnh-charcoal); margin-bottom: 0.5rem; font-size: 0.9rem; }
.section-hint { font-size: 0.8rem; color: var(--tnh-steel); margin: 0 0 0.5rem 0; }
.small-label { display: block; font-size: 0.8rem; color: var(--tnh-steel); margin-bottom: 0.25rem; }

/* Photo Upload */
.photo-upload-row { display: flex; align-items: center; gap: 1rem; }
.photo-preview { width: 80px; height: 80px; border-radius: 50%; background: var(--tnh-light-grey); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; border: 3px solid white; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-initial { font-size: 2rem; font-weight: 600; color: var(--tnh-steel); }
.photo-controls { display: flex; flex-direction: column; gap: 0.25rem; }
.photo-hint { font-size: 0.75rem; color: var(--tnh-medium-grey); }

/* Form Inputs */
.form-select, .form-input, .form-textarea { width: 100%; padding: 0.75rem; border: 1px solid var(--tnh-light-grey); border-radius: 6px; font-family: inherit; font-size: 0.9rem; transition: border-color 150ms, box-shadow 150ms; }
.form-select:focus, .form-input:focus, .form-textarea:focus { outline: none; border-color: var(--tnh-blue); box-shadow: 0 0 0 3px rgba(0,176,240,0.15); }
.form-select.field-error, .form-input.field-error { border-color: var(--tnh-orange); background: rgba(204,85,0,0.05); }

/* Radio Buttons */
.radio-buttons { display: flex; flex-direction: column; gap: 0.5rem; }
.radio-option { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: white; border: 1px solid var(--tnh-light-grey); border-radius: 6px; cursor: pointer; transition: all 150ms; }
.radio-option:hover { border-color: var(--tnh-blue); }
.radio-option input[type="radio"] { width: 18px; height: 18px; accent-color: var(--tnh-blue); margin: 0; flex-shrink: 0; }
.radio-option span { font-size: 0.9rem; color: var(--tnh-charcoal); }

/* Checkbox Grid */
.checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
@media (max-width: 500px) { .checkbox-grid { grid-template-columns: 1fr; } }
.checkbox-option { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem; background: white; border: 1px solid var(--tnh-light-grey); border-radius: 6px; cursor: pointer; transition: all 150ms; }
.checkbox-option:hover { border-color: var(--tnh-blue); }
.checkbox-option input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--tnh-blue); margin: 0; flex-shrink: 0; }
.checkbox-option span { font-size: 0.85rem; color: var(--tnh-charcoal); }
.checkbox-option.field-error { border-color: var(--tnh-orange); background: rgba(204,85,0,0.05); }

/* Two Column Row */
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 400px) { .form-row-2 { grid-template-columns: 1fr; } }

/* Buttons */
.btn-block { width: 100%; margin-top: 0.5rem; }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 0.5rem; }

/* Field Errors (Auth) */
.field-error { border-color: var(--tnh-orange) !important; background: rgba(204,85,0,0.05) !important; }
.field-error-message { display: block; color: var(--tnh-orange); font-size: 0.8rem; margin-top: 0.25rem; }
.hint { font-weight: 400; color: var(--tnh-steel); font-size: 0.8rem; }

/* Profile Card */
.profile-card { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; background: white; border: 1px solid var(--tnh-light-grey); border-radius: 12px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.profile-photo { width: 70px; height: 70px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--tnh-light-grey); }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-placeholder-large { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: var(--tnh-dark-steel); color: white; font-size: 1.75rem; font-weight: 600; }
.profile-info { flex: 1; min-width: 150px; }
.profile-info h3 { margin: 0 0 0.25rem 0; font-size: 1.125rem; }
.profile-membership { color: var(--tnh-steel); margin: 0 0 0.25rem 0; font-size: 0.85rem; }
.profile-experience { color: var(--tnh-medium-grey); margin: 0; font-size: 0.8rem; }

/* Badges */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 9999px; font-size: 0.7rem; font-weight: 600; }
.badge-success { background: rgba(146,208,80,0.2); color: #5a8c2a; }
.badge-info { background: rgba(0,176,240,0.2); color: #0077a3; }
.badge-warning { background: rgba(244,194,85,0.2); color: #b8860b; }

/* Admin Trainer Cards */
.trainer-profile-row { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: white; border: 1px solid var(--tnh-light-grey); border-radius: 8px; margin-bottom: 0.75rem; flex-wrap: wrap; }
.trainer-profile-row .profile-photo { width: 50px; height: 50px; }
.trainer-profile-row .trainer-details { flex: 1; min-width: 180px; }
.trainer-profile-row .trainer-details h4 { margin: 0 0 0.25rem 0; font-size: 0.95rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.trainer-profile-row .trainer-meta { font-size: 0.8rem; color: var(--tnh-steel); }
.trainer-profile-row .trainer-stats { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.trainer-stat { text-align: center; }
.trainer-stat .stat-value { font-size: 1.125rem; font-weight: 700; color: var(--tnh-charcoal); }
.trainer-stat .stat-label { font-size: 0.7rem; color: var(--tnh-steel); }
.trainer-profile-row .trainer-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Star Rating */
.star-rating { display: inline-flex; gap: 0.125rem; }
.star-rating .star { color: var(--tnh-light-grey); font-size: 0.9rem; }
.star-rating .star.filled { color: var(--tnh-amber); }
.star-rating-input { display: flex; gap: 0.25rem; }
.star-rating-input .star { cursor: pointer; font-size: 1.5rem; color: var(--tnh-light-grey); transition: color 150ms; }
.star-rating-input .star:hover, .star-rating-input .star.active { color: var(--tnh-amber); }

/* Qualifications Tags */
.qualifications-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.25rem; }
.qual-tag { background: var(--tnh-white); border: 1px solid var(--tnh-light-grey); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.65rem; color: var(--tnh-steel); }

/* =====================================================
   MOBILE RESPONSIVE STYLES
   ===================================================== */

/* Tablet and below */
@media (max-width: 768px) {
    /* Header */
    .header { flex-direction: column; gap: 0.75rem; padding: 0.75rem 1rem; }
    .header-left { width: 100%; justify-content: center; }
    .header-right { width: 100%; justify-content: center; }
    .header-title h1 { font-size: 1.125rem; }
    .header-logo { height: 40px; }
    
    /* Main content */
    .main-content { padding: 1rem; }
    
    /* Calendar - trainer view */
    .calendar { gap: 1px; }
    .calendar-header { padding: 0.375rem 0.25rem; font-size: 0.7rem; }
    .calendar-day { min-height: 50px; padding: 0.25rem; }
    .calendar-day .day-number { font-size: 0.8rem; }
    .calendar-day .day-status { font-size: 0.875rem; }
    
    /* Admin grid - horizontal scroll */
    .availability-grid { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .grid-cell { min-width: 36px; font-size: 0.75rem; }
    .grid-cell.trainer-row-name { min-width: 120px; position: sticky; left: 0; background: white; z-index: 1; }
    .grid-header.trainer-name { min-width: 120px; position: sticky; left: 0; z-index: 2; }
    
    /* Tabs */
    .tabs { flex-wrap: wrap; gap: 0.25rem; }
    .tab-btn { flex: 1; min-width: 100px; padding: 0.625rem 0.75rem; font-size: 0.8rem; }
    
    /* Action bar */
    .action-bar { flex-direction: column; text-align: center; }
    .action-bar-buttons { width: 100%; justify-content: center; }
    
    /* Selection bar (admin) */
    .selection-bar { flex-direction: column; gap: 0.5rem; }
    .selection-bar .selection-info { text-align: center; }
    .selection-bar .selection-actions { width: 100%; justify-content: center; }
    
    /* Allocation cards */
    .allocation-card { flex-direction: column; align-items: flex-start; }
    .allocation-actions { width: 100%; margin-top: 0.75rem; flex-direction: row; justify-content: space-between; }
    
    /* Profile card */
    .profile-card { flex-direction: column; text-align: center; }
    .profile-card .profile-info { width: 100%; }
    .profile-card button { width: 100%; }
    
    /* Modals */
    .modal-content { margin: 0.5rem; padding: 1.25rem; max-height: 95vh; }
    .modal-profile { margin: 0.25rem; padding: 1rem; }
    .modal-large { width: calc(100% - 1rem); }
    
    /* Form rows */
    .form-row { grid-template-columns: 1fr; }
    
    /* Legend */
    .legend-bar { flex-wrap: wrap; justify-content: center; gap: 0.5rem 1rem; }
    .calendar-legend { flex-wrap: wrap; justify-content: center; gap: 0.5rem 1rem; }
}

/* Mobile phones */
@media (max-width: 480px) {
    html { font-size: 14px; }
    
    /* Auth */
    .auth-card { padding: 1.5rem; margin: 0.5rem; }
    .logo-img { height: 80px; }
    .auth-title { font-size: 1.5rem; }
    
    /* Header */
    .header-title h1 { font-size: 1rem; }
    .user-name { display: none; }
    
    /* Calendar */
    .calendar-day { min-height: 44px; }
    .calendar-day .day-number { font-size: 0.75rem; }
    .calendar-day .day-status { font-size: 0.75rem; }
    .calendar-controls h3 { font-size: 1rem; }
    
    /* Admin grid */
    .grid-cell { min-width: 32px; height: 32px; font-size: 0.7rem; }
    .grid-cell.trainer-row-name { min-width: 100px; font-size: 0.75rem; }
    .grid-header { font-size: 0.65rem; padding: 0.25rem; }
    
    /* Buttons */
    .btn { padding: 0.625rem 1rem; font-size: 0.875rem; }
    .btn-sm { padding: 0.375rem 0.625rem; font-size: 0.75rem; }
    
    /* Action bar buttons */
    .btn-available, .btn-unavailable { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
    
    /* Tabs - stack on very small screens */
    .tab-btn { min-width: unset; flex: 1 1 45%; }
    
    /* Modals */
    .modal-content { padding: 1rem; }
    .modal-content h3 { font-size: 1.125rem; }
    .modal-actions { flex-direction: column; }
    .modal-actions .btn { width: 100%; }
    
    /* Profile form */
    .checkbox-grid { grid-template-columns: 1fr; }
    .radio-buttons { gap: 0.375rem; }
    .radio-option { padding: 0.5rem 0.75rem; }
    .photo-upload-row { flex-direction: column; align-items: center; text-align: center; }
    .photo-preview { width: 70px; height: 70px; }
    
    /* Employment toggle */
    .employment-toggle { flex-direction: column; }
    
    /* Trainer cards in admin */
    .trainer-profile-row { padding: 0.75rem; }
    .trainer-profile-row .trainer-stats { width: 100%; justify-content: space-around; margin: 0.5rem 0; }
    .trainer-profile-row .trainer-actions { width: 100%; }
    .trainer-profile-row .trainer-actions .btn { flex: 1; }
    
    /* Content header */
    .content-header h2 { font-size: 1.25rem; }
    .content-header p { font-size: 0.85rem; }
    
    /* Allocation details */
    .details-grid { font-size: 0.875rem; }
    .detail-row { padding: 0.375rem 0; }
}

/* Very small phones */
@media (max-width: 360px) {
    html { font-size: 13px; }
    
    .auth-card { padding: 1.25rem; }
    .logo-img { height: 60px; }
    
    .calendar-day { min-height: 40px; }
    .calendar-header { font-size: 0.6rem; }
    
    .grid-cell { min-width: 28px; height: 28px; }
    .grid-cell.trainer-row-name { min-width: 80px; }
}

/* Landscape phone - ensure grid is usable */
@media (max-height: 500px) and (orientation: landscape) {
    .modal-content { max-height: 90vh; }
    .modal-profile { max-height: 85vh; }
    .calendar-day { min-height: 36px; }
}
