:root {
    --primary-color: #4a6bff;
    --primary-light: #e8f0fe;
    --secondary-color: #3a56d4;
    --accent-color: #5c8aff;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --success-color: #10b981;
    --success-light: #d1fae5;
    --danger-color: #ef4444;
    --danger-light: #fee2e2;
    --warning-color: #f59e0b;
    --warning-light: #fef3c7;
    --info-color: #3b82f6;
    --info-light: #dbeafe;
    --gray-color: #64748b;
    --gray-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --rounded-sm: 0.25rem;
    --rounded: 0.5rem;
    --rounded-lg: 0.75rem;
    --rounded-xl: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 15px 20px;
    border-radius: var(--rounded-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.header-subtitle {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 3px;
}

.header-info {
    text-align: right;
}

.header-info p {
    margin: 2px 0;
    font-size: 0.9rem;
}

.main-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    transition: all 0.3s ease;
}

.left-panel {
    flex: 1;
    min-width: 300px;
    background: white;
    border-radius: var(--rounded-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.right-panel {
    flex: 2;
    min-width: 400px;
    background: white;
    border-radius: var(--rounded-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.panel-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--dark-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 5px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 15px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--rounded-sm);
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 107, 255, 0.2);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--rounded-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    text-align: center;
    font-weight: 500;
}

.btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.btn-block {
    display: block;
    width: 100%;
}

.btn-success {
    background-color: var(--success-color);
}

.btn-success:hover {
    background-color: #0d9b6c;
}

.btn-danger {
    background-color: var(--danger-color);
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-warning {
    background-color: var(--warning-color);
}

.btn-warning:hover {
    background-color: #e69007;
}

.btn-info {
    background-color: var(--info-color);
}

.btn-info:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: var(--gray-color);
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-light);
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--rounded-sm);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background-color: #f1f3f5;
    font-weight: 500;
    color: #555;
    position: sticky;
    top: 0;
}

.table tr:hover {
    background-color: #f8f9fa;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-success {
    background-color: var(--success-light);
    color: #065f46;
}

.badge-danger {
    background-color: var(--danger-light);
    color: #b91c1c;
}

.badge-warning {
    background-color: var(--warning-light);
    color: #92400e;
}

.badge-info {
    background-color: var(--info-light);
    color: #1e40af;
}

.badge-primary {
    background-color: #eef2ff;
    color: var(--primary-color);
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    padding-left: 40px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
}

.cart-item:hover {
    background-color: #f9f9f9;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.cart-item-price {
    color: #666;
    font-size: 0.9rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
}

.cart-item-qty button {
    width: 25px;
    height: 25px;
    border: 1px solid #ddd;
    background-color: #f8f9fa;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
}

.cart-item-qty button:hover {
    background-color: #e9ecef;
}

.cart-item-qty input {
    width: 40px;
    text-align: center;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 3px;
}

.cart-summary {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px dashed #ddd;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.summary-label {
    font-weight: 500;
}

.summary-value {
    font-weight: 500;
}

