/* =========================================
   CLIENT PORTAL - REFINED STYLES (CLEAN & FIXED)
   ========================================= */

:root {
    --primary: #5a7256;
    --primary-hover: #4b6148;
    --primary-light: #eef2ee;
    
    --bg-body: #F5F7FA;
    --bg-card: #FFFFFF;
    
    --text-main: #2D3436;
    --text-secondary: #636E72;
    --text-muted: #B2BEC3;
    
    --border-color: #E0E0E0;
    --focus-ring: rgba(90, 114, 86, 0.2);
    
    --error: #E74C3C;
    
    --radius-m: 16px;
    --radius-s: 10px;
    
    --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.08);
    --shadow-nav: 0 -4px 20px rgba(0,0,0,0.05);
}

/* --- BASE LAYOUT --- */
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    flex-direction: column; /* Changed for layout */
    height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* For Auth Pages only - center content */
body.auth-page {
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* --- GENERIC CONFIRMATION MODAL --- */
.confirm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.confirm-modal-box {
    background: #fff;
    width: 85%;
    max-width: 320px;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.confirm-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

.confirm-modal-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-confirm-yes {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    background: var(--error);
    color: white;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-confirm-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    background: #d63d2e; /* Slightly darker red */
}

.btn-confirm-yes:active {
    transform: translateY(0);
}

.btn-confirm-no {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    background: #f0f0f0;
    color: var(--text-main);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-confirm-no:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #e0e0e0;
}

.btn-confirm-no:active {
    transform: translateY(0);
}

/* --- CLIENT TOAST CONTAINER --- */
#toast-container-client {
    position: fixed;
    top: 90px; /* Below header */
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column; /* Stack downwards from top */
    gap: 10px;
    pointer-events: none;
    width: 100%;
    max-width: 320px;
}

.client-toast {
    background: #333; /* Fallback dark */
    border-radius: 12px;
    padding: 12px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); /* Stronger shadow */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 280px;
    max-width: 320px;
    border: none;
    pointer-events: auto;
    color: white; /* White text for all toasts */
    
    opacity: 0;
    transform: translateY(-150%); /* Start fully off-screen (above) */
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Bouncy slide */
}

.client-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* SUCCESS (Default) */
.client-toast {
    background: var(--primary); /* Green brand color */
}

/* ERROR */
.client-toast.error {
    background: var(--error); /* Red */
}

/* INFO */
.client-toast.info {
    background: #34495e; /* Dark Blue/Grey */
}

/* WARNING (Yellow) */
.client-toast.warning {
    background: #f39c12; /* Yellow/Orange */
}
.client-toast.warning .toast-icon {
    background: rgba(255, 255, 255, 0.2);
}

/* Make it responsive */
@media (max-width: 480px) {
    #toast-container-client {
        top: 20px; 
        width: 90%;
    }
    .client-toast {
        width: 100%;
        max-width: none;
    }
}

.client-toast .toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2); /* Semi-transparent white circle */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Remove specific background overrides for icons since the whole toast is colored */
.client-toast.error .toast-icon {
    background: rgba(255, 255, 255, 0.2);
}

.client-toast.info .toast-icon {
    background: rgba(255, 255, 255, 0.2);
}

.client-toast .toast-message {
    font-size: 14px;
    font-weight: 600; /* Bold text for better readability on color */
    color: white;
    line-height: 1.4;
    text-align: center;
}

/* --- APP LAYOUT (Header + Content + Nav) --- */
#app-header {
    height: 60px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    z-index: 100;
    /* Limit width on desktop */
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    /* Sticky for better UX */
    position: sticky;
    top: 0;
}

.brand-logo {
    font-weight: 800;
    font-size: 20px;
    color: var(--primary);
    text-transform: none;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    color: var(--text-main);
    padding: 8px;
}

.badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
    border: 2px solid #fff;
    display: none;
}

#main-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 90px; /* Space for bottom nav */
    /* Limit width on desktop */
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%; /* Center horizontally */
    transform: translateX(-50%); /* Center horizontally */
    width: 100%;
    max-width: 600px; /* Limit width */
    height: 70px;
    background: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: var(--shadow-nav);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom); /* iOS safe area */
    border-top: 1px solid var(--border-color); /* Subtle border for desktop look */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary); /* Was --text-muted, made darker for better visibility */
    font-size: 10px;
    font-weight: 500;
    gap: 4px;
    width: 100%;
    height: 100%;
    transition: color 0.2s;
}

