:root {
    --primary: #2563eb; --success: #10b981; --danger: #ef4444; --warning: #f59e0b;
    --sidebar-bg: #ffffff; --main-bg: #f8fafc; --border: #e2e8f0; --text: #1e293b;
}

* { box-sizing: border-box; font-family: 'Inter', system-ui, sans-serif; }
body { margin: 0; background: var(--main-bg); color: var(--text); }

.app-container { 
    display: none; 
    height: 100vh; 
    overflow: hidden; 
}

/* SIDEBAR */
.sidebar { width: 380px; background: var(--sidebar-bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.sidebar-header h3 { margin: 0; font-size: 13px; color: var(--primary); font-weight: 800; }

.filter-box { padding: 15px; background: #f1f5f9; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.filter-box input, .filter-box select { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; outline: none; }

.date-range-group { display: flex; gap: 10px; }
.date-item { flex: 1; }
.date-item label { font-size: 11px; color: #64748b; font-weight: bold; margin-bottom: 4px; display: block; }

.lsx-list-container { flex-grow: 1; overflow-y: auto; padding: 10px; }
.list-header-flex { display: flex; justify-content: space-between; align-items: center; padding: 10px; }
.list-label { font-size: 11px; font-weight: 900; color: #94a3b8; text-transform: uppercase; }
.btn-add-main { background: var(--success); color: white; border: none; padding: 6px 12px; border-radius: 4px; font-size: 11px; font-weight: 800; cursor: pointer; }

.lsx-item { padding: 15px; border-radius: 12px; margin-bottom: 10px; cursor: pointer; border: 1px solid transparent; background: white; box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: 0.2s; }
.lsx-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.lsx-item.active { border-color: var(--primary); background: #eff6ff; }

.lsx-item-top { display: flex; justify-content: space-between; margin-bottom: 8px; }
.code { font-weight: 800; color: #1e293b; font-size: 13px; }
.customer-tag { font-size: 11px; background: #e0e7ff; color: #4338ca; padding: 2px 6px; border-radius: 4px; }
.lsx-item-name { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: #334155; }
.lsx-item-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12px; color: #64748b; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.processing { background: var(--primary); }

.lsx-item-progress { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: bold; }
.progress-bg { flex-grow: 1; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--success); }

/* MAIN EDITOR */
.main-editor { flex-grow: 1; overflow-y: auto; padding: 30px; }
.editor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.editor-header h1 { margin: 0; font-size: 20px; font-weight: 800; }
.header-actions { display: flex; gap: 10px; }

.form-card { background: white; border-radius: 15px; padding: 25px; border: 1px solid var(--border); margin-bottom: 25px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02); }
.card-header, .card-header-flex { font-weight: bold; color: var(--primary); margin-bottom: 20px; border-bottom: 1px solid #f1f5f9; padding-bottom: 15px; font-size: 15px; }
.card-header-flex { display: flex; justify-content: space-between; align-items: center; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field label { display: block; font-size: 11px; font-weight: 700; color: #64748b; margin-bottom: 6px; text-transform: uppercase; }
.field input, .field select { width: 100%; padding: 10px 15px; border: 1px solid var(--border); border-radius: 8px; outline: none; font-size: 14px; }
.readonly-field { background: #f8fafc; color: #94a3b8; cursor: not-allowed; }

.detail-table { width: 100%; border-collapse: collapse; }
.detail-table th { text-align: left; background: #f8fafc; padding: 12px; font-size: 11px; color: #64748b; border-bottom: 2px solid var(--border); text-transform: uppercase; }
.detail-table td { padding: 10px; border-bottom: 1px solid #f1f5f9; }
.detail-table input, .detail-table select { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; outline: none; }
.detail-table input:focus { border-color: var(--primary); }

/* BUTTONS */
.btn-primary { background: var(--primary); color: white; border: none; padding: 12px 25px; border-radius: 8px; font-weight: 800; cursor: pointer; }
.btn-secondary { background: white; color: #64748b; border: 1px solid var(--border); padding: 12px 25px; border-radius: 8px; font-weight: 800; cursor: pointer; }
.btn-add { background: #eff6ff; color: var(--primary); border: 1px dashed var(--primary); padding: 8px 15px; border-radius: 8px; font-weight: 800; cursor: pointer; }
.btn-del { color: var(--danger); border: none; background: none; font-size: 20px; cursor: pointer; }
.btn-reset { background: none; border: none; color: var(--primary); font-size: 12px; cursor: pointer; text-decoration: underline; }

/* LOGIN SCREEN */
#login-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #f3f4f6; display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.login-card {
    background: white; padding: 40px; border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); width: 100%; max-width: 400px;
}
.login-card h2 { 
    text-align: center; margin-top: 0; margin-bottom: 25px; 
    color: var(--text); font-weight: 800; text-transform: uppercase; 
}
.form-group { margin-bottom: 15px; }
.form-group label { 
    display: block; font-size: 11px; font-weight: 700; 
    color: #64748b; margin-bottom: 6px; text-transform: uppercase; 
}
.form-group input { 
    width: 100%; padding: 12px 15px; border: 1px solid var(--border); 
    border-radius: 8px; outline: none; font-size: 14px; 
}
#login-btn { 
    width: 100%; background: var(--primary); color: white; border: none; 
    padding: 12px; border-radius: 8px; font-weight: 800; cursor: pointer; margin-top: 10px;
}
/* Error message style */
.error-msg { 
    background: #fef2f2; color: #b91c1c; padding: 10px; border-radius: 6px; 
    font-size: 13px; margin-bottom: 15px; display: none; border: 1px solid #fee2e2; 
}
