.page-layout{
    max-width:1500px;
    width:95%;
    margin:40px auto;

    display:flex;
    gap:30px;
    align-items:flex-start;

    flex:1;
}


.sidebar-card{
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 35px rgba(0,0,0,.08);
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
}

.right-sidebar {
    position: fixed;
    top: 100px;
    right: 30px;
    width: 370px;
    z-index: 100;

    max-height: calc(100vh - 120px);
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;

    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
}

.sidebar-card:last-child{
    margin-bottom: 0;
}
.sidebar-card h3{

    margin-bottom:20px;

    font-size:24px;

}

.appointment-card{

    padding:15px;

    margin-bottom:15px;

    border-radius:15px;

    background:#faf8f3;

    border-left:5px solid #C9A96E;

}

.appointment-date{

    font-weight:bold;

    font-size:17px;

}

.appointment-time{

    color:#C9A96E;

    font-size:20px;

    margin:8px 0;

}

.appointment-service{

    font-weight:600;

}

.appointment-master{

    color:#666;

    margin-top:6px;

}

.empty-text{

    color:#888;

    text-align:center;

}


/* ===========================
        POPUP ЗАПИСИ
=========================== */

.appointment-modal{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.45);

    display:none;

    justify-content:center;

    align-items:center;

    z-index:9999;

    animation:fadeIn .25s;
}

.appointment-modal.show{

    display:flex;

}


.appointment-modal-content {

    width: 700px;
    max-width: 90vw;

    max-height: 85vh;

    overflow-y: auto;

    background: #fff;
    border-radius: 20px;

    padding: 30px;

    position: relative;

    box-sizing: border-box;

}

.appointment-modal-content::-webkit-scrollbar {

    width: 8px;

}

.appointment-modal-content::-webkit-scrollbar-thumb {

    background: #d0d0d0;
    border-radius: 10px;

}

.appointment-modal-content::-webkit-scrollbar-thumb:hover {

    background: #b8b8b8;

}

.appointment-modal-close{

    position:absolute;

    right:20px;

    top:20px;

    width:38px;

    height:38px;

    border:none;

    border-radius:50%;

    background:#f3f3f3;

    cursor:pointer;

    font-size:18px;

}

.appointment-modal-close:hover{

    background:#e5e5e5;

}

@keyframes fadeIn{

    from{
        opacity:0;
    }

    to{
        opacity:1;
    }

}

@keyframes popup{

    from{
        transform:translateY(25px);
        opacity:0;
    }

    to{
        transform:none;
        opacity:1;
    }

}


.modal-appointment{

    display:flex;

    flex-direction:column;

    gap:18px;

}

.modal-appointment h2{

    text-align:center;

    margin-bottom:10px;

}

.modal-row{

    padding:12px 15px;

    background:#faf8f3;

    border-radius:12px;

}

.modal-comment{

    margin-top:10px;

    padding:15px;

    background:#f7f7f7;

    border-radius:12px;

}

.modal-comment p{

    margin-top:8px;

    color:#555;

    line-height:1.6;

}

.modal-service-image {

    display: flex;
    justify-content: center;

    margin-bottom: 20px;

}

.modal-service-image img {

    width: 100%;
    max-width: 420px;

    height: 240px;

    object-fit: cover;

    border-radius: 16px;

    display: block;

}

.modal-master{

    display:flex;

    gap:15px;

    align-items:center;

}

.modal-master-photo{

    width:70px;

    height:70px;

    border-radius:50%;

    object-fit:cover;

}

.cancel-btn{

    width:100%;

    margin-top:25px;

    padding:14px;

    border:none;

    border-radius:10px;

    background:#d32f2f;

    color:white;

    font-size:17px;

    cursor:pointer;

}

.cancel-btn:hover{

    background:#b71c1c;

}

.cancel-disabled{

    margin-top:20px;

    color:#888;

    text-align:center;

    font-size:15px;

}

