/* Платежный календарь */

.pc-shell {
    max-width: 72rem;
}

.pc-notice {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0.625rem;
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-size: 0.9375rem;
}

.pc-notice--error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.pc-guest-banner {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0.625rem;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    font-size: 0.875rem;
}

.pc-import-bar__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.pc-import-bar__actions {
    display: flex;
    gap: 0.5rem;
}

.pc-link {
    color: #059669;
    font-weight: 600;
    text-decoration: underline;
}

.pc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.pc-toolbar__left,
.pc-toolbar__right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.pc-month-label {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    min-width: 10rem;
    text-align: center;
    margin: 0;
}

.pc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    cursor: pointer;
    background: #fff;
    color: #334155;
    transition: background 0.15s, border-color 0.15s;
}

.pc-btn--primary {
    background: #059669;
    color: #fff;
    border-color: #059669;
}

.pc-btn--primary:hover {
    background: #047857;
}

.pc-btn--secondary {
    border-color: #cbd5e1;
}

.pc-btn--ghost {
    background: transparent;
    border-color: transparent;
    color: #64748b;
}

.pc-btn--danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.pc-btn--icon {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    border: 1px solid #e2e8f0;
}

.pc-btn.is-disabled,
.pc-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pc-select,
.pc-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    color: #0f172a;
}

.pc-select:focus,
.pc-input:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.pc-view-toggle {
    display: inline-flex;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
}

.pc-view-btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    background: #fff;
    color: #64748b;
    cursor: pointer;
}

.pc-view-btn.is-active {
    background: #059669;
    color: #fff;
}

.pc-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.pc-summary__item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
}

