/* Printer Billing - Public Frontend Styles */

.pb-public-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.pb-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0073aa;
}

.pb-header h2 {
    margin: 0 0 5px;
    color: #23282d;
}

.pb-period-info {
    color: #666;
    margin: 0;
    font-size: 15px;
}

/* Login Notice */
.pb-login-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.pb-login-notice a {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}

/* Notice */
.pb-notice {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px 0;
}

.pb-notice-info {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    color: #1565c0;
}

/* Printer Card */
.pb-printer-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.pb-printer-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.pb-printer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.pb-printer-info h3 {
    margin: 0 0 8px;
    color: #23282d;
    font-size: 18px;
}

.pb-printer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

.pb-printer-meta span strong {
    color: #333;
}

/* Status */
.pb-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.pb-status-accepted {
    background: #e8f5e9;
    color: #2e7d32;
}

.pb-status-pending {
    background: #fff3e0;
    color: #e65100;
}

/* Counters Grid */
.pb-counters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.pb-counter-group {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 16px;
}

.pb-counter-group.pb-disabled {
    opacity: 0.5;
    background: #f0f0f0;
}

.pb-counter-group.pb-hidden-format {
    display: none !important;
}

.pb-counter-group h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pb-counter-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.pb-counter-field {
    flex: 1;
}

.pb-counter-field label {
    display: block;
    font-size: 11px;
    color: #868e96;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.pb-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    text-align: left;
    box-sizing: border-box;
}

.pb-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.pb-input[readonly],
.pb-input[disabled] {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.pb-cost-field {
    text-align: right;
}

.pb-cost-value {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #0073aa;
    padding: 8px 0;
}

/* Total Cost */
.pb-total-cost {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 6px;
    padding: 12px 20px;
    margin-bottom: 16px;
    text-align: right;
    font-size: 16px;
}

.pb-total-value {
    font-size: 20px;
    font-weight: 700;
    color: #1565c0;
}

/* Action Buttons */
.pb-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pb-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.pb-btn:hover {
    transform: translateY(-1px);
}

.pb-btn:active {
    transform: translateY(0);
}

.pb-btn-save {
    background: #0073aa;
    color: #fff;
}

.pb-btn-save:hover {
    background: #fff;
    color: #0073aa;
    border: 1px solid #0073aa;
}

.pb-btn-accept {
    background: #46b450;
    color: #fff;
}

.pb-btn-accept:hover {
    background: #fff;
    color: #46b450;
    border: 1px solid #46b450;
}

.pb-btn-error {
    background: #dc3545;
    color: #fff;
}

.pb-btn-error:hover {
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.pb-btn-cancel {
    background: #6c757d;
    color: #fff;
}

.pb-btn-cancel:hover {
    background: #fff;
    color: #6c757d;
    border: 1px solid #6c757d;
}

/* Modal */
.pb-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pb-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.pb-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.pb-modal-content h3 {
    margin: 0 0 10px;
}

.pb-modal-printer-name {
    color: #666;
    margin-bottom: 15px;
}

.pb-modal-content textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
}

.pb-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Notifications */
.pb-notification {
    position: fixed;
    top: 40px;
    right: 20px;
    z-index: 100000;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: pb-slide-in 0.3s ease;
}

.pb-notification-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.pb-notification-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

@keyframes pb-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Validation errors */
.pb-input-error,
.pb-input.pb-input-error {
    border-color: #dc3545 !important;
    background: #fff5f5;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.pb-counter-warning {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #dc3545;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .pb-public-wrapper {
        padding: 10px;
    }

    .pb-printer-header {
        flex-direction: column;
        gap: 10px;
    }

    .pb-counters-grid {
        grid-template-columns: 1fr;
    }

    .pb-counter-row {
        flex-direction: column;
        gap: 8px;
    }

    .pb-actions {
        flex-direction: column;
    }

    .pb-btn {
        text-align: center;
    }

    .pb-printer-meta {
        flex-direction: column;
        gap: 5px;
    }
}

/* ==================== Koszty ==================== */
.pb-cost-total {
    margin: 6px 0 0;
}

.pb-cost-total-note {
    font-size: 0.85em;
    color: #666;
}

.pb-cost-box {
    margin: 14px 0 6px;
    padding: 10px 14px;
    background: #f4f8fb;
    border: 1px solid #d6e4ef;
    border-radius: 6px;
}

.pb-cost-main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}

.pb-cost-value {
    font-size: 1.25em;
}

.pb-cost-details,
.pb-cost-note {
    margin-top: 4px;
    font-size: 0.85em;
    color: #555;
}

.pb-cost-invalid .pb-cost-value {
    color: #b32d2e;
}
