.pos-modal {
    display: none;
    z-index: 10006;
}

.pos-modal.is-open {
    display: flex;
}

.pos-modal__box {
    background: #fff;
    max-width: 980px;
    padding: clamp(22px, 3vw, 40px);
}

.pos-form {
    align-items: stretch;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
}

.pos-alert {
    margin-bottom: -10px;
    width: 100%;
}

.pos-card {
    min-width: 0;
}

.pos-card--customer {
    background: #f8f9fa;
}

.pos-card--order {
    background: #fdfaf6;
    border-color: #f5e6cc;
}

.pos-autocomplete-wrap {
    position: relative;
    width: 100%;
}

.pos-autocomplete {
    background: #fff;
    border: 1px solid #d4d4d4;
    border-bottom: 0;
    border-top: 0;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    left: 0;
    max-height: 200px;
    margin-top: -15px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 99;
}

.pos-autocomplete[hidden] {
    display: none;
}

.pos-autocomplete__item {
    background: #fff;
    border-bottom: 1px solid #eee;
    color: #333;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 10px 15px;
}

.pos-autocomplete__item:hover,
.pos-autocomplete__item.is-active {
    background: #f8f9fa;
}

.pos-autocomplete__details {
    color: #888;
    font-size: 0.75rem;
    margin-top: 3px;
}

.pos-input-spaced {
    margin-bottom: 15px;
}

.pos-input-tight {
    margin-bottom: 5px;
}

.pos-check-row {
    align-items: center;
    color: #555;
    cursor: pointer;
    display: flex;
    font-size: 0.8rem;
    gap: 8px;
    margin-bottom: 15px;
}

.pos-check-row input {
    accent-color: var(--admin-success);
    height: 14px;
    width: 14px;
}

.pos-field-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.pos-field {
    flex: 1 1 120px;
    font-size: 0.85rem;
    font-weight: 700;
}

.pos-field .admin-form-input {
    margin-top: 5px;
}

.pos-readonly {
    background: #e9ecef;
    color: #666;
    cursor: not-allowed;
    font-weight: 700;
}

.pos-calculator {
    background: #fff8ef;
    border: 1px solid #f0d8b8;
    border-radius: 8px;
    margin: 0 0 15px;
    padding: 12px;
}

.pos-calculator__row {
    display: flex;
    gap: 8px;
}

.pos-calculator__row .admin-form-input {
    flex: 1;
}

.pos-calculator__row button {
    min-width: 48px;
}

.pos-calculator__result {
    color: #5d3b26;
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 8px;
}

.pos-calculator__result.is-error {
    color: var(--admin-danger);
}

.pos-calculator__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.pos-payment-box {
    align-items: center;
    background: #f4fcf6;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
    padding: 15px;
    width: 100%;
}

.pos-check-row--paid {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0;
    min-width: 200px;
}

.pos-check-row--paid span {
    color: var(--admin-success);
}

.pos-check-row--paid input {
    height: 18px;
    width: 18px;
}

.pos-payment-method {
    align-items: center;
    color: #555;
    display: flex;
    flex: 1;
    font-size: 0.85rem;
    font-weight: 700;
    gap: 10px;
    min-width: 150px;
    white-space: nowrap;
}

.pos-payment-method select {
    font-size: 0.85rem;
    padding: 8px;
}

.pos-check-row--wide {
    flex-basis: 100%;
    font-size: 0.85rem;
    margin-bottom: 0;
}

.pos-check-row--wide input {
    accent-color: var(--admin-danger);
    height: 16px;
    width: 16px;
}

.pos-submit-row {
    margin-top: 5px;
    width: 100%;
}

.pos-submit {
    font-size: 1.1rem;
    padding: 15px;
    width: 100%;
}

@media (max-width: 700px) {
    .pos-payment-method {
        align-items: stretch;
        flex-direction: column;
        white-space: normal;
    }
}


.pos-field-grid--amounts {
    align-items: end;
}

.pos-balance-panel {
    background: #f8fafc;
    border: 1px solid #dce3ea;
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: -2px 0 15px;
    padding: 12px;
}

.pos-balance-panel div {
    min-width: 0;
}

.pos-balance-panel span,
.pos-balance-panel strong {
    display: block;
}

.pos-balance-panel span {
    color: #667085;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.pos-balance-panel strong {
    color: #20242c;
    font-size: 1rem;
    line-height: 1.25;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.pos-balance-panel__due strong {
    color: #0f766e;
}

.pos-balance-panel p {
    color: #667085;
    font-size: 0.82rem;
    grid-column: 1 / -1;
    margin: 2px 0 0;
}

.pos-balance-panel.is-paid {
    background: #effcf4;
    border-color: #b7e4c7;
}

.pos-balance-panel.is-warning {
    background: #fff7ed;
    border-color: #fdba74;
}

.pos-balance-panel.is-warning .pos-balance-panel__due strong,
.pos-balance-panel.is-warning p {
    color: #c2410c;
}

.pos-calculator .admin-btn-secondary {
    padding: 10px 12px;
}

@media (max-width: 900px) {
    .pos-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .pos-balance-panel {
        grid-template-columns: 1fr;
    }
}