.pc-summary__item span {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.pc-summary__item strong {
    font-size: 1.125rem;
    color: #0f172a;
}

.pc-summary__item--in strong { color: #059669; }
.pc-summary__item--out strong { color: #dc2626; }

.pc-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.pc-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
}

.pc-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
}

.pc-cell {
    min-height: 5.5rem;
    padding: 0.5rem;
    text-align: left;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pc-cell:hover {
    border-color: #059669;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.12);
}

.pc-cell--empty {
    background: #f8fafc;
    border-style: dashed;
    cursor: default;
    pointer-events: none;
}

.pc-cell--today {
    border-color: #059669;
    box-shadow: inset 0 0 0 1px #059669;
}

.pc-cell__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.pc-cell__day {
    font-weight: 700;
    font-size: 0.875rem;
    color: #0f172a;
}

.pc-cell__rec {
    font-size: 0.75rem;
    color: #7c3aed;
}

.pc-cell__in {
    font-size: 0.6875rem;
    color: #059669;
    font-weight: 600;
}

.pc-cell__out {
    font-size: 0.6875rem;
    color: #dc2626;
    font-weight: 600;
}

.pc-cell__dots {
    display: flex;
    gap: 0.2rem;
    margin-top: 0.35rem;
}

.pc-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: #94a3b8;
}

.pc-dot--paid { background: #059669; }
.pc-dot--pending { background: #f59e0b; }
.pc-dot--cancelled { background: #94a3b8; }

.pc-table-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
}

.pc-table-scroll {
    overflow-x: auto;
}

.pc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.pc-table th,
.pc-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.pc-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.pc-td-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pc-td-actions {
    white-space: nowrap;
}

.pc-type--in { color: #059669; }
.pc-type--out { color: #dc2626; }

.pc-status--paid { color: #059669; }
.pc-status--pending { color: #d97706; }
.pc-status--cancelled { color: #94a3b8; }

.pc-badge-rec {
    color: #7c3aed;
    font-size: 0.75rem;
}

.pc-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
}

.pc-link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.8125rem;
    color: #059669;
    cursor: pointer;
    text-decoration: underline;
}

.pc-link-btn--danger {
    color: #dc2626;
}

.pc-empty,
.pc-empty-inline {
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
}

.pc-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.pc-modal.hidden {
    display: none;
}

.pc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.pc-modal__panel {
    position: relative;
    width: 100%;
    max-width: 32rem;
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 0.875rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

.pc-modal__panel--form {
    max-width: 28rem;
}

.pc-modal__panel--sm {
    max-width: 24rem;
}

.pc-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.pc-modal__head h3 {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
}

.pc-modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
}

.pc-modal__body {
    padding: 1rem 1.25rem;
}

.pc-modal__foot {
    padding: 0.75rem 1.25rem 1.25rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pc-day-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.pc-day-item:last-child {
    border-bottom: none;
}

.pc-day-item__title {
    font-weight: 600;
    color: #0f172a;
}

.pc-day-item__meta {
    font-size: 0.8125rem;
    color: #64748b;
    margin-top: 0.15rem;
}

.pc-day-item__amount {
    font-weight: 700;
    text-align: right;
    grid-column: 2;
    grid-row: 1;
}

.pc-day-item .pc-row-actions {
    grid-column: 1 / -1;
}

.pc-form__row {
    margin-bottom: 0.875rem;
}

.pc-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.35rem;
}

.pc-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.pc-form__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.pc-delete-text {
    margin: 0 0 0.75rem;
    color: #334155;
}

.pc-delete-series {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

@media (max-width: 768px) {
    .pc-summary {
        grid-template-columns: 1fr;
    }

    .pc-cell {
        min-height: 4.5rem;
        padding: 0.35rem;
    }

    .pc-cell__in,
    .pc-cell__out {
        font-size: 0.625rem;
    }
}

/* ——— Модальное окно платежа (как продажи / УПД) ——— */

.pc-payment-modal__panel {
    width: min(52rem, calc(100vw - 2rem));
    max-width: none;
    padding: 1rem 1.25rem 0.75rem;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 640px) {
    .pc-payment-modal__panel {
        padding: 1.125rem 1.5rem 0.875rem;
    }
}

.pc-payment-modal__panel[data-pc-type="incoming"] {
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 7.5rem);
    box-shadow: 0 30px 80px -20px rgba(5, 150, 105, 0.28);
}

.pc-payment-modal__panel[data-pc-type="outgoing"] {
    background: linear-gradient(180deg, #fef2f2 0%, #ffffff 7.5rem);
    box-shadow: 0 30px 80px -20px rgba(220, 38, 38, 0.22);
}

.pc-payment-modal__header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e2e8f0;
}

.pc-payment-modal__panel[data-pc-type="incoming"] .pc-payment-modal__header {
    border-bottom-color: #86efac;
}

.pc-payment-modal__panel[data-pc-type="outgoing"] .pc-payment-modal__header {
    border-bottom-color: #fca5a5;
}

.pc-payment-modal__panel .finance-modal__title {
    font-size: 1.35rem;
}

.pc-payment-modal__panel .finance-modal__subtitle {
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.pc-payment-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.pc-payment-modal__body {
    padding-right: 0.15rem;
}

.pc-payment-modal__panel .finance-modal__field {
    margin-top: 0.75rem;
}

.pc-payment-modal__panel .finance-modal__field:first-child {
    margin-top: 0;
}

.pc-payment-modal__panel .finance-label {
    margin-bottom: 0.35rem;
    font-size: 0.8125rem;
}

.pc-payment-modal__panel .finance-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
}

.pc-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.pc-form-grid--wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pc-form-grid .finance-modal__field {
    margin-top: 0;
}

@media (max-width: 640px) {
    .pc-form-grid,
    .pc-form-grid--wide {
        grid-template-columns: 1fr;
    }
}

.pc-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pc-pill {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    flex: 1 1 0;
    min-width: 8rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    background: #fff;
    color: #475569;
    font-size: 0.8125rem;
    line-height: 1.3;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.pc-pill--sm {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    min-width: 0;
    padding: 0.45rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 9999px;
}

.pc-pill__title {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.9375rem;
}

.pc-pill__desc {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.125rem;
}

.pc-pill:hover:not(:disabled):not(.is-disabled) {
    border-color: #94a3b8;
    background: #f8fafc;
}

.pc-pill.is-disabled,
.pc-pill:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pc-pill--type-in.is-active {
    border-color: #10b981;
    background: #ecfdf5;
    box-shadow: 0 0 0 1px #10b981;
    color: #047857;
}

.pc-pill--type-in.is-active .pc-pill__title {
    color: #047857;
}

.pc-pill--type-out.is-active {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 1px #ef4444;
    color: #b91c1c;
}

.pc-pill--type-out.is-active .pc-pill__title {
    color: #b91c1c;
}

.pc-status-pills .pc-pill.is-active,
.pc-schedule-pills .pc-pill.is-active {
    border-color: #64748b;
    background: #f1f5f9;
    box-shadow: 0 0 0 1px #94a3b8;
    color: #0f172a;
}

.pc-payment-modal__panel[data-pc-type="incoming"] .pc-amount-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.pc-payment-modal__panel[data-pc-type="outgoing"] .pc-amount-input:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.pc-field-hint {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: #64748b;
}

.pc-payment-modal__footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.pc-payment-modal__panel[data-pc-type="incoming"] .pc-submit-btn {
    background: #059669;
    border-color: #059669;
}

.pc-payment-modal__panel[data-pc-type="incoming"] .pc-submit-btn:hover {
    background: #047857;
    border-color: #047857;
}

.pc-payment-modal__panel[data-pc-type="outgoing"] .pc-submit-btn {
    background: #dc2626;
    border-color: #dc2626;
}

.pc-payment-modal__panel[data-pc-type="outgoing"] .pc-submit-btn:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.pc-payment-modal__panel .finance-modal__divider {
    margin: 1rem 0 0.75rem;
    font-size: 0.8125rem;
}

/* Поисковые селекты (bp-combobox + menu-search) — самодостаточно, без зависимости от bank-payments.css */
.pc-payment-modal__panel .bp-combobox-field {
    position: relative;
    min-width: 0;
}

.pc-payment-modal__panel .bp-combobox {
    position: relative;
}

.pc-payment-modal__panel .bp-combobox__control {
    position: relative;
    display: flex;
    align-items: stretch;
}

.pc-payment-modal__panel .bp-combobox__input {
    flex: 1;
    min-width: 0;
    padding-right: 2.25rem;
}

.pc-payment-modal__panel .bp-combobox__input[readonly] {
    cursor: pointer;
    background: #fff;
}

.pc-payment-modal__panel .bp-combobox__toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.75rem;
    height: 1.75rem;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
}

.pc-payment-modal__panel .bp-combobox__toggle::before {
    content: '▾';
}

.pc-payment-modal__panel .bp-combobox.is-open .bp-combobox__toggle::before {
    content: '▴';
}

.pc-payment-modal__panel .bp-combobox__native {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.pc-payment-modal__panel .bp-combobox__menu {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    margin-top: 0.35rem;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.pc-payment-modal__panel .bp-combobox__menu-search {
    padding: 0.5rem 0.5rem 0.4rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.pc-payment-modal__panel .bp-combobox__filter {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 2rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.8125rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
}

.pc-payment-modal__panel .bp-combobox__list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
    max-height: 12rem;
    overflow-y: auto;
}

.pc-payment-modal__panel .bp-combobox__option {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.875rem;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 0.875rem;
    color: #0f172a;
    cursor: pointer;
}

.pc-payment-modal__panel .bp-combobox__option:hover,
.pc-payment-modal__panel .bp-combobox__option.is-active {
    background: #fef2f2;
    color: #b91c1c;
}

.pc-payment-modal__panel[data-pc-type="incoming"] .bp-combobox__option:hover,
.pc-payment-modal__panel[data-pc-type="incoming"] .bp-combobox__option.is-active {
    background: #ecfdf5;
    color: #047857;
}

.pc-payment-modal__panel .bp-combobox__empty {
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
    color: #64748b;
}

.pc-payment-modal__panel .bp-combobox--menu-search .bp-combobox__menu .bp-combobox__list {
    max-height: 12rem;
}

.pc-payment-modal__panel .bp-combobox__menu.is-fixed {
    z-index: 1300;
}