.payment-btn{
    width:100%;
    margin-top:14px;
    padding:13px 16px;
    border:1px solid #b88e49;
    border-radius:10px;
    background:linear-gradient(135deg,#d2b274,#a77c38);
    color:#fff;
    font-size:16px;
    font-weight:700;
    cursor:pointer;
    transition:transform .18s ease,box-shadow .18s ease,opacity .18s ease;
}

.payment-btn:hover:not(:disabled){
    transform:translateY(-1px);
    box-shadow:0 8px 18px rgba(136,97,38,.23);
}

.payment-btn:disabled{cursor:wait;opacity:.72}

.payment-btn.is-paid{
    border-color:#9bc5a6;
    background:#edf7ef;
    color:#39734a;
    cursor:default;
    opacity:1;
}

.sidebar-payment-card{
    border-color:rgba(165,116,48,.34)!important;
    background:linear-gradient(180deg,#fff 0%,#fffaf1 100%);
}

.sidebar-payment-card[hidden]{
    display:none;
}

.payment-due-list{
    display:grid;
    gap:12px;
    max-height:min(52vh,560px);
    padding-right:6px;
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
    scrollbar-color:#c8aa79 transparent;
}

.review-pending-list {
    display: grid;
    gap: 12px;
    max-height: min(48vh, 520px);
    padding-right: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #c8aa79 transparent;
    -webkit-overflow-scrolling: touch;
}

.sidebar-review-pending-card {
    border-color: rgba(201,169,110,.34) !important;
    background: linear-gradient(180deg,#fff 0%,#fffcf5 100%);
}
.sidebar-review-pending-card[hidden] { display: none; }
.review-pending-card { margin: 0; border-left-color: #d0a13e; background: #fffaf0; }

.payment-due-card{
    margin:0;
    border-left-color:#a87935;
    background:#fff8ec;
}

.payment-service-link{
    display:block;
    width:100%;
    padding:0;
    border:0;
    background:transparent;
    color:inherit;
    cursor:pointer;
    text-align:left;
    font:inherit;
    font-weight:600;
}

.payment-due-price{
    margin-top:10px;
    color:#79664a;
    font-size:14px;
}

.payment-due-price strong{color:#654719;font-size:16px}

.appointment-review-button {
    width: 100%;
    min-height: 42px;
    margin-top: 9px;
    padding: 10px 13px;
    border: 1px solid #c9a96e;
    border-radius: 10px;
    color: #7b5b27;
    background: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}
.appointment-review-button:disabled { color: #67806e; border-color: #b8d2bf; background: #eff7f1; cursor: default; }

body.appointment-review-open { overflow: hidden; }
.appointment-review-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    padding: 18px;
    place-items: center;
    background: rgba(29, 24, 19, .58);
    backdrop-filter: blur(6px);
}
.appointment-review-modal[hidden] { display: none; }
.appointment-review-dialog {
    position: relative;
    width: min(100%, 560px);
    max-height: min(88vh, 780px);
    box-sizing: border-box;
    padding: clamp(22px, 4vw, 34px);
    overflow-y: auto;
    border: 1px solid rgba(201, 169, 110, .35);
    border-radius: 23px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(31, 24, 17, .24);
}
.appointment-review-close {
    position: absolute;
    top: 15px;
    right: 15px;
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #64584b;
    background: #f4efe8;
    cursor: pointer;
}
.appointment-review-eyebrow { color: #a17d3d; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.appointment-review-dialog h2 { margin: 6px 45px 8px 0; color: #40362c; font-size: clamp(25px, 4vw, 34px); }
.appointment-review-dialog > p { margin: 0 0 19px; color: #7b7064; line-height: 1.55; }
.appointment-review-platforms { display: grid; gap: 10px; margin: 18px 0 0; padding: 14px; border: 1px solid #eadfce; border-radius: 14px; background: #fffaf2; }
.appointment-review-platforms[hidden],
.appointment-review-platforms a[hidden] { display: none; }
.appointment-review-platforms h3 { margin: 0; color: #55483c; font-size: 14px; }
.appointment-review-platforms > div { display: flex; flex-wrap: wrap; gap: 8px; }
.appointment-review-platforms a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 11px; border: 1px solid #e3d4bd; border-radius: 11px; color: #604a2c; background: #fff; text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.appointment-review-platforms a:hover { border-color: #c9a96e; transform: translateY(-1px); }
.appointment-review-platforms img,
.appointment-review-platforms a > span { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; border-radius: 7px; color: #d1a13d; object-fit: cover; }
.appointment-review-platforms strong { font-size: 12px; overflow-wrap: anywhere; }
.appointment-review-dialog form { display: grid; gap: 14px; }
.appointment-review-rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 3px; margin: 0; padding: 0; border: 0; }
.appointment-review-rating legend,
.appointment-review-text > span,
.appointment-review-files > span { display: block; width: 100%; margin-bottom: 7px; color: #655a4e; font-size: 12px; font-weight: 800; }
.appointment-review-rating input { position: absolute; opacity: 0; pointer-events: none; }
.appointment-review-rating label { color: #d9cebd; cursor: pointer; font-size: 32px; line-height: 1; }
.appointment-review-rating label:hover,
.appointment-review-rating label:hover ~ label,
.appointment-review-rating input:checked ~ label { color: #d4a23c; }
.appointment-review-rating input:focus-visible + label { outline: 2px solid #9d7433; outline-offset: 2px; }
.appointment-review-text textarea,
.appointment-review-files input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 12px;
    border: 1px solid #ddd0be;
    border-radius: 11px;
    color: #493f35;
    background: #fff;
    font: inherit;
}
.appointment-review-text textarea { min-height: 110px; resize: vertical; }
.appointment-review-files input { border-style: dashed; }
.appointment-review-preview { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 7px; }
.appointment-review-preview:empty { display: none; }
.appointment-review-preview img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; }
.appointment-review-error { min-height: 18px; color: #776b5e; font-size: 12px; }
.appointment-review-error.is-error { color: #a64d4d; }
.appointment-review-submit { min-height: 46px; padding: 11px 16px; border: 0; border-radius: 12px; color: #fff; background: linear-gradient(135deg,#c9a96e,#a57b38); cursor: pointer; font: inherit; font-weight: 800; }
.appointment-review-submit:disabled { cursor: wait; opacity: .65; }

.cancel-confirmation-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    padding: 20px;
    place-items: center;
    background: rgba(28, 24, 20, .58);
    backdrop-filter: blur(5px);
    animation: fadeIn .2s ease;
}

.cancel-confirmation-modal[hidden] {
    display: none;
}

.cancel-confirmation-dialog {
    width: min(100%, 470px);
    padding: clamp(24px, 5vw, 34px);
    border: 1px solid #eadbc4;
    border-radius: 24px;
    background: #fffdf9;
    box-shadow: 0 24px 65px rgba(31, 24, 17, .24);
    text-align: center;
    animation: popup .22s ease;
}

.cancel-confirmation-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 17px;
    place-items: center;
    border-radius: 17px;
    color: #fff;
    background: linear-gradient(145deg, #d95c52, #b93632);
    box-shadow: 0 9px 22px rgba(185, 54, 50, .24);
    font-size: 28px;
    font-weight: 800;
}

.cancel-confirmation-dialog h2 {
    margin: 0 0 12px;
    color: #342d25;
    font-size: clamp(23px, 4vw, 29px);
}

.cancel-rating-warning {
    margin: 0 0 14px;
    padding: 13px 15px;
    border: 1px solid #efc8a5;
    border-radius: 13px;
    color: #8c4e22;
    background: #fff4e8;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

.cancel-confirmation-question {
    margin: 0;
    color: #6e655b;
    font-size: 15px;
    line-height: 1.55;
}

.cancel-confirmation-error {
    margin: 14px 0 0;
    color: #b72f2f;
    font-size: 13px;
    font-weight: 700;
}

.cancel-confirmation-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.cancel-confirmation-button {
    min-height: 46px;
    padding: 11px 18px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.cancel-confirmation-button:hover {
    transform: translateY(-1px);
}

.cancel-confirmation-button--no {
    color: #665c50;
    background: #eee8df;
}

.cancel-confirmation-button--no:hover {
    background: #e3dbd0;
}

.cancel-confirmation-button--yes {
    color: #fff;
    background: #bd3e38;
    box-shadow: 0 8px 18px rgba(189, 62, 56, .2);
}

.cancel-confirmation-button--yes:hover {
    background: #a92f2b;
}

.cancel-confirmation-button:focus-visible {
    outline: 3px solid rgba(201, 169, 110, .45);
    outline-offset: 2px;
}

.cancel-confirmation-button:disabled {
    opacity: .62;
    cursor: wait;
    transform: none;
}

.appointment-prepayment-label{
    border:1px solid #d8c397;
    color:#74551f;
    background:linear-gradient(135deg,#fff9e9,#f7ecd1);
}

@media (max-width: 480px) {
    .cancel-confirmation-actions {
        grid-template-columns: 1fr;
    }
}

.cancelled-appointment {
    padding: 20px;
    background: #ffe5e5;
    color: #b30000;
    border-radius: 12px;
    font-weight: bold;
    text-align: center;
}
.appointments-scroll {
    max-height: 300px;
    overflow-y: auto;

    display: flex;
    flex-direction: column;
    gap: 10px;

    padding-right: 6px;
}

.appointment-service.clickable {
    cursor: pointer;
    color: #2b6fff;
    font-weight: 600;
}

.appointment-service.clickable:hover {
    text-decoration: underline;
}

.sidebar-toggle {
    position: fixed;
    top: clamp(88px, 12vh, 120px);
    right: 0;
    display: grid;
    width: 48px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.72);
    border-right: 0;
    border-radius: 16px 0 0 16px;
    background: linear-gradient(145deg, #d5b879, #ad8240);
    color: #fff;
    cursor: pointer;
    z-index: 10001;
    box-shadow: 0 8px 24px rgba(83,61,28,.25);
    transition: width .2s ease, background .2s ease, box-shadow .2s ease;
}

.sidebar-toggle:hover {
    width: 54px;
    background: linear-gradient(145deg, #dfc58c, #b68a45);
    box-shadow: 0 10px 28px rgba(83,61,28,.32);
}

.sidebar-toggle:focus-visible {
    outline: 3px solid rgba(201,169,110,.45);
    outline-offset: 3px;
}

.sidebar-toggle-icon {
    display: block;
    font: 700 36px/1 Georgia, serif;
    transform: translateX(-1px);
    transition: transform .35s ease;
}

.sidebar-toggle.is-expanded .sidebar-toggle-icon {
    transform: rotate(180deg) translateX(-1px);
}

.sidebar-toggle.is-expanded {
    z-index: 14001;
}

.right-sidebar {
    transition: transform .38s cubic-bezier(.22,.8,.28,1), visibility 0s linear 0s;
}

.right-sidebar.collapsed {
    transform: translateX(calc(100% + 40px));
    visibility: hidden;
    pointer-events: none;
    transition: transform .38s cubic-bezier(.22,.8,.28,1), visibility 0s linear .38s;
}
.sidebar-no-transition {
    transition: none !important;
}

.flatpickr-day.appointment-day {
    background: #C9A96E !important;
    border-color: #C9A96E !important;
    color: #fff !important;
    font-weight: 700;
}

.flatpickr-day.appointment-day:hover {
    background: #b99354 !important;
    border-color: #b99354 !important;
}

/* ==========================
   Запись на согласовании
========================== */

.flatpickr-day.appointment-day-pending {
    background: #d6d6d6;
    border-color: #d6d6d6;
    color: #666;
}

.flatpickr-day.appointment-day-pending:hover {
    background: #c8c8c8;
    border-color: #c8c8c8;
}

.appointment-card.appointment-pending {
    background: #f4f4f4;
    border: 1px solid #d9d9d9;
    opacity: .85;
}

.appointment-pending-label {
    display: inline-block;
    margin: 6px 0 8px;
    padding: 3px 10px;
    background: #d9d9d9;
    color: #555;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* ==========================
   Приоритетная панель клиента
========================== */

.priority-client-panel {
    z-index: 4000;
    max-height: calc(100dvh - 116px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.priority-client-panel.right-sidebar {
    position: fixed;
    top: 100px;
    right: 30px;
    margin: 0;
    order: initial;
    z-index: 13000;
}

.priority-client-panel .sidebar-content {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.priority-client-panel .sidebar-card {
    width: 100%;
    min-width: 0;
    margin: 0;
    border: 1px solid rgba(201, 169, 110, 0.22);
}

.priority-client-panel .sidebar-card h3 {
    margin-bottom: clamp(12px, 2vw, 20px);
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.25;
}

#appointments-calendar {
    display: flex;
    width: 100%;
    min-width: 0;
    justify-content: center;
    overflow: visible;
}

.priority-client-panel .flatpickr-calendar.inline {
    flex: 0 0 307px;
    align-self: center;
    margin: 0 auto;
}

.priority-client-panel .appointment-card {
    min-width: 0;
    margin-bottom: 0;
}

.priority-client-panel .appointment-service,
.priority-client-panel .appointment-master {
    overflow-wrap: anywhere;
}

.priority-client-panel .empty-appointments {
    padding: 14px;
    border-radius: 12px;
    background: #faf8f3;
    color: #777;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .right-sidebar,
    .right-sidebar.collapsed,
    .sidebar-toggle,
    .sidebar-toggle-icon {
        transition-duration: .01ms;
    }
}

@media (max-width: 992px) {
    body.client-sidebar-open {
        overflow: hidden;
        overscroll-behavior: none;
    }

    .priority-client-panel.right-sidebar {
        position: fixed;
        inset: 0 0 auto auto;
        width: min(700px, 100vw);
        min-width: 0;
        max-width: 700px;
        height: 100dvh;
        max-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        border-radius: 24px 0 0 24px;
    }

    .priority-client-panel .sidebar-content {
        flex: 0 0 auto;
    }

    .sidebar-toggle {
        z-index: 13001;
    }
}

@media (max-width: 640px) {
    .priority-client-panel.right-sidebar {
        inset: 0;
        width: 100vw;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }

    .sidebar-toggle {
        top: 82px;
        width: 44px;
        height: 48px;
    }
}
