@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700&display=swap');

:root {
    --primary-dark-blue: #0A1128;
    --secondary-blue: #001F54;
    --accent-blue: #034078;
    --light-blue: #1282A2;
    --text-light: #E0FBFC;
    --text-dark: #333;
    --error-red: #E74C3C;
    --success-green: #2ECC71;
    --warning-orange: #f39c12;
    --card-bg: #FFFFFF;
    --input-bg: #F8F8F8;
    --border-light: #DDD;
    --gradient-start: #001F54;
    --gradient-end: #0A1128;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

/* Loader Overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.loader-overlay.active { opacity: 1; visibility: visible; display: flex; }
.spinner { border: 5px solid rgba(255, 255, 255, 0.3); border-top: 5px solid var(--light-blue); border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Login Background */
.login-background { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(45deg, var(--primary-dark-blue), var(--secondary-blue)); z-index: -1; }

/* Base style for all modal-like cards */
.modal-card {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Main Content containers start hidden and transition in */
#authContainer, #appContent, #unauthorizedAccess {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    display: none; /* All major sections start hidden */
}

/* Active state for making sections visible */
#authContainer.active, #appContent.active, #unauthorizedAccess.active {
    opacity: 1;
    transform: translateY(0);
    /* JS will set display to flex or block */
}

/* Auth container specifics */
#authContainer {
    height: 670px; 
    padding: 0;
    position: relative;
}

