* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 5px;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
    text-align: center;
    padding: clamp(15px, 6vw, 20px);
    position: relative;
}

.header h1 {
    font-size: clamp(1.4rem, 6vw, 2.2rem);
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    line-height: 1.2;
}

.header marquee {
    font-size: clamp(0.75rem, 4vw, 1rem);
    font-weight: bold;
    background: rgba(255,255,255,0.2);
    padding: 4px 8px;
    border-radius: 20px;
    display: inline-block;
    max-width: 90vw;
    overflow: hidden;
}

/* DESKTOP & TABLET */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    min-height: 70vh;
}

/* MOBILE FIRST - SEMUA HP */
@media (max-width: 900px) {
    body {
        padding: 3px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }
    
    .input-section,
    .cart-section {
        padding: 18px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 2px;
    }
    
    .container {
        border-radius: 15px;
        margin: 0;
    }
    
    .main-content {
        padding: 10px;
        gap: 10px;
    }
    
    .input-section,
    .cart-section {
        padding: 16px;
        border-radius: 12px;
    }
}

@media (max-width: 600px) {
    .header {
        padding: clamp(12px, 8vw, 18px);
    }
    
    .main-content {
        padding: 8px;
        gap: 8px;
    }
    
    .input-section,
    .cart-section {
        padding: 14px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1px;
    }
    
    .main-content {
        padding: 6px;
        gap: 6px;
    }
    
    .input-section,
    .cart-section {
        padding: 12px;
        border-radius: 10px;
    }
}

@media (max-width: 400px) {
    .main-content {
        padding: 4px;
        gap: 5px;
    }
    
    .input-section,
    .cart-section {
        padding: 10px;
    }
}

@media (max-width: 360px) {
    body {
        padding: 0;
    }
    
    .container {
        border-radius: 12px;
    }
    
    .main-content {
        padding: 3px;
        gap: 4px;
    }
    
    .input-section,
    .cart-section {
        padding: 8px;
        border-radius: 8px;
    }
}

.section-title {
    color: #333;
    margin-bottom: 15px;
    font-size: clamp(1rem, 5vw, 1.4rem);
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    border-radius: 2px;
}

/* INPUT SECTION - MOBILE OPTIMIZED */
.input-section {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: clamp(12px, 5vw, 20px);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.kasir-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    flex-direction: column;
}

@media (min-width: 480px) {
    .kasir-info {
        flex-direction: row;
    }
}

.kasir-name {
    background: rgba(255,255,255,0.8);
    padding: clamp(5px, 2vw, 8px) clamp(8px, 2.5vw, 12px);
    border-radius: 20px;
    font-weight: bold;
    color: #333;
    font-size: clamp(0.8rem, 3vw, 0.95rem);
    min-width: 60px;
    text-align: center;
    white-space: nowrap;
}

#customKasir {
    flex: 1;
    padding: clamp(10px, 3vw, 12px) clamp(10px, 3vw, 14px);
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 20px;
    font-size: clamp(0.85rem, 3vw, 0.95rem);
    background: rgba(255,255,255,0.9);
    transition: all 0.3s ease;
    min-width: 100px;
    width: 100%;
}

#customKasir:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 12px rgba(255,107,107,0.3);
    transform: scale(1.01);
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: clamp(0.85rem, 3vw, 0.95rem);
}

#productSelect, #quantity {
    width: 100%;
    padding: clamp(10px, 3vw, 12px) clamp(10px, 3vw, 14px);
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 10px;
    font-size: clamp(0.85rem, 3vw, 0.95rem);
    background: rgba(255,255,255,0.9);
    transition: all 0.3s ease;
}

#productSelect:focus, #quantity:focus {
    outline: none;
    border-color: #ff6b6b;
    box-shadow: 0 0 12px rgba(255,107,107,0.3);
}

.button-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* CART SECTION - MOBILE PERFECT */
.cart-section {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: clamp(12px, 5vw, 20px);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.cart-table-container {
    overflow-x: auto;
    margin-bottom: 12px;
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 450px;
}

.cart-table th,
.cart-table td {
    padding: clamp(5px, 2.5vw, 10px) clamp(3px, 1.5vw, 6px);
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: clamp(0.7rem, 2.8vw, 0.85rem);
    white-space: nowrap;
}

.cart-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* MOBILE TABLE OPTIMIZATION */
@media (max-width: 768px) {
    .cart-table {
        min-width: 400px;
    }
}

@media (max-width: 480px) {
    .cart-table {
        min-width: 350px;
    }
    
    .cart-table th,
    .cart-table td {
        padding: clamp(4px, 2.2vw, 8px) clamp(2px, 1.2vw, 4px);
        font-size: clamp(0.65rem, 3vw, 0.8rem);
    }
}

@media (max-width: 360px) {
    .cart-table {
        min-width: 320px;
    }
}

.total-section {
    background: white;
    padding: clamp(12px, 4vw, 18px);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-top: 8px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: clamp(6px, 2vw, 10px) 0;
    font-size: clamp(0.85rem, 3vw, 0.95rem);
}

.total-row.total {
    font-size: clamp(1rem, 4vw, 1.2rem);
    font-weight: bold;
    color: #333;
    border-top: 2px solid #ff6b6b;
    padding-top: clamp(12px, 3vw, 18px);
    margin-top: 8px;
}

#payment {
    width: 100%;
    padding: clamp(10px, 3vw, 14px);
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: clamp(1rem, 4vw, 1.15rem);
    font-weight: bold;
    text-align: right;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

/* BUTTONS - PERFECT MOBILE */
.btn {
    padding: clamp(14px, 5vw, 16px) clamp(16px, 5vw, 20px);
    border: none;
    border-radius: 10px;
    font-size: clamp(0.9rem, 3.5vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex: 1;
    min-height: clamp(48px, 14vw, 56px);
    touch-action: manipulation;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #e17055, #d63031);
    color: white;
}

.btn-full-width {
    width: 100%;
    flex: none;
}

.btn-small {
    padding: clamp(8px, 2.5vw, 10px) clamp(10px, 3vw, 12px);
    font-size: clamp(0.75rem, 3vw, 0.8rem);
    min-height: 36px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 2vw, 10px);
    margin-top: 12px;
}

/* MOBILE BUTTONS */
@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn {
        min-height: clamp(52px, 16vw, 60px);
        padding: clamp(16px, 6vw, 20px);
        font-size: clamp(1rem, 4vw, 1.1rem);
    }
}

@media (max-width: 480px) {
    .button-group {
        gap: 6px;
    }
    
    .btn {
        min-height: clamp(50px, 15vw, 58px);
    }
}

/* TOUCH DEVICE OPTIMIZATION */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 56px;
        padding: clamp(18px, 7vw, 22px);
    }
    
    .button-group {
        gap: 10px;
    }
    
    #productSelect, #quantity, #customKasir {
        padding: clamp(14px, 4vw, 16px);
        min-height: 50px;
    }
}

/* PREVENT ZOOM ON INPUT FOCUS */
input[type="number"], input[type="text"], select {
    font-size: 16px;
}