html {
font-size: calc(100vw/60);
}
button {
touch-action: manipulation;
}

:root {
--primary-color: #2563eb;
--primary-light: #dbeafe;
--secondary-color: #1e40af;
--accent-color: #60a5fa;
--success-color: #10b981;
--success-light: #d1fae5;
--warning-color: #f59e0b;
--home-delivery-color: #f97316;
--danger-color: #ef4444;
--highlight-color: #fef3c7;
--text-dark: #111827;
--text-medium: #4b5563;
--text-light: #6b7280;
--border-radius: 2rem; /* Converted from 12px */
--box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); /* lebih ringan */
--box-shadow-modern: 0 6px 16px -4px rgba(0, 0, 0, 0.07);
--transition: all 0.3s ease-in-out;
}

* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}

body {
background-color: #f9fafb;
color: var(--text-dark);
line-height: 1.5;
font-size: 2.5rem; /* Converted from 40px */
}

.container {
max-width: 100rem; /* Converted from 1600px */
margin: 0 auto;
padding: 0;
}

header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 2rem 3rem; /* Converted from 32px, 48px */
margin-bottom: 3rem; /* Converted from 48px */
background: linear-gradient(135deg, #1e3a8a, #3b82f6);
color: #ffffff;
z-index: 100;
box-shadow: var(--box-shadow);
position: sticky;
top: 0;
gap: 2rem;
flex-wrap: wrap;
}

.logo {
display: flex;
align-items: center;
gap: 1.5rem;
}

.logo i {
font-size: 7rem;
color: #ffffff;
line-height: 1;
vertical-align: middle;
}

.logo h1 {
font-size: 3.25rem;
font-weight: 700;
color: #ffffff;
}

.header-actions {
display: flex;
gap: 1.5rem; /* Converted from 24px */
}

.btn {
padding: 1rem 2rem; /* Converted from 16px, 32px */
border-radius: 2rem; /* Converted from 12px */
border: none;
cursor: pointer;
font-weight: 500;
transition: transform 0.1s ease, opacity 0.1s ease;
display: inline-flex;
align-items: center;
gap: 1rem; /* Converted from 16px */
font-size: 2.5rem; /* Converted from 36px */
}

.btn i {
font-size: 2.5rem; /* Converted from 36px */
line-height: 1;
vertical-align: middle;
}

.btn:active, .btn.pressed {
transform: scale(0.95);
opacity: 0.8;
}

.btn-primary {
background-color: var(--primary-color);
color: #ffffff;
}

.btn-success {
background-color: var(--success-color);
color: #ffffff;
}

/* Add this at the end of the <style> section */
.order-item .btn {
font-size: 2.5rem; /* Adjust to desired size, e.g., 40px */
}

.order-item .btn i {
font-size: 2.5rem; /* Optional: adjust icon size */
}

.btn-outline {
background: transparent;
border: 0.3125rem solid #ffffff; /* Converted from 5px */
color: #ffffff;
}

.card {
background-color: white;
border-radius: var(--border-radius);
box-shadow: var(--box-shadow);
padding: 3rem; /* Converted from 48px */
margin-bottom: 3rem; /* Converted from 48px */
animation: fadeIn 0.3s forwards;
}

.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2.5rem; /* Converted from 40px */
flex-wrap: wrap;
gap: 2rem; /* Converted from 32px */
}

.card-title {
font-size: 3rem; /* Converted from 44px */
font-weight: 600;
color: var(--primary-color);
display: flex;
align-items: center;
gap: 1.25rem; /* Converted from 20px */
}

.card-title i {
font-size: 3rem; /* Converted from 44px */
line-height: 1;
vertical-align: middle;
}

.filter-bar {
    display: flex;
    gap: 1.5rem; /* Converted from 24px */
    flex-wrap: wrap;
    position: relative;
}

.filter-select {
    padding: 1rem 3.25rem 1rem 1rem; /* Converted from 14px, 24px */
    border: 0.125rem solid #e5e7eb; /* Converted from 2px */
    border-radius: 0.75rem; /* Converted from 12px */
    font-size: 2.5rem; /* Converted from 34px */
    width: fit-content; /* Lebar menyesuaikan isi */
    appearance: none;
    background-color: white;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem var(--primary-light); /* Converted from 4px */
}

.filter-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.filter-wrapper i {
    position: absolute;
    right: 1rem; /* Converted from 16px */
    font-size: 2.25rem; /* Converted from 36px */
    color: var(--text-medium);
    pointer-events: none;
}

.order-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(31.25rem, 1fr));
gap: 2rem;

/* Tambahkan ini */
contain: content;           /* ← penting untuk performa */
content-visibility: auto;   /* Chrome-friendly */
}

.order-item {
background: white;
border-radius: var(--border-radius);
box-shadow: var(--box-shadow);           /* ← ringankan */
overflow: hidden;
border: 1px solid #e5e7eb;
height: fit-content;

/* Layer promotion untuk scroll smoothness */
transform: translateZ(0);
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
}