.nav-item svg {
    stroke-width: 2px;
    transition: stroke 0.2s;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active svg {
    fill: var(--primary-light);
    stroke: var(--primary);
}

/* --- WIDGETS & CARDS --- */
.widget-card {
    background: #fff;
    border-radius: var(--radius-m);
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin-bottom: 20px;
}

.widget-card h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: var(--text-secondary);
    /* text-transform: uppercase; Removed */
    letter-spacing: 0.5px;
}

.btn-cancel-sm {
    background: rgba(231, 76, 60, 0.1);
    color: var(--error);
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-cancel-sm:hover {
    background: rgba(231, 76, 60, 0.2);
}

.btn-change-sm {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    flex: 1; /* For flex layout */
}

.btn-change-sm:hover {
    background: rgba(243, 156, 18, 0.2);
}

.search-box {
    position: relative;
    margin-bottom: 25px;
}

.search-input {
    width: 100%;
    height: 50px;
    padding: 0 20px 0 50px;
    border: 1px solid transparent;
    background: #fff;
    border-radius: 25px; /* Pill shape */
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.2s;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(90, 114, 86, 0.15);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input::placeholder {
    font-size: 11px; /* Very small to fit long text */
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    line-height: 50px; /* Center vertically */
}

/* --- SEARCH RESULTS LIST --- */
#search-results {
    max-height: 50vh; /* Limit to 50% of viewport height */
    overflow-y: auto; /* Enable vertical scroll */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
    scrollbar-width: thin; /* Thin scrollbar for Firefox */
    margin-bottom: 20px;
    padding-bottom: 10px;
}
/* Scrollbar styling for Webkit */
#search-results::-webkit-scrollbar {
    width: 6px;
}
#search-results::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}
#search-results::-webkit-scrollbar-track {
    background-color: transparent;
}


/* --- MASTER CARD --- */
.master-card {
    background: #fff;
    border-radius: var(--radius-m);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: pointer; /* Clickable card */
    position: relative;
}

.master-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    border-color: var(--border-color);
}

/* Remove active scale for card itself since it is not clickable */
/* .master-card:active { transform: scale(0.98); } */

.master-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #eee;
    object-fit: cover;
    flex-shrink: 0;
}

.master-info {
    flex: 1;
}

.master-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.master-category {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-book-sm {
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s; /* Smooth hover */
}

.btn-book-sm:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(90, 114, 86, 0.2);
}

.btn-book-sm:active {
    transform: scale(0.95);
}

/* --- FAVORITE BUTTON --- */
.btn-fav {
    /* position: absolute; removed */
    /* top: 10px; right: 10px; removed */
    background: #fff;
    border: 1px solid #eee;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s;
    color: #ccc;
    z-index: 5;
    margin-right: 10px; /* Add spacing */
    flex-shrink: 0;
}

.btn-fav:hover {
    transform: scale(1.1);
}

.btn-fav svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2px;
    transition: all 0.2s;
    pointer-events: none; /* Prevent click capture */
}

.btn-fav.active {
    color: #e74c3c !important;
    border-color: #e74c3c !important;
    background: #fff5f5 !important;
}

.btn-fav.active svg {
    fill: #e74c3c !important;
    stroke: #e74c3c !important;
}

/* --- AUTH STYLES (Keep existing) --- */
.auth-wrapper {
    width: 100%;
    max-width: 400px;
    position: relative;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-card);
    padding: 40px 30px;
    text-align: center;
    position: relative;
}

/* --- LANGUAGE SWITCHER --- */
.lang-switcher {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 30px;
}

.lang-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn:hover {
    color: var(--text-main);
    background: #f0f0f0;
}

.lang-btn.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* --- BRANDING --- */
.auth-logo-text {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    line-height: 1.2;
    text-transform: uppercase;
}

.auth-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 35px;
    line-height: 1.5;
}

.auth-subtitle strong {
    color: var(--text-main);
    font-weight: 600;
}

/* --- INPUT FIELDS --- */
.form-group {
    margin-bottom: 24px;
    text-align: left;
}

.input-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* Base Input Styles */
.form-input {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    border: 1px solid #E0E0E0;
    border-radius: var(--radius-s);
    font-size: 18px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-main);
    background: #FAFAFA;
    outline: none;
    transition: border-color 0.2s, background-color 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: none;
}

