* {
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 0;
    background: #f3f4f6;
    color: #111827;
}

.page {
    padding: 16px;
}

h1 {
    margin: 0 0 12px 0;
    font-size: 22px;
    text-transform: uppercase;
    text-align: center;
}

.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    background: #ffffff;
    padding: 12px;
    border: 1px solid #d1d5db;
}

.toolbar label {
    font-weight: bold;
}

.toolbar input {
    padding: 6px 8px;
    border: 1px solid #9ca3af;
    border-radius: 4px;
}

.toolbar button {
    padding: 7px 14px;
    border: 0;
    background: #0070c0;
    color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.table-wrap {
    width: 100%;
    overflow: auto;
    background: #ffffff;
    border: 1px solid #111827;
}

table {
    width: 100%;
    min-width: 1600px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
}

th,
td {
    border: 1px solid #111827;
    padding: 6px;
    vertical-align: middle;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

th {
    color: #ffffff;
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    line-height: 1.35;
}

td {
    background: #ffffff;
    line-height: 1.35;
}

.col-stt {
    width: 45px;
    text-align: center;
}

.col-busa {
    width: 60px;
    text-align: center;
}

.col-store {
    width: 260px;
}

.col-bank {
    width: 220px;
    text-align: center;
}

.col-periods {
    width: 270px;
}

.col-term {
    width: 170px;
    text-align: center;
}

.col-date {
    width: 100px;
    text-align: center;
}

.col-money {
    width: 130px;
    text-align: right;
}

.col-small {
    width: 80px;
    text-align: center;
}

.blue {
    background: #0070c0;
}

.cyan {
    background: #00a9d6;
}

.orange {
    background: #f4b183;
    color: #ffffff;
}

.green {
    background: #00b050;
}

.bank-info {
    text-align: center;
}

.period-line {
    margin-bottom: 6px;
}

.period-line:last-child {
    margin-bottom: 0;
}

.money {
    text-align: right;
}

.bold {
    font-weight: bold;
}

.loading {
    text-align: center;
    padding: 20px;
}

@media print {
    body {
        background: #ffffff;
    }

    .toolbar {
        display: none;
    }

    .page {
        padding: 0;
    }

    table {
        font-size: 10px;
    }
}
.active-period {
    color: red !important;
    font-weight: bold !important;
}

.active-period strong {
    color: red !important;
}
.col-paid {
    width: 160px;
    text-align: center;
}

.col-current-period {
    width: 90px;
    text-align: center;
}

.col-status {
    width: 90px;
    text-align: center;
}

.col-action {
    width: 130px;
    text-align: center;
}

.status-paid {
    color: #008000;
    font-weight: bold;
}

.status-unpaid {
    color: #d60000;
    font-weight: bold;
}

.btn-pay {
    padding: 4px 8px;
    border: 1px solid #666;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 3px;
}

.btn-delete {
    color: blue;
    margin-left: 6px;
    cursor: pointer;
    text-decoration: underline;
}
.col-payment-tracking {
    width: 260px;
    text-align: left;
}

.payment-tracking {
    text-align: left;
    line-height: 1.6;
    font-size: 12px;
}

.payment-line {
    margin-bottom: 5px;
    white-space: nowrap;
}

.payment-line:last-child {
    margin-bottom: 0;
}

.payment-line.paid {
    color: #111827;
}

.payment-line.unpaid {
    color: #d60000;
    font-weight: bold;
}

.payment-line.current {
    font-weight: bold;
}

.payment-line.current.unpaid {
    color: #d60000;
    font-weight: bold;
}

.btn-transfer {
    margin-left: 6px;
    padding: 2px 7px;
    font-size: 12px;
    border: 1px solid #666;
    background: #f5f5f5;
    cursor: pointer;
    border-radius: 3px;
}

.btn-transfer:hover {
    background: #e5e7eb;
}

.action-links {
    display: flex;
    gap: 6px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.action-links button {
    padding: 3px 7px;
    font-size: 12px;
    cursor: pointer;
}

.action-links .danger {
    color: #d60000;
}
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
}

.payment-modal {
    width: 460px;
    max-width: calc(100vw - 30px);
    background: #ffffff;
    border-radius: 10px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.payment-modal h2 {
    margin: 0 0 18px 0;
    font-size: 20px;
}

.payment-info {
    margin-bottom: 14px;
    line-height: 1.6;
    font-size: 14px;
}

.qr-box {
    width: 260px;
    height: 260px;
    margin: 0 auto 14px auto;
    border: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
}

.qr-box img {
    max-width: 250px;
    max-height: 250px;
    object-fit: contain;
}

.qr-missing {
    color: #d60000;
    font-weight: bold;
    padding: 12px;
}

.upload-row {
    margin: 12px 0;
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.modal-actions {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal-actions button,
.upload-row button {
    padding: 5px 10px;
    cursor: pointer;
}
.editable-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.editable-cell.left {
    justify-content: flex-start;
}

.btn-edit {
    border: 1px solid #999;
    background: #f9fafb;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 12px;
}

.btn-edit:hover {
    background: #e5e7eb;
}
.form-row {
    margin-bottom: 10px;
    text-align: left;
}

.form-row label {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
}

.form-row input,
.form-row textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #9ca3af;
    border-radius: 4px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

.bank-cell {
    position: relative;
}

.bank-cell-content {
    text-align: center;
}

.bank-cell .btn-edit {
    margin-top: 6px;
}
.large-modal {
    width: 920px;
    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 40px);
    overflow: auto;
    background: #ffffff;
    border-radius: 10px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 13px;
}

.modal-table th,
.modal-table td {
    border: 1px solid #999;
    padding: 5px;
}

.modal-table input,
.modal-table select {
    width: 100%;
    padding: 5px;
    border: 1px solid #9ca3af;
    border-radius: 3px;
}

.modal-table .col-delete {
    width: 50px;
    text-align: center;
}

.period-cell-wrap {
    position: relative;
}

.period-cell-wrap .btn-edit {
    margin-top: 6px;
}
.mini-calendar {
    text-align: center;
    font-size: 12px;
}

.mini-calendar-title {
    font-weight: bold;
    margin-bottom: 6px;
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 6px;
}

.mini-day {
    border: 2px solid #111827;
    background: #ffffff;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

.mini-day.pay-window {
    background: #ffef66;
}

.mini-day.current-day {
    background: #ff3b30;
    color: #ffffff;
}

.mini-day.current-day.pay-window {
    background: #ff3b30;
    color: #ffffff;
    border-color: #ffef66;
    box-shadow: inset 0 0 0 3px #ffef66;
}

.mini-calendar-note {
    font-size: 11px;
    line-height: 1.4;
    text-align: left;
}

.mini-calendar-range {
    margin-top: 4px;
    font-size: 11px;
    text-align: left;
}

.legend-box {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid #111827;
    vertical-align: middle;
    margin-right: 4px;
}

.legend-red {
    background: #ff3b30;
}

.legend-yellow {
    background: #ffef66;
}
.col-date {
    width: 260px !important;
    min-width: 260px !important;
    text-align: center;
    vertical-align: top;
}
.mini-calendar-status {
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    font-weight: bold;
}

.mini-calendar-status.paid {
    color: #047857;
}

.mini-calendar-status.muted {
    color: #6b7280;
    font-weight: normal;
}

.mini-calendar-status.warning {
    color: #d60000;
    font-weight: bold;
}
.col-date {
    width: 260px !important;
    min-width: 260px !important;
    text-align: center;
    vertical-align: top;
}

.mini-calendar {
    width: 230px;
    margin: 0 auto;
    text-align: center;
    font-size: 12px;
}

.mini-calendar-title {
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 12px;
}

.mini-calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 28px) !important;
    gap: 4px !important;
    justify-content: center;
    margin-bottom: 6px;
}

.mini-day {
    width: 24px !important;
    height: 24px !important;
    border: 2px solid #111827;
    background: #ffffff;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    box-sizing: border-box;
    line-height: 1;
}

.mini-day.pay-window {
    background: #ffef66 !important;
}

.mini-day.current-day {
    background: #ff3b30 !important;
    color: #ffffff !important;
}

.mini-day.current-day.pay-window {
    background: #ff3b30 !important;
    color: #ffffff !important;
    border-color: #ffef66 !important;
    box-shadow: inset 0 0 0 3px #ffef66;
}

.mini-calendar-note {
    font-size: 11px;
    line-height: 1.4;
    text-align: left;
    margin-top: 4px;
}

.mini-calendar-range {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.4;
    text-align: left;
}

.legend-box {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 1px solid #111827;
    vertical-align: middle;
    margin-right: 4px;
}

.legend-red {
    background: #ff3b30;
}

.legend-yellow {
    background: #ffef66;
}

.mini-calendar-status {
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
    font-weight: bold;
}

.mini-calendar-status.paid {
    color: #047857;
}

.mini-calendar-status.muted {
    color: #6b7280;
    font-weight: normal;
}

.mini-calendar-status.warning {
    color: #d60000;
    font-weight: bold;
}
.col-store {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
}

.col-term {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}
.col-money {
    width: 95px !important;
    min-width: 95px !important;
    max-width: 95px !important;
    text-align: right;
    font-size: 12px;
    white-space: nowrap;
}
.col-action {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    text-align: center;
}

.action-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    align-items: center;
}

.action-links button {
    width: 70px;
    padding: 3px 4px;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
}

.action-links .danger {
    color: #d60000;
    font-weight: bold;
}
.payment-period-title {
    line-height: 1.4;
}

.payment-period-status {
    margin-left: 22px;
    line-height: 1.4;
}