* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --success: #34a853;
    --warning: #fbbc04;
    --danger: #ea4335;
    --bg: #f5f7fa;
    --card-bg: #ffffff;
    --text: #202124;
    --text-secondary: #5f6368;
    --border: #dadce0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --radius: 8px;
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }

/* Header */
.header { background: var(--primary); color: white; padding: 0 20px; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.header h1 { font-size: 20px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header .btn-sm { background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3); padding: 6px 16px; border-radius: 20px; cursor: pointer; font-size: 13px; transition: all 0.2s; }
.header .btn-sm:hover { background: rgba(255,255,255,0.3); }

/* Steps */
.steps { display: flex; justify-content: center; padding: 30px 20px 10px; gap: 0; max-width: 700px; margin: 0 auto; }
.step { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); position: relative; }
.step .num { width: 32px; height: 32px; border-radius: 50%; background: var(--border); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; transition: all 0.3s; }
.step.active .num { background: var(--primary); color: white; }
.step.done .num { background: var(--success); color: white; }
.step.active { color: var(--primary); font-weight: 500; }
.step-line { width: 60px; height: 2px; background: var(--border); margin: 0 8px; }
.step-line.active { background: var(--primary); }

/* Container */
.container { max-width: 800px; margin: 20px auto; padding: 0 20px; }
.container-wide { max-width: 1200px; margin: 20px auto; padding: 0 20px; }

/* Card */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px; }
.card-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }

/* Form */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-group label .required { color: var(--danger); margin-left: 2px; }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; transition: border-color 0.2s; outline: none; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }
select.form-control { appearance: none; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 36px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 24px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all 0.2s; gap: 6px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-warning { background: var(--warning); color: var(--text); }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: rgba(26,115,232,0.05); }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-group { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

/* Product Grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 16px; cursor: pointer; transition: all 0.2s; position: relative; }
.product-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.product-card.selected { border-color: var(--primary); background: rgba(26,115,232,0.04); }
.product-card.selected::after { content: '✓'; position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.product-card .name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.product-card .meta { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.product-card .price { font-size: 18px; font-weight: 700; color: var(--danger); margin-top: 8px; }
.product-card .price small { font-size: 12px; font-weight: 400; color: var(--text-secondary); }

/* Upload */
.upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: 30px; text-align: center; cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden; min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.upload-area:hover { border-color: var(--primary); background: rgba(26,115,232,0.02); }
.upload-area.has-file { border-color: var(--success); background: rgba(52,168,83,0.04); }
.upload-area .icon { font-size: 40px; margin-bottom: 8px; color: var(--text-secondary); }
.upload-area .text { font-size: 14px; color: var(--text-secondary); }
.upload-area .hint { font-size: 12px; color: #999; margin-top: 4px; }
.upload-area input[type="file"] { display: none; }
.upload-area .preview { max-width: 100%; max-height: 200px; border-radius: 4px; object-fit: contain; }
.upload-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Status Badge */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.badge-pending { background: #fff3e0; color: #e65100; }
.badge-approved { background: #e8f5e9; color: #2e7d32; }
.badge-rejected { background: #fce4ec; color: #c62828; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
table th { background: #f8f9fa; font-weight: 600; text-align: left; padding: 12px; border-bottom: 2px solid var(--border); white-space: nowrap; }
table td { padding: 12px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
table tr:hover { background: #fafafa; }
table .actions { display: flex; gap: 6px; }
table .actions .btn { padding: 5px 12px; font-size: 12px; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: 12px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 18px; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent; cursor: pointer; font-size: 20px; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); }
.modal-close:hover { background: var(--bg); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* Result */
.result-box { text-align: center; padding: 40px 20px; }
.result-box .icon { font-size: 64px; margin-bottom: 16px; }
.result-box h2 { font-size: 24px; margin-bottom: 8px; }
.result-box p { color: var(--text-secondary); margin-bottom: 4px; }
.result-box .order-no { font-size: 20px; font-weight: 600; color: var(--primary); margin: 16px 0; }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab { padding: 12px 20px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card-bg); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); text-align: center; }
.stat-card .value { font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-card .label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* Toast */
.toast { position: fixed; top: 20px; right: 20px; padding: 14px 24px; border-radius: var(--radius); color: white; font-size: 14px; z-index: 2000; animation: slideIn 0.3s ease; box-shadow: var(--shadow-lg); }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Loading */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text-secondary); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Image preview in modal */
.id-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.id-preview img { width: 100%; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; }
.id-preview .label { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }

/* Sidebar admin layout */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #1e293b; color: white; padding: 0; flex-shrink: 0; }
.sidebar .logo { padding: 20px; font-size: 16px; font-weight: 700; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar .menu { list-style: none; padding: 10px 0; }
.sidebar .menu li { padding: 12px 20px; cursor: pointer; transition: all 0.2s; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.sidebar .menu li:hover { background: rgba(255,255,255,0.1); }
.sidebar .menu li.active { background: var(--primary); }
.main-content { flex: 1; padding: 20px 30px; overflow-y: auto; }
.main-content .page-title { font-size: 22px; font-weight: 600; margin-bottom: 20px; }

/* Login page */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.login-card { background: white; border-radius: 16px; padding: 40px; width: 400px; box-shadow: var(--shadow-lg); }
.login-card h2 { text-align: center; margin-bottom: 8px; font-size: 24px; }
.login-card .subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 30px; font-size: 14px; }

/* Responsive */
@media (max-width: 768px) {
    .upload-row { grid-template-columns: 1fr !important; }
    .product-grid { grid-template-columns: 1fr; }
    .card [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    .steps { gap: 0; font-size: 12px; }
    .step-line { width: 30px; }
    .sidebar { display: none; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .container { padding: 0 12px; }
    .modal { width: 95%; }
    .id-preview { grid-template-columns: 1fr !important; }
}