.form-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 16px; /* Default size */
}

/* Wrapper for Phone Input */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    background: #FAFAFA;
    border: 1px solid #E0E0E0;
    border-radius: var(--radius-s);
    transition: border-color 0.2s;
    cursor: text;
    gap: 12px; 
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    background: #fff;
    box-shadow: none;
}

.phone-prefix {
    position: static;
    font-size: 18px;
    font-weight: 500; 
    color: var(--text-main);
    pointer-events: none;
    margin: 0;
    padding: 0;
    line-height: normal;
    font-family: 'Inter', sans-serif;
}

/* --- GHOST INPUT STYLES --- */
.phone-input-container {
    position: relative;
    width: 145px; 
    height: 100%;
}

.phone-ghost {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 1;
    font-size: 18px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    letter-spacing: 1px;
    white-space: pre;
}

.phone-ghost .dim {
    color: #CFD8DC; 
}

.form-input.phone {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent !important;
    padding: 0;
    margin: 0;
    box-shadow: none;
    letter-spacing: 1px;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    font-size: 18px !important;
    font-weight: 500 !important;
    font-family: 'Inter', sans-serif !important;
    color: transparent !important; 
    caret-color: var(--text-main); 
    opacity: 1 !important;
    -webkit-text-fill-color: transparent !important;
    line-height: normal;
}

.form-input.phone:focus {
    box-shadow: none;
    background: transparent;
    border-color: transparent;
    outline: none; 
}

.simple-field {
    background: #FAFAFA;
    border: 1px solid var(--border-color);
}
.simple-field:focus {
    background: #FFF;
    border-color: var(--primary);
}

.btn-primary {
    width: 100%;
    height: 56px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-s);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    /* transform: scale(0.98); Отключаем эффект нажатия, чтобы не "дёргалась" */
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: var(--primary);
}

.btn-back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s;
    width: 100%;
}

.btn-back-link:hover {
    color: var(--primary);
}

.auth-footer {
    margin-top: 25px;
    font-size: 14px;
    color: var(--text-secondary);
}

.link-btn {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    cursor: pointer;
}

.link-btn:hover {
    text-decoration: underline;
}

.otp-container {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 25px;
}

.otp-digit {
    width: 100%;
    height: 64px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-s);
    font-size: 28px;
    text-align: center;
    font-weight: 700;
    color: var(--text-main);
    background: #FAFAFA;
    outline: none;
    transition: 0.2s;
}