.order-item.ready-to-ship {
border-left: 0.5rem solid var(--success-color); /* Converted from 8px */
}

/* === HIGHLIGHT HEADER UNTUK KIRIM KE RUMAH (METODE = 1) === */
.order-item-home-delivery .order-header {
background: #fef9c3 !important;
border-bottom: 1px solid #f59e0b;
}

.order-item-home-delivery .order-id {
color: #b45309;                     /* Warna teks ID agar tetap kontras */
font-weight: 700;
}

/* Efek hover agar lebih jelas */
.order-item-home-delivery .order-header:hover {
background: #fef3c7 !important;     /* Kuning sedikit lebih terang saat hover */
}

.order-header {
background: var(--primary-light);
padding: 1.75rem 2.5rem; /* Converted from 28px, 40px */
border-bottom: 0.125rem solid #e5e7eb; /* Converted from 2px */
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
}

.order-id {
font-size: 3.75rem; /* Converted from 60px */
font-weight: 600;
color: var(--primary-color);
}

.order-body {
max-height: 0;
overflow: hidden;
transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1); /* lebih halus */
}

.order-body.open {
/* max-height set dynamically via JavaScript */
}

.barang-list {
list-style: none;
margin-bottom: 2rem; /* Converted from 32px */
padding: 2.5rem; /* Converted from 40px */
}

.barang-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 0; /* Converted from 16px */
border-bottom: 0.25rem dashed #111827; /* Converted from 2px */
}

.barang-item:last-child {
border-bottom: none;
}

.barang-name {
font-weight: 500;
color: var(--text-dark);
font-size: 2.75rem; /* Converted from 36px */
}

.barang-qty {
color: var(--primary-color);
font-size: 2.75rem; /* Converted from 34px */
background-color: var(--primary-light);
margin: 0.625rem; /* Converted from 10px */
padding: 0.375rem 1rem; /* Converted from 6px, 16px */
border-radius: 1rem; /* Converted from 16px */
font-weight: 500;
white-space: nowrap;
}

.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(15.625rem, 1fr)); /* Converted from 250px */
gap: 2rem; /* Converted from 32px */
margin: 2.5rem; /* Converted from 40px */
margin-bottom: 3rem; /* Converted from 48px */
}

.stat-card {
background: linear-gradient(145deg, white, #f8fafc);
border-radius: 0.5rem;
box-shadow: var(--box-shadow);
padding: 1.75rem; /* Converted from 28px */
position: relative;
overflow: hidden;
border: 0.0625rem solid #e5e7eb; /* Converted from 1px */
}

.stat-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 0.375rem; /* Converted from 6px */
height: 100%;
background: var(--primary-color);
}

.stat-content {
display: flex;
flex-direction: column;
gap: 1rem; /* Converted from 16px */
}

.stat-header {
position: relative;
padding-bottom: 0.5rem; /* Converted from 8px */
}

.stat-title {
font-size: 2.75rem; /* Converted from 40px */
color: var(--text-medium);
font-weight: 500;
}

.stat-header::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 0.125rem; /* Converted from 2px */
background-color: #e5e7eb;
}

.stat-body {
display: flex;
align-items: center;
gap: 1rem; /* Converted from 16px */
padding-top: 0.5rem; /* Converted from 8px */
}

.stat-card i {
font-size: 5rem; /* Converted from 80px */
color: var(--primary-color);
line-height: 1;
vertical-align: middle;
}

.stat-value {
font-size: 5rem; /* Converted from 80px */
font-weight: 700;
color: var(--primary-color);
}

.popup-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.4);
display: none;
z-index: 1000;
opacity: 0;
transition: opacity 0.2s ease-out;
}

.popup-overlay.open {
opacity: 1;
}

.popup {
position: fixed;
top: 0;
right: 0;
transform: translateX(100%);
width: 50rem; /* Converted from 800px */
max-width: 90vw;
height: 100%;
background: #ffffff;
box-shadow: -0.5rem 0 1rem rgba(0, 0, 0, 0.1); /* Converted from -8px, 16px */
z-index: 1001;
transition: transform 0.3s ease-out;
overflow-y: auto;
padding: 3rem; /* Converted from 48px */
border-radius: 1rem 0 0 1rem; /* Converted from 16px */
will-change: transform;
}

.popup.open {
transform: translateX(0);
}

.popup-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2.5rem; /* Converted from 40px */
padding-bottom: 1.5rem; /* Converted from 24px */
border-bottom: 0.125rem solid #e5e7eb; /* Converted from 2px */
background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
color: #ffffff;
border-radius: var(--border-radius);
padding: 1.5rem 2rem; /* Converted from 24px, 32px */
}

.popup-title {
font-size: 3rem; /* Converted from 44px */
font-weight: 600;
color: #ffffff;
display: flex;
align-items: center;
gap: 1.25rem; /* Converted from 20px */
}

.popup-title i {
font-size: 3rem; /* Converted from 44px */
line-height: 1;
vertical-align: middle;
}

