:root {
    --primary-color: #0091ff;
    --bg-color: #f4f6f8;
    --white: #ffffff;
    --text-dark: #1a1a1a;
    --text-gray: #666666;
    --success: #00b14f;
    --error: #ff3b30;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

html {
    scroll-behavior: smooth; /* Hiệu ứng cuộn mượt */
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

body { background-color: var(--bg-color); color: var(--text-dark); -webkit-font-smoothing: antialiased; padding-bottom: 40px; position: relative; }

/* HEADER */
.header { 
    background: var(--primary-color);
    padding: 8px 15px;
    text-align: center; 
    box-shadow: 0 2px 10px rgba(0, 145, 255, 0.2); 
    position: sticky; 
    top: 0; 
    z-index: 100; 
}
.logo { height: 35px; object-fit: contain; }

/* CONTAINER */
.container { max-width: 600px; margin: 20px auto; padding: 0 15px; min-height: 80vh; }

/* CARDS */
.card { background: var(--white); border-radius: var(--radius); padding: 20px; margin-bottom: 15px; box-shadow: var(--shadow); }
.card-title { 
    font-size: 16px; 
    font-weight: 700; 
    margin-bottom: 15px; 
    color: var(--text-dark); 
    border-bottom: 1px solid #eee; 
    padding-bottom: 10px; 
    display: flex;
    align-items: center;
}
.section-icon { width: 20px; height: 20px; margin-right: 8px; object-fit: contain; }

/* INFO ROW */
.info-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 14px; }
.info-label { color: var(--text-gray); }
.info-val { font-weight: 500; text-align: right; }
.info-val.highlight { color: var(--primary-color); font-weight: 700; font-size: 16px; }
.divider { height: 1px; background: #eee; margin: 10px 0; }

/* CUSTOMER GRID */
.customer-grid { display: flex; flex-direction: column; gap: 10px; }
.cust-item { display: flex; flex-direction: column; }
.cust-label { font-size: 12px; color: var(--text-gray); margin-bottom: 2px; }
.cust-val { font-size: 14px; font-weight: 600; color: var(--text-dark); }

/* PRODUCT LIST */
.product-item { display: flex; align-items: flex-start; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f5f5f5; }
.product-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.product-img { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; background: #fff; margin-right: 12px; border: 1px solid #eee; }
.product-details { flex: 1; }
.product-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.product-code { font-size: 12px; color: var(--text-gray); margin-bottom: 4px; display: block; }
.product-meta { font-size: 13px; display: flex; justify-content: space-between; }
.product-price { font-weight: 500; }
.product-total { font-weight: 700; color: var(--primary-color); }

/* TIMELINE */
.timeline { position: relative; padding-left: 25px; border-left: 2px solid #e0e0e0; margin-left: 8px; padding-top: 5px; }
.timeline-item { position: relative; margin-bottom: 25px; }
.timeline-dot { position: absolute; left: -32px; top: 0; width: 14px; height: 14px; border-radius: 50%; background: #e0e0e0; border: 3px solid var(--white); box-shadow: 0 0 0 1px #e0e0e0; }
.timeline-item.active .timeline-dot { 
    background: var(--primary-color); 
    box-shadow: 0 0 0 3px rgba(0, 145, 255, 0.3);
    animation: pulse 2s infinite; 
}
.timeline-item.active .timeline-status { color: var(--primary-color); }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 145, 255, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(0, 145, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 145, 255, 0); }
}
.timeline-time { font-size: 12px; color: var(--text-gray); margin-bottom: 4px; font-weight: 500; }
.timeline-status { font-weight: 700; font-size: 14px; margin-bottom: 4px; color: #333; }
.timeline-location { font-size: 13px; color: #555; line-height: 1.4; background: #f9f9f9; padding: 8px; border-radius: 6px; }

/* LOADING & ERROR */
.loading-state, .error-state { text-align: center; padding: 50px 0; }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.3); border-top: 4px solid var(--primary-color); border-radius: 50%; margin: 0 auto 15px; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.error-icon svg { width: 60px; height: 60px; fill: var(--error); margin-bottom: 10px; }
.btn-hotline { display: inline-flex; align-items: center; background: var(--primary-color); color: #fff; padding: 10px 20px; border-radius: 25px; text-decoration: none; font-weight: bold; margin-top: 15px; }
.hidden { display: none !important; }
.footer { text-align: center; font-size: 12px; color: #999; margin-top: 20px; }

/* BACK TO TOP BUTTON */
.back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: var(--primary-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 145, 255, 0.4);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    border: none;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top svg { width: 24px; height: 24px; fill: currentColor; }
.back-to-top:active { transform: scale(0.9); }