.otp-digit:focus {
    border-color: var(--border-color); 
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.step-container {
    display: none;
    animation: fadeIn 0.4s ease;
}
.step-container.active {
    display: block !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.shake {
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.loader {
    width: 20px;
    height: 20px;
    border: 3px solid #FFF;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- OFFCANVAS (NOTIFICATIONS) --- */
.offcanvas-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999; /* Just below panel (2000) */
    visibility: hidden;
    pointer-events: none;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.offcanvas-backdrop.active {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
}

.offcanvas-panel {
    position: fixed;
    top: 0;
    right: -100%; /* Hidden by default */
    width: 300px;
    height: 100%;
    background: #fff;
    box-shadow: -5px 0 30px rgba(0,0,0,0.1);
    z-index: 2000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.offcanvas-panel.active {
    right: 0;
}

.offcanvas-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.offcanvas-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-main);
}

.offcanvas-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Make it full width on mobile */
@media (max-width: 480px) {
    .offcanvas-panel {
        width: 100%;
    }
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Slightly darker */
    z-index: 3000; /* Higher than nav (1000) and offcanvas (2000) */
    display: none;
    align-items: flex-end; /* Bottom sheet logic */
    justify-content: center;
    backdrop-filter: blur(4px);
    padding-bottom: 20px; /* Gap from bottom edge */
    box-sizing: border-box;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 480px;
    border-radius: 24px; /* Fully rounded corners */
    padding: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 80vh; 
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 0 15px; /* Side gaps */
}

@media (min-width: 768px) {
    .modal-overlay {
        align-items: center;
    }
    .modal-content {
        border-radius: var(--radius-m);
        width: 450px;
        animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        max-height: 80vh; /* More compact on desktop */
    }
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0; /* Critical for scrolling in flex column */
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: 10px 24px;
    border-top: 1px solid var(--bg-body);
    display: flex;
    gap: 12px;
    background: #fff; /* Ensure it covers content */
    border-radius: 0 0 24px 24px; /* Match container rounded corners */
    flex-shrink: 0; /* Prevent shrinking */
}

    /* --- SCROLLABLE CATEGORY CHIPS --- */
    .category-scroll {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 12px;
        margin-bottom: 15px;
        scrollbar-width: none; /* Firefox */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling iOS */
        cursor: grab; /* Desktop hint */
        user-select: none; /* Prevent text selection while dragging */
        
        /* Sticky positioning */
        position: sticky;
        top: 0;
        background: #fff; /* Ensure opaque background */
        z-index: 10;
        padding-top: 5px; /* Add some padding for visual comfort when sticky */
    }
.category-scroll.active {
    cursor: grabbing;
}
.category-scroll::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.chip {
    padding: 8px 16px;
    border-radius: 20px;
    background: #F5F7FA;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.chip.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(90, 114, 86, 0.2);
}

/* --- ADDON SELECTION --- */
.addon-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.addon-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.chk-circle {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.addon-item.selected .chk-circle {
    border-color: var(--primary);
    background: var(--primary);
}

.chk-circle::after {
    content: '';
    width: 8px;
    height: 4px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg);
    display: none;
}

.addon-item.selected .chk-circle::after {
    display: block;
}

.addon-info {
    flex: 1;
}
.addon-name { font-weight: 600; font-size: 14px; color: var(--text-main); }
.addon-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.addon-price { font-weight: 700; color: var(--primary); font-size: 14px; }

/* --- SERVICE SELECTION LIST --- */
.service-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.service-item:hover, .service-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.service-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: var(--text-main);
}

.service-info p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.service-price {
    font-weight: 700;
    color: var(--primary);
}

/* --- DATE & TIME SLOTS --- */
.date-selector {
    margin-bottom: 24px;
}

.slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.time-slot {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 0;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-main);
}

.time-slot.selected {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.time-slot.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f0f0f0;
}

/* --- CONFIRMATION --- */
.confirm-summary {
    background: #fcfcfc;
    border-radius: 20px;
    padding: 24px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    margin-bottom: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Центрируем по вертикали */
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 15px;
}

.summary-row:first-child {
    padding-top: 0;
}

/* Master & Service & Date Labels */
.summary-row > span:first-child {
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Values */
.summary-row > span:last-child {
    font-weight: 700 !important;
    color: var(--text-main);
    text-align: right;
    max-width: 60%;
    line-height: 1.4;
}

/* TOTAL ROW (Last one) */
.summary-row:last-child {
    border-bottom: none;
    margin-top: 12px;
    padding-top: 20px;
    border-top: 2px dashed #ddd; /* Эффект чека */
}

.summary-row:last-child > span:first-child {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}

.summary-row:last-child > span:last-child {
    color: var(--primary) !important;
    font-size: 24px;
    font-weight: 800 !important;
}

/* Comment Field Styling */
.form-group {
    margin-top: 0 !important; /* Override inline style */
}
.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}
.form-input {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 12px;
    transition: all 0.2s;
}
.form-input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(90, 114, 86, 0.1);
}

/* New Confirmation Styles (Legacy - keeping just in case) */
.conf-master-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.conf-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
}

.conf-row-services {
    align-items: flex-start;
}

.conf-label {
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-right: 12px;
}

.conf-val {
    font-weight: 600;
    color: var(--text-main);
    text-align: right;
    min-width: 0;
}

.conf-val-services {
    min-width: 0;
    width: 100%;
}

.conf-service-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.conf-service-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
}

.conf-service-num {
    flex-shrink: 0;
    min-width: 1.75em;
    text-align: right;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
}

.conf-service-name {
    min-width: 0;
    word-break: break-word;
}