/* Auth subsections for sliding animation */
.auth-sub-section {
    width: 100%;
    padding: 40px;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
    background-color: var(--card-bg);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.auth-sub-section.active { transform: translateX(0%); opacity: 1; z-index: 1; }
.auth-sub-section.inactive-left { transform: translateX(-100%); opacity: 0; z-index: 0; }
.auth-sub-section.inactive-right { transform: translateX(100%); opacity: 0; z-index: 0; }

.modal-title { color: var(--primary-dark-blue); font-weight: 700; margin-bottom: 10px; font-size: 2.2rem; display: flex; align-items: center; justify-content: center; gap: 15px; }
.modal-subtitle { color: var(--secondary-blue); font-size: 1.1rem; margin-bottom: 30px; }

/* Input Group */
.input-group { position: relative; margin-bottom: 25px; width: 100%; }
.input-group input, .input-group select, .input-group textarea { width: calc(100% - 24px); padding: 14px 12px; border: 1px solid var(--border-light); border-radius: 8px; font-size: 1rem; background-color: var(--input-bg); color: var(--text-dark); transition: all 0.3s ease; font-family: 'Montserrat', sans-serif; }
.input-group textarea { min-height: 80px; resize: vertical; }
.input-group label { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #666; pointer-events: none; transition: all 0.3s ease; background-color: var(--input-bg); padding: 0 4px; font-size: 0.95rem; }
.input-group input:focus + label, .input-group input:not(:placeholder-shown) + label, .input-group select:focus + label, .input-group select:valid + label, .input-group textarea:focus + label, .input-group textarea:not(:placeholder-shown) + label { top: 0; font-size: 0.8rem; color: var(--accent-blue); }
.input-group input:focus, .input-group select:focus, .input-group textarea:focus { border-color: var(--light-blue); box-shadow: 0 0 0 3px rgba(18, 130, 162, 0.2); outline: none; }
.input-group.inline-action { display: flex; align-items: center; gap: 10px; }
.input-group.inline-action .search-container { flex-grow: 1; }
.input-group input:disabled { background-color: #eee; cursor: not-allowed; }

/* Buttons */
.btn { padding: 14px 28px; border: none; border-radius: 8px; cursor: pointer; font-size: 1rem; font-weight: 600; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 0.5px; }
.btn i { margin-right: 8px; }
.btn-primary { background-color: var(--accent-blue); color: var(--text-light); box-shadow: 0 5px 15px rgba(3, 64, 120, 0.3); width: 100%; }
.btn-primary:hover { background-color: var(--light-blue); box-shadow: 0 8px 20px rgba(18, 130, 162, 0.4); transform: translateY(-2px); }
.btn-primary:disabled { background-color: #a0a0a0; box-shadow: none; transform: none; cursor: not-allowed; }
.btn-secondary { background-color: var(--secondary-blue); color: var(--text-light); box-shadow: 0 3px 10px rgba(0, 31, 84, 0.2); }
.btn-secondary:hover { background-color: var(--primary-dark-blue); transform: translateY(-1px); }
.btn-action { background-color: var(--secondary-blue); color: var(--text-light); box-shadow: 0 3px 10px rgba(0, 31, 84, 0.2); display: inline-flex; align-items: center; justify-content: center; }
.btn-action:hover { background-color: var(--primary-dark-blue); transform: translateY(-1px); }
.btn-warning { background-color: var(--warning-orange); color: white; }
.btn-warning:hover { background-color: #e67e22; }
.btn-danger { background-color: var(--error-red); color: white; }
.btn-danger:hover { background-color: #c0392b; }
.btn-text { background: none; color: var(--accent-blue); text-transform: none; padding: 5px 10px; font-weight: 600; font-size: 0.95rem; }
.btn-text:hover { color: var(--light-blue); transform: translateY(0); text-decoration: underline; }
.btn-icon { background: none; border: none; color: var(--secondary-blue); font-size: 1.4rem; cursor: pointer; padding: 8px; border-radius: 50%; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; transition: background-color 0.3s ease, color 0.3s ease; }
.btn-icon:hover { background-color: #f0f0f0; color: var(--primary-dark-blue); }
.admin-badge { color: var(--accent-blue); font-size: 1.5rem; position: relative; z-index: 5; }
.admin-badge:hover { color: var(--light-blue); }
.profile-btn { font-size: 1.8rem; }

/* Messages */
.error-message, .info-message { font-size: 0.9rem; margin-top: 15px; text-align: center; opacity: 0; transform: translateY(10px); transition: opacity 0.3s ease, transform 0.3s ease; width: 100%; }
.error-message.show, .info-message.show { opacity: 1; transform: translateY(0); }
.error-message { color: var(--error-red); }
.info-message { color: var(--success-green); }

.auth-switch { margin-top: 20px; font-size: 0.9rem; color: #888; }
#loginForm, #registerForm { width: 100%; display: flex; flex-direction: column; align-items: center; }

/* Main App Content */
.app-content { background-color: var(--card-bg); padding: 30px; border-radius: 12px; box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); width: 100%; max-width: 1200px; box-sizing: border-box; min-height: 500px; }
.app-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--border-light); margin-bottom: 25px; }
.app-title { color: var(--primary-dark-blue); font-weight: 700; font-size: 1.8rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.user-info { display: flex; align-items: center; gap: 10px; }

/* Profile Dropdown */
.profile-menu { position: relative; z-index: 4; }
.dropdown-content { display: none; position: absolute; right: 0; top: 50px; background-color: #fff; min-width: 220px; box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); border-radius: 8px; z-index: 100; overflow: hidden; animation: fadeInDropdown 0.2s ease-out; }
.dropdown-content.show { display: block; }
.dropdown-header { padding: 15px; border-bottom: 1px solid var(--border-light); }
.dropdown-header .user-name { display: block; font-weight: 600; color: var(--primary-dark-blue); font-size: 1rem; }
.dropdown-header .user-status { display: block; font-size: 0.85rem; color: #666; }
.dropdown-item { color: black; padding: 12px 16px; text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 0.95rem; transition: background-color 0.2s ease; }
.dropdown-item:hover { background-color: #f1f1f1; }
.dropdown-item i { color: #555; }
@keyframes fadeInDropdown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Tabs Navigation */
.nav-tabs { display: flex; margin-bottom: 20px; border-bottom: 2px solid var(--border-light); }
.nav-btn { flex-grow: 1; padding: 15px 20px; background-color: transparent; border: none; border-bottom: 3px solid transparent; color: var(--secondary-blue); font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-align: center; }
.nav-btn:hover:not(.active) { color: var(--primary-dark-blue); background-color: #f5f5f5; }
.nav-btn.active { color: var(--light-blue); border-bottom-color: var(--light-blue); background-color: #fff; }

/* Tab Content */
.tab-container { padding-top: 15px; }
.tab-content { display: none; animation: fadeInContent 0.5s ease-out; }
.tab-content.active { display: block; }
.tab-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.tab-header h3 { margin: 0; color: var(--primary-dark-blue); }
.actions-group { display: flex; gap: 10px; align-items: center; }
.search-input { padding: 10px 15px; border: 1px solid var(--border-light); border-radius: 8px; font-size: 0.9rem; width: 250px; transition: all 0.3s ease; }
.search-input:focus { border-color: var(--light-blue); box-shadow: 0 0 0 3px rgba(18, 130, 162, 0.2); outline: none; }
@keyframes fadeInContent { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* PIN Lock & Modal Overlay */
.pin-lock-overlay, .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.85); display: none; justify-content: center; align-items: center; z-index: 999; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; }
.pin-lock-overlay.active, .modal-overlay.active { opacity: 1; visibility: visible; display: flex; }
.pin-lock-card, .modal-overlay .modal-card { transform: scale(0.9); transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55); }
.modal-overlay .modal-card#formModal { max-width: 650px; text-align: left; }
.form-title { text-align: center; }
.modal-close-btn { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 1.5rem; color: #888; cursor: pointer; transition: color 0.3s ease; }
.modal-close-btn:hover { color: var(--error-red); }
.modal-body { margin-bottom: 25px; max-height: 60vh; overflow-y: auto; padding: 5px 15px; } 
.modal-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--border-light); padding-top: 20px; width: 100%; box-sizing: border-box; }
.modal-footer .actions-left, .modal-footer .actions-right { display: flex; gap: 10px; }
.pin-lock-overlay.active .pin-lock-card, .modal-overlay.active .modal-card { transform: scale(1); }
.pin-lock-card { background-color: var(--card-bg); padding: 40px; border-radius: 12px; box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); width: 100%; max-width: 380px; box-sizing: border-box; text-align: center; }
.pin-lock-title { color: var(--primary-dark-blue); font-weight: 700; margin-bottom: 25px; font-size: 1.8rem; }
.pin-input-container { display: flex; justify-content: center; margin-bottom: 25px; }
.pin-input { width: 200px; padding: 15px 20px; font-size: 1.5rem; letter-spacing: 8px; text-align: center; border: 2px solid var(--border-light); border-radius: 8px; transition: all 0.3s ease; color: var(--primary-dark-blue); font-weight: 600; }
.pin-input:focus { border-color: var(--light-blue); box-shadow: 0 0 0 4px rgba(18, 130, 162, 0.3); outline: none; }
.pin-input-field { -webkit-text-security: disc; text-security: disc; }

/* Unauthorized access specific styles */
.unauthorized-access { max-width: 450px; }
.unauthorized-access .modal-title { color: var(--error-red); }

/* Blur Effect for Overlays */
body.pin-locked #appContent, body.pin-locked #authContainer, body.modal-open #appContent, body.modal-open #authContainer { filter: blur(5px); pointer-events: none; transition: filter 0.3s ease-out; }
body.pin-locked #loader-overlay, body.modal-open #loader-overlay { filter: none; z-index: 1001; }

/* Data Tables */
.table-container { overflow-x: auto; max-height: 60vh; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.data-table th, .data-table td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.data-table th { background-color: #f8f9fa; color: var(--secondary-blue); font-weight: 600; position: sticky; top: 0; }
.data-table tbody tr:hover { background-color: #f1f1f1; }
.data-table .actions-cell { white-space: nowrap; display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.data-table .actions-cell button { background: none; border: none; cursor: pointer; font-size: 1.2rem; margin: 0; transition: color 0.2s, transform 0.2s ease; padding: 5px; }
.data-table .actions-cell button:hover { transform: scale(1.15); }
.actions-cell .btn-edit { color: var(--accent-blue); }
.actions-cell .btn-cancel { color: var(--warning-orange); }
.actions-cell .btn-check-in { color: var(--success-green); }
.actions-cell .btn-start-session { color: var(--accent-blue); }
.actions-cell .btn-check-out { color: var(--secondary-blue); }
.actions-cell .btn-delete { color: var(--error-red); }
.actions-cell .btn-details { color: #888; font-size: 1.1rem; }

.empty-row td { text-align: center; padding: 40px; color: #888; font-style: italic; }
.data-table small { color: #777; font-size: 0.8em; }

/* Badges */
.group-badge { display: inline-flex; align-items: center; color: var(--text-light); padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; margin: 2px; font-weight: 500; }
.status-badge { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.status-scheduled { background-color: #ecf0f1; color: #7f8c8d; }
.status-confirmed { background-color: #e8f5e9; color: var(--success-green); }
.status-cancelled { background-color: #fbe9e7; color: var(--error-red); }
.status-rescheduled { background-color: #f5f5f5; color: #616161; }
.status-admin { background-color: #f3e5f5; color: #8e24aa; }
.status-staff { background-color: #e3f2fd; color: #1e88e5; }
.status-pending { background-color: #fff3e0; color: #fb8c00; }
.status-arriving-soon { background-color: #e3f2fd; color: #1e88e5; }
.status-checked-in { background-color: #e0f2f1; color: #00897b; }
.status-in-session { background-color: #f3e5f5; color: #8e24aa; }
.status-checked-out { background-color: #f5f5f5; color: #616161; }
.status-late { background-color: #fff3e0; color: #fb8c00; }
.status-no-show { background-color: #fbe9e7; color: var(--error-red); }

/* Sub-headings in modals */
.modal-sub-heading { font-weight: 600; color: var(--primary-dark-blue); margin-top: 20px; margin-bottom: 15px; padding-bottom: 5px; border-bottom: 1px solid var(--border-light); font-size: 1.1rem; }
.modal-sub-heading:first-child { margin-top: 0; }
.reschedule-info-box {
    background-color: #f5f5f5;
    border-left: 4px solid var(--accent-blue);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

/* Searchable Input and Attendee Tags */
.search-container { position: relative; }
.search-results { position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid var(--border-light); border-top: none; border-radius: 0 0 8px 8px; max-height: 200px; overflow-y: auto; z-index: 10; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.search-result-item { padding: 10px 15px; cursor: pointer; }
.search-result-item:hover { background-color: #f1f1f1; }
.attendee-container { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; border: 1px solid var(--border-light); border-radius: 8px; min-height: 40px; }
.attendee-tag { display: flex; align-items: center; background-color: var(--accent-blue); color: var(--text-light); padding: 5px 10px; border-radius: 15px; font-size: 0.9rem; }
.attendee-tag button { background: none; border: none; color: white; margin-left: 8px; font-size: 1rem; cursor: pointer; padding: 0; line-height: 1; }

/* Appointment Filter */
.filter-container { position: relative; }
.filter-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 5px); background-color: #fff; width: 300px; box-shadow: 0 8px 16px 0 rgba(0,0,0,0.15); border-radius: 8px; z-index: 10; padding: 15px; animation: fadeInDropdown 0.2s ease-out; border: 1px solid var(--border-light); }
.filter-dropdown.show { display: block; }
.filter-section { margin-bottom: 15px; }
.filter-section:last-child { margin-bottom: 0; }
.filter-section h4 { margin: 0 0 10px 0; font-size: 0.9rem; color: var(--secondary-blue); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border-light); padding-bottom: 5px; }
.filter-options { max-height: 150px; overflow-y: auto; padding-right: 5px; }
.filter-item label { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; font-size: 0.95rem; }
.filter-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent-blue); }
.filter-button-count {
    background-color: var(--light-blue);
    color: white;
    border-radius: 50%;
    padding: 2px 7px;
    font-size: 0.75rem;
    margin-left: 8px;
    font-weight: 700;
}

/* --- NEW STYLES --- */

/* Notification Toasts */
#notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}
.notification-toast {
    background-color: #fff;
    border-left: 5px solid var(--light-blue);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative; /* For positioning close button */
}
.notification-toast.show {
    opacity: 1;
    transform: translateX(0);
}
.notification-toast-title {
    font-weight: 700;
    color: var(--primary-dark-blue);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.notification-toast-message {
    font-size: 0.9rem;
    color: var(--text-dark);
}
.notification-close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.notification-close-btn:hover {
    color: #333;
}
.notification-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}
.btn-view-notification {
    padding: 5px 12px !important;
    font-size: 0.8rem !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    width: auto !important;
    font-weight: 600 !important;
}

/* Modal Info Header */
.modal-info-header {
    background-color: #f8f9fa;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent-blue);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
}
.modal-info-header p {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-info-header p:last-child {
    margin-bottom: 0;
}
.modal-info-header strong {
    color: var(--primary-dark-blue);
}

/* Toggle Switch */
.toggle-switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}
.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-blue); }
input:checked + .slider:before { transform: translateX(22px); }

/* --- NEW STYLES TO ADD --- */

/* Client History Icon */
.actions-cell .btn-history {
    color: #555;
}

/* Form layout for side-by-side fields */
.form-row {
    display: flex;
    gap: 20px;
    width: 100%;
}
.form-row .input-group {
    flex: 1;
}

/* Radio button group styling */
.radio-group {
    padding: 10px 0;
}
.radio-group label {
    margin-right: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.radio-group input[type="radio"] {
    width: auto;
}

/* Conditional field that can be hidden/shown */
.conditional-field {
    display: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}
.conditional-field.visible {
    display: block;
    opacity: 1;
}

/* Special notice for opted-out text reminders */
.reminder-opt-out-notice {
    background-color: #fff3e0;
    border-left: 4px solid var(--warning-orange);
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 0.9rem;
}
.reminder-opt-out-notice p {
    margin: 0 0 10px 0;
}

/* Client History Modal */
.modal-overlay .modal-card.client-history-modal {
    max-width: 800px;
}
.history-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}
.history-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--primary-dark-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}
.history-section h4 {
    color: var(--secondary-blue);
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}
.history-table {
    width: 100%;
    border-collapse: collapse;
}
.history-table td {
    padding: 10px 5px;
    border-bottom: 1px solid #f0f0f0;
}
.history-table tr:last-child td {
    border-bottom: none;
}
.history-table .actions-cell {
    text-align: right;
}
.history-table .actions-cell .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    text-transform: none;
    width: auto;
}

/* --- NEW STYLES TO ADD --- */

/* Client History Icon */
.actions-cell .btn-history {
    color: #555;
}

/* Form layout for side-by-side fields */
.form-row {
    display: flex;
    gap: 20px;
    width: 100%;
}
.form-row .input-group {
    flex: 1;
}

/* Radio button group styling */
.radio-group-wrapper {
    margin-bottom: 25px; /* Replaces input-group margin */
}
.radio-group-wrapper > label {
    display: block;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 8px;
}
.radio-group {
    padding-top: 5px;
}
.radio-group label {
    margin-right: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.radio-group input[type="radio"] {
    width: auto;
}

/* Conditional field that can be hidden/shown */
.conditional-field {
    display: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}
.conditional-field.visible {
    display: block;
    opacity: 1;
}

/* Special notice for opted-out text reminders */
.reminder-opt-out-notice {
    background-color: #fff3e0;
    border-left: 4px solid var(--warning-orange);
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 0.9rem;
}
.reminder-opt-out-notice p {
    margin: 0 0 10px 0;
}

/* Client Meta Info (Age, Gender, Language) */
.client-meta-info {
    font-style: italic;
    font-size: 0.9em;
    font-weight: 400;
    color: #666;
    margin-left: 8px;
}
.client-language-icon {
    color: var(--accent-blue);
    margin-left: 8px;
    cursor: help;
}

/* Icons in Modal Info Header */
.modal-info-header .client-actions {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-left: auto; /* Pushes to the right */
}
.modal-info-header .client-actions .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
}
.modal-info-header-content {
    display: flex;
    align-items: center;
    width: 100%;
}

/* --- NEW STYLES TO ADD --- */

/* Client History Icon */
.actions-cell .btn-history {
    color: #555;
}

/* Form layout for side-by-side fields */
.form-row {
    display: flex;
    gap: 20px;
    width: 100%;
}
.form-row .input-group {
    flex: 1;
}

/* Radio button group styling */
.radio-group-wrapper {
    margin-bottom: 25px; /* Replaces input-group margin */
}
.radio-group-wrapper > label {
    display: block;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 8px;
}
.radio-group {
    padding-top: 5px;
}
.radio-group label {
    margin-right: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.radio-group input[type="radio"] {
    width: auto;
}

/* Conditional field that can be hidden/shown */
.conditional-field {
    display: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}
.conditional-field.visible {
    display: block;
    opacity: 1;
}

/* Special notice for opted-out text reminders */
.reminder-opt-out-notice {
    background-color: #fff3e0;
    border-left: 4px solid var(--warning-orange);
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 0.9rem;
}
.reminder-opt-out-notice p {
    margin: 0 0 10px 0;
}

/* Client History Modal */
.modal-overlay .modal-card.client-history-modal {
    max-width: 800px;
}
.history-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}
.history-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--primary-dark-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}
.history-section h4 {
    color: var(--secondary-blue);
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}
.history-table {
    width: 100%;
    border-collapse: collapse;
}
.history-table td {
    padding: 10px 5px;
    border-bottom: 1px solid #f0f0f0;
}
.history-table tr:last-child td {
    border-bottom: none;
}
.history-table .actions-cell {
    text-align: right;
}
.history-table .actions-cell .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    text-transform: none;
    width: auto;
}

/* Client Meta Info (Age, Gender, Language) */
.client-meta-info {
    font-style: italic;
    font-size: 0.9em;
    font-weight: 400;
    color: #666;
    margin-left: 8px;
}
.client-language-icon {
    color: var(--accent-blue);
    margin-left: 8px;
    cursor: help;
}

/* Icons in Modal Info Header */
.modal-info-header .client-actions {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-left: auto; /* Pushes to the right */
}
.modal-info-header .client-actions .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
}
.modal-info-header-content {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Removed Client Styling */
tr.is-removed {
    opacity: 0.6;
    background-color: #f8f9fa;
}
tr.is-removed td:first-child {
    text-decoration: line-through;
}

/* Appointment View Controls */
.appointment-view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}
.calendar-nav h3 {
    margin: 0;
    color: var(--primary-dark-blue);
    width: 250px;
    text-align: center;
}
.view-switcher {
    position: relative;
}
.view-switcher .btn.active {
    background-color: var(--primary-dark-blue);
}
/* New styles for the view dropdown */
.view-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    background-color: #fff;
    min-width: 120px;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.15);
    border-radius: 8px;
    z-index: 10;
    padding: 5px;
    animation: fadeInDropdown 0.2s ease-out;
    border: 1px solid var(--border-light);
    flex-direction: column;
    gap: 5px;
}
.view-dropdown.show {
    display: flex;
}
.view-dropdown-item {
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
}
.view-dropdown-item:hover {
    background-color: #f1f1f1;
}

.calendar-grid {
    display: grid;
    border-top: 1px solid var(--border-light);
    border-left: 1px solid var(--border-light);
}
.calendar-header {
    background-color: #f8f9fa;
    text-align: center;
    padding: 8px;
    font-weight: 600;
    color: var(--secondary-blue);
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}
.calendar-day {
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    min-height: 120px;
    padding: 5px;
}
.calendar-day.is-today .day-number {
    background-color: var(--accent-blue);
    color: white;
}
.day-number {
    font-weight: 600;
    font-size: 0.9rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 5px;
}
.calendar-appointment {
    background-color: var(--accent-blue);
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 4px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.calendar-appointment:hover {
    background-color: var(--light-blue);
}

/* --- NEW STYLES TO ADD --- */

/* Client History Icon */
.actions-cell .btn-history {
    color: #555;
}

/* Form layout for side-by-side fields */
.form-row {
    display: flex;
    gap: 20px;
    width: 100%;
}
.form-row .input-group {
    flex: 1;
}

/* Radio button group styling */
.radio-group-wrapper {
    margin-bottom: 25px; /* Replaces input-group margin */
}
.radio-group-wrapper > label {
    display: block;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 8px;
}
.radio-group {
    padding-top: 5px;
}
.radio-group label {
    margin-right: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.radio-group input[type="radio"] {
    width: auto;
}

/* Conditional field that can be hidden/shown */
.conditional-field {
    display: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}
.conditional-field.visible {
    display: block;
    opacity: 1;
}

/* Special notice for opted-out text reminders */
.reminder-opt-out-notice {
    background-color: #fff3e0;
    border-left: 4px solid var(--warning-orange);
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 0.9rem;
}
.reminder-opt-out-notice p {
    margin: 0 0 10px 0;
}

/* Client History Modal */
.modal-overlay .modal-card.client-history-modal {
    max-width: 800px;
}
.history-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}
.history-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--primary-dark-blue);
    display: flex;
    align-items: center;
    gap: 10px;
}
.history-section h4 {
    color: var(--secondary-blue);
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}
.history-table {
    width: 100%;
    border-collapse: collapse;
}
.history-table td {
    padding: 10px 5px;
    border-bottom: 1px solid #f0f0f0;
}
.history-table tr:last-child td {
    border-bottom: none;
}
.history-table .actions-cell {
    text-align: right;
}
.history-table .actions-cell .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    text-transform: none;
    width: auto;
}

/* Client Meta Info (Age, Gender, Language) */
.client-meta-info {
    font-style: italic;
    font-size: 0.9em;
    font-weight: 400;
    color: #666;
    margin-left: 8px;
}
.client-language-icon {
    color: var(--accent-blue);
    margin-left: 8px;
    cursor: help;
}

/* Icons in Modal Info Header */
.modal-info-header .client-actions {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-left: auto; /* Pushes to the right */
}
.modal-info-header .client-actions .btn-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
}
.modal-info-header-content {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Removed Client Styling */
tr.is-removed {
    opacity: 0.6;
    background-color: #f8f9fa;
}
tr.is-removed td:first-child {
    text-decoration: line-through;
}

/* Appointment View Controls & Day Grouping */
.appointment-view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}
.calendar-nav h3 {
    margin: 0;
    color: var(--primary-dark-blue);
    width: 250px;
    text-align: center;
}
.view-switcher .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.day-group-header {
    background-color: #f8f9fa;
    padding: 10px 15px;
    font-weight: 600;
    color: var(--secondary-blue);
    position: sticky;
    top: 49px; /* Height of table header */
    z-index: 2;
    border-bottom: 2px solid var(--border-light);
}
.day-group-header td {
    padding: 10px 15px !important;
}

/* --- NEW STYLES TO ADD --- */

/* Reminder Settings in Modals */
.reminder-settings-container {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background-color: #f8f9fa;
}

.reminder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.reminder-item:last-child {
    border-bottom: none;
}
.reminder-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.reminder-item-controls input[type="number"] {
    width: 60px;
    padding: 8px;
    text-align: center;
}
.reminder-item-status {
    font-weight: 600;
    font-size: 0.9rem;
}
.reminder-item-status .status-icon-pending { color: var(--warning-orange); }
.reminder-item-status .status-icon-sent { color: var(--success-green); }
.reminder-item-status .status-icon-error { color: var(--error-red); }
.reminder-item-status .status-icon-disabled { color: #999; }
.reminder-item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--error-red);
}
#addReminderBtn {
    margin-top: 10px;
}

/* Event Attendee List in Modal */
.attendee-status-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px;
}
.attendee-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
}
.attendee-status-item:nth-child(even) {
    background-color: #f8f9fa;
}
.attendee-status-badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}
.attendee-status-pending { background-color: #fff3e0; color: #fb8c00; }
.attendee-status-sent { background-color: #e3f2fd; color: #1e88e5; }
.attendee-status-confirmed { background-color: #e8f5e9; color: var(--success-green); }
.attendee-status-denied { background-color: #fbe9e7; color: var(--error-red); }

/* --- NEW STYLES TO ADD --- */

/* Message Icons & Mailbox */
.actions-cell .btn-message, .modal-info-header .btn-message {
    color: var(--light-blue);
}
.mailbox-button {
    position: relative;
}
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: var(--error-red);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    border: 2px solid var(--card-bg);
}
.notification-badge.visible {
    display: flex;
}

/* Reminder Customization UI */
.reminder-template-select {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}
.reminder-template-select .input-group {
    flex-grow: 1;
    margin-bottom: 0;
}
.btn-help {
    font-size: 1.1rem;
    width: 30px;
    height: 30px;
    color: #888;
}
.reminder-text-group {
    margin-bottom: 15px;
}
.reminder-text-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary-blue);
    display: block;
    margin-bottom: 5px;
}
.reminder-text-group textarea {
    min-height: 100px;
}

/* Overall Appointment Reminder Status */
.appointment-reminder-status {
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
}
.appointment-reminder-status.status-confirmed {
    background-color: #e8f5e9;
    color: var(--success-green);
    border: 1px solid var(--success-green);
}
.appointment-reminder-status.status-pending {
    background-color: #fff3e0;
    color: #fb8c00;
     border: 1px solid #fb8c00;
}
.appointment-reminder-status.status-disabled {
    background-color: #f5f5f5;
    color: #616161;
    border: 1px solid #ddd;
}

/* Messaging Modal */
.modal-overlay .modal-card.messaging-modal {
    max-width: 800px;
    height: 85vh;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.messaging-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.messaging-body {
    flex-grow: 1;
    display: flex;
    overflow: hidden;
}
.message-history {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse; /* Newest messages at the bottom */
}
.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    margin-bottom: 10px;
    position: relative;
}
.message-bubble p { margin: 0; }
.message-bubble .meta {
    font-size: 0.75rem;
    color: #888;
    margin-top: 5px;
}
.message-inbound {
    background-color: #f1f1f1;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}
.message-outbound {
    background-color: var(--accent-blue);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}
.message-outbound.is-auto {
    background-color: var(--secondary-blue);
}
.message-outbound .meta {
    color: #eee;
}
.messaging-sidebar {
    width: 250px;
    border-left: 1px solid var(--border-light);
    padding: 20px;
    overflow-y: auto;
    background-color: #f8f9fa;
    flex-shrink: 0;
}
.messaging-sidebar h4 {
    margin: 0 0 15px 0;
    color: var(--primary-dark-blue);
}
.assigned-staff-list .staff-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
}
.assigned-staff-list .staff-item:hover {
    background-color: #eee;
}
.messaging-footer {
    padding: 15px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}
.messaging-footer form {
    display: flex;
    gap: 10px;
}
.messaging-footer textarea {
    flex-grow: 1;
    resize: none;
    height: 40px; /* Initial height */
    padding: 10px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
}
.messaging-footer .btn {
    width: auto;
    border-radius: 20px;
}

/* --- NEW STYLES TO ADD --- */

/* Mailbox Icon & Notification Badge */
.mailbox-button {
    position: relative;
}
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: var(--error-red);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    border: 2px solid var(--card-bg);
}
.notification-badge.visible {
    display: flex;
}

/* Mailbox Modal */
.modal-overlay .modal-card.mailbox-modal {
    max-width: 700px;
}
.conversation-list {
    max-height: 60vh;
    overflow-y: auto;
}
.conversation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.conversation-item:hover {
    background-color: #f8f9fa;
}
.conversation-item.is-unread .client-name {
    font-weight: 700;
}
.conversation-item .timestamp {
    font-size: 0.8rem;
    color: #888;
    flex-shrink: 0;
    margin-left: 15px;
}

/* Message Icons */
.actions-cell .btn-message, .modal-info-header .btn-message {
    color: var(--light-blue);
}

/* Reminder Customization UI */
.reminder-template-select {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}
.reminder-template-select .input-group {
    flex-grow: 1;
    margin-bottom: 0;
}
.btn-help {
    font-size: 1.1rem;
    width: 30px;
    height: 30px;
    color: #888;
}
.reminder-text-group {
    margin-bottom: 15px;
}
.reminder-text-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary-blue);
    display: block;
    margin-bottom: 5px;
}
.reminder-text-group textarea {
    min-height: 100px;
}

/* Overall Appointment Reminder Status */
.appointment-reminder-status {
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
}
.appointment-reminder-status.status-confirmed {
    background-color: #e8f5e9;
    color: var(--success-green);
    border: 1px solid var(--success-green);
}
.appointment-reminder-status.status-pending {
    background-color: #fff3e0;
    color: #fb8c00;
     border: 1px solid #fb8c00;
}
.appointment-reminder-status.status-cancelled {
    background-color: #fbe9e7;
    color: var(--error-red);
     border: 1px solid var(--error-red);
}
.appointment-reminder-status.status-disabled {
    background-color: #f5f5f5;
    color: #616161;
    border: 1px solid #ddd;
}

/* Messaging Modal */
.modal-overlay .modal-card.messaging-modal {
    max-width: 800px;
    height: 85vh;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.messaging-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.messaging-body {
    flex-grow: 1;
    display: flex;
    overflow: hidden;
}
.message-history {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse; /* Newest messages at the bottom */
}
.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    margin-bottom: 10px;
    position: relative;
    line-height: 1.4;
}
.message-bubble p { margin: 0; }
.message-bubble .meta {
    font-size: 0.75rem;
    color: #888;
    margin-top: 5px;
}
.message-inbound {
    background-color: #f1f1f1;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}
.message-outbound {
    background-color: var(--accent-blue);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}
.message-outbound.is-auto {
    background-color: var(--secondary-blue);
}
.message-outbound .meta {
    color: #eee;
}
.messaging-sidebar {
    width: 250px;
    border-left: 1px solid var(--border-light);
    padding: 20px;
    overflow-y: auto;
    background-color: #f8f9fa;
    flex-shrink: 0;
}
.messaging-sidebar h4 {
    margin: 0 0 15px 0;
    color: var(--primary-dark-blue);
}
.assigned-staff-list .staff-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
}
.assigned-staff-list .staff-item:hover {
    background-color: #eee;
}
.messaging-footer {
    padding: 15px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}
.messaging-footer form {
    display: flex;
    gap: 10px;
}
.messaging-footer textarea {
    flex-grow: 1;
    resize: none;
    height: 40px; /* Initial height */
    padding: 10px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
}
.messaging-footer .btn {
    width: auto;
    border-radius: 20px;
}

/* --- NEW STYLES TO ADD --- */

/* Mailbox Icon & Notification Badge */
.mailbox-button {
    position: relative;
}
.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: var(--error-red);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    border: 2px solid var(--card-bg);
}
.notification-badge.visible {
    display: flex;
}

/* Mailbox Modal */
.modal-overlay .modal-card.mailbox-modal {
    max-width: 700px;
}
.conversation-list {
    max-height: 60vh;
    overflow-y: auto;
}
.conversation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.conversation-item:hover {
    background-color: #f8f9fa;
}
.conversation-item.is-unread .client-name {
    font-weight: 700;
}
.conversation-item .timestamp {
    font-size: 0.8rem;
    color: #888;
    flex-shrink: 0;
    margin-left: 15px;
}

/* Message Icons */
.actions-cell .btn-message, .modal-info-header .btn-message {
    color: var(--light-blue);
}

/* Reminder Customization UI */
.reminder-template-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}
.reminder-template-controls .input-group {
    flex-grow: 1;
    margin-bottom: 0;
}
.btn-help {
    font-size: 1.1rem;
    width: 30px;
    height: 30px;
    color: #888;
}
.reminder-text-group {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px dashed var(--border-light);
    border-radius: 8px;
}
.reminder-text-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary-blue);
    display: block;
    margin-bottom: 5px;
}
.reminder-text-group textarea {
    min-height: 100px;
}
.event-reminder-item {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

/* Overall Appointment Reminder Status */
.appointment-reminder-status {
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
}
.appointment-reminder-status.status-confirmed {
    background-color: #e8f5e9;
    color: var(--success-green);
    border: 1px solid var(--success-green);
}
.appointment-reminder-status.status-pending {
    background-color: #fff3e0;
    color: #fb8c00;
     border: 1px solid #fb8c00;
}
.appointment-reminder-status.status-cancelled {
    background-color: #fbe9e7;
    color: var(--error-red);
     border: 1px solid var(--error-red);
}
.appointment-reminder-status.status-disabled {
    background-color: #f5f5f5;
    color: #616161;
    border: 1px solid #ddd;
}

/* Messaging Modal Redesign */
.modal-overlay .modal-card.messaging-modal {
    max-width: 700px;
    height: 85vh;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.messaging-header {
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.messaging-header .modal-title {
    font-size: 1.5rem;
    margin: 0;
}
.messaging-header .actions {
    display: flex;
    gap: 10px;
}
.message-history {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse; /* Newest messages at the bottom */
}
.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    margin-bottom: 10px;
    position: relative;
    line-height: 1.4;
}
.message-bubble p { margin: 0; }
.message-bubble .meta {
    font-size: 0.75rem;
    color: #888;
    margin-top: 5px;
}
.message-inbound {
    background-color: #f1f1f1;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}
.message-outbound {
    background-color: var(--accent-blue);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}
.message-outbound.is-auto {
    background-color: var(--secondary-blue);
}
.message-outbound .meta {
    color: #eee;
}
.messaging-footer {
    padding: 15px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}
.messaging-footer form {
    display: flex;
    gap: 10px;
    align-items: center;
}
.messaging-footer textarea {
    flex-grow: 1;
    resize: none;
    height: 40px; /* Initial height */
    padding: 10px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
}
.messaging-footer textarea:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
}
.messaging-footer .btn {
    width: auto;
    border-radius: 20px;
}
#assign-self-prompt {
    width: 100%;
    text-align: center;
    padding: 10px;
}

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700&display=swap');

:root {
    --primary-dark-blue: #0A1128;
    --secondary-blue: #001F54;
    --accent-blue: #034078;
    --light-blue: #1282A2;
    --text-light: #E0FBFC;
    --text-dark: #333;
    --error-red: #E74C3C;
    --success-green: #2ECC71;
    --warning-orange: #f39c12;
    --card-bg: #FFFFFF;
    --input-bg: #F8F8F8;
    --border-light: #DDD;
    --gradient-start: #001F54;
    --gradient-end: #0A1128;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

/* Loader Overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.loader-overlay.active { opacity: 1; visibility: visible; display: flex; }
.spinner { border: 5px solid rgba(255, 255, 255, 0.3); border-top: 5px solid var(--light-blue); border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Login Background */
.login-background { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(45deg, var(--primary-dark-blue), var(--secondary-blue)); z-index: -1; }

/* Base style for all modal-like cards */
.modal-card {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Main Content containers start hidden and transition in */
#authContainer, #appContent, #unauthorizedAccess {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    display: none; /* All major sections start hidden */
}

/* Active state for making sections visible */
#authContainer.active, #appContent.active, #unauthorizedAccess.active {
    opacity: 1;
    transform: translateY(0);
    /* JS will set display to flex or block */
}

/* Auth container specifics */
#authContainer {
    height: 670px; 
    padding: 0;
    position: relative;
}

/* Auth subsections for sliding animation */
.auth-sub-section {
    width: 100%;
    padding: 40px;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
    background-color: var(--card-bg);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.auth-sub-section.active { transform: translateX(0%); opacity: 1; z-index: 1; }
.auth-sub-section.inactive-left { transform: translateX(-100%); opacity: 0; z-index: 0; }
.auth-sub-section.inactive-right { transform: translateX(100%); opacity: 0; z-index: 0; }

.modal-title { color: var(--primary-dark-blue); font-weight: 700; margin-bottom: 10px; font-size: 2.2rem; display: flex; align-items: center; justify-content: center; gap: 15px; }
.modal-subtitle { color: var(--secondary-blue); font-size: 1.1rem; margin-bottom: 30px; }

/* Input Group */
.input-group { position: relative; margin-bottom: 25px; width: 100%; }
.input-group input, .input-group select, .input-group textarea { width: calc(100% - 24px); padding: 14px 12px; border: 1px solid var(--border-light); border-radius: 8px; font-size: 1rem; background-color: var(--input-bg); color: var(--text-dark); transition: all 0.3s ease; font-family: 'Montserrat', sans-serif; }
.input-group textarea { min-height: 80px; resize: vertical; }
.input-group label { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #666; pointer-events: none; transition: all 0.3s ease; background-color: var(--input-bg); padding: 0 4px; font-size: 0.95rem; }
.input-group input:focus + label, .input-group input:not(:placeholder-shown) + label, .input-group select:focus + label, .input-group select:valid + label, .input-group textarea:focus + label, .input-group textarea:not(:placeholder-shown) + label { top: 0; font-size: 0.8rem; color: var(--accent-blue); }
.input-group input:focus, .input-group select:focus, .input-group textarea:focus { border-color: var(--light-blue); box-shadow: 0 0 0 3px rgba(18, 130, 162, 0.2); outline: none; }
.input-group.inline-action { display: flex; align-items: center; gap: 10px; }
.input-group.inline-action .search-container { flex-grow: 1; }
.input-group input:disabled { background-color: #eee; cursor: not-allowed; }

/* Buttons */
.btn { padding: 14px 28px; border: none; border-radius: 8px; cursor: pointer; font-size: 1rem; font-weight: 600; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 0.5px; }
.btn i { margin-right: 8px; }
.btn-primary { background-color: var(--accent-blue); color: var(--text-light); box-shadow: 0 5px 15px rgba(3, 64, 120, 0.3); width: 100%; }
.btn-primary:hover { background-color: var(--light-blue); box-shadow: 0 8px 20px rgba(18, 130, 162, 0.4); transform: translateY(-2px); }
.btn-primary:disabled { background-color: #a0a0a0; box-shadow: none; transform: none; cursor: not-allowed; }
.btn-secondary { background-color: var(--secondary-blue); color: var(--text-light); box-shadow: 0 3px 10px rgba(0, 31, 84, 0.2); }
.btn-secondary:hover { background-color: var(--primary-dark-blue); transform: translateY(-1px); }
.btn-action { background-color: var(--secondary-blue); color: var(--text-light); box-shadow: 0 3px 10px rgba(0, 31, 84, 0.2); display: inline-flex; align-items: center; justify-content: center; }
.btn-action:hover { background-color: var(--primary-dark-blue); transform: translateY(-1px); }
.btn-warning { background-color: var(--warning-orange); color: white; }
.btn-warning:hover { background-color: #e67e22; }
.btn-danger { background-color: var(--error-red); color: white; }
.btn-danger:hover { background-color: #c0392b; }
.btn-text { background: none; color: var(--accent-blue); text-transform: none; padding: 5px 10px; font-weight: 600; font-size: 0.95rem; }
.btn-text:hover { color: var(--light-blue); transform: translateY(0); text-decoration: underline; }
.btn-icon { background: none; border: none; color: var(--secondary-blue); font-size: 1.4rem; cursor: pointer; padding: 8px; border-radius: 50%; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; transition: background-color 0.3s ease, color 0.3s ease; }
.btn-icon:hover { background-color: #f0f0f0; color: var(--primary-dark-blue); }
.admin-badge { color: var(--accent-blue); font-size: 1.5rem; position: relative; z-index: 5; }
.admin-badge:hover { color: var(--light-blue); }
.profile-btn { font-size: 1.8rem; }

/* Messages */
.error-message, .info-message { font-size: 0.9rem; margin-top: 15px; text-align: center; opacity: 0; transform: translateY(10px); transition: opacity 0.3s ease, transform 0.3s ease; width: 100%; }
.error-message.show, .info-message.show { opacity: 1; transform: translateY(0); }
.error-message { color: var(--error-red); }
.info-message { color: var(--success-green); }

.auth-switch { margin-top: 20px; font-size: 0.9rem; color: #888; }
#loginForm, #registerForm { width: 100%; display: flex; flex-direction: column; align-items: center; }

/* Main App Content */
.app-content { background-color: var(--card-bg); padding: 30px; border-radius: 12px; box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); width: 100%; max-width: 1200px; box-sizing: border-box; min-height: 500px; }
.app-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--border-light); margin-bottom: 25px; }
.app-title { color: var(--primary-dark-blue); font-weight: 700; font-size: 1.8rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.user-info { display: flex; align-items: center; gap: 10px; }

/* Profile Dropdown */
.profile-menu { position: relative; z-index: 4; }
.dropdown-content { display: none; position: absolute; right: 0; top: 50px; background-color: #fff; min-width: 220px; box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); border-radius: 8px; z-index: 100; overflow: hidden; animation: fadeInDropdown 0.2s ease-out; }
.dropdown-content.show { display: block; }
.dropdown-header { padding: 15px; border-bottom: 1px solid var(--border-light); }
.dropdown-header .user-name { display: block; font-weight: 600; color: var(--primary-dark-blue); font-size: 1rem; }
.dropdown-header .user-status { display: block; font-size: 0.85rem; color: #666; }
.dropdown-item { color: black; padding: 12px 16px; text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 0.95rem; transition: background-color 0.2s ease; }
.dropdown-item:hover { background-color: #f1f1f1; }
.dropdown-item i { color: #555; }
@keyframes fadeInDropdown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Tabs Navigation */
.nav-tabs { display: flex; margin-bottom: 20px; border-bottom: 2px solid var(--border-light); }
.nav-btn { flex-grow: 1; padding: 15px 20px; background-color: transparent; border: none; border-bottom: 3px solid transparent; color: var(--secondary-blue); font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-align: center; }
.nav-btn:hover:not(.active) { color: var(--primary-dark-blue); background-color: #f5f5f5; }
.nav-btn.active { color: var(--light-blue); border-bottom-color: var(--light-blue); background-color: #fff; }

/* Tab Content */
.tab-container { padding-top: 15px; }
.tab-content { display: none; animation: fadeInContent 0.5s ease-out; }
.tab-content.active { display: block; }
.tab-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.tab-header h3 { margin: 0; color: var(--primary-dark-blue); }
.actions-group { display: flex; gap: 10px; align-items: center; }
.search-input { padding: 10px 15px; border: 1px solid var(--border-light); border-radius: 8px; font-size: 0.9rem; width: 250px; transition: all 0.3s ease; }
.search-input:focus { border-color: var(--light-blue); box-shadow: 0 0 0 3px rgba(18, 130, 162, 0.2); outline: none; }
@keyframes fadeInContent { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* PIN Lock & Modal Overlay */
.pin-lock-overlay, .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.85); display: none; justify-content: center; align-items: center; z-index: 999; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; }
.pin-lock-overlay.active, .modal-overlay.active { opacity: 1; visibility: visible; display: flex; }
.pin-lock-card, .modal-overlay .modal-card { transform: scale(0.9); transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55); }
.modal-overlay .modal-card#formModal { max-width: 650px; text-align: left; }
.form-title { text-align: center; }
.modal-close-btn { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 1.5rem; color: #888; cursor: pointer; transition: color 0.3s ease; }
.modal-close-btn:hover { color: var(--error-red); }
.modal-body { margin-bottom: 25px; max-height: 60vh; overflow-y: auto; padding: 5px 15px; } 
.modal-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--border-light); padding-top: 20px; width: 100%; box-sizing: border-box; }
.modal-footer .actions-left, .modal-footer .actions-right { display: flex; gap: 10px; }
.pin-lock-overlay.active .pin-lock-card, .modal-overlay.active .modal-card { transform: scale(1); }
.pin-lock-card { background-color: var(--card-bg); padding: 40px; border-radius: 12px; box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); width: 100%; max-width: 380px; box-sizing: border-box; text-align: center; }
.pin-lock-title { color: var(--primary-dark-blue); font-weight: 700; margin-bottom: 25px; font-size: 1.8rem; }
.pin-input-container { display: flex; justify-content: center; margin-bottom: 25px; }
.pin-input { width: 200px; padding: 15px 20px; font-size: 1.5rem; letter-spacing: 8px; text-align: center; border: 2px solid var(--border-light); border-radius: 8px; transition: all 0.3s ease; color: var(--primary-dark-blue); font-weight: 600; }
.pin-input:focus { border-color: var(--light-blue); box-shadow: 0 0 0 4px rgba(18, 130, 162, 0.3); outline: none; }
/* REMOVED: .pin-input-field styles are no longer needed as the input type is "password" */

/* Unauthorized access specific styles */
.unauthorized-access { max-width: 450px; }
.unauthorized-access .modal-title { color: var(--error-red); }

/* Blur Effect for Overlays */
body.pin-locked #appContent, body.pin-locked #authContainer, body.modal-open #appContent, body.modal-open #authContainer { filter: blur(5px); pointer-events: none; transition: filter 0.3s ease-out; }
body.pin-locked #loader-overlay, body.modal-open #loader-overlay { filter: none; z-index: 1001; }

/* Data Tables */
.table-container { overflow-x: auto; max-height: 60vh; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.data-table th, .data-table td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.data-table th { background-color: #f8f9fa; color: var(--secondary-blue); font-weight: 600; position: sticky; top: 0; z-index: 1; }
.data-table tbody tr:hover { background-color: #f1f1f1; }
.data-table .actions-cell { white-space: nowrap; display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.data-table .actions-cell button { background: none; border: none; cursor: pointer; font-size: 1.2rem; margin: 0; transition: color 0.2s, transform 0.2s ease; padding: 5px; }
.data-table .actions-cell button:hover { transform: scale(1.15); }
.actions-cell .btn-edit { color: var(--accent-blue); }
.actions-cell .btn-cancel { color: var(--warning-orange); }
.actions-cell .btn-check-in { color: var(--success-green); }
.actions-cell .btn-start-session { color: var(--accent-blue); }
.actions-cell .btn-check-out { color: var(--secondary-blue); }
.actions-cell .btn-delete { color: var(--error-red); }
.actions-cell .btn-details { color: #888; font-size: 1.1rem; }
.actions-cell .btn-history { color: #555; }
.actions-cell .btn-message { color: var(--light-blue); }


.empty-row td { text-align: center; padding: 40px; color: #888; font-style: italic; }
.data-table small { color: #777; font-size: 0.8em; }

/* Badges */
.group-badge { display: inline-flex; align-items: center; color: var(--text-light); padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; margin: 2px; font-weight: 500; }
.status-badge { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.status-scheduled { background-color: #ecf0f1; color: #7f8c8d; }
.status-confirmed { background-color: #e8f5e9; color: var(--success-green); }
.status-cancelled { background-color: #fbe9e7; color: var(--error-red); }
.status-rescheduled { background-color: #f5f5f5; color: #616161; }
.status-admin { background-color: #f3e5f5; color: #8e24aa; }
.status-staff { background-color: #e3f2fd; color: #1e88e5; }
.status-pending { background-color: #fff3e0; color: #fb8c00; }
.status-arriving-soon { background-color: #e3f2fd; color: #1e88e5; }
.status-checked-in { background-color: #e0f2f1; color: #00897b; }
.status-in-session { background-color: #f3e5f5; color: #8e24aa; }
.status-checked-out { background-color: #f5f5f5; color: #616161; }
.status-late { background-color: #fff3e0; color: #fb8c00; }
.status-no-show { background-color: #fbe9e7; color: var(--error-red); }

/* Sub-headings in modals */
.modal-sub-heading { font-weight: 600; color: var(--primary-dark-blue); margin-top: 20px; margin-bottom: 15px; padding-bottom: 5px; border-bottom: 1px solid var(--border-light); font-size: 1.1rem; }
.modal-sub-heading:first-child { margin-top: 0; }
.reschedule-info-box {
    background-color: #f5f5f5;
    border-left: 4px solid var(--accent-blue);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

/* Searchable Input and Attendee Tags */
.search-container { position: relative; }
.search-results { position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid var(--border-light); border-top: none; border-radius: 0 0 8px 8px; max-height: 200px; overflow-y: auto; z-index: 10; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.search-result-item { padding: 10px 15px; cursor: pointer; }
.search-result-item:hover { background-color: #f1f1f1; }
.attendee-container { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; border: 1px solid var(--border-light); border-radius: 8px; min-height: 40px; }
.attendee-tag { display: flex; align-items: center; background-color: var(--accent-blue); color: var(--text-light); padding: 5px 10px; border-radius: 15px; font-size: 0.9rem; }
.attendee-tag button { background: none; border: none; color: white; margin-left: 8px; font-size: 1rem; cursor: pointer; padding: 0; line-height: 1; }

/* Appointment Filter */
.filter-container { position: relative; }
.filter-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 5px); background-color: #fff; width: 300px; box-shadow: 0 8px 16px 0 rgba(0,0,0,0.15); border-radius: 8px; z-index: 10; padding: 15px; animation: fadeInDropdown 0.2s ease-out; border: 1px solid var(--border-light); }
.filter-dropdown.show { display: block; }
.filter-section { margin-bottom: 15px; }
.filter-section:last-child { margin-bottom: 0; }
.filter-section h4 { margin: 0 0 10px 0; font-size: 0.9rem; color: var(--secondary-blue); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border-light); padding-bottom: 5px; }
.filter-options { max-height: 150px; overflow-y: auto; padding-right: 5px; }
.filter-item label { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; font-size: 0.95rem; }
.filter-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent-blue); }
.filter-button-count {
    background-color: var(--light-blue);
    color: white;
    border-radius: 50%;
    padding: 2px 7px;
    font-size: 0.75rem;
    margin-left: 8px;
    font-weight: 700;
}

/* Notification Toasts */
#notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}
.notification-toast {
    background-color: #fff;
    border-left: 5px solid var(--light-blue);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
}
.notification-toast.show {
    opacity: 1;
    transform: translateX(0);
}
.notification-toast-title {
    font-weight: 700;
    color: var(--primary-dark-blue);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.notification-toast-message {
    font-size: 0.9rem;
    color: var(--text-dark);
}
.notification-close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.notification-close-btn:hover {
    color: #333;
}
.notification-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}
.btn-view-notification {
    padding: 5px 12px !important;
    font-size: 0.8rem !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    width: auto !important;
    font-weight: 600 !important;
}

/* Modal Info Header */
.modal-info-header {
    background-color: #f8f9fa;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent-blue);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
}
.modal-info-header p {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-info-header p:last-child {
    margin-bottom: 0;
}
.modal-info-header strong {
    color: var(--primary-dark-blue);
}

/* Toggle Switch */
.toggle-switch-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}
.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-blue); }
input:checked + .slider:before { transform: translateX(22px); }

/* Form layout for side-by-side fields */
.form-row {
    display: flex;
    gap: 20px;
    width: 100%;
}
.form-row .input-group {
    flex: 1;
}

/* Radio button group styling */
.radio-group-wrapper {
    margin-bottom: 25px; /* Replaces input-group margin */
}
.radio-group-wrapper > label {
    display: block;
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 8px;
}
.radio-group {
    padding-top: 5px;
}
.radio-group label {
    margin-right: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.radio-group input[type="radio"] {
    width: auto;
}

/* Conditional field that can be hidden/shown */
.conditional-field {
    display: none;
    transition: opacity 0.3s ease;
    opacity: 0;
}
.conditional-field.visible {
    display: block;
    opacity: 1;
}

/* Special notice for opted-out text reminders */
.reminder-opt-out-notice {
    background-color: #fff3e0;
    border-left: 4px solid var(--warning-orange);
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 0.9rem;
}
.reminder-opt-out-notice p {
    margin: 0 0 10px 0;
}
.reminder-opt-out-notice p:last-child {
    margin-bottom: 0;
}

/* Appointment View Controls & Day Grouping */
.appointment-view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}
.calendar-nav h3 {
    margin: 0;
    color: var(--primary-dark-blue);
    width: 250px;
    text-align: center;
}
.view-switcher .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.day-group-header {
    background-color: #f8f9fa;
    padding: 10px 15px;
    font-weight: 600;
    color: var(--secondary-blue);
    position: sticky;
    top: 51px; /* Height of table header */
    z-index: 2;
    border-bottom: 2px solid var(--border-light);
}
.day-group-header td {
    padding: 10px 15px !important;
}

/* Reminder Customization UI */
.reminder-template-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}
.reminder-template-controls .input-group {
    flex-grow: 1;
    margin-bottom: 0;
}
.btn-help {
    font-size: 1.1rem;
    width: 30px;
    height: 30px;
    color: #888;
}
.reminder-text-group {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px dashed var(--border-light);
    border-radius: 8px;
}
.reminder-text-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary-blue);
    display: block;
    margin-bottom: 5px;
}
.reminder-text-group textarea {
    min-height: 100px;
}
.event-reminder-item {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

/* Overall Appointment Reminder Status */
.appointment-reminder-status {
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
    border: 1px solid transparent;
}
.appointment-reminder-status.status-confirmed {
    background-color: #e8f5e9;
    color: var(--success-green);
    border-color: var(--success-green);
}
.appointment-reminder-status.status-pending {
    background-color: #fff3e0;
    color: #fb8c00;
     border-color: #fb8c00;
}
.appointment-reminder-status.status-cancelled {
    background-color: #fbe9e7;
    color: var(--error-red);
     border-color: var(--error-red);
}
.appointment-reminder-status.status-disabled {
    background-color: #f5f5f5;
    color: #616161;
    border-color: #ddd;
}

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700&display=swap');

:root {
    --primary-dark-blue: #0A1128;
    --secondary-blue: #001F54;
    --accent-blue: #034078;
    --light-blue: #1282A2;
    --text-light: #E0FBFC;
    --text-dark: #333;
    --error-red: #E74C3C;
    --success-green: #2ECC71;
    --warning-orange: #f39c12;
    --card-bg: #FFFFFF;
    --input-bg: #F8F8F8;
    --border-light: #DDD;
    --gradient-start: #001F54;
    --gradient-end: #0A1128;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

/* Loader Overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.loader-overlay.active { opacity: 1; visibility: visible; display: flex; }
.spinner { border: 5px solid rgba(255, 255, 255, 0.3); border-top: 5px solid var(--light-blue); border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Login Background */
.login-background { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(45deg, var(--primary-dark-blue), var(--secondary-blue)); z-index: -1; }

/* Base style for all modal-like cards */
.modal-card {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Main Content containers start hidden and transition in */
#authContainer, #appContent, #unauthorizedAccess {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    display: none; /* All major sections start hidden */
}

/* Active state for making sections visible */
#authContainer.active, #appContent.active, #unauthorizedAccess.active {
    opacity: 1;
    transform: translateY(0);
    /* JS will set display to flex or block */
}

/* Auth container specifics */
#authContainer {
    height: 670px; 
    padding: 0;
    position: relative;
}

/* Auth subsections for sliding animation */
.auth-sub-section {
    width: 100%;
    padding: 40px;
    box-sizing: border-box;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
    background-color: var(--card-bg);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.auth-sub-section.active { transform: translateX(0%); opacity: 1; z-index: 1; }
.auth-sub-section.inactive-left { transform: translateX(-100%); opacity: 0; z-index: 0; }
.auth-sub-section.inactive-right { transform: translateX(100%); opacity: 0; z-index: 0; }

.modal-title { color: var(--primary-dark-blue); font-weight: 700; margin-bottom: 10px; font-size: 2.2rem; display: flex; align-items: center; justify-content: center; gap: 15px; }
.modal-subtitle { color: var(--secondary-blue); font-size: 1.1rem; margin-bottom: 30px; }

/* Input Group */
.input-group { position: relative; margin-bottom: 25px; width: 100%; }
.input-group input, .input-group select, .input-group textarea { width: calc(100% - 24px); padding: 14px 12px; border: 1px solid var(--border-light); border-radius: 8px; font-size: 1rem; background-color: var(--input-bg); color: var(--text-dark); transition: all 0.3s ease; font-family: 'Montserrat', sans-serif; }
.input-group textarea { min-height: 80px; resize: vertical; }
.input-group label { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #666; pointer-events: none; transition: all 0.3s ease; background-color: var(--input-bg); padding: 0 4px; font-size: 0.95rem; }
.input-group input:focus + label, .input-group input:not(:placeholder-shown) + label, .input-group select:focus + label, .input-group select:valid + label, .input-group textarea:focus + label, .input-group textarea:not(:placeholder-shown) + label { top: 0; font-size: 0.8rem; color: var(--accent-blue); }
.input-group input:focus, .input-group select:focus, .input-group textarea:focus { border-color: var(--light-blue); box-shadow: 0 0 0 3px rgba(18, 130, 162, 0.2); outline: none; }
.input-group.inline-action { display: flex; align-items: center; gap: 10px; }
.input-group.inline-action .search-container { flex-grow: 1; }
.input-group input:disabled { background-color: #eee; cursor: not-allowed; }

/* Buttons */
.btn { padding: 14px 28px; border: none; border-radius: 8px; cursor: pointer; font-size: 1rem; font-weight: 600; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 0.5px; }
.btn i { margin-right: 8px; }
.btn-primary { background-color: var(--accent-blue); color: var(--text-light); box-shadow: 0 5px 15px rgba(3, 64, 120, 0.3); width: 100%; }
.btn-primary:hover { background-color: var(--light-blue); box-shadow: 0 8px 20px rgba(18, 130, 162, 0.4); transform: translateY(-2px); }
.btn-primary:disabled { background-color: #a0a0a0; box-shadow: none; transform: none; cursor: not-allowed; }
.btn-secondary { background-color: var(--secondary-blue); color: var(--text-light); box-shadow: 0 3px 10px rgba(0, 31, 84, 0.2); }
.btn-secondary:hover { background-color: var(--primary-dark-blue); transform: translateY(-1px); }
.btn-action { background-color: var(--secondary-blue); color: var(--text-light); box-shadow: 0 3px 10px rgba(0, 31, 84, 0.2); display: inline-flex; align-items: center; justify-content: center; }
.btn-action:hover { background-color: var(--primary-dark-blue); transform: translateY(-1px); }
.btn-warning { background-color: var(--warning-orange); color: white; }
.btn-warning:hover { background-color: #e67e22; }
.btn-danger { background-color: var(--error-red); color: white; }
.btn-danger:hover { background-color: #c0392b; }
.btn-text { background: none; color: var(--accent-blue); text-transform: none; padding: 5px 10px; font-weight: 600; font-size: 0.95rem; }
.btn-text:hover { color: var(--light-blue); transform: translateY(0); text-decoration: underline; }
.btn-icon { background: none; border: none; color: var(--secondary-blue); font-size: 1.4rem; cursor: pointer; padding: 8px; border-radius: 50%; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; transition: background-color 0.3s ease, color 0.3s ease; }
.btn-icon:hover { background-color: #f0f0f0; color: var(--primary-dark-blue); }
.admin-badge { color: var(--accent-blue); font-size: 1.5rem; position: relative; z-index: 5; }
.admin-badge:hover { color: var(--light-blue); }
.profile-btn { font-size: 1.8rem; }

/* Messages */
.error-message, .info-message { font-size: 0.9rem; margin-top: 15px; text-align: center; opacity: 0; transform: translateY(10px); transition: opacity 0.3s ease, transform 0.3s ease; width: 100%; }
.error-message.show, .info-message.show { opacity: 1; transform: translateY(0); }
.error-message { color: var(--error-red); }
.info-message { color: var(--success-green); }

.auth-switch { margin-top: 20px; font-size: 0.9rem; color: #888; }
#loginForm, #registerForm { width: 100%; display: flex; flex-direction: column; align-items: center; }

/* Main App Content */
.app-content { background-color: var(--card-bg); padding: 30px; border-radius: 12px; box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); width: 100%; max-width: 1200px; box-sizing: border-box; min-height: 500px; }
.app-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--border-light); margin-bottom: 25px; }
.app-title { color: var(--primary-dark-blue); font-weight: 700; font-size: 1.8rem; margin: 0; display: flex; align-items: center; gap: 10px; }
.user-info { display: flex; align-items: center; gap: 10px; }

/* Profile Dropdown */
.profile-menu { position: relative; z-index: 4; }
.dropdown-content { display: none; position: absolute; right: 0; top: 50px; background-color: #fff; min-width: 220px; box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2); border-radius: 8px; z-index: 100; overflow: hidden; animation: fadeInDropdown 0.2s ease-out; }
.dropdown-content.show { display: block; }
.dropdown-header { padding: 15px; border-bottom: 1px solid var(--border-light); }
.dropdown-header .user-name { display: block; font-weight: 600; color: var(--primary-dark-blue); font-size: 1rem; }
.dropdown-header .user-status { display: block; font-size: 0.85rem; color: #666; }
.dropdown-item { color: black; padding: 12px 16px; text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 0.95rem; transition: background-color 0.2s ease; }
.dropdown-item:hover { background-color: #f1f1f1; }
.dropdown-item i { color: #555; }
@keyframes fadeInDropdown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* Tabs Navigation */
.nav-tabs { display: flex; margin-bottom: 20px; border-bottom: 2px solid var(--border-light); }
.nav-btn { flex-grow: 1; padding: 15px 20px; background-color: transparent; border: none; border-bottom: 3px solid transparent; color: var(--secondary-blue); font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-align: center; }
.nav-btn:hover:not(.active) { color: var(--primary-dark-blue); background-color: #f5f5f5; }
.nav-btn.active { color: var(--light-blue); border-bottom-color: var(--light-blue); background-color: #fff; }

/* Tab Content */
.tab-container { padding-top: 15px; }
.tab-content { display: none; animation: fadeInContent 0.5s ease-out; }
.tab-content.active { display: block; }
.tab-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.tab-header h3 { margin: 0; color: var(--primary-dark-blue); }
.actions-group { display: flex; gap: 10px; align-items: center; }
.search-input { padding: 10px 15px; border: 1px solid var(--border-light); border-radius: 8px; font-size: 0.9rem; width: 250px; transition: all 0.3s ease; }
.search-input:focus { border-color: var(--light-blue); box-shadow: 0 0 0 3px rgba(18, 130, 162, 0.2); outline: none; }
@keyframes fadeInContent { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* PIN Lock & Modal Overlay */
.pin-lock-overlay, .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.85); display: none; justify-content: center; align-items: center; z-index: 999; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; }
.pin-lock-overlay.active, .modal-overlay.active { opacity: 1; visibility: visible; display: flex; }
.pin-lock-card, .modal-overlay .modal-card { transform: scale(0.9); transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55); }
.modal-overlay .modal-card#formModal { max-width: 650px; text-align: left; }
.form-title { text-align: center; }
.modal-close-btn { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 1.5rem; color: #888; cursor: pointer; transition: color 0.3s ease; }
.modal-close-btn:hover { color: var(--error-red); }
.modal-body { margin-bottom: 25px; max-height: 60vh; overflow-y: auto; padding: 5px 15px; } 
.modal-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--border-light); padding-top: 20px; width: 100%; box-sizing: border-box; }
.modal-footer .actions-left, .modal-footer .actions-right { display: flex; gap: 10px; }
.pin-lock-overlay.active .pin-lock-card, .modal-overlay.active .modal-card { transform: scale(1); }
.pin-lock-card { background-color: var(--card-bg); padding: 40px; border-radius: 12px; box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2); width: 100%; max-width: 380px; box-sizing: border-box; text-align: center; }
.pin-lock-title { color: var(--primary-dark-blue); font-weight: 700; margin-bottom: 25px; font-size: 1.8rem; }
.pin-input-container { display: flex; justify-content: center; margin-bottom: 25px; }
.pin-input { width: 200px; padding: 15px 20px; font-size: 1.5rem; letter-spacing: 8px; text-align: center; border: 2px solid var(--border-light); border-radius: 8px; transition: all 0.3s ease; color: var(--primary-dark-blue); font-weight: 600; }
.pin-input:focus { border-color: var(--light-blue); box-shadow: 0 0 0 4px rgba(18, 130, 162, 0.3); outline: none; }

/* Unauthorized access specific styles */
.unauthorized-access { max-width: 450px; }
.unauthorized-access .modal-title { color: var(--error-red); }

/* Blur Effect for Overlays */
body.pin-locked #appContent, body.pin-locked #authContainer, body.modal-open #appContent, body.modal-open #authContainer { filter: blur(5px); pointer-events: none; transition: filter 0.3s ease-out; }
body.pin-locked #loader-overlay, body.modal-open #loader-overlay { filter: none; z-index: 1001; }

/* Data Tables */
.table-container { overflow-x: auto; max-height: 60vh; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.data-table th, .data-table td { padding: 15px; text-align: left; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.data-table th { background-color: #f8f9fa; color: var(--secondary-blue); font-weight: 600; position: sticky; top: 0; z-index: 1; }
.data-table tbody tr:hover { background-color: #f1f1f1; }
.data-table .actions-cell { white-space: nowrap; display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.data-table .actions-cell button { background: none; border: none; cursor: pointer; font-size: 1.2rem; margin: 0; transition: color 0.2s, transform 0.2s ease; padding: 5px; }
.data-table .actions-cell button:hover { transform: scale(1.15); }
.actions-cell .btn-edit { color: var(--accent-blue); }
.actions-cell .btn-cancel { color: var(--warning-orange); }
.actions-cell .btn-check-in { color: var(--success-green); }
.actions-cell .btn-start-session { color: var(--accent-blue); }
.actions-cell .btn-check-out { color: var(--secondary-blue); }
.actions-cell .btn-delete { color: var(--error-red); }
.actions-cell .btn-details { color: #888; font-size: 1.1rem; }
.actions-cell .btn-history { color: #555; }
.actions-cell .btn-message { color: var(--light-blue); }

.empty-row td { text-align: center; padding: 40px; color: #888; font-style: italic; }
.data-table small { color: #777; font-size: 0.8em; }

/* Badges */
.group-badge { display: inline-flex; align-items: center; color: var(--text-light); padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; margin: 2px; font-weight: 500; }
.status-badge { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.status-scheduled { background-color: #ecf0f1; color: #7f8c8d; }
.status-confirmed { background-color: #e8f5e9; color: var(--success-green); }
.status-cancelled { background-color: #fbe9e7; color: var(--error-red); }
.status-rescheduled { background-color: #f5f5f5; color: #616161; }
.status-admin { background-color: #f3e5f5; color: #8e24aa; }
.status-staff { background-color: #e3f2fd; color: #1e88e5; }
.status-pending { background-color: #fff3e0; color: #fb8c00; }
.status-arriving-soon { background-color: #e3f2fd; color: #1e88e5; }
.status-checked-in { background-color: #e0f2f1; color: #00897b; }
.status-in-session { background-color: #f3e5f5; color: #8e24aa; }
.status-checked-out { background-color: #f5f5f5; color: #616161; }
.status-late { background-color: #fff3e0; color: #fb8c00; }
.status-no-show { background-color: #fbe9e7; color: var(--error-red); }

/* Removed Client Styling */
tr.is-removed { opacity: 0.6; background-color: #f8f9fa; }
tr.is-removed td:first-child { text-decoration: line-through; }

/* Sub-headings in modals */
.modal-sub-heading { font-weight: 600; color: var(--primary-dark-blue); margin-top: 20px; margin-bottom: 15px; padding-bottom: 5px; border-bottom: 1px solid var(--border-light); font-size: 1.1rem; }
.modal-sub-heading:first-child { margin-top: 0; }
.reschedule-info-box { background-color: #f5f5f5; border-left: 4px solid var(--accent-blue); padding: 15px; margin-bottom: 20px; border-radius: 4px; }

/* Searchable Input and Attendee Tags */
.search-container { position: relative; }
.search-results { position: absolute; top: 100%; left: 0; width: 100%; background: #fff; border: 1px solid var(--border-light); border-top: none; border-radius: 0 0 8px 8px; max-height: 200px; overflow-y: auto; z-index: 10; box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.search-result-item { padding: 10px 15px; cursor: pointer; }
.search-result-item:hover { background-color: #f1f1f1; }
.attendee-container { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; border: 1px solid var(--border-light); border-radius: 8px; min-height: 40px; }
.attendee-tag { display: flex; align-items: center; background-color: var(--accent-blue); color: var(--text-light); padding: 5px 10px; border-radius: 15px; font-size: 0.9rem; }
.attendee-tag button { background: none; border: none; color: white; margin-left: 8px; font-size: 1rem; cursor: pointer; padding: 0; line-height: 1; }

/* Appointment Filter */
.filter-container { position: relative; }
.filter-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 5px); background-color: #fff; width: 300px; box-shadow: 0 8px 16px 0 rgba(0,0,0,0.15); border-radius: 8px; z-index: 10; padding: 15px; animation: fadeInDropdown 0.2s ease-out; border: 1px solid var(--border-light); }
.filter-dropdown.show { display: block; }
.filter-section { margin-bottom: 15px; }
.filter-section:last-child { margin-bottom: 0; }
.filter-section h4 { margin: 0 0 10px 0; font-size: 0.9rem; color: var(--secondary-blue); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border-light); padding-bottom: 5px; }
.filter-options { max-height: 150px; overflow-y: auto; padding-right: 5px; }
.filter-item label { display: flex; align-items: center; gap: 8px; padding: 6px 0; cursor: pointer; font-size: 0.95rem; }
.filter-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent-blue); }
.filter-button-count { background-color: var(--light-blue); color: white; border-radius: 50%; padding: 2px 7px; font-size: 0.75rem; margin-left: 8px; font-weight: 700; }

/* Notification Toasts */
#notification-container { position: fixed; top: 80px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: 350px; }
.notification-toast { background-color: #fff; border-left: 5px solid var(--light-blue); padding: 15px 20px; border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.15); display: flex; flex-direction: column; gap: 5px; opacity: 0; transform: translateX(100%); transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55); position: relative; }
.notification-toast.show { opacity: 1; transform: translateX(0); }
.notification-toast-title { font-weight: 700; color: var(--primary-dark-blue); font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.notification-toast-message { font-size: 0.9rem; color: var(--text-dark); }
.notification-close-btn { position: absolute; top: 5px; right: 10px; background: none; border: none; font-size: 1.5rem; color: #aaa; cursor: pointer; line-height: 1; padding: 0; }
.notification-close-btn:hover { color: #333; }
.notification-actions { margin-top: 10px; display: flex; gap: 10px; }
.btn-view-notification { padding: 5px 12px !important; font-size: 0.8rem !important; text-transform: none !important; letter-spacing: 0 !important; width: auto !important; font-weight: 600 !important; }

/* Modal Info Header */
.modal-info-header { background-color: #f8f9fa; border: 1px solid var(--border-light); border-left: 4px solid var(--accent-blue); padding: 15px; margin-bottom: 20px; border-radius: 8px; }
.modal-info-header p { margin: 0 0 8px 0; font-size: 0.95rem; color: #555; display: flex; align-items: center; gap: 8px; }
.modal-info-header p:last-child { margin-bottom: 0; }
.modal-info-header strong { color: var(--primary-dark-blue); }
.modal-info-header .client-actions { display: flex; gap: 5px; align-items: center; margin-left: auto; }
.modal-info-header .client-actions .btn-icon { width: 32px; height: 32px; font-size: 0.9rem; }
.modal-info-header-content { display: flex; align-items: center; width: 100%; }

/* Toggle Switch */
.toggle-switch-container { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; }
.switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-blue); }
input:checked + .slider:before { transform: translateX(22px); }

/* Form layout */
.form-row { display: flex; gap: 20px; width: 100%; }
.form-row .input-group { flex: 1; }

/* Radio button group */
.radio-group-wrapper { margin-bottom: 25px; }
.radio-group-wrapper > label { display: block; color: #666; font-size: 0.95rem; margin-bottom: 8px; }
.radio-group { padding-top: 5px; }
.radio-group label { margin-right: 20px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.radio-group input[type="radio"] { width: auto; }

/* Conditional field */
.conditional-field { display: none; transition: opacity 0.3s ease; opacity: 0; }
.conditional-field.visible { display: block; opacity: 1; }

/* Special notices */
.reminder-opt-out-notice { background-color: #fff3e0; border-left: 4px solid var(--warning-orange); padding: 15px; margin: 10px 0; border-radius: 4px; font-size: 0.9rem; }
.reminder-opt-out-notice p { margin: 0 0 10px 0; }

/* Client History Modal */
.modal-overlay .modal-card.client-history-modal { max-width: 800px; }
.history-header { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border-light); }
.history-header h3 { margin: 0; font-size: 1.4rem; color: var(--primary-dark-blue); display: flex; align-items: center; gap: 10px; }
.history-section h4 { color: var(--secondary-blue); margin-top: 20px; margin-bottom: 10px; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.history-table { width: 100%; border-collapse: collapse; }
.history-table td { padding: 10px 5px; border-bottom: 1px solid #f0f0f0; }
.history-table tr:last-child td { border-bottom: none; }
.history-table .actions-cell { text-align: right; }
.history-table .actions-cell .btn { padding: 6px 12px; font-size: 0.8rem; text-transform: none; width: auto; }

/* Client Meta Info */
.client-meta-info { font-style: italic; font-size: 0.9em; font-weight: 400; color: #666; margin-left: 8px; }
.client-language-icon { color: var(--accent-blue); margin-left: 8px; cursor: help; }

/* Appointment View Controls & Day Grouping */
.appointment-view-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.calendar-nav { display: flex; align-items: center; gap: 10px; }
.calendar-nav h3 { margin: 0; color: var(--primary-dark-blue); width: 250px; text-align: center; }
.view-switcher { position: relative; }
.view-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 5px); background-color: #fff; min-width: 120px; box-shadow: 0 8px 16px 0 rgba(0,0,0,0.15); border-radius: 8px; z-index: 10; padding: 5px; animation: fadeInDropdown 0.2s ease-out; border: 1px solid var(--border-light); flex-direction: column; gap: 5px; }
.view-dropdown.show { display: flex; }
.view-dropdown-item { width: 100%; text-align: left; padding: 8px 12px; border: none; background: none; cursor: pointer; border-radius: 4px; font-family: 'Montserrat', sans-serif; font-size: 0.9rem; }
.view-dropdown-item:hover { background-color: #f1f1f1; }
.day-group-header { background-color: #f8f9fa; padding: 10px 15px; font-weight: 600; color: var(--secondary-blue); position: sticky; top: 51px; z-index: 2; border-bottom: 2px solid var(--border-light); }
.day-group-header td { padding: 10px 15px !important; }

/* Reminder UI items */
.reminder-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #eee; }
.reminder-item:last-child { border-bottom: none; }
.reminder-item-controls { display: flex; align-items: center; gap: 10px; }
.reminder-item-controls input[type="number"] { width: 60px; padding: 8px; text-align: center; }
.reminder-item-actions button { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: var(--error-red); }

/* Reminder Customization UI */
.reminder-template-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 15px; }
.reminder-template-controls .input-group { flex-grow: 1; margin-bottom: 0; }
.btn-help { font-size: 1.1rem; width: 30px; height: 30px; color: #888; }
.reminder-text-group { margin-bottom: 15px; padding: 15px; border: 1px dashed var(--border-light); border-radius: 8px; }
.reminder-text-group label { font-weight: 600; font-size: 0.9rem; color: var(--secondary-blue); display: block; margin-bottom: 5px; }
.reminder-text-group textarea { min-height: 100px; }
.event-reminder-item { border: 1px solid var(--border-light); border-radius: 8px; padding: 15px; margin-bottom: 15px; }

/* Overall Appointment Reminder Status */
.appointment-reminder-status { padding: 15px; border-radius: 8px; margin-top: 10px; text-align: center; font-weight: 600; border: 1px solid transparent; }
.appointment-reminder-status.status-confirmed { background-color: #e8f5e9; color: var(--success-green); border-color: var(--success-green); }
.appointment-reminder-status.status-pending { background-color: #fff3e0; color: #fb8c00; border-color: #fb8c00; }
.appointment-reminder-status.status-cancelled { background-color: #fbe9e7; color: var(--error-red); border-color: var(--error-red); }
.appointment-reminder-status.status-disabled { background-color: #f5f5f5; color: #616161; border-color: #ddd; }

/* Event Attendee List */
.attendee-status-list { max-height: 250px; overflow-y: auto; border: 1px solid var(--border-light); border-radius: 8px; padding: 10px; }
.attendee-status-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; }
.attendee-status-item:nth-child(even) { background-color: #f8f9fa; }
.attendee-status-badge { padding: 3px 8px; border-radius: 10px; font-size: 0.8rem; font-weight: 600; }
.attendee-status-pending { background-color: #fff3e0; color: #fb8c00; }
.attendee-status-confirmed { background-color: #e8f5e9; color: var(--success-green); }
.attendee-status-cancelled { background-color: #fbe9e7; color: var(--error-red); }

/* Messaging Modal (Read-Only History) */
.modal-overlay .modal-card.messaging-modal { max-width: 700px; height: 80vh; padding: 0; display: flex; flex-direction: column; }
.messaging-header { padding: 15px 25px; border-bottom: 1px solid var(--border-light); flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; }
.messaging-header .modal-title { font-size: 1.5rem; margin: 0; }
.message-history { flex-grow: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column-reverse; background-color: #f9f9f9; }
.message-bubble { max-width: 75%; padding: 10px 15px; border-radius: 18px; margin-bottom: 10px; position: relative; line-height: 1.4; font-size: 0.95rem; }
.message-bubble p { margin: 0; }
.message-bubble .meta { font-size: 0.75rem; margin-top: 5px; display: block; opacity: 0.8; }
/* Inbound: Client Responses (Y, N, STOP) */
.message-inbound { background-color: #e9ecef; color: #333; border-bottom-left-radius: 4px; align-self: flex-start; }
/* Outbound: Staff messages and Automated reminders */
.message-outbound { background-color: var(--accent-blue); color: white; border-bottom-right-radius: 4px; align-self: flex-end; }
.message-outbound.is-auto { background-color: var(--secondary-blue); }
.messaging-footer { padding: 15px; border-top: 1px solid var(--border-light); flex-shrink: 0; background-color: #fff; }
.messaging-footer textarea { width: 100%; resize: none; height: 60px; padding: 10px; border-radius: 8px; border: 1px solid var(--border-light); box-sizing: border-box; font-family: inherit; }
.messaging-footer .footer-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.messaging-notice { font-size: 0.85rem; color: #666; font-style: italic; }

/* --- APPEND TO THE END OF YOUR CSS FILE --- */

/* Removed Client Styling */
tr.is-removed {
    opacity: 0.6;
    background-color: #f8f9fa;
}
tr.is-removed td:first-child {
    text-decoration: line-through;
}

/* Appointment View Controls & Day Grouping */
.appointment-view-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.calendar-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}
.calendar-nav h3 {
    margin: 0;
    color: var(--primary-dark-blue);
    width: 250px;
    text-align: center;
}
.view-switcher {
    position: relative;
}
.view-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    background-color: #fff;
    min-width: 120px;
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.15);
    border-radius: 8px;
    z-index: 10;
    padding: 5px;
    animation: fadeInDropdown 0.2s ease-out;
    border: 1px solid var(--border-light);
    flex-direction: column;
    gap: 5px;
}
.view-dropdown.show {
    display: flex;
}
.view-dropdown-item {
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
}
.view-dropdown-item:hover {
    background-color: #f1f1f1;
}
.day-group-header {
    background-color: #f8f9fa;
    padding: 10px 15px;
    font-weight: 600;
    color: var(--secondary-blue);
    position: sticky;
    top: 51px; /* Height of table header */
    z-index: 2;
    border-bottom: 2px solid var(--border-light);
}
.day-group-header td {
    padding: 10px 15px !important;
}

/* Dynamic Reminder Schedule UI */
.reminder-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.reminder-item:last-child {
    border-bottom: none;
}
.reminder-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.reminder-item-controls input[type="number"] {
    width: 60px;
    padding: 8px;
    text-align: center;
    border-radius: 6px;
    border: 1px solid var(--border-light);
}
.reminder-item-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--error-red);
    padding: 0 5px;
    line-height: 1;
}

/* Event Attendee Status List */
.attendee-status-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 10px;
}
.attendee-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
}
.attendee-status-item:nth-child(even) {
    background-color: #f8f9fa;
}
.attendee-status-badge {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}
.attendee-status-pending { background-color: #fff3e0; color: #fb8c00; }
.attendee-status-confirmed { background-color: #e8f5e9; color: var(--success-green); }
.attendee-status-denied { background-color: #fbe9e7; color: var(--error-red); }

/* Reminder Customization & Status UI */
.reminder-template-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}
.reminder-template-controls .input-group {
    flex-grow: 1;
    margin-bottom: 0;
}
.btn-help {
    font-size: 1.1rem;
    width: 30px;
    height: 30px;
    color: #888;
}
.reminder-text-group {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px dashed var(--border-light);
    border-radius: 8px;
}
.reminder-text-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary-blue);
    display: block;
    margin-bottom: 5px;
}
.reminder-text-group textarea {
    min-height: 100px;
}
.event-reminder-item {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}
.appointment-reminder-status {
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
    border: 1px solid transparent;
}
.appointment-reminder-status.status-confirmed {
    background-color: #e8f5e9;
    color: var(--success-green);
    border-color: var(--success-green);
}
.appointment-reminder-status.status-pending {
    background-color: #fff3e0;
    color: #fb8c00;
     border-color: #fb8c00;
}
.appointment-reminder-status.status-cancelled {
    background-color: #fbe9e7;
    color: var(--error-red);
     border-color: var(--error-red);
}
.appointment-reminder-status.status-disabled {
    background-color: #f5f5f5;
    color: #616161;
    border-color: #ddd;
}

/* Messaging Modal (History & Send) */
.modal-overlay .modal-card.messaging-modal {
    max-width: 700px;
    height: 80vh;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.messaging-header {
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.messaging-header h2 {
    font-size: 1.5rem;
    margin: 0;
    text-align: left;
}
.message-history {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse; /* Newest messages at the bottom */
    background-color: #f9f9f9;
}
.message-bubble {
    max-width: 75%;
    padding: 10px 15px;
    border-radius: 18px;
    margin-bottom: 10px;
    position: relative;
    line-height: 1.4;
    font-size: 0.95rem;
    word-wrap: break-word;
}
.message-bubble p {
    margin: 0;
}
.message-bubble .meta {
    font-size: 0.75rem;
    margin-top: 5px;
    display: block;
    opacity: 0.8;
}
.message-outbound {
    background-color: var(--accent-blue);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}
.messaging-footer {
    padding: 15px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
    background-color: #fff;
}
.messaging-footer textarea {
    width: 100%;
    resize: none;
    height: 60px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    box-sizing: border-box;
    font-family: inherit;
    margin-bottom: 10px;
}
.footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.messaging-notice {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}