.close-popup {
background: none;
border: none;
cursor: pointer;
font-size: 3rem; /* Converted from 40px */
color: #ffffff;
transition: transform 0.1s ease, opacity 0.1s ease;
line-height: 1;
vertical-align: middle;
}

.close-popup i {
font-size: 2rem;
padding: 0.5rem;
border: 0.2rem solid white;
border-radius: 50%;
}

.close-popup:active, .close-popup.pressed {
transform: scale(0.95);
opacity: 0.8;
}

.summary-list {
display: grid;
grid-template-columns: 1fr;
gap: 1.25rem; /* Converted from 20px */
}

.summary-item {
background: white;
border-radius: 0.75rem; /* Converted from 12px */
box-shadow: var(--box-shadow-modern);
padding: 1.25rem; /* Converted from 20px */
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem; /* Converted from 16px */
border: 0.0625rem solid #e5e7eb; /* Converted from 1px */
cursor: pointer;
animation: fadeInItem 0.3s ease-in-out;
min-height: 5rem; /* Converted from 80px */
}

.summary-item {
    transition: all 0.08s ease-out;   /* Transisi normal sangat cepat */
}

.summary-item.tapped {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border: 0.2rem solid #1e40af;
    transform: scale(1.04);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.4);
    transition: all 0.05s ease-out;   /* Sangat cepat saat ditekan */
}

/* PASTIKAN TEKS MENJADI PUTIH */
.summary-item.tapped .summary-item-name,
.summary-item.tapped .summary-item-qty {
    color: #ffffff !important;
    transition: color 0.05s ease-out;
}

/* Qty lebih menonjol */
.summary-item.tapped .summary-item-qty {
    background-color: rgba(255,255,255,0.25) !important;
    border-color: rgba(255,255,255,0.7) !important;
}

.summary-item-name {
font-weight: 500;
color: var(--text-dark);
font-size: 2.5rem; /* Converted from 35px */
flex-grow: 1;
}

.summary-item-qty {
font-size: 2.5rem; /* Converted from 35px */
color: var(--primary-color);
background-color: var(--primary-light);
padding: 0.375rem 1rem; /* Converted from 6px, 16px */
margin: 0.625rem; /* Converted from 10px */
border: 0.1875rem solid #2563eb; /* Converted from 3px */
border-radius: 1rem; /* Converted from 16px */
font-weight: 500;
text-align: right;
white-space: nowrap;
}

.category-header {
font-size: 3rem; /* Converted from 45px */
font-weight: 600;
background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
-webkit-background-clip: text;
background-clip: text;
color: transparent;
padding: 1rem 0; /* Converted from 16px */
margin-bottom: 1.5rem; /* Converted from 24px */
border-bottom: 0.125rem solid var(--primary-color); /* Converted from 2px */
text-align: center;
}

.empty-state {
text-align: center;
padding: 5rem 2.5rem; /* Converted from 80px, 40px */
color: var(--text-light);
background-color: white;
border-radius: var(--border-radius);
box-shadow: var(--box-shadow);
}

.empty-state i {
font-size: 5rem; /* Converted from 80px */
color: #e5e7eb;
margin-bottom: 1.5rem; /* Converted from 24px */
line-height: 1;
vertical-align: middle;
}

.empty-state p {
margin-bottom: 2rem; /* Converted from 32px */
font-size: 2.25rem; /* Converted from 36px */
}

.error-message {
color: var(--danger-color);
text-align: center;
padding: 1.5rem; /* Converted from 24px */
background-color: #fee2e2;
border-radius: var(--border-radius);
margin: 0 auto 3rem; /* Converted from 48px */
max-width: 50rem; /* Converted from 800px */
display: flex;
align-items: center;
justify-content: center;
gap: 1rem; /* Converted from 16px */
box-shadow: var(--box-shadow);
font-size: 3rem; /* Converted from 36px */
}

.error-message i {
font-size: 3rem; /* Converted from 36px */
line-height: 1;
vertical-align: middle;
}

.loading {
display: flex;
justify-content: center;
padding: 5rem; /* Converted from 80px */
}

.loading-spinner {
width: 5rem; /* Converted from 80px */
height: 5rem; /* Converted from 80px */
border: 0.5rem solid rgba(79, 70, 229, 0.1); /* Converted from 8px */
border-top: 0.5rem solid var(--primary-color); /* Converted from 8px */
border-radius: 50%;
animation: spin 1s linear infinite;
}

/* Subtitle nama karyawan */
.employee-name {
  font-size: 2.5rem;
  font-weight: 500;
  color: white;           /* Diubah jadi putih */
  margin-top: -1rem;
  opacity: 0.95;
}

/* Layer promotion untuk semua card besar */
.card,
.order-item,
.stat-card {
contain: layout style paint;
}

/* Kurangi beban paint saat expand */
.order-body.open {
will-change: height; /* hanya saat terbuka */
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
from { opacity: 0; transform: translateY(1.25rem); } /* Converted from 20px */
to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInItem {
from { opacity: 0; transform: translateY(0.625rem); } /* Converted from 10px */
to { opacity: 1; transform: translateY(0); }
}