.conf-val-datetime {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.conf-time-line {
    display: block;
}

.conf-date-line {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
}

.conf-comment-counter {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

.conf-separator {
    margin-top: 12px;
    padding-top: 0;
    border-top: 1px dashed var(--border-color);
}

.conf-row-duration {
    font-weight: 700;
    font-size: 16px;
}
.conf-row-duration .conf-label {
    color: var(--text-main);
}
.conf-row-duration .conf-val {
    color: var(--primary);
}

.conf-total {
    margin-top: 12px;
    padding-top: 0;
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
}

/* --- RESPONSIVE / DESKTOP APP SIMULATION --- */
@media (max-width: 480px) {
    body.auth-page {
        align-items: flex-start;
        padding: 0;
        background: #fff;
    }
    .auth-wrapper {
        max-width: 100%;
    }
    .auth-card {
        box-shadow: none;
        border-radius: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* DESKTOP DEVICE SIMULATION */
@media (min-width: 800px) {
    body {
        /* Stylish, modern abstract background */
        background-color: #E8ECEF;
        background-image: 
            radial-gradient(circle at 15% 50%, rgba(90, 114, 86, 0.08), transparent 25%), 
            radial-gradient(circle at 85% 30%, rgba(52, 152, 219, 0.08), transparent 25%);
        background-size: cover;
        align-items: center;
        /* Subtle mesh pattern overlay */
        background-attachment: fixed;
    }
    
    :root {
        --app-width: 480px;
        --app-margin: 30px;
    }

    /* MAIN CONTENT */
    #main-content {
        max-width: var(--app-width);
        min-height: auto;
        margin: var(--app-margin) auto;
        box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.02);
        background: var(--bg-body);
        position: relative;
        padding: 80px 20px 90px 20px; /* Top, Right, Bottom, Left */
        border-radius: 24px;
        /* Let's make main-content THE scroll container */
        height: calc(100vh - (var(--app-margin) * 2));
        overflow-y: scroll;
        scrollbar-width: none;
        box-sizing: border-box;
    }
    
    /* INTERNAL SCROLL AREA */
    #main-content > *:not(#app-header):not(#bottom-nav):not(.offcanvas-panel):not(.modal-overlay) {
        /* This selector is tricky if structure is flat. Better to wrap content? */
    }
    
    /* Better approach: Assume Header and Footer are siblings of #main-content in DOM, but visually inside on desktop. */
    /* Wait, structure is: Header, Content, Footer. */
    
    /* Let's fix positioning relative to window for "App Window" feel */
    
    #app-header {
        position: fixed;
        top: var(--app-margin);
        z-index: 1000;
        width: var(--app-width);
        border-radius: 24px 24px 0 0;
    }

    #bottom-nav {
        position: fixed;
        bottom: var(--app-margin);
        z-index: 1000;
        width: var(--app-width);
        border-radius: 0 0 24px 24px;
    }
    
    /* OFFCANVAS NOTIFICATIONS (Desktop) */
    .offcanvas-panel {
        /* Partial width - Side Drawer (leaving left side visible) */
        width: 320px; 
        height: calc(100vh - (var(--app-margin) * 2));
        
        /* Positioning: Align to Right side of App Container */
        /* Logic: Center (50%) + Half App Width (240px) - Panel Width (320px) */
        left: calc(50% + (var(--app-width) / 2) - 320px); 
        top: var(--app-margin);
        right: auto;
        
        /* Styling */
        background: #fff;
        /* Rounded corners matching the phone on the right side */
        border-radius: 20px 24px 24px 20px; 
        z-index: 2000;
        
        /* Animation: Slide from Right (from outside the phone area) */
        transform: translateX(110%); /* Hidden to the right */
        opacity: 0;
        pointer-events: none;
        
        transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
        box-shadow: -5px 0 30px rgba(0,0,0,0.15);
    }
    
    .offcanvas-panel.active {
        /* Slide IN to its position */
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }
    
    /* TOASTS (Desktop Override) */
    #toast-container-client {
        top: 110px; /* Below header */
        bottom: auto;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 100%;
        max-width: 400px;
    }
    
    /* SCROLLBAR */
    ::-webkit-scrollbar { width: 8px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: #CBD5E0; border-radius: 4px; }
}

/* --- DASHBOARD STATS WIDGETS --- */
.dashboard-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    margin-top: -10px;
}

.stat-card {
    flex: 1;
    background: #fff;
    border-radius: 16px;
    padding: 12px 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s;
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(46, 204, 113, 0.1);
    color: var(--primary);
}

.stat-icon-wrap.pending {
    background: rgba(243, 156, 18, 0.1);
    color: #f39c12;
}

.stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    /* text-transform: uppercase; Removed */
    letter-spacing: 0.5px;
}

