* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0b0b0b  0%, #000000 100%);
    min-height: 100vh;
    padding: 20px;
}

.status-offline {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    z-index: 1001;
    animation: pulse 2s infinite;
    font-size: 0.9em;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.container {
    max-width: 900px;
    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(45deg, #FFD700, #FFA500, #FFEB3B) !important; /* Kuning cerah */
    color: #000000 !important; /* Hitam pekat */
    text-align: center;
    padding: 30px;
}

header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    color: #000000 !important; /* Hitam pekat */
}

.main-content .tab-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.tab-btn {
    flex: 1;
    padding: 20px;
    border: none;
    background: none;
    font-size: 1.1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover { background: #e9ecef; }
.tab-btn.active {
    background: white;
    color: #f39c12;
    border-bottom: 3px solid #f39c12;
}

.tab-content { display: none; padding: 40px; }
.tab-content.active { display: block; }

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1.1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.total-display {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    min-height: 50px;
}

.total-display.large {
    color: #e74c3c;
    font-size: 1.2em;
    background: linear-gradient(90deg, #fff3cd, #ffeaa7);
    border-color: #f39c12;
}

.btn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 12px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-buy {
    background: linear-gradient(45deg, #1a1a1a, #2d2d2d, #000000) !important;
    color: #FFD700 !important; /* Teks emas */
    border: 2px solid #FFD700 !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4) !important;
}

.btn-buy:hover {
    background: linear-gradient(45deg, #2d2d2d, #404040, #1a1a1a) !important;
    color: #FFD700 !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6) !important;
    border-color: #FFA500 !important;
}

.btn-sell {
    background: linear-gradient(45deg, #1a1a1a, #2d2d2d, #000000) !important;
    color: #FFD700 !important; /* Teks emas */
    border: 2px solid #FFD700 !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4) !important;
}

.btn-sell:hover {
    background: linear-gradient(45deg, #2d2d2d, #404040, #1a1a1a) !important;
    color: #FFD700 !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6) !important;
    border-color: #FFA500 !important;
}

.riwayat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    flex: 1;
}

.search-container {
    display: flex;
    gap: 8px;
    align-items: center;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 25px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

.search-container.search-active {
    border-color: #f39c12;
    background: linear-gradient(90deg, #fff3cd, #ffeaa7);
}

.search-date {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95em;
    background: white;
    cursor: pointer;
}

.search-date:focus {
    outline: none;
    border-color: #f39c12;
}

.btn-search, .btn-clear-search {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-search {
    background: linear-gradient(45deg, #17a2b8, #138496);
    color: white;
}

.btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-clear-search {
    background: linear-gradient(45deg, #6c757d, #5a6268);
    color: white;
}

.btn-clear-search:hover {
    background: linear-gradient(45deg, #dc3545, #c82333);
    transform: translateY(-1px);
}

.header-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-print, .btn-clear {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    width: auto;
}

.btn-clear {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-print:hover, .btn-clear:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.riwayat-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 30px;
}

.riwayat-item {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    border-left: 5px solid #f39c12;
}

.riwayat-item.jual { border-left-color: #e74c3c; }
.riwayat-item.beli { border-left-color: #27ae60; }

.riwayat-item h4 {
    color: #333;
    margin-bottom: 8px;
}

.riwayat-item p {
    color: #666;
    margin-bottom: 5px;
}

.empty-state {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px;
}

.summary {
    background: linear-gradient(45deg, #D4AF37, #F4D03F, #FAD02C) !important;
    color: #1a1a1a !important;
    padding: 25px;
    border-radius: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    text-align: center;
}

.summary-item span {
    display: block;
    opacity: 0.9;
    margin-bottom: 5px;
}

.action-buttons {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    justify-content: flex-end;
}

.btn-edit, .btn-delete, .btn-print-small {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    flex: 1;
    min-width: 50px;
}

.btn-edit { background: linear-gradient(45deg, #3498db, #2980b9); color: white; }
.btn-delete { background: linear-gradient(45deg, #e74c3c, #c0392b); color: white; }
.btn-print-small { background: linear-gradient(45deg, #17a2b8, #138496); color: white; }

.btn-edit:hover, .btn-delete:hover, .btn-print-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-save {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(45deg, #D4AF37, #F4D03F, #FAD02C) !important;
    color: #1a1a1a !important;
    padding: 25px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { margin: 0; font-size: 1.4em; }

.close {
    font-size: 2em;
    cursor: pointer;
    color: white;
    opacity: 0.8;
}

.close:hover { opacity: 1; }

.modal-body { padding: 30px; }

.modal-body select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1em;
}

/* LOGIN ENHANCEMENT */
#modalLogin .modal-content {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

#modalLogin .input-rupiah {
    font-family: inherit !important;
    letter-spacing: normal;
}

/* Input Rupiah */
.input-rupiah {
    font-family: 'Courier New', monospace !important;
    font-size: 16px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    text-align: right;
    letter-spacing: 1px;
    font-weight: 500;
}

.input-rupiah:focus {
    border-color: #f39c12 !important;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
    background: white !important;
    outline: none;
}

.input-rupiah::placeholder {
    color: #999;
    font-style: italic;
}

.empty-state.search-empty {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52) !important;
    color: white !important;
    border-radius: 15px !important;
    padding: 40px !important;
    font-size: 1.2em !important;
    font-weight: 600 !important;
    text-align: center !important;
    margin: 20px 0 !important;
    box-shadow: 0 10px 30px rgba(238, 90, 82, 0.4) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row, .summary { grid-template-columns: 1fr; }
    .header-controls { 
        align-items: stretch; 
        width: 100%; 
    }
    .search-container {
        justify-content: center;
        flex-wrap: wrap;
    }
    .header-buttons {
        justify-content: center;
        width: 100%;
    }
    .btn-print, .btn-clear { width: 100%; }
    body { padding: 10px; }
    
    .riwayat-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* 🔥 THERMAL PRINT BOOST */
@media print {

    *{
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;

        text-rendering: geometricPrecision !important;
        image-rendering: pixelated !important;

        -webkit-font-smoothing: none !important;
    }

    body{
        filter: contrast(120%) brightness(95%) !important;
    }

    .harga-jual,
    .harga-beli,
    .total-value{

        font-weight: 900 !important;

        text-shadow:
            0.3px 0 black,
            -0.3px 0 black,
            0 0.3px black,
            0 -0.3px black;

        letter-spacing: 0.4px !important;

        transform: scaleY(1.08) !important;

        filter: contrast(250%) !important;
    }

    .harga-jual{
        color: rgb(140,0,0) !important;
    }

    .harga-beli{
        color: rgb(0,40,140) !important;
    }
}