.total-row {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.payment-methods {
    margin-top: 20px;
}

.payment-method {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 5px;
    transition: all 0.2s;
}

.payment-method:hover {
    background-color: #f8f9fa;
}

.payment-method input {
    margin-right: 10px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    border-radius: var(--rounded-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    transition: all 0.2s;
}

.modal-close:hover {
    color: #333;
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.setup-container {
    max-width: 500px;
    margin: 50px auto;
    background: white;
    border-radius: var(--rounded-xl);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease;
    position: relative;
    overflow: hidden;
}

.setup-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.setup-title {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
}

.receipt {
    background-color: white;
    padding: 20px;
    font-family: 'Courier New', monospace;
    max-width: 300px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
    position: relative;
    line-height: 1.4;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.receipt::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('https://raw.githubusercontent.com/LenteraKarya/transaksi/main/watermak-struk.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60%;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

.receipt > * {
    position: relative;
    z-index: 1;
}

.receipt-header {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 1px dashed #000;
    padding-bottom: 10px;
}

.receipt-title {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.receipt-address {
    font-size: 0.8rem;
    margin-bottom: 5px;
}

.receipt-date {
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.receipt-items {
    margin-bottom: 15px;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.receipt-item-name {
    flex: 2;
}

.receipt-item-price {
    flex: 1;
    text-align: right;
}

.receipt-total {
    border-top: 1px dashed #000;
    padding-top: 10px;
    margin-top: 10px;
    font-weight: bold;
}

.receipt-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 0.8rem;
    border-top: 1px dashed #000;
    padding-top: 10px;
}

.receipt-brand {
    font-size: 0.7rem;
    margin-top: 5px;
    color: #555;
}

.receipt-order-info {
    font-size: 0.7rem;
    margin-top: 5px;
    color: #555;
}

.float-right {
    float: right;
}

.ml-2 {
    margin-left: 10px;
}

.mt-2 {
    margin-top: 10px;
}

.mt-3 {
    margin-top: 15px;
}

.mt-4 {
    margin-top: 20px;
}

.mb-3 {
    margin-bottom: 15px;
}

/* Error message styling */
.error-message {
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background-color: #333;
    color: white;
    border-radius: var(--rounded-sm);
    box-shadow: var(--shadow-md);
    z-index: 1100;
    display: flex;
    align-items: center;
    transform: translateX(200%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background-color: var(--success-color);
}

.toast.error {
    background-color: var(--danger-color);
}

.toast.warning {
    background-color: var(--warning-color);
}

.toast.info {
    background-color: var(--info-color);
}

.toast i {
    margin-right: 10px;
}

/* Confirmation dialog */
.confirmation-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.confirmation-content {
    background-color: white;
    padding: 20px;
    border-radius: var(--rounded-lg);
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.confirmation-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

/* Additional fee section */
.additional-fee-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.additional-fee-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.additional-fee-option {
    flex: 1;
    text-align: center;
}

.additional-fee-option input[type="radio"] {
    display: none;
}

.additional-fee-option label {
    display: block;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: var(--rounded-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.additional-fee-option input[type="radio"]:checked + label {
    background-color: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 500;
}

.additional-fee-details {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: var(--rounded-sm);
}

.additional-fee-description {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

/* Print styles */
@media print {
    body * {
        visibility: hidden;
    }
    #receiptPrint, #receiptPrint * {
        visibility: visible;
    }
    #receiptPrint {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        padding: 0;
        margin: 0;
        font-size: 12px;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .no-print {
        display: none !important;
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    .left-panel, .right-panel {
        min-width: 100%;
    }
    .header {
        flex-direction: column;
        text-align: center;
    }
    .header-info {
        text-align: center;
        margin-top: 10px;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .setup-container {
        padding: 20px;
        margin: 20px auto;
    }
    
    /* Fix for receipt text visibility on mobile */
    .receipt {
        font-size: 14px;
        max-width: 100%;
        padding: 15px;
    }
    
    .receipt-item {
        font-size: 12px;
    }
    
    .receipt-title {
        font-size: 16px;
    }
    
    .additional-fee-options {
        flex-direction: column;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 30px;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 15px;
}

/* Radio button group */
.radio-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.radio-option {
    flex: 1;
}

.radio-option input {
    margin-right: 8px;
}

/* Select role */
.select-role {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.select-role select {
    flex: 1;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1300;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

/* Print button */
.print-button {
    margin-top: 20px;
    text-align: center;
}

/* Settings button */
.settings-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 100;
    transition: all 0.3s;
}

.settings-button:hover {
    background-color: var(--secondary-color);
    transform: rotate(90deg) scale(1.1);
}

/* Settings modal */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.settings-content {
    background-color: white;
    border-radius: var(--rounded-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalFadeIn 0.3s;
}

.settings-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 10px;
}

/* Discount input */
.discount-input {
    display: flex;
    gap: 10px;
}

.discount-input input {
    flex: 1;
}

.discount-input select {
    width: 80px;
}

/* Backup/Restore section */
.backup-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

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

.backup-actions .btn {
    flex: 1;
}

/* File input for restore */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Enhanced receipt styling */
.receipt-enhanced {
    font-size: 14px;
}

.receipt-enhanced .receipt-item {
    font-size: 13px;
}

.receipt-enhanced .receipt-title {
    font-size: 18px;
}