/* --- HEADER ICONS --- */
.icon-btn svg {
    color: var(--primary); /* Green brand color */
}

/* --- NOTIFICATION BADGE --- */
.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #E74C3C; /* Red/Orange */
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 2;
}

/* --- NOTIFICATION ITEMS --- */
.notif-item {
    transition: background-color 1.5s ease; /* Slow fade out */
    background-color: #fff;
}

.notif-item.unread {
    background-color: rgba(90, 114, 86, 0.12); /* Light green tint */
}

/* --- ICON BUTTONS (PHONE) --- */
.btn-icon-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F5F7FA;
    color: var(--text-secondary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-right: 4px; /* Gap to the Book button */
}

.btn-icon-sm:hover {
    background: #e0e0e0;
    color: var(--primary);
    transform: scale(1.05);
}

.btn-icon-sm svg {
    width: 18px;
    height: 18px;
    stroke-width: 2px;
}

/* --- HISTORY PAGE STYLES --- */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.history-item {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid #f0f0f0;
    position: relative;
}

.history-status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    /* text-transform: uppercase; Removed */
    letter-spacing: 0.5px;
    display: inline-block;
    margin-bottom: 12px;
}

.status-confirmed { background: rgba(46, 204, 113, 0.1); color: #2ecc71; }
.status-cancelled { background: rgba(231, 76, 60, 0.1); color: #e74c3c; }
.status-completed { background: var(--primary-light); color: var(--primary); }

.history-master-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.history-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #eee;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #777;
    font-size: 14px;
}

.history-details {
    flex: 1;
}

.history-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.history-service {
    font-size: 13px;
    color: var(--text-secondary);
}

.history-date-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f5f5f5;
    margin-top: 5px;
}

.history-time {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
}

.history-date {
    font-size: 12px;
    color: #999;
}

.history-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 14px;
}

.empty-history {
    text-align: center;
    color: #999;
    margin-top: 50px;
    font-size: 14px;
}

/* --- LANGUAGE OPTIONS (PROFILE) --- */
.btn-lang-opt {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: var(--radius-s);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-size: 14px;
}

.btn-lang-opt:hover {
    background: #fafafa;
    border-color: #ccc;
}

.btn-lang-opt.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(90, 114, 86, 0.1);
}

/* --- REPEAT BOOKING BUTTON --- */
.btn-repeat {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: rgba(90, 114, 86, 0.1); 
    color: var(--primary);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-repeat:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(90, 114, 86, 0.2);
}

.btn-repeat:active {
    transform: translateY(0);
}

/* --- CUSTOM CALENDAR STYLES --- */
.cal-container {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    user-select: none;
}

.cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cal-month-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-main);
}

.cal-nav-btn {
    background: #f0f0f0;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}
.cal-nav-btn:hover {
    background: #e0e0e0;
    color: var(--primary);
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.cal-day-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    padding-bottom: 8px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
}

.cal-day:hover:not(.disabled):not(.selected):not(.cal-day-off):not(.cal-vacation) {
    background: var(--primary-light);
    color: var(--primary);
}

.cal-day.selected {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(90, 114, 86, 0.3);
}

.cal-day.today {
    border: 1px solid var(--primary);
    color: var(--primary);
}
.cal-day.today.selected {
    color: white;
}

.cal-day.disabled {
    color: #ddd;
    cursor: not-allowed;
    pointer-events: none;
}

.cal-day.empty {
    cursor: default;
    pointer-events: none;
}

/* Vacation & Day Off Styling in Calendar */
.cal-day.cal-day-off, .cal-day.cal-vacation {
    background-color: #f0f0f0;
    color: #bbb;
    cursor: default;
    /* Optional: Add a pattern or icon styling here */
}

/* --- READONLY INPUT STYLES --- */
.form-input[readonly], .form-input[disabled] {
    background-color: #f9f9f9; 
    color: var(--text-secondary);
    cursor: default;
    border-color: transparent;
    pointer-events: none; /* Disable interaction events */
}

.form-input[readonly]:focus, .form-input[disabled]:focus {
    border-color: transparent;
    box-shadow: none;
    background-color: #f9f9f9;
    outline: none;
}

/* Specifically for input wrapper if needed */
.input-wrapper[readonly] {
    pointer-events: none;
    background-color: #f9f9f9;
    border-color: transparent;
}