/* =========================================================================
 |  اجاره کوتاه مدت سایت ۲ — تقویم رزرو ، پنل میزبان و فاکتور
 |  تبدیل تاریخ سمت سرور انجام می شود ؛ اینجا فقط ظاهر شبکه تقویم است.
 * ====================================================================== */

:root {
    --gr-open: #1e3a2c;
    --gr-open-bg: #ffffff;
    --gr-selected: #1e3a2c;
    --gr-inrange: #e8f1ec;
    --gr-closed: #f3f4f6;
    --gr-unopened: #fafafa;
    --gr-booked: #fdeaea;
    --gr-border: #e6e8eb;
}

.gr-cal {
    direction: rtl;
}

.gr-cal__months {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .gr-cal--multi .gr-cal__months {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .gr-cal--wide .gr-cal__months {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.gr-cal__month {
    border: 1px solid var(--gr-border);
    border-radius: 12px;
    padding: 12px;
    background: #fff;
}

.gr-cal__title {
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.gr-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.gr-cal__dow {
    text-align: center;
    font-size: 0.7rem;
    color: #7a8290;
    padding-bottom: 4px;
}

.gr-cal__cell {
    min-height: 46px;
    border: 1px solid transparent;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    line-height: 1.1;
    cursor: default;
    padding: 2px;
    background: var(--gr-unopened);
    color: #b6bcc5;
    user-select: none;
}

.gr-cal__cell--empty {
    background: transparent;
    border-color: transparent;
}

.gr-cal__price {
    font-size: 0.6rem;
    margin-top: 2px;
    opacity: 0.75;
    white-space: nowrap;
}

/* روز باز و قابل انتخاب */
.gr-cal__cell--open {
    background: var(--gr-open-bg);
    border-color: var(--gr-border);
    color: #22272f;
    cursor: pointer;
}

.gr-cal__cell--open:hover {
    border-color: var(--gr-open);
}

.gr-cal__cell--weekend.gr-cal__cell--open {
    background: #fffaf0;
}

/* روزی که میزبان هنوز باز نکرده — با روز «رزرو شده» یکی نیست */
.gr-cal__cell--unopened {
    background: repeating-linear-gradient(45deg, #fafafa, #fafafa 4px, #f2f2f2 4px, #f2f2f2 8px);
    color: #c2c7ce;
}

.gr-cal__cell--closed {
    background: var(--gr-closed);
    color: #aab0b8;
    text-decoration: line-through;
}

.gr-cal__cell--booked {
    background: var(--gr-booked);
    color: #c05252;
    text-decoration: line-through;
}

.gr-cal__cell--past {
    background: transparent;
    color: #dcdfe3;
}

/* انتخاب مسافر */
.gr-cal__cell--selected {
    background: var(--gr-selected) !important;
    border-color: var(--gr-selected) !important;
    color: #fff !important;
}

.gr-cal__cell--inrange {
    background: var(--gr-inrange) !important;
    border-color: var(--gr-inrange) !important;
    color: #1e3a2c !important;
}

.gr-cal__cell--checkout {
    background: var(--gr-selected) !important;
    border-color: var(--gr-selected) !important;
    color: #fff !important;
}

/* راهنمای رنگ ها */
.gr-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 0.75rem;
    color: #5c646f;
    margin-top: 12px;
}

.gr-legend__item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.gr-legend__swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid var(--gr-border);
    display: inline-block;
}

.gr-legend__swatch--open { background: #fff; }
.gr-legend__swatch--unopened { background: repeating-linear-gradient(45deg, #fafafa, #fafafa 3px, #eee 3px, #eee 6px); }
.gr-legend__swatch--closed { background: var(--gr-closed); }
.gr-legend__swatch--booked { background: var(--gr-booked); }
.gr-legend__swatch--selected { background: var(--gr-selected); }

/* جعبه رزرو در صفحه اقامتگاه */
.gr-book {
    position: sticky;
    top: 90px;
}

.gr-book__price {
    font-size: 1.25rem;
    font-weight: 700;
}

.gr-book__dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.gr-book__date {
    border: 1px solid var(--gr-border);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    background: #fff;
}

.gr-book__date small {
    display: block;
    color: #7a8290;
    font-size: 0.7rem;
}

.gr-book__date strong {
    font-size: 0.85rem;
}

.gr-book__date.is-active {
    border-color: var(--gr-open);
    box-shadow: 0 0 0 2px rgba(30, 58, 44, 0.12);
}

.gr-book__rows {
    font-size: 0.82rem;
}

.gr-book__rows .row-line {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.gr-book__total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    border-top: 1px dashed var(--gr-border);
    padding-top: 8px;
    margin-top: 8px;
}

.gr-nights-table {
    max-height: 190px;
    overflow-y: auto;
    font-size: 0.78rem;
}

/* پنل میزبان */
.gr-owner-toolbar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: #fff;
    border-top: 1px solid var(--gr-border);
    padding: 12px;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.06);
}

.gr-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    background: #eef1f4;
    color: #47505c;
}

.gr-chip--success { background: #e6f5ec; color: #1c7a45; }
.gr-chip--warning { background: #fdf3e2; color: #a3701a; }
.gr-chip--danger  { background: #fdeaea; color: #b23b3b; }

/* فاکتور */
.gr-invoice {
    max-width: 860px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--gr-border);
    border-radius: 14px;
    padding: 24px;
}

.gr-invoice__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 2px solid var(--gr-open);
    padding-bottom: 14px;
    margin-bottom: 18px;
}

.gr-invoice table {
    width: 100%;
    border-collapse: collapse;
}

.gr-invoice th,
.gr-invoice td {
    border: 1px solid var(--gr-border);
    padding: 8px 10px;
    font-size: 0.85rem;
    text-align: right;
}

.gr-invoice thead th {
    background: #f6f8f7;
}

.gr-invoice__stamp {
    display: inline-block;
    border: 2px solid;
    border-radius: 8px;
    padding: 6px 14px;
    font-weight: 700;
    transform: rotate(-4deg);
}

@media print {
    .gr-no-print,
    header,
    footer,
    .btn-scroll-top,
    #goftino_w {
        display: none !important;
    }

    .gr-invoice {
        border: none;
        max-width: 100%;
    }

    body {
        background: #fff !important;
    